Marco Patzer schrieb am 28.11.18 um 08:38:
On Tue, 27 Nov 2018 22:41:25 +0100
Wolfgang Schuster <wolfgang.schuster.li...@gmail.com> wrote:

With named setups I need to specify a name for each occurrence and
gather them at the end. This is not as clean. Is it possible e.g. to
add something to an already existing setup instead of creating a new
one every time?
No, this is only possible with a token list.
Works perfectly.

Your first solution is technically better since it works even if the
language is changed mid document (something not used in this
project). However, the second solution is cleaner. I'll make up my mind.

Below is a improved version of the token method which works with the new beta.


\startenvironment [*]

\definetokenlist [english] % optional because \starttokenlist
\definetokenlist [swedish] % checks if the token lists exists

\starttokenlist [english]
  \setupitemgroup [itemize] [i]
\stoptokenlist

\starttokenlist [swedish]
  \setupitemgroup [itemize] [a]
\stoptokenlist

\startsetups [document:start]

\doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}

  \startmodeset
    [*en] {\gettokenlist[english]}
    [*sv] {\gettokenlist[swedish]}
  \stopmodeset

\stopsetups

\stopenvironment


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to