Background:
For one project, I store all my header .tex/.sty files in ../../../Templates, and all the files need to be at a particular relative directly location so using this relative hierarchy enforces that rule.
In order to speed up compilation, I created a pre compiled .fmt file. Now to use this, I can either:
Add to the command line:
-fmt ../../../Templates/MyPreambleAdd the following line as the the first line in my .tex file:
%& ../../../Templates/MyPreamble
and both methods work fine.
Question:
What I would like to do is to to have the first line in the .tex file as
\input{../../../Templates/MySetup.tex}
and the content of the MySetup.tex invoke the .fmt file with something such as:
%& ../../../Templates/MyPreamble
Is there anyway to do this?
Reasons:
I am open to any other suggestions as well, but here is my reasons for this:
I used the first method and adjusted the
pdflatexcommand in TeXShop to have that directive. However, when I am working on some other project (ex, an TeX.SE answer) I do not want that pre-compiled format, so need a way to disable it. Hence decided not to use this method.I already have ALL file individual files set up to
\inputtheMySetup.texfile on the very first line. If I can just change that one file, then I can easily switch between using the pre-compiled format or not, by just changing theMySetup.texfile. And yes I could use a shell script to update all the files, to add this first comment line, but would prefer to not to do that.
pdflatexroute for TeX.SE answers etc, and your ownmypreambleroute for everything else (though you would have to remember to press the right one). Alternatively, you could set up the compile action to be a script that checks based on the location of the document (or the first line of the file say) which command line to invoke. – cyberSingularity Nov 8 '12 at 23:42