[NTG-context] Language dependency in environment-project file

Marco Patzer lists at homerow.info
Thu Nov 29 21:57:41 CET 2018


On Thu, 29 Nov 2018 20:30:53 +0100
Wolfgang Schuster <wolfgang.schuster.lists at gmail.com> wrote:

> 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

So that's basically a glorified \appendtoks … \to\… using the
usual context syntax? Very neat.

Marco


More information about the ntg-context mailing list