TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to typeset a longer document with lots of packages. Now it seems that pre-compiling the header can speed up the edit-compile-revise cycle quite a bit. I tried to follow the guideline from How to speed up pdflatex for a very large document on MacOS X? but it does not work on my system and I am not sure what I am doing wrong.

My preamble.tex looks as follows:

\def\preambleloaded{Precompiled preamble loaded.}

and the main.tex file:

\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax} \ifundefined{preambleloaded}
\typeout{PRECOMILED PREAMBLE NOT LOADED}\input{preamble} \else

test test test

Now after compiling the preamble with

lualatex -ini -job-name="main" "&lualatex preamble.tex\dump"

a main.fmt file is created and lualatex runs without errors. Compiling the main file with

lualatex -shell-escape main.tex

gives the message right at the beginning that the preamble was not included:

LaTeX2e <2011/06/27>
LuaTeX adaptation of babel <v3.8l-luatex-1.4> and hyphenation patterns for engl
ish, loaded.

The only difference that I can think of at the moment is that I am using LuaLaTeX on Windows 7 instead of pdftex on Mac OS X as in the linked question. Any hint how to fix this is very appreciated.

share|improve this question
Don't you need: lualatex -shell-escape "&main main.tex" ? – Taco Hoekwater May 10 '12 at 14:14
@TacoHoekwater: Thank you! That works nicely. Could you convert your comment into an answer and maybe add a sentence what the difference is so that I can accept it? – Alexander May 10 '12 at 15:04
up vote 7 down vote accepted

You need:

lualatex -shell-escape "&main main.tex"

otherwise the newly generated main.fmt file is not used at all.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.