[NTG-context] document structure
Hans van der Meer
hansm at science.uva.nl
Fri Jul 21 20:02:55 CEST 2006
On Jul 21, 2006, at 14:58, Taco Hoekwater wrote:
>
>
> Hans van der Meer wrote:
>> Must I understand that "\startlocalenvironment[abc]" within an
>> environment file means that this codeblock is used only for
>> typesetting
>> product/component abc and excluded automatically when another
>> product/component is typeset?
>
> I believe so.
>
>> How does this relate to the above question about setup-file
>> structure?
>
> \localenvironment is sort of an alias of \environment.
>
> Differences: there is a but less bookkeeping done, and the file
> is loaded only once in a run, never repeatedly (so that the command
> can safely be used in a number of components). The files' name
> (== the argument) is unimportant.
>
Sorry, but I think I do not yet understand and I do not get it right.
Next is in a nutshell my setup of the environments, the relevant
projects are syllabus-s and syllabus-p
% calls up the product, file syllabus-s.tex
\startproduct syllabus-s
\project onderwijs
\environment syllabus-setup
...
\stopproduct
% common initializations, file syllabus-setup.tex
\startenvironment syllabus-setup
\writestring{LOADED ENVIRONMENT SYLLABUS-SETUP}\writeline
\startlocalenvironment[syllabus-s]
\localenvironment syllabus-s-setup
\stoplocalenvironment
\startlocalenvironment[syllabus-p]
\localenvironment syllabus-p-setup
\stoplocalenvironment
% setups local to p-version, file syllabus-p-setup.tex
\startlocalenvironment[syllabus-p-setup]
\writestring{LOADED ENVIRONMENT SYLLABUS-P-SETUP}\writeline
\stoplocalenvironment
% setups local to s-version, file syllabus-s-setup.tex
\startlocalenvironment[syllabus-s-setup]
\writestring{LOADED ENVIRONMENT SYLLABUS-S-SETUP}\writeline
\stoplocalenvironment
Running from product syllabus-s.tex I get this in the log:
systems : begin file syllabus-setup at line 10
(./syllabus-setup.tex
LOADED ENVIRONMENT SYLLABUS-SETUP
systems : begin file syllabus-s-setup at line 6
(./syllabus-s-setup.tex
LOADED ENVIRONMENT SYLLABUS-S-SETUP
)
systems : end file syllabus-s-setup at line 6
systems : begin file syllabus-p-setup at line 10
(./syllabus-p-setup.tex
LOADED ENVIRONMENT SYLLABUS-P-SETUP
)
systems : end file syllabus-p-setup at line 10
And this shows that running the product syllabus-s still loads both
localenvironments and goes inside both \startlocalenvironments!
What I am doing wrong here?
Hans van der Meer
More information about the ntg-context
mailing list