Background
Looking to generate a PDF using latexmk. The LaTeX document, which is automatically generated from a web-based application, will include many large images, Tikz graphics, table of contents, multiple indices, etc.
The default call to latexmk will include the images in each run of pdflatex. To increase performance, it was advised to use -draftmode.
Problem
The latexmk program cannot determine whether the next run of pdflatex will be the last run required to produce a finished document.
The difference, with a simple test, was 10 seconds without -draftmode and 0.9 seconds with using -draftmode: an order of magnitude, which is quite significant.
Question
How can you determine the exact number of pdflatex runs that are required to produce a PDF document so that calls to pdflatex, except the final call, can use -draftmode?
Thank you!
Ideas
- It might be possible to pass in a number that equals the number of runs required. I'd rather not use this approach as dynamic determination is ideal.
- Perform an extra run of
pdflatexat the end, which is not in-draftmode.