Project structure with nested subfolders and shared environments.
Dear Everyone, I'm setting up a project structure that will possibly let me share styles and layouts with lots of documents I need to create weekly. Unfortunately my definitions in the environment file or files are ignored... Here is the setup under the purposely created structure: ** The folder called: 'MainFolder' is the root of my document repository. ** The 'Metadata' folder inside the 'MainFolder' contains environment files. ** The 'SubFolder/SubSubFolder' inside the 'MainFolder' is the nestin glevel I need with all the documents. Here are the files: % /MainFolder/Meta.tex \startproject * \usepath [{ Metadata }] \environment Environment.tex \stopproject % /MainFolder/Metadata/Environment.tex \startenvironment * % Test if setup is applied. \setupbodyfont[ebgaramond] \stopenvironment % /MainFolder/SubFolder/SubSubFolder/Doc.tex \startproduct * \project Meta \startcomponent * \startchapter[title={ Nested }] \input tufte \stopchapter \stopcomponent \stopproduct Unfortunately the default font is applied and EB Garamond is not picked up from the environment. The question is: ** How can I use such a structure to share styles and layouts kept i the 'Metadata' folder and use htem in products that are ment to be complete documents kept in the 'SubSubFolders'? All the very best and htank you in advance for any clarifications... Pawel
Am 15.12.22 um 22:52 schrieb Pawel Urbanski via ntg-context:
\usepath [{ Metadata }]
Did you try without the spaces? I’d assume ConTeXt will look for a folder " Metadata " and not "Metadata". If this is just a template variable, you didn’t tell us about templating. And then it matters from where you call your files (MainFolder, SubFolder or whereever). Hraban
Hi,
To address the first question: \usepath[{Metadata}] % Is the actual code - I put spaces for readability reasons, which was a bad idea. When I compile a document I switch to the SubSubFolder for the document file is in there. I will appriciate any further hints. Obvious htings are usually obvious for people more experenced than I am with Context at this time. Best, Pawel
Am 16.12.22 um 10:09 schrieb Pawel Urbanski via ntg-context:
When I compile a document I switch to the SubSubFolder for the document file is in there.
In my experience this won’t work. ConTeXt searches from the current folder (you can configure search paths, but I gave up on that, and you’d have to do it in the called file). It should be enough to call the environment from the project, but either the project or the environment isn’t found if the path doesn’t fit the call location. Hraban
Thank you for responses. While the ability to sort of inherit setups would be very useful it looks like as of time of posting this message in December 2022 it is not possible. As a workaround I will create a shead environment file and just bulk copy it to subfolders. In case when I'll need to globally change some configuration I can just replace the file. I keep all my documents in GIT so the ability to reverte hte change is just a command away. Thanks for help. Best, Pawel On Fri, Dec 16, 2022 at 10:55 AM Henning Hraban Ramm via ntg-context < ntg-context@ntg.nl> wrote:
Am 16.12.22 um 10:09 schrieb Pawel Urbanski via ntg-context:
When I compile a document I switch to the SubSubFolder for the document file is in there.
In my experience this won’t work. ConTeXt searches from the current folder (you can configure search paths, but I gave up on that, and you’d have to do it in the called file).
It should be enough to call the environment from the project, but either the project or the environment isn’t found if the path doesn’t fit the call location.
Hraban
___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net
___________________________________________________________________________________
Another think you might want to consider: automatic local overrides. So, I’d copy everthing to a build folder, copy the environment from somewhere above unless the current folder contains a file with the same name.
Denis
Von: ntg-context
When I compile a document I switch to the SubSubFolder for the document file is in there.
In my experience this won’t work. ConTeXt searches from the current folder (you can configure search paths, but I gave up on that, and you’d have to do it in the called file). It should be enough to call the environment from the project, but either the project or the environment isn’t found if the path doesn’t fit the call location. Hraban ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nlmailto:ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___________________________________________________________________________________
Pawel Urbanski via ntg-context schrieb am 16.12.2022 um 10:09:
Hi,
To address the first question: \usepath[{Metadata}] % Is the actual code - I put spaces for readability reasons, which was a bad idea.
When I compile a document I switch to the SubSubFolder for the document file is in there.
I will appriciate any further hints. Obvious htings are usually obvious for people more experenced than I am with Context at this time.
You need \usepath[../../Metadata] because the search path is relative to the location of your document. Wolfgang
Also, I think you'll need to load the environment in your products as well. I don't think linking to the project is enough. (Check the mailing list, I have also asked similar questions already...) Best, Denis
-----Ursprüngliche Nachricht----- Von: ntg-context
Im Auftrag von Henning Hraban Ramm via ntg-context Gesendet: Freitag, 16. Dezember 2022 07:52 An: Pawel Urbanski via ntg-context Cc: Henning Hraban Ramm Betreff: Re: [NTG-context] Project structure with nested subfolders and shared environments. Am 15.12.22 um 22:52 schrieb Pawel Urbanski via ntg-context:
\usepath [{ Metadata }]
Did you try without the spaces? I’d assume ConTeXt will look for a folder " Metadata " and not "Metadata". If this is just a template variable, you didn’t tell us about templating.
And then it matters from where you call your files (MainFolder, SubFolder or whereever).
Hraban ________________________________________________________________ ___________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg- context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ________________________________________________________________ ___________________
participants (4)
-
denis.maier@unibe.ch
-
Henning Hraban Ramm
-
Pawel Urbanski
-
Wolfgang Schuster