0

When running pdflatex more than once successively, is it possible to:

• Compile your preamble packages
• Snapshot this moment in compilation
• Continue running through the rest of the pdflatex compilation
• Start at the next compilation of pdflatex BUT from the moment of the snapshot.

It seems logical efficient since you're using the exact same packages in each run after the first.

12
  • 1
    in some cases, yes, see mylatex.ltx or mylatexformat available in texlive, miktex from ctan. In most cases reading the preamble isn't a large proportion of the processing time so saving it in a format doesn't save so much time, but it can be useful sometimes Commented Sep 19, 2020 at 21:38
  • 1
    yes you can use pdflatex as the format to base the custom format on (that is the usual way) I assume you could set up an arara rule to call the new format once made Commented Sep 19, 2020 at 22:32
  • 1
    I wrote mylatex.ltx in 1994 :-) Commented Sep 19, 2020 at 22:42
  • 1
    if you put the preamble code in a separate file myfoo.sty included as \usepfackage{myfoo} then you could use any external tool eg make or a simple shell file date check and re-make the custom format if the source is newer. Never actually done that but that's just usual coding stuff. In practice I'd never needed to do this for a document preamble that wasn't very stable. Commented Sep 19, 2020 at 22:56
  • 1
    glad you got it working but can you put an answer in an answer post not as an edited question (makes a mess of the site Q&A format otherwise) Commented Sep 20, 2020 at 8:59

1 Answer 1

1

Create precompiled code .fmt file:

According to @DavidCarlisle here,
this is possible using:

$ pdflatex --ini  \&pdflatex  mylatex.ltx <.texFilename>

In arara this is:

% arara: pdflatex: {options: ['-ini','&pdflatex','mylatex.ltx']}
% or
% arara: pdflatex: {options: ['-ini','&pdflatex','mylatexformat.ltx']}

Use precompiled code .fmt file:

You can then reap the rewards using:

$ pdflatex -fmt=mylatex <.texFilename>

In arara this is:

% arara: pdflatex: {options: ['-fmt=mylatexformat'] }
% or
% arara: pdflatex: {options: ['-fmt=mylatex'] }

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .