[OS X TeX] Per-folder project root

Martin Costabel costabel at wanadoo.fr
Tue Oct 13 02:03:07 CEST 2009


Chris Goedde wrote:
[]
> Yes, I understand all that. The problem with that model is (a) you have 
> to set it in every file, and (b) if you change the name of the root file 
> then you have to change it in every file. What I'm saying is that it 
> would be nice if you could set this once for every file in a given folder.

Here is a possibility: In the preamble of your main Notes.tex file, write

\def\INPUT#1{%
\immediate\write18{printf \jobname.tex > #1.texshop}%
\input{#1}}

Then, for your individual notes, use \INPUT{foo} instead of \input{foo}.
You will have to typeset from Notes.tex once, then afterwards the 
project root for foo is set, and you can typeset from foo.tex.

For this to work, your engine has to include the --shell_escape flag.

-- 
Martin



More information about the macostex-archives mailing list