Hi Jan !
The directory structure issue isn't very complicated with "environment," but it
can become so. In principle, the env/ directory should contain everything
related to settings: env-book-styles.mkiv, env-book-whatever.mkiv, as well as
image folders and any folders related to what you want to import (e.g., the
folder with MetaPost figures codes). The main/master file should be placed with
the components, which are themselves divided into frontmatter, bodymatter, and
backmatter. I But that's not all! In the "environment" files, we need to
specify the paths we need (to the directories), but not the *.tex files. The
environment file is useful for global settings.
Example:
% env-mybook.mkiv
% ------------------
\setuppaths
[frontmatter,
bodymatter,
backmatter,
figures,
metapost
lua,
xml]
% Fonts
\setupbodyfont[...]
% Latour
\setuplayout[...]
% Styles
\setuphead[...]
% Macros global
\def\WkSomething{...}
The file main.tex/master.tex is very poor :
% master.tex
% entry point (project)
\environment env/env-book
\starttext
\product env-book
\stoptext
Here below is the scheme :
project/
├─ master.tex
├─ env/
│ └─ env-yourbook-styles.mkiv
│
├─ frontmatter/
│ ├─ 01-title.tex
│ ├─ 02-preface.tex
│
├─ bodymatter/
│ ├─ 10-introduction.tex
│ ├─ 20-whatever .tex
│
├─ backmatter/
│ ├─ 60-bibliographie.tex
│ ├─ 61-index.tex
Inside each directory (frontmatter, bodymatter, backmatter),you will develop
.tex files called "components." We do not compile these components directly:
main.tex will do that.
Jean-Pierre Delange
> Le 30 déc. 2025 à 11:47, Jan Ulrich Hasecke via ntg-context
> <[email protected]> a écrit :
>
> Dear all,
>
> between the days, as we say in Germany, I setup a proof of concept for a
> repository with documents that reference each other.
>
> I followed the Wiki:
> https://wiki.contextgarden.net/References_notes_and_floats/References
>
> I had no problems when all master files were in the same toplevel folder:
>
> master-1.tex
> master-2.tex
> components-for-1/
> components-for-2/
>
> I also tried to include files from other folders outside the hierarchy of the
> main folder with \useexternaldocument, but that does not work.
>
> While \from gave the intended result, \at, \about, \in and \page does not.
>
> While I did not expect this to work at all, as relative paths and absolute
> paths may break when you deliver the final pdfs via a web service or put them
> in an other folder somewhere else I wonder why \from works and the others not.
>
> Is it correct that the best and robust way to make a group of documents that
> reference each other is to put them in the same folder?
>
> TIA and a happy new year
> juh
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the
> Wiki!
>
> maillist : [email protected] /
> https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
> webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
> archive : https://github.com/contextgarden/context
> wiki : https://wiki.contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________