Feeds

Blog

Thursday, May 10, 2007

LaTex and Rubber

We are currently busy writing our masters thesis, and as always we use LaTeX to write the report. LaTeX documents consists of LaTeX files and a bibliography, and in order to get all references correct for both chapters, sections, figures, and citations to bibliography entries the LaTeX document has to be compiled in 4 steps.

First a list of all labels has to be generated. The second step is to compile the bibliography. The third and fourth steps walk through the document and insert correct references, generate the table of contents etc.

Even though we have a Makefile that make it easy to compile the LaTeX files into a PDF document, the compilation still takes a while, and as the document grows so does the compilation time. Yesterday I discovered a clever little program called rubber, that can greatly decrease the compilation time to a minimum.

Instead of having to go through all four steps every time, the rubber document build system analyzes the document files and determines what compilations steps are necessary to produce the PDF document. If I only modify text in a single file, and do not add any new labels, rubber only performs a single LaTeX compilation. If I add a new reference it performs two LaTeX compilations. Finally if I add a new bibliography entry and reference it, rubber will perform all four compilation steps.

Under normal use, it reduces the compilation time with a factor of three. To use rubber, execute the following command

rubber --texpath=packages --pdf report.tex

If you do not have any extra LaTeX packages, you can skip the --texpath option. As an extra bonus for all the university students - rubber is already installed on the servers, so update your Makefiles today! :-)
posted by Brian Jørgensen at 11:33am.
permanent url: http://www.qte.dk/blog/archive/49