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
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)
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
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)
In article
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
2007/6/18, nicola
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
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
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
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
participants (6)
-
Aditya Mahajan
-
fiëé visuëlle
-
Henning Hraban Ramm
-
nicola
-
Sanjoy Mahajan
-
Wolfgang Schuster