ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Xan <dxpublica@telefonica.net>
To: Wolfgang Schuster <schuster.wolfgang@gmail.com>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: [***SPAM***] \defineenumeration options?
Date: Tue, 21 May 2013 19:59:01 +0200	[thread overview]
Message-ID: <519BB5E5.1040002@telefonica.net> (raw)
In-Reply-To: <E97319AF-FFCE-4536-A854-F80A7BD10DE8@gmail.com>


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

      reply	other threads:[~2013-05-21 17:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-21 15:41 Xan
2013-05-21 16:41 ` Wolfgang Schuster
2013-05-21 17:59   ` Xan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=519BB5E5.1040002@telefonica.net \
    --to=dxpublica@telefonica.net \
    --cc=ntg-context@ntg.nl \
    --cc=schuster.wolfgang@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).