From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/82596 Path: news.gmane.org!not-for-mail From: Xan Newsgroups: gmane.comp.tex.context Subject: Re: [***SPAM***] \defineenumeration options? Date: Tue, 21 May 2013 19:59:01 +0200 Message-ID: <519BB5E5.1040002@telefonica.net> References: <519B95BF.6000802@telefonica.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1816786628==" X-Trace: ger.gmane.org 1369159164 9258 80.91.229.3 (21 May 2013 17:59:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 21 May 2013 17:59:24 +0000 (UTC) Cc: mailing list for ConTeXt users To: Wolfgang Schuster Original-X-From: ntg-context-bounces@ntg.nl Tue May 21 19:59:25 2013 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UeqqJ-0002dW-Ps for gctc-ntg-context-518@m.gmane.org; Tue, 21 May 2013 19:59:23 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3A513101F5; Tue, 21 May 2013 19:59:23 +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 bxhOhPK-5A8M; Tue, 21 May 2013 19:59:17 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 974C0101E4; Tue, 21 May 2013 19:59:17 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id C6755101E4 for ; Tue, 21 May 2013 19:59:16 +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 vRxKZBK5yWEr for ; Tue, 21 May 2013 19:59:15 +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 A6F00101E0 for ; Tue, 21 May 2013 19:59:05 +0200 (CEST) Original-Received: from telefonica.net (impaqm2.telefonica.net [213.4.138.18]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r4LHx3rW011113 for ; Tue, 21 May 2013 19:59:04 +0200 Original-Received: from IMPmailhost2.adm.correo ([10.20.102.39]) by IMPaqm2.telefonica.net with bizsmtp id ehqn1l00D0r0BT63Nhz3eB; Tue, 21 May 2013 19:59:03 +0200 Original-Received: from [172.26.0.6] ([81.47.138.17]) by IMPmailhost2.adm.correo with BIZ IMP id ehz01l00o0NiMKD1ihz1ji; Tue, 21 May 2013 19:59:01 +0200 X-CMAE-Analysis: v=1.1 cv=SGdqEyPum/isWZMbzBTrZnpEhAjqzrguzJFay1xBsa0= c=1 sm=1 a=LlOSm3cjFWgA:10 a=VMBmOUH7nP4A:10 a=VY-2JVJxNB4A:10 a=tOC4kGaAeBlGomqVsvfEcg==:17 a=WYd5oxahAAAA:8 a=XkZPIy1jEBWO57Ufg00A:9 a=wPNLvfGTeEIA:10 a=SIgZ-KYG32UA:10 a=pGLkceISAAAA:8 a=NbpBlbTbHX9kqyNZ7nMA:9 a=_W_S_7VecoQA:10 a=MSl-tDqOz04A:10 a=25ve7RPUBr9DhVZe:21 a=tOC4kGaAeBlGomqVsvfEcg==:117 X-original-sender: publicitat@telefonica.net User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 In-Reply-To: X-Bayes-Prob: 0.007 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.4.138.18; country=ES; latitude=40.0000; longitude=-4.0000; http://maps.google.com/maps?q=40.0000,-4.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TJCFX3ku - 5ba8bba59d48 - 20130521 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 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:82596 Archived-At: This is a multi-part message in MIME format. --===============1816786628== Content-Type: multipart/alternative; boundary="------------060402010406080506040700" This is a multi-part message in MIME format. --------------060402010406080506040700 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Al 21/05/13 18:41, En/na Wolfgang Schuster ha escrit: > > Am 21.05.2013 um 17:41 schrieb Xan >: > >> Hi, >> >> I have two enumerations: >> >> \defineenumeration >> [exercici] > You need a different name for the normal enumeration environment, e.g. > exercicidefault >> [alternative=serried,text={\startcolor[middlecyan]Exercici\stopcolor},stopper={.\space},left={\bgroup},right={\egroup},width=fit,headstyle=\ss] >> >> \defineenumeration >> [exercicivora] >> [alternative=serried,text={\startcolor[middlecyan]Exercici\stopcolor},stopper={.\space},left={\bgroup\startframedtext[background=screen,frame=off,width=broad]},right={\stopframedtext\egroup},width=fit,headstyle=\ss] >> >> >> I just want to join into one: when I do \startexercici ... >> \stopexercici ConTeXt do the first, and when I pass >> \startexercici[vora] ... \stopexercici then do the second. That is, >> 'vora' as optional argument. >> >> How can I achieve that? > > You have to write you own version of the exercise environment which > chooses one the two enumerations dependent on the argument. > > \def\startexercici > {\dosingleempty\dostartexercici} > > \def\dostartexercici[#1]% > {\edef\currentexercici{#1}% > \doifelse{\currentexercici}{vora} > \startexercicivora > \startexercicidefault} > > \def\stopexercici > {\doifelse{\currentexercici}{vora} > \stopexercicivora > \stopexercicidefault} > > Wolfgang Thanks Wolfgang. I note this is a little bit complicated than LaTeX define command (by me). But, thanks a lot, Xan. --------------060402010406080506040700 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
Al 21/05/13 18:41, En/na Wolfgang Schuster ha escrit:

Am 21.05.2013 um 17:41 schrieb Xan <dxpublica@telefonica.net>:

Hi,

I have two enumerations:

\defineenumeration
  [exercici]
You need a different name for the normal enumeration environment, e.g. exercicidefault
  [alternative=serried,text={\startcolor[middlecyan]Exercici\stopcolor},stopper={.\space},left={\bgroup},right={\egroup},width=fit,headstyle=\ss]

\defineenumeration
  [exercicivora]
  [alternative=serried,text={\startcolor[middlecyan]Exercici\stopcolor},stopper={.\space},left={\bgroup\startframedtext[background=screen,frame=off,width=broad]},right={\stopframedtext\egroup},width=fit,headstyle=\ss]


I just want to join into one: when I do \startexercici ...      \stopexercici ConTeXt do the first, and when I pass \startexercici[vora] ... \stopexercici then do the second. That is, 'vora' as optional argument.

How can I achieve that?

You have to write you own version of the exercise environment which chooses one the two enumerations dependent on the argument.

\def\startexercici
  {\dosingleempty\dostartexercici}

\def\dostartexercici[#1]%
  {\edef\currentexercici{#1}%
   \doifelse{\currentexercici}{vora}
     \startexercicivora
     \startexercicidefault}

\def\stopexercici
  {\doifelse{\currentexercici}{vora}
     \stopexercicivora
     \stopexercicidefault}

Wolfgang
Thanks Wolfgang.
I note this is a little bit complicated than LaTeX define command (by me).

But, thanks a lot,
Xan.
--------------060402010406080506040700-- --===============1816786628== 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 ___________________________________________________________________________________ --===============1816786628==--