From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/88522 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:30:59 +0200 Message-ID: <4F105E0F-27CD-47BC-90B3-20D508525361@gmail.com> 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="===============1873292116==" X-Trace: ger.gmane.org 1408653092 26723 80.91.229.3 (21 Aug 2014 20:31:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 21 Aug 2014 20:31:32 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 21 22:31:28 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 1XKZ15-0005WY-7E for gctc-ntg-context-518@m.gmane.org; Thu, 21 Aug 2014 22:31:27 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EFD061021F for ; Thu, 21 Aug 2014 22:31:26 +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 FGucALM+N7-4 for ; Thu, 21 Aug 2014 22:31:26 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 7EDB610221 for ; Thu, 21 Aug 2014 22:31:18 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 22C9E101E3 for ; Thu, 21 Aug 2014 22:31:15 +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 DHy2WPnLnmK9 for ; Thu, 21 Aug 2014 22:31:10 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id 03FBA101E1 for ; Thu, 21 Aug 2014 22:31:09 +0200 (CEST) Original-Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [IPv6:2a00:1450:400c:c03::235]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s7LKV3kE014713 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 21 Aug 2014 22:31:08 +0200 Original-Received: by mail-we0-f181.google.com with SMTP id k48so9869477wev.40 for ; Thu, 21 Aug 2014 13:31:03 -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=2enbFh5eESUtgvNZQk/+uBvVB5kmDxDQDVjsNeBXHnI=; b=JITqctJUTkdeXfQ1ETXv/Hrw7nU3/S4wxv26ZrjGzlW87AFbhQa7eifEwCmeGEwU/D nhn9PzVf7ej7qTiXqC+Gx+vjzsKN6RFoL3mb5ElFsNHPmB6fD3ihS0r2Rchaxlcv7ooP 2biAitSRmaW3mIDPWWTDTkxS6q0EsvyYyIaoYDje1kqpqUaYWpxDJ9cx+Se2C9QgyNA7 UpyewSwmZV124mNKW6nu2KliM7cxsBGFro0UlP3h/1G+OlTaUtmsTaclkZfwRy3qHxad sq2hYtknxRKHSbtikthNqH7Qa0B5yOGfnSvsd1EDr1bSLVHAtdPFMVY4M0aPRF3c/yrt m9MQ== X-Received: by 10.180.188.35 with SMTP id fx3mr6557269wic.82.1408653063045; Thu, 21 Aug 2014 13:31:03 -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 fa10sm12695457wjd.42.2014.08.21.13.31.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Aug 2014 13:31:02 -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::235; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TMFwv3hh - 2572edab694a - 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:88522 Archived-At: --===============1873292116== Content-Type: multipart/alternative; boundary="Apple-Mail=_26C943B8-9B88-40AF-90C4-EB83EAA89C1B" --Apple-Mail=_26C943B8-9B88-40AF-90C4-EB83EAA89C1B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 And here a few more examples=85 \starttext \doifinset {knuth} {knuth,ward} {\input knuth.tex \blank[2*big]}=20 \doifnotinset {ward} {knuth,Hans} {\input ward.tex\blank[2*big]}=20 \doifinsetelse {Hans} {Hans,knuth} {then Hans is a = genious...\blank[2*big]} {else ...}=20 \doifcommon {string,...} {string,...} {it is common...}=20 \doifnotcommon {string} {String,...} {nothing is common...}=20 \doifcommonelse {string,...} {string,...} {then ...} {else ...}=20 \blank %\def\substring{substring} %\doifincsnameelse {substring} {\string} {then ...} {else ...}=20 \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=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=_26C943B8-9B88-40AF-90C4-EB83EAA89C1B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 And = here a few more = examples=85

\starttext

\d= oifinset {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{subst= ring}

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

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

\blank

\doifnumbere= lse {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=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=_26C943B8-9B88-40AF-90C4-EB83EAA89C1B-- --===============1873292116== 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 ___________________________________________________________________________________ --===============1873292116==--