ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [***SPAM***] \defineenumeration options?
@ 2013-05-21 15:41 Xan
  2013-05-21 16:41 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Xan @ 2013-05-21 15:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 761 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1696 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [***SPAM***] \defineenumeration options?
  2013-05-21 15:41 [***SPAM***] \defineenumeration options? Xan
@ 2013-05-21 16:41 ` Wolfgang Schuster
  2013-05-21 17:59   ` Xan
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2013-05-21 16:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Xan


[-- Attachment #1.1: Type: text/plain, Size: 1371 bytes --]


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

[-- Attachment #1.2: Type: text/html, Size: 3961 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [***SPAM***] \defineenumeration options?
  2013-05-21 16:41 ` Wolfgang Schuster
@ 2013-05-21 17:59   ` Xan
  0 siblings, 0 replies; 3+ messages in thread
From: Xan @ 2013-05-21 17:59 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1589 bytes --]

Al 21/05/13 18:41, En/na Wolfgang Schuster ha escrit:
>
> Am 21.05.2013 um 17:41 schrieb Xan <dxpublica@telefonica.net 
> <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.

[-- Attachment #1.2: Type: text/html, Size: 5037 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-21 17:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-21 15:41 [***SPAM***] \defineenumeration options? Xan
2013-05-21 16:41 ` Wolfgang Schuster
2013-05-21 17:59   ` Xan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).