[NTG-context] How to use local setups in selected components of a project only

Elias Oltmanns eo at nebensachen.de
Mon Aug 9 09:34:28 CEST 2010

Hi all,

it has been suggested on this list before, that people should use modes
instead of \localenvironment and friends. Unfortunately, I don't seem to
get either of them working as expected. Consider the following example:

% project.tex
\startproject project
\environment environ
\component compa
\component compb

% environ.tex
\startenvironment environ
% global setups
% ...

% localenv.tex
\startlocalenvironment [compa]

% compa.tex
\startcomponent compa
\project project
\localenvironment localenv

\section{First section}
Some text


% compb.tex
\startcomponent compb
\project project

\section{Second section}
More text

Compiling project.tex results in both sections being unnumbered.
Compiling just compb.tex yields the expected result. Apparently, the
setups of localenv stay in effect for all components processed

Commenting out \localenvironment and uncommenting \enablemode /
\disablemode in compa.tex, however, does not solve the problem either:
When I compile just compa.tex, everything works as expected. Compiling
preject.tex, however, results in all sections being numbered. Obviously,
the call to \enablemode comes too late.

What is the recommended approach to such a problem? Do I have to undo
local setups manually at the end of a component?

Thanks in advance for any advice,


More information about the ntg-context mailing list