From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/88521 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: [doifinset] how it works ? Date: Thu, 21 Aug 2014 22:28:46 +0200 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Content-Type: multipart/mixed; boundary="===============1389005123==" X-Trace: ger.gmane.org 1408652967 25422 80.91.229.3 (21 Aug 2014 20:29:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Aug 2014 20:29:27 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 21 22:29:22 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XKYz1-0004QN-Ui for gctc-ntg-context-518@m.gmane.org; Thu, 21 Aug 2014 22:29:20 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4A9C51021D for ; Thu, 21 Aug 2014 22:29:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 997miKFB-ikp for ; Thu, 21 Aug 2014 22:29:19 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 784201021F for ; Thu, 21 Aug 2014 22:29:10 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id F2B97101E3 for ; Thu, 21 Aug 2014 22:29:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id exeNmSz+ujpt for ; Thu, 21 Aug 2014 22:28:51 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id A3E98101E1 for ; Thu, 21 Aug 2014 22:28:51 +0200 (CEST) Original-Received: from mail-we0-x234.google.com (mail-we0-x234.google.com [IPv6:2a00:1450:400c:c03::234]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s7LKtK7r015664 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 21 Aug 2014 22:55:20 +0200 Original-Received: by mail-we0-f180.google.com with SMTP id w61so9782668wes.25 for ; Thu, 21 Aug 2014 13:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:message-id:mime-version:subject:date:references :to:in-reply-to; bh=cfID+A1Y+ElhGQMDlWDWjpT15UleJeJbWimSWz5a6OE=; b=vKRa/VMXLcXQQvJLH0DDnv7oeFmcXLuxdkqCihtfJRso+KMCvRykVXcXNbGoAbWQSA k/ejvWxaWLZ0RFEEtlGTv3iQvq1QhYRmIarEfhpq4GEW6Z/fT47io1JZI289QtKBD0BG 1RlUJiortvgBYl5LM88zbTYMyaBervQTXFsVoy1T7MfLyENkojesgy/eRaBRnDTBOUCt gcq555xLoZ0jS5JeFt0UnMI+s+vm7GAahBSxJuBnVFifiuvydFwZ1ZhaXBvO6X/g9LwM MjAZv6BjjifMQ3dG1jPgFjD/r2e2dDB5xRL+PwBCpENAEJs4GctVAGMLsp0oA4yTqT7c z3qQ== X-Received: by 10.194.157.10 with SMTP id wi10mr736691wjb.31.1408652930104; Thu, 21 Aug 2014 13:28:50 -0700 (PDT) Original-Received: from [192.168.0.101] (lns-bzn-45-82-65-189-35.adsl.proxad.net. [82.65.189.35]) by mx.google.com with ESMTPSA id t6sm23431216wib.4.2014.08.21.13.28.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Aug 2014 13:28:49 -0700 (PDT) In-Reply-To: X-Mailer: Apple Mail (2.1878.6) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c03::234; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01MFwTkh7 - 8c3c7a26a699 - 20140821 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:88521 Archived-At: --===============1389005123== Content-Type: multipart/alternative; boundary="Apple-Mail=_8D3DBE6F-D3EB-45F7-B6BB-66113EEEAF0B" --Apple-Mail=_8D3DBE6F-D3EB-45F7-B6BB-66113EEEAF0B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi, Here are a few examples of how to use \doifinset and \doifinsetelse = (they were given by Wolfgang S. a few years ago=85): \starttext \type{\doifinset{A}{A,B,C}{should go}:} \doifinset{A}{A,B,C}{should go} \type{\doifinset{D}{A,B,C}{should go}:} \doifinset{D}{A,B,C}{should = participate} \type{\doifnotinset{}{A,B,C}{not in the set}:} = \doifnotinset{}{A,B,C}{not in the set} \type{\doifnotinset{D}{A,B,C}{not in the set}:} = \doifnotinset{D}{A,B,C}{not in the set} \doifinsetelse{D}{A,B,C}{it is in the set}{it is not in the set} \define\test{B} \type{\doifinsetelse{\test}{A,B,C}{\test\ is in the set}{\test\ is not = in the set}} \doifinsetelse{\test}{A,B,C}{\test\ is in the set}{\test\ is not in the = set} \stoptext Best regards: OK On 21 Aug 2014, at 21:58, Pierre-Fran=E7ois Bonnefoi = wrote: > Hello, >=20 > I'm currently prepping my teaching material for my back-to-university. >=20 > I want to design some conditional slides based presentation where I = can select the slides that I want to show in my final presentation. >=20 > My current attempt is to use : > 1 - MKIV as I use currently only MKII; > 2 - a counter is defined, that it is incremented at each slide = definition; > 3 - a commalist to indicate the slides that I want. The number = affected to each slide is made according to its definition in the file = and not the slide number displayed; > 4 - a block is added to enclosed each slide in order to allow or not = it to be shown in the final presentation. >=20 > \definenumber[slide][way=3Dbytext,prefix=3Dno] > % firstly I generate a full commalist=20 > \def\slidelist{} > \dorecurse{8}{ > \doglobal\appendtocommalist{#1}\slidelist > } >=20 > % then I define my slide where I increment the counter > = \def\startSlide{\setupbackgrounds[page][background=3D{fond,Auteur,backgrap= hics,foreground,foregraphics}] > \directsetup{slide:start}}=20 > \def\stopSlide{\directsetup{slide:stop}}=20 > \startsetups slide:start=20 > \page > \incrementnumber[slide] > \switchtobodyfont[14pt]=20 > \setupinteractionbar[state=3Dstart]=20 > \startnarrower[left] > \stopsetups=20 >=20 > \startsetups slide:stop > \stopnarrower=20 > \page=20 > \stopsetups >=20 > \starttext >=20 > \doifinset{\getnumber[slide]}{\slidelist} > { > \startSlide > \SlideTitleSub{Hello there} >=20 > What is my number ? \getnumber[slide] ! >=20 > \stopSlide > } > \stoptext >=20 >=20 > This doesn't work. the "doifinset" doesn't work. I've tried to put = some \expanded in order to expand the arguments with no success. >=20 > The only way is to use direct argument as : > \doifinset{1}{1,2,3,4,5} >=20 > Let me know it it is possible. >=20 > best regards, > Pierre-Fran=E7ois Bonnefoi. > --=20 > Bonnefoi Pierre-Francois | E-mail : = bonnefoi@unilim.fr http://libpfb.so/ > Universite de Limoges, Laboratoire XLIM | Tel : 06 28 18 03 38 > 123 av Albert Thomas | Mrs. Peel, we're needed... > 87060 Limoges CEDEX - FRANCE | The = Avengers. >=20 > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > maillist : ntg-context@ntg.nl / = http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > = __________________________________________________________________________= _________ --Apple-Mail=_8D3DBE6F-D3EB-45F7-B6BB-66113EEEAF0B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 Hi,

Here are a few examples of = how to use \doifinset and \doifinsetelse (they were given by Wolfgang S. = a few years = ago=85):

\starttext
\type{\doifins= et{A}{A,B,C}{should go}:} \doifinset{A}{A,B,C}{should = go}

\type{\doifinset{D}{A,B,C}{should go}:} =  \doifinset{D}{A,B,C}{should = participate}


\type{\doifnotinset{}= {A,B,C}{not in the set}:} \doifnotinset{}{A,B,C}{not in the = set}

\type{\doifnotinset{D}{A,B,C}{not in the = set}:} \doifnotinset{D}{A,B,C}{not in the = set}

\doifinsetelse{D}{A,B,C}{it is in the = set}{it is not in the = set}

\define\test{B}

\ty= pe{\doifinsetelse{\test}{A,B,C}{\test\ is in the set}{\test\ is not in = the set}}

\doifinsetelse{\test}{A,B,C}{\test\ = is in the set}{\test\ is not in the = set}
\stoptext


Best = regards: OK

On 21 Aug 2014, at 21:58, = Pierre-Fran=E7ois Bonnefoi <bonnefoi@unilim.fr> = wrote:

Hello,

I'm currently prepping my = teaching material for my back-to-university.

I = want to design some conditional slides based presentation where I can = select the slides that I want to show in my final = presentation.

My current attempt is to use = :
1 - MKIV as I use currently only MKII;
2 - a = counter is defined, that it is incremented at each slide = definition;
3 - a commalist to indicate the slides that I = want. The number affected to each slide is made according to its = definition in the file and not the slide number displayed;
4 - = a block is added to enclosed each slide in order to allow or not it to = be shown in the final = presentation.

\definenumber[slide][way=3Dbytext,p= refix=3Dno]
% firstly I generate a full = commalist 
\def\slidelist{}
\dorecurse{8}{
= \doglobal\appendtocommalist{#1}\slidelist
}

% then I define my slide where I increment the = counter
\def\startSlide{\setupbackgrounds[page][background=3D= {fond,Auteur,backgraphics,foreground,foregraphics}]
\directsetup= {slide:start}} 
\def\stopSlide{\directsetup{slide:stop}}&nb= sp;
\startsetups = slide:start 
\page
\incrementnumber[slide]
<= div>\switchtobodyfont[14pt] 
\setupinteractionbar[state=3Ds= tart] 
\startnarrower[left]
\stopsetups 

\startsetups = slide:stop
\stopnarrower 
\page 
\= stopsetups

\starttext

<= div>
\doifinset{\getnumber[slide]}{\slidelist}
{
\= startSlide
\SlideTitleSub{Hello = there}

What is my number ? \getnumber[slide] = !

\stopSlide
}
\stoptex= t


This doesn't work. the = "doifinset" doesn't work. I've tried to put some \expanded in order to = expand the arguments with no success.

The only = way is to use direct argument as = :
\doifinset{1}{1,2,3,4,5}

Let me = know it it is possible.

best = regards,
Pierre-Fran=E7ois Bonnefoi.
Bonnefoi Pierre-Francois     =            |    E-mail : bonnefoi@unilim.fr http://libpfb.so/
<= font class=3D"Apple-style-span" face=3D"Courier" size=3D"3">Universite de = Limoges, Laboratoire XLIM |       Tel : 06 28 18 03 = 38
123 av Albert Thomas       =              |  Mrs. Peel, we're = needed...
87060 Limoges CEDEX - FRANCE     =        |             =     The Avengers.
ntg-context@ntg.nl / http://www.ntg.nl/= mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive =  : http://foundry.sup= elec.fr/projects/contextrev/
wiki     : http://contextgarden.net
________= __________________________________________________________________________= _

= --Apple-Mail=_8D3DBE6F-D3EB-45F7-B6BB-66113EEEAF0B-- --===============1389005123== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1389005123==--