[***SPAM***] \defineenumeration options?
Hi, I have two enumerations: \defineenumeration [exercici] [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? I use MKIV. Thanks in advance, Xan. PS: Please CCme
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
Al 21/05/13 18:41, En/na Wolfgang Schuster ha escrit:
Am 21.05.2013 um 17:41 schrieb Xan
mailto: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.
participants (2)
-
Wolfgang Schuster
-
Xan