context minimals "path and directory structure" question
Hello! I'm using context-minimal version: 2008.10.01 19:13 and have a generally question. I'm writing several documents with similar structure and design and have collected all common settings in "settings.tex" like following: \startenvironment settings ... ... ... \stopenvironment and just do the usual invoking by in anything.tex \environment settings \starttext ... ... ... \stoptext I've installed the "minimals" structure in /home/$USER/context/... on my ubuntu 8.04 machine. Now to the question: Where in this "structure" do I place "settings.tex" so it can be found by context from anywhere in my document-structure? I suppose I should do something like "context --make" after placing the file. If I do the usual upgrade what happens then? Is there a more efficient way doing similar tasks, like writing a module? All best! Janneman
On Mon, Oct 20, 2008 at 10:13 AM, Jan-Erik Hägglöf < janerik.hagglof@bredband.net> wrote:
Hello!
I'm using context-minimal version: 2008.10.01 19:13
ok, I suppose that you are using first-setup.sh and . setuptext
and have a generally question.
I'm writing several documents with similar structure and design and have collected all common settings in "settings.tex" like following:
\startenvironment settings ... ... ... \stopenvironment
and just do the usual invoking by
in
anything.tex
\environment settings
\starttext ... ... ... \stoptext
I've installed the "minimals" structure in /home/$USER/context/... on my ubuntu 8.04 machine.
Now to the question:
Where in this "structure" do I place "settings.tex" so it can be found by context from anywhere in my document-structure?
tex/texmf-local/tex/context/user can be a good place
I suppose I should do something like "context --make" after placing the file. If I do the usual upgrade what happens then?
first-setup.sh should not delete your files. context --generate context --make are "safe " (well, one can always write a malicius tex file that overwrite tex/texmf-local/tex/context/user/settings.tex ...) -- luigi
On Mon, Oct 20, 2008 at 10:13 AM, Jan-Erik Hägglöf wrote:
Hello!
I'm using context-minimal version: 2008.10.01 19:13 and have a generally question.
I'm writing several documents with similar structure and design and have collected all common settings in "settings.tex" like following:
\startenvironment settings ... ... ... \stopenvironment
and just do the usual invoking by
in
anything.tex
\environment settings
\starttext ... ... ... \stoptext
I've installed the "minimals" structure in /home/$USER/context/... on my ubuntu 8.04 machine.
Now to the question:
Where in this "structure" do I place "settings.tex" so it can be found by context from anywhere in my document-structure?
Like Luigi said, texmf-local/tex/context/whatever might be the best place in the tree.
I suppose I should do something like "context --make" after placing the file.
mktexlsr for kpathsea and luatools --generate for mkiv. Though some folders are searched even without putting them to database.
If I do the usual upgrade what happens then?
The script doesn't touch texmf-local.
Is there a more efficient way doing similar tasks, like writing a module?
You can also have "settings.tex" on top of all the folders that use it. Plain file and module do not make much difference in such cases. (For safety reasons, I prefer to have a copy of such files locally (in folder where I process files). I never know when I switch computer and forget to copy some files from some "global" folders.) Mojca
On Mon, 20 Oct 2008, Jan-Erik Hägglöf wrote:
Where in this "structure" do I place "settings.tex" so it can be found by context from anywhere in my document-structure?
For files which are specific to one or two projects, I usually place them in the directory: main-dir/ | +---- settings.tex | +---- project-1/ | | | +--- component-1-1.tex | +---- project-2/ and then in component-1-1.tex, put \environment settings There is no need to tell the relative path to context. When context cannot find a file in the current dir, it looks up two (or three?) levels to find the file. As Mojca said, this has the added advantage of making the structure self-sufficient. You can just copy the main-dir on a different computer and everything works. For files that are used in many different projects, I usually make it a module (if you are not using any advanced features, like localenvironments or setupmodules, modules and environments are the same) I have created a directory texmf-local/tex/context/aditya where I put all my files (and sync them to a svn server so that I can use them on different computers).
I suppose I should do something like "context --make" after placing the file. If I do the usual upgrade what happens then?
You make need to run luatools --generate (or texhash if using mkii) if place the files in texmf-local. To prevent any accidents with upgrades, create a directory in texmf-local/tex/context that is unique. You can also create the directory in $TEXMFHOME/tex/context (which is usually $HOME/tex/context in *nix systems, I do not know about win/mac). Normally upgrades do not touch anything in $TEXMFHOME. Aditya
participants (4)
-
Aditya Mahajan
-
Jan-Erik Hägglöf
-
luigi scarso
-
Mojca Miklavec