ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Language dependency in environment-project file
@ 2018-11-27 20:37 Marco Patzer
  2018-11-27 20:41 ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Marco Patzer @ 2018-11-27 20:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 716 bytes --]

Hi,

I do have a project structure with environment, project and component files.
The language of the individual documents is defined in the components using

  \setupdocument
    [language=sv]

The environment needs to adjust language-dependent settings. However, when the
environment file is read, the language is not specified, yet. In the past I've
used

  \appendtoks
    …
  \to\everystarttext

and I belive it has worked that way. In any case, right now it doesn't. I have
attached a not-so-minimal example project.

How to set this up correctly? If possible I'd like to keep the language in the
document settings as shown above.

A nudge in the right direction appreciated.

Marco

[-- Attachment #2: ctx-lang.zip --]
[-- Type: application/zip, Size: 5127 bytes --]

[-- Attachment #3: Type: text/plain, Size: 492 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Language dependency in environment-project file
  2018-11-27 20:37 Language dependency in environment-project file Marco Patzer
@ 2018-11-27 20:41 ` Wolfgang Schuster
  2018-11-27 20:56   ` Marco Patzer
  0 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2018-11-27 20:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Marco Patzer



Marco Patzer schrieb am 27.11.18 um 21:37:
> Hi,
>
> I do have a project structure with environment, project and component files.
> The language of the individual documents is defined in the components using
>
>    \setupdocument
>      [language=sv]
>
> The environment needs to adjust language-dependent settings. However, when the
> environment file is read, the language is not specified, yet. In the past I've
> used
>
>    \appendtoks
>      …
>    \to\everystarttext
>
> and I belive it has worked that way. In any case, right now it doesn't. I have
> attached a not-so-minimal example project.
>
> How to set this up correctly? If possible I'd like to keep the language in the
> document settings as shown above.
>
> A nudge in the right direction appreciated.

\appendtoks
   \mainlanguage[\documentvariable{language}]%
%\doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}%
\to \everysetupdocument

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
___________________________________________________________________________________

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

* Re: Language dependency in environment-project file
  2018-11-27 20:41 ` Wolfgang Schuster
@ 2018-11-27 20:56   ` Marco Patzer
  2018-11-27 21:05     ` Wolfgang Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Marco Patzer @ 2018-11-27 20:56 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

On Tue, 27 Nov 2018 21:41:52 +0100
Wolfgang Schuster <wolfgang.schuster.lists@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?

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

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

* Re: Language dependency in environment-project file
  2018-11-27 20:56   ` Marco Patzer
@ 2018-11-27 21:05     ` Wolfgang Schuster
  2018-11-27 21:23       ` Marco Patzer
  2018-11-28  8:20       ` Hans Hagen
  0 siblings, 2 replies; 12+ messages in thread
From: Wolfgang Schuster @ 2018-11-27 21:05 UTC (permalink / raw)
  To: Marco Patzer; +Cc: mailing list for ConTeXt users

Marco Patzer schrieb am 27.11.18 um 21:56:
> On Tue, 27 Nov 2018 21:41:52 +0100
> Wolfgang Schuster <wolfgang.schuster.lists@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

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
___________________________________________________________________________________

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

* Re: Language dependency in environment-project file
  2018-11-27 21:05     ` Wolfgang Schuster
@ 2018-11-27 21:23       ` Marco Patzer
  2018-11-27 21:41         ` Wolfgang Schuster
  2018-11-28  8:20       ` Hans Hagen
  1 sibling, 1 reply; 12+ messages in thread
From: Marco Patzer @ 2018-11-27 21:23 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

On Tue, 27 Nov 2018 22:05:27 +0100
Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:

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

That works, thanks.

One more question: I used to use modes, since I could just

  \startmode[*en]
    …
  \stopmode

any number of times. There are many language dependent settings in
the environment files.

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?

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

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

* Re: Language dependency in environment-project file
  2018-11-27 21:23       ` Marco Patzer
@ 2018-11-27 21:41         ` Wolfgang Schuster
  2018-11-28  7:38           ` Marco Patzer
  0 siblings, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2018-11-27 21:41 UTC (permalink / raw)
  To: Marco Patzer; +Cc: mailing list for ConTeXt users



Marco Patzer schrieb am 27.11.18 um 22:23:
> On Tue, 27 Nov 2018 22:05:27 +0100
> Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:
>
>>> 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
> That works, thanks.
>
> One more question: I used to use modes, since I could just
>
>    \startmode[*en]
>      …
>    \stopmode
>
> any number of times. There are many language dependent settings in
> the environment files.
>
> 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.


\startenvironment [*]

\newtoks\EnglishSettings
\newtoks\SwedishSettings

\appendtoks
   \setupitemgroup [itemize] [i]
\to \EnglishSettings

\appendtoks
   \setupitemgroup [itemize] [a]
\to \SwedishSettings

% the order of the following settings is important because you have
% to set the language before you can make the language dependant
% mode setting

\appendtoks
\doifdocumentvariable{language}{\mainlanguage[\documentvariable{language}]}
\to \everysetupdocument

\appendtoks
   \startmodeset
     [**en] {\flushtoks\EnglishSettings}
     [**sv] {\flushtoks\SwedishSettings}
   \stopmodeset
\to \everysetupdocument

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

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

* Re: Language dependency in environment-project file
  2018-11-27 21:41         ` Wolfgang Schuster
@ 2018-11-28  7:38           ` Marco Patzer
  2018-11-28 21:17             ` Wolfgang Schuster
  2018-11-29 19:30             ` Wolfgang Schuster
  0 siblings, 2 replies; 12+ messages in thread
From: Marco Patzer @ 2018-11-28  7:38 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

On Tue, 27 Nov 2018 22:41:25 +0100
Wolfgang Schuster <wolfgang.schuster.lists@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.

Thanks for the quick help.

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

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

* Re: Language dependency in environment-project file
  2018-11-27 21:05     ` Wolfgang Schuster
  2018-11-27 21:23       ` Marco Patzer
@ 2018-11-28  8:20       ` Hans Hagen
  2018-11-28 10:09         ` Marco Patzer
  1 sibling, 1 reply; 12+ messages in thread
From: Hans Hagen @ 2018-11-28  8:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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

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

* Re: Language dependency in environment-project file
  2018-11-28  8:20       ` Hans Hagen
@ 2018-11-28 10:09         ` Marco Patzer
  0 siblings, 0 replies; 12+ messages in thread
From: Marco Patzer @ 2018-11-28 10:09 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

On Wed, 28 Nov 2018 09:20:49 +0100
Hans Hagen <j.hagen@xs4all.nl> wrote:

> 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

I do use modes and modesets in this project, but mainly in the
components. In the environment files it's a bit more tricky because
the language is unknown at this point and the system modes trigger
the wrong language. But Wolfgang already provided a solution, which
works fine.

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

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

* Re: Language dependency in environment-project file
  2018-11-28  7:38           ` Marco Patzer
@ 2018-11-28 21:17             ` Wolfgang Schuster
  2018-11-29 19:30             ` Wolfgang Schuster
  1 sibling, 0 replies; 12+ messages in thread
From: Wolfgang Schuster @ 2018-11-28 21:17 UTC (permalink / raw)
  To: Marco Patzer; +Cc: mailing list for ConTeXt users

Marco Patzer schrieb am 28.11.18 um 08:38:
> On Tue, 27 Nov 2018 22:41:25 +0100
> Wolfgang Schuster <wolfgang.schuster.lists@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.

The solution with the token list would be nicer if there where a way
to store the content in a similar fashion as buffers (which allow adding
content but this requires Lua) or setups.


\unprotect

\installnamespace {tokenlist}

\unexpanded\def\definetokenlist[#1]%
   {\expandafter\newtoks\csname\????tokenlist#1\endcsname}

\unexpanded\def\starttokenlist[#1]#2\stoptokenlist
   {\ifcsname\????tokenlist#1\endcsname \else
      \expandafter\newtoks\csname\????tokenlist#1\endcsname
    \fi
    \expandafter\toksapp\csname\????tokenlist#1\endcsname{#2}}

\def\gettokenlist[#1]%
   {\ifcsname\????tokenlist#1\endcsname
      \expandafter\the\csname\????tokenlist#1\endcsname
    \fi}

% \unexpanded\def\definetokenlist[#1]%
%   {\expandafter\let\csname\????tokenlist#1\endcsname\empty}
%
% \unexpanded\def\starttokenlist[#1]#2\stoptokenlist
%   {\ifcsname\????tokenlist#1\endcsname \else
%      \expandafter\let\csname\????tokenlist#1\endcsname\empty
%    \fi
%    \expandafter\edef\csname\????tokenlist#1\endcsname
% 
{\normalunexpanded\expandafter\expandafter\expandafter{\csname\????tokenlist#1\endcsname}%
%       \normalunexpanded\expandafter{#2}}}
%
% \def\gettokenlist[#1]%
%   {\ifcsname\????tokenlist#1\endcsname
%      \csname\????tokenlist#1\endcsname
%    \fi}

\protect

\starttext

% \definetokenlist[test]

\starttokenlist[test]
a
\stoptokenlist

b

\starttokenlist[test]
c
\stoptokenlist

\gettokenlist[test]

\stoptext


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
___________________________________________________________________________________

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

* Re: Language dependency in environment-project file
  2018-11-28  7:38           ` Marco Patzer
  2018-11-28 21:17             ` Wolfgang Schuster
@ 2018-11-29 19:30             ` Wolfgang Schuster
  2018-11-29 20:57               ` Marco Patzer
  1 sibling, 1 reply; 12+ messages in thread
From: Wolfgang Schuster @ 2018-11-29 19:30 UTC (permalink / raw)
  To: Marco Patzer; +Cc: mailing list for ConTeXt users

Marco Patzer schrieb am 28.11.18 um 08:38:
> On Tue, 27 Nov 2018 22:41:25 +0100
> Wolfgang Schuster <wolfgang.schuster.lists@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
___________________________________________________________________________________

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

* Re: Language dependency in environment-project file
  2018-11-29 19:30             ` Wolfgang Schuster
@ 2018-11-29 20:57               ` Marco Patzer
  0 siblings, 0 replies; 12+ messages in thread
From: Marco Patzer @ 2018-11-29 20:57 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

On Thu, 29 Nov 2018 20:30:53 +0100
Wolfgang Schuster <wolfgang.schuster.lists@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
___________________________________________________________________________________
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
___________________________________________________________________________________

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

end of thread, other threads:[~2018-11-29 20:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-27 20:37 Language dependency in environment-project file Marco Patzer
2018-11-27 20:41 ` Wolfgang Schuster
2018-11-27 20:56   ` Marco Patzer
2018-11-27 21:05     ` Wolfgang Schuster
2018-11-27 21:23       ` Marco Patzer
2018-11-27 21:41         ` Wolfgang Schuster
2018-11-28  7:38           ` Marco Patzer
2018-11-28 21:17             ` Wolfgang Schuster
2018-11-29 19:30             ` Wolfgang Schuster
2018-11-29 20:57               ` Marco Patzer
2018-11-28  8:20       ` Hans Hagen
2018-11-28 10:09         ` Marco Patzer

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).