ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* How to use local setups in selected components of a project only
@ 2010-08-09  7:34 Elias Oltmanns
  2010-08-17 15:36 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Elias Oltmanns @ 2010-08-09  7:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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


% environ.tex
\startenvironment environ
% global setups
% ...
\startmode[compa]
\setuphead[section][number=no]
\stopmode
\stopenvironment


% localenv.tex
\startlocalenvironment [compa]
\setuphead[section][number=no]
\stoplocalenvironment


% compa.tex
\startcomponent compa
%\enablemode[compa]
\project project
\localenvironment localenv

\section{First section}
Some text

%\disablemode[compa]
\stopcomponent


% compb.tex
\startcomponent compb
\project project

\section{Second section}
More text
\stopcomponent


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

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,

Elias
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: How to use local setups in selected components of a project only
  2010-08-09  7:34 How to use local setups in selected components of a project only Elias Oltmanns
@ 2010-08-17 15:36 ` Hans Hagen
  0 siblings, 0 replies; 2+ messages in thread
From: Hans Hagen @ 2010-08-17 15:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 9-8-2010 9:34, Elias Oltmanns wrote:

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

indeed, local is not local in the sense of grouped, it just permits 
nesting ; you need to use grouping to localize settings

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

grouping

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2010-08-17 15:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-09  7:34 How to use local setups in selected components of a project only Elias Oltmanns
2010-08-17 15:36 ` Hans Hagen

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