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

Hans Hagen j.hagen at xs4all.nl
Wed Nov 28 09:20:49 CET 2018


On 11/27/2018 10:05 PM, Wolfgang Schuster wrote:
> Marco Patzer schrieb am 27.11.18 um 21:56:
>> On Tue, 27 Nov 2018 21:41:52 +0100
>> Wolfgang Schuster <wolfgang.schuster.lists at gmail.com> wrote:
>>
>>>> A nudge in the right direction appreciated.
>>> \appendtoks
>>>     \mainlanguage[\documentvariable{language}]%
>>> %\doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}% 
>>>
>>> \to \everysetupdocument
>> That's basically what I've done in my project file (te-proj.tex). At
>> least the code is supposed to do exactly that.
>>
>> But even your solution doesn't work here. Did you try it in the
>> example project file?
> 
> \startenvironment [*]
> 
> \startsetups [itemgroup:en]
>    \setupitemgroup [itemize] [i]
> \stopsetups
> 
> \startsetups [itemgroup:sv]
>    \setupitemgroup [itemize] [a]
> \stopsetups
> 
> \setuplanguage
>    [en]
>    [setups=itemgroup:en]
> 
> \setuplanguage
>    [sv]
>    [setups=itemgroup:sv]
> 
> \appendtoks
> \doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}
> \to \everysetupdocument
> 
> \stopenvironment
An alternative is to use system modes:

\mainlanguage[nl]

% \startmode[*en]
%     \setupitemize[n]
% \stopmode

% \startmode[*nl]
%     \setupitemize[a]
% \stopmode

% \startmode[*de]
%     \setupitemize[i]
% \stopmode

\startmodeset
     [*en] {
         \setupitemize[n]
     }
     [*nl] {
         \setupitemize[a]
     }
     [*de] {
         \setupitemize[i]
     }
\stopmodeset

\starttext

\startitemize
     \startitem test \stopitem
     \startitem test \stopitem
\stopitemize

\stoptext

where modesets have a sort of special syntax (so probably only wolfgang 
and i know that this one exists),

Hans


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list