ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Elias Oltmanns <eo@nebensachen.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: How to use local setups in selected components of a project only
Date: Mon, 09 Aug 2010 09:34:28 +0200	[thread overview]
Message-ID: <8762zkdyt7.fsf@denkblock.local> (raw)

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
___________________________________________________________________________________


             reply	other threads:[~2010-08-09  7:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-09  7:34 Elias Oltmanns [this message]
2010-08-17 15:36 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8762zkdyt7.fsf@denkblock.local \
    --to=eo@nebensachen.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).