Am 21.05.2013 um 17:41 schrieb Xan <dxpubl...@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
___________________________________________________________________________________
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