[NTG-context] Do environment files add implicit \starttext ... \stopttext

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Fri Nov 18 15:52:07 CET 2022


Pablo Rodriguez via ntg-context schrieb am 15.11.2022 um 16:06:
> On 11/15/22 13:22, Denis Maier via ntg-context wrote:
>> Hi,
>>
>> if I process an XML buffer, I’ve noticed I need to wrap the
>> \xmlprocessbuffer in a \starttext ... \stoptext pair.
>> []
>> However, if I have the XML and the setups in dedicated files, there
>> seems to be no need for \starttext ... \stoptext.
>> []
>> Therefore my question:
>>
>> Does the use –environment automatically wrap the processed file in
>> \starttext ... stoptext ?
> Hi Denis,
>
> try a source file with this contents:
>
>    \ConTeXt\ is great.
>
> with the following environment:
>
>    \setuppapersize[A6]
>    \setupbodyfont[pagella]
>
> It looks like when --environment is used, ConTeXt assumes that the main
> source only contains text. Which makes sense (at least, to me).

The reason why this does work has nothing to do with the environment 
file, the only
thing which is responsible to get a PDF with output is the 
\setupbodyfont line.


Better examples are

%%%% begin example 1
\CONTEXT\ is great.
%%%% end example 1

and

%%%% begin example 2
\setupbodyfont[modern]

\CONTEXT\ is great.
%%%% begin example 2

where the output of the first example is broken.


To ensure the document exists in a proper manner ConTeXt inserts \stoptext
at the end of the document but there is never a \starttext inserted at 
any point
when you process a regular tex file.

You should also notice a message like

     system          > invalid \starttext ... \stoptext structure

on the terminal.

Wolfgang



More information about the ntg-context mailing list