And here a few more examples…

\starttext

\doifinset {knuth} {knuth,ward} {\input knuth.tex \blank[2*big]} 

\doifnotinset {ward} {knuth,Hans} {\input ward.tex\blank[2*big]} 

\doifinsetelse {Hans} {Hans,knuth} {then Hans is a genious...\blank[2*big]} 
{else ...} 

\doifcommon {string,...} {string,...} {it is common...} 

\doifnotcommon {string} {String,...} {nothing is common...} 

\doifcommonelse {string,...} {string,...} {then ...} {else ...} 

\blank
%\def\substring{substring}

%\doifincsnameelse {substring} {\string} {then ...} {else ...} 
\blank

\doifinstringelse {substring} {substringSUB} {then ...} {else ...}

\blank

\doifnumberelse {string} {then ...} {else string is not a number...}

\doifnumberelse {123} {then string is a number...} {else ...}
\stoptext

Best regards: OK

On 21 Aug 2014, at 21:58, Pierre-François Bonnefoi <bonne...@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=bytext,prefix=no]
> % 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={fond,Auteur,backgraphics,foreground,foregraphics}]
> \directsetup{slide:start}} 
> \def\stopSlide{\directsetup{slide:stop}} 
> \startsetups slide:start 
> \page
> \incrementnumber[slide]
> \switchtobodyfont[14pt] 
> \setupinteractionbar[state=start] 
> \startnarrower[left]
> \stopsetups 
> 
> \startsetups slide:stop
> \stopnarrower 
> \page 
> \stopsetups
> 
> \starttext
> 
> \doifinset{\getnumber[slide]}{\slidelist}
> {
> \startSlide
> \SlideTitleSub{Hello there}
> 
> What is my number ? \getnumber[slide] !
> 
> \stopSlide
> }
> \stoptext
> 
> 
> 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çois Bonnefoi.
> -- 
> Bonnefoi Pierre-Francois                |    E-mail : bonne...@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.
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________

Reply via email to