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.

  • 1
    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

You need:

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

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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