Working on my phd thesis has become a nightmare since I tried to insert some very large (sideways)tables with many columns and cells all containing citations.

A complete compiling run with latexmk took more than 5 minutes. Before I inserted the tables, it was about 3 minutes which is still long enough.

As the tables contain references (\cite), they can not be handled as "static", as the numeric references might change with changes of the document. (Otherwise I'd typeset the tables in a separate document and insert the pdf with includegraphics.)

What possibilities are there to speed up compiling?

  • Is there a way to exclude parts of a document (similar to includeonly), so that I could normally replace the tables (which will normally fill an entire page) by a large rectangle?

Sure I could remove chapters I'm currently not working on, but it partially need them for cross-referencing and cross-checking information...

_and sure, I could compile less often, but to avoid mistakes and see what I'll get after small changes, I'd like to compile directly after making changes to the text, if possible.

Any ideas?


just an hint, in case someone else should have the same problem:

I tended to compile very often to directly see if my changes in the source document had the wished effect(s) and to avoid syntax error which could be hard to find later. This took me a lot of time.

Since I am using Emacs and auctex now for editing my source document and finally learn to use its features properly, there is the command on region command, which only compiles the selected region and so directly shows if changes have taken effect without compiling the whole document (or large parts of it). :-)


You can use the draft option to speed up things a bit, but using \includeonly is the only efficient solution that I am aware of.

Note that it is smarter than you think. In particular, it preserves cross reference. I cannot see any reason why not to use it while you are in the process of writing.

  • Thank you, Olivier! I don't like the draft option because then I don't see my graphics any more. (I'm having mostly vector images, embedded as PDF, so I think they are not as "problematic" as included bitmap graphics). – MostlyHarmless Sep 26 '11 at 21:03

use the option -draftmode for pdflatex and delete this one only for the last run, which can then be done without using latexmk

pdflatex -draftmode <file>

it doesn't create a pdf but all the auxiliary files. That is a useful option.

To exclude some parts of your document use:

... to ignore ...

You can run a full compilation of your document and keep the pdf aside for reference, since you mention that you need this. Then exclude the parts you don't need and compile the remaining parts quickly. This way, all the references will be fine, too, since all the .aux files will be created.

Another cause of slowness could be many (and high resolution) images. If you can't afford the draft option, you may use lower-resolution ones while you work and incorporate the full-resolution ones only for final compilation. By keeping them in separate directories this could be very easy and error-free.


You could use the \ifdraft switch provided by the ifdraft package for this purpose:

%% \documentclass[final]{article}



  placeholder for draft document%
  stuff for final document%


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.