Thank you Taco and Wolfgang.

 

I will have a look at both solutions.

 

Kind regards,

Jan Willem Flamma

 

From: Wolfgang Schuster
Sent: Friday, 4 September 2020 16:26
To: mailing list for ConTeXt users
Subject: Re: [NTG-context] Typing efficiency

 

Taco Hoekwater schrieb am 04.09.2020 um 15:51:

>

> Hi,

>

> Sounds like a job for the blocks mechanism more so than buffers:

>

>

> \defineblock[entext]

> \defineblock[nltext]

>   

> \defineselector [language] [max=2,n=1]

> \startmode[en]

>      \setupselector[language][n=1]

>      \keepblocks[entext]

> \stopmode

> \startmode[nl]

>      \setupselector[language][n=2]

>      \keepblocks[nltext]

> \stopmode

>  

> \starttext

>  

> \startsection[title=\select{language}{English title}{Dutch title}]

>  

> \beginentext

>      This is English text.

> \endentext

> \beginnltext

>      This is Dutch text.

> \endnltext

>  

> \stopsection

>  

> \stoptext

 

 

It can also be done with buffers.

 

\definebuffer [entext]

\definebuffer [nltext]

 

\defineselector [language] [max=2,n=1]

 

\startmode[en]

     \setupselector[language][n=1]

     \def\stopentext{\getentext}

\stopmode

 

\startmode[nl]

     \setupselector[language][n=2]

     \def\stopnltext{\getnltext}

\stopmode

 

\starttext

 

\startsection[title=\select{language}{English title}{Dutch title}]

 

\startentext

     This is English text.

\stopentext

\startnltext

     This is Dutch text.

\stopnltext

 

\stopsection

 

\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

___________________________________________________________________________________