2

I know that I can significantly speed up LaTeX compilation times by using a format file. However there seem to be multiple options to create a format file:

  • Just using the ini option of pdflatex (in the sense pdflatex -ini -jobname="preamble" "&pdflatex preamble.tex\dump"

  • Use mylatexformat to create the format file

How do both approaches compare? What are the differences and advantages/disadvantages of one over the other? Or is there a third approach you should prefer in 2023? If so, why?

student
  • 29,003

1 Answers1

1

You can just try both options yourself. Essentially they're "the same", with mylatexformat offers some additional convenience.

Tutorial on -ini: https://tex.stackexchange.com/a/15606/250119

Tutorial on mylatexformat: https://tex.stackexchange.com/a/377033/250119 or https://tex.stackexchange.com/a/269052/250119

Note that the latter also uses -ini.

The additional convenience of the package is that, if you use mylatexformat, then you

  • don't need to keep two separate TeX files preamble and main, they're both in the same file.
  • don't need to modify the source code (apart from a single format line at the start of the file. You can add \endofdump to explicitly mark the end of the "precompiled" part if you want/if anything in the preamble is not precompilable, but it's not mandatory, by default the part before \begin{document} is precompiled)

For other methods to speed up compilation refer to Speeding up LaTeX compilation.

user202729
  • 7,143