ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Several environments in a project?
@ 2007-06-18 10:50 nicola
  2007-06-18 21:24 ` fiëé visuëlle
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: nicola @ 2007-06-18 10:50 UTC (permalink / raw)
  To: ntg-context

Hi,
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? 

Nicola

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


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

* Re: Several environments in a project?
  2007-06-18 10:50 Several environments in a project? nicola
@ 2007-06-18 21:24 ` fiëé visuëlle
  2007-06-19  6:45   ` Aditya Mahajan
  2007-06-20  8:50 ` Wolfgang Schuster
  2007-07-21 16:46 ` Sanjoy Mahajan
  2 siblings, 1 reply; 9+ messages in thread
From: fiëé visuëlle @ 2007-06-18 21:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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.


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

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


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

* Re: Several environments in a project?
  2007-06-18 21:24 ` fiëé visuëlle
@ 2007-06-19  6:45   ` Aditya Mahajan
  2007-06-19  8:53     ` Henning Hraban Ramm
  2007-06-19  8:54     ` nicola
  0 siblings, 2 replies; 9+ messages in thread
From: Aditya Mahajan @ 2007-06-19  6:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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.

So, the short answer is just add \environment commands in your 
components. Another way is to use localenvironments in your 
environment file, but I have never used them myself.

Aditya

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


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

* Re: Several environments in a project?
  2007-06-19  6:45   ` Aditya Mahajan
@ 2007-06-19  8:53     ` Henning Hraban Ramm
  2007-06-19  8:54     ` nicola
  1 sibling, 0 replies; 9+ messages in thread
From: Henning Hraban Ramm @ 2007-06-19  8:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2007-06-19 um 08:45 schrieb Aditya Mahajan:

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

Sorry, I overlooked that it should be executed while typesetting a  
component.
I never managed to do that, too. (Normally I use a copy of the  
product file with only one component to test this component).

Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

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


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

* Re: Several environments in a project?
  2007-06-19  6:45   ` Aditya Mahajan
  2007-06-19  8:53     ` Henning Hraban Ramm
@ 2007-06-19  8:54     ` nicola
  1 sibling, 0 replies; 9+ messages in thread
From: nicola @ 2007-06-19  8:54 UTC (permalink / raw)
  To: ntg-context

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2150 bytes --]

In article <alpine.WNT.0.99.0706190214510.1080@nqvgln>,
 Aditya Mahajan <adityam@umich.edu> wrote:

> 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.
> 
> So, the short answer is just add \environment commands in your 
> 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


[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

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

* Re: Several environments in a project?
  2007-06-18 10:50 Several environments in a project? nicola
  2007-06-18 21:24 ` fiëé visuëlle
@ 2007-06-20  8:50 ` Wolfgang Schuster
  2007-06-20  9:13   ` nicola
  2007-07-21 16:46 ` Sanjoy Mahajan
  2 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Schuster @ 2007-06-20  8:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

2007/6/18, nicola <vitacolo@dimi.uniud.it>:
> Hi,
> 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?
>
> Nicola

Hi Nicola,

if you use the same layout for all your documents in a project you can use the
following structure.

% Project

\startproject projectname

\environment environment1
.. more environments

\product product1
.. more products

\stopproject

% Product

\startproduct product1

\project projectname

\component component1
... more components

\stopproduct

% Component

\startcomponent component1

\project projectname

Content

\stopcomponent

The important part is to use \project in your component and not \product,
if I understand the code in core-job correct product files are not read within
a component, only projects, environments and other components.

Greetings
Wolfgang
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Several environments in a project?
  2007-06-20  8:50 ` Wolfgang Schuster
@ 2007-06-20  9:13   ` nicola
  0 siblings, 0 replies; 9+ messages in thread
From: nicola @ 2007-06-20  9:13 UTC (permalink / raw)
  To: ntg-context

> The important part is to use \project in your component and not \product,
> if I understand the code in core-job correct product files are not read 
> within
> a component, only projects, environments and other components.

All my components already start with

\startcomponent X
\product Y
\project Z

So, the rule of thumb is: include all environments in the project file, 
not in the products files, if you want them to be read when typesetting 
the project, a product or a component. That works for me. Thanks!

Nicola

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


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

* Re: Several environments in a project?
  2007-06-18 10:50 Several environments in a project? nicola
  2007-06-18 21:24 ` fiëé visuëlle
  2007-06-20  8:50 ` Wolfgang Schuster
@ 2007-07-21 16:46 ` Sanjoy Mahajan
  2007-07-21 16:55   ` Aditya Mahajan
  2 siblings, 1 reply; 9+ messages in thread
From: Sanjoy Mahajan @ 2007-07-21 16:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

I had the same question and came to the following solution.  The
component files begin as follows:

  \startcomponent extreme-cases
  \product book
  \project project

  \startnotmode[*product]
  \environment env_book
  \stopnotmode
  ...

Here, env_book.tex is the product-specific environment file, which is
called at the beginning of the product file book.tex.  If only a
component is being run, the \startnotmode[*product] will ensure that
env_book is read in anyway.

Let me know if that does what you want (CC me as well as the list,
since I'm highly irregular in reading list email these days, due to
having a baby, and might miss your response otherwise).

-Sanjoy

"Creativity can be a social contribution, but only in so
 far as society is free to use the results." --Richard Stallman
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

* Re: Several environments in a project?
  2007-07-21 16:46 ` Sanjoy Mahajan
@ 2007-07-21 16:55   ` Aditya Mahajan
  0 siblings, 0 replies; 9+ messages in thread
From: Aditya Mahajan @ 2007-07-21 16:55 UTC (permalink / raw)
  To: Sanjoy Mahajan; +Cc: mailing list for ConTeXt users

On Sat, 21 Jul 2007, Sanjoy Mahajan wrote:

> I had the same question and came to the following solution.  The
> component files begin as follows:
>
>  \startcomponent extreme-cases
>  \product book
>  \project project
>
>  \startnotmode[*product]
>  \environment env_book
>  \stopnotmode
>  ...
>
> Here, env_book.tex is the product-specific environment file, which is
> called at the beginning of the product file book.tex.  If only a
> component is being run, the \startnotmode[*product] will ensure that
> env_book is read in anyway.

I think that \startnotmode is not needed. \environment is smart enough 
to read the file only once. So, if the file has been read in the 
product, it will not be read again when the component is processed.

Aditya
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

end of thread, other threads:[~2007-07-21 16:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-18 10:50 Several environments in a project? nicola
2007-06-18 21:24 ` fiëé visuëlle
2007-06-19  6:45   ` Aditya Mahajan
2007-06-19  8:53     ` Henning Hraban Ramm
2007-06-19  8:54     ` nicola
2007-06-20  8:50 ` Wolfgang Schuster
2007-06-20  9:13   ` nicola
2007-07-21 16:46 ` Sanjoy Mahajan
2007-07-21 16:55   ` Aditya Mahajan

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