Friday, May 9, 2008
Wednesday, May 7, 2008
Generating LeTeX preamble format (.fmt) file
I used to use a compiled preamble, but since i really didn't see a difference in the processing times, perhaps because my dynamic part in my documents is usually quite big, and also because i now have a quad-core machine (gasp!). Anyhow, so i stopped compiling, and over time, forgot the way to generate the .fmt file.
Lately, have been doing some TeX-ing on my laptop, which obviously lacks the desktop's muscle, hence the need for a pre-compiled preamble. Searching on the net brought me to the blog [1], which gives a pretty good description of the process.
First, some remarks about the command below, looking at which today, sort of connected together bits of knowledge i have about the inner workings of the TeX system. Also somewhat explains the various options in the command, which even to a seasoned LaTeX user would seem obscure.
latex -ini "&latex preamble.tex \dump"
so now, LaTeX (and it's other avatars), in my understanding, is just a front end; in that it provides a number of macros to TeX, which is the real typesetting engine. The macros are (pre-)compiled and stored in a format file, which in the case of LaTeX would be latex.fmt. So, ``&latex" in the command above, simply states that latex.fmt be loaded.
Now, let's look using the compiled preamble while compiling the actual document main.tex. The first line of main.tex is:
%&preamble
well, other than the comment symbol ``%", we've figured out what's going on: the ``&" operator tells TeX to load the (binary ) format file preamble.fmt
As I see on my Powerbook G4, the time saved in the compile cycle is significant when the compiled preamble is used.
References:
- http://magic.aladdin.cs.cmu.edu/2007/11/02/precompiled-preamble-for-latex
- TeX info manual: memory dump
- LaTeX info manual
Subscribe to:
Posts (Atom)