ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Project Structure - inheritance rules for environments
@ 2021-02-28 22:09 denis.maier
  2021-03-01 19:09 ` Wolfgang Schuster
  0 siblings, 1 reply; 2+ messages in thread
From: denis.maier @ 2021-02-28 22:09 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 644 bytes --]

Hi,
I'm just having a look a project structure again. I am using the example given in the wiki: https://wiki.contextgarden.net/Project_structure, i.e., in my component I'm linking to the product, but not to the project. Now I was expecting that the component inherits the environment set in the project via the product. The wiki currently explains: "If you tex (compile) one single component (e.g. a chapter of a book) or product (e.g. one volume of a magazine), the environment file of the project is used." That does not seem to be the case here. Can anyone confirm this? Is this a bug or does the wiki needs to be revised?
Best,
Denis


[-- Attachment #1.2: Type: text/html, Size: 2614 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

* Re: Project Structure - inheritance rules for environments
  2021-02-28 22:09 Project Structure - inheritance rules for environments denis.maier
@ 2021-03-01 19:09 ` Wolfgang Schuster
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Schuster @ 2021-03-01 19:09 UTC (permalink / raw)
  To: mailing list for ConTeXt users

denis.maier@ub.unibe.ch schrieb am 28.02.2021 um 23:09:
> Hi,
> 
> I’m just having a look a project structure again. I am using the example 
> given in the wiki: https://wiki.contextgarden.net/Project_structure, 
> i.e., in my component I’m linking to the product, but not to the 
> project. Now I was expecting that the component inherits the environment 
> set in the project via the product. The wiki currently explains: “If you 
> tex (compile) one single component (e.g. a chapter of a book) or product 
> (e.g. one volume of a magazine), the environment file of the project is 
> used.” That does not seem to be the case here. Can anyone confirm this? 
> Is this a bug or does the wiki needs to be revised?

The \product command doesn't load any files because it doesn't make
any sense. Let us take a look at the following example. When you process
only a single component and \product would load the parent file you're
running in a problem because the parent file is now loading the previous
component file etc.

This would end in a loop and to prevent this \product lines are ignored.
There are ways to avoid this by redefining \component etc. when
the parent file is loaded but it's a mess to take care about all
combinations in which files are loaded.

The best thing you can do here is to load the environment file
in each product and component because the file is only loaded once
on the first call. When you use multiple environment files you
can collect them in a project file and use \project to load only
one file but this is seldom needed.

%%%% begin product.tex
\startproduct *

\environment environment

\component component_1
\component component_2

\stopproduct
%%%% end product.tex

%%%% begin component_1.tex
\startcomponent *

\environment environment

...

\stopcomponent
%%%% end component_1.tex

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2021-03-01 19:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-28 22:09 Project Structure - inheritance rules for environments denis.maier
2021-03-01 19:09 ` Wolfgang Schuster

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