# [NTG-context] Several environments in a project?

nicola vitacolo at dimi.uniud.it
Tue Jun 19 10:54:03 CEST 2007

In article <alpine.WNT.0.99.0706190214510.1080 at nqvgln>,

> On Mon, 18 Jun 2007, fiÃ«Ã© visuÃ«lle wrote:
>
> > Am 2007-06-18 um 12:50 schrieb nicola:
> >
> >> I have a project with a few products sharing the same layout, which is
> >> specified in a global environment file. Each product is in a separate
> >> subdirectory together with its components. Then, I want to put some
> >> setups and figure definitions in product-specific environments and
> >> I do
> >> it like this:
> >>
> >> \startproduct OneProduct
> >> \project MyProject
> >> \environment OneProductDir/LocalEnvironment
> >> ...
> >>
> >> The problem is that the local environment is not read when I typeset a
> >> particular component, but only when I typeset the whole product.
> >> How can
> >> I fix that?
> >
> > Put your product specific settings in the product file.
>
> AFAIU, they will not be executed. There is really no clean way of
> doing this without adding extra markup. Suppose I have a product file
> which says
>
> \startproduct product \environemnt env1 \environemnt env2
>   Title Text
> \component one
> \component two
> \stopproduct
>
> and a component
>
> \startcomponent one
> \product product
> text
> \stopcomponent
>
> How can TeX parse the product file without typesetting title text?  It
> would have been simple if title text was surronded by some markup, but
> it is not. This is one of the reasons projects are not supposed to
> have any matertial that will be typeset.
>
> components.

Ok, I had thought about it: it just doesn't feel the "right" way to me
(logically, as the enviroment is common to all components, it should be
put at a level that is common to all components...)

> Another way is to use localenvironments in your
> environment file, but I have never used them myself.

I have read about \localenvironment and tried it a bit, but without much
success: I must say that I find the documentation about it a bit
cryptic. I would gladly see a usage example by someone more
knowledgeable than myself...

Nicola