Reading the docs, I came under the impression that products have isolated environments.
Experimentation suggests I misunderstand or am misusing them. Given the following project structure:
entry.tex
|- p1.tex
| \- p1-env.tex
|- p2.tex
\- p2-env.tex
Where entry.tex
includes two products (separated by a \page
), I would expect p1
to include the p1-env
but not p2-env
. However it appears that p2-env.tex
, being the last to load, dominants any other styles.
A solution/workaround would seem to be just not use environments but rather have macros/commands that set the style accordingly, on demand.
However, if indeed all environments end up collapsing on the last-loaded environment, what's what's the point of the ConTeXt product-structure and environments?
Here's a sample starter that one can use to illustrate.
p1-env.tex
\startenvironment *
\setuplayout[
leftmargin=0pt,
backspace=9em,
cutspace=3em,
leftmargindistance=1em,
leftedgedistance=1em,
leftmargin=7.5em,
]
\stopenvironment
p1.tex
\environment p1-env
\startproject *
Hello from p1 \inmargin{Left}
\stopproject
p2-env.tex
\startenvironment *
\setuplayout[
leftmargin=0pt,
backspace=3em,
cutspace=9em,
rightmargindistance=1em,
rightedgedistance=1em,
rightmargin=7.5em,
]
\setupmargindata[inmargin]
[style=normal, location=right, stack=yes, distance=0pt]
\stopenvironment
p2.tex
\environment p2-env
\startproject *
Hello from p2 \inmargin{Right}
\stopproject
entry.tex
% !TEX TS-program = ConTeXt (LuaTeX)
\startproduct *
\product p1
\page % Should reset layout.
\product p2
\stopproduct
entry.tex
have\start...\stopproject
andp1.tex
/p2.tex
the\start...\stopproduct
pair?projects
don't actually compile. The innerproducts
could becomponents
but from looking at the source it looks like they were designed to be peers as well. I stand to be corrected though. lol