ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Project Structure - inheritance rules for environments
Date: Mon, 1 Mar 2021 20:09:45 +0100	[thread overview]
Message-ID: <b35e36d7-5ed0-a6cb-2dec-047140252bb8@gmail.com> (raw)
In-Reply-To: <59729b5dc5764dd88d9a4d6ef358222a@ub.unibe.ch>

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
___________________________________________________________________________________

      reply	other threads:[~2021-03-01 19:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-28 22:09 denis.maier
2021-03-01 19:09 ` Wolfgang Schuster [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b35e36d7-5ed0-a6cb-2dec-047140252bb8@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).