0

I am building an online LaTeX editor and now face issues with slow compilation for documents of increased size. Everytime the user changes the document, the compiler has to recompile the whole document.

Is it possible to only compile the changed part and speed up compile performance that way?

Ingmar
  • 6,690
  • 5
  • 26
  • 47
Dolphin
  • 843
  • 3
    Not really. The changed material may affect the other pages (for example a change in page number) – daleif Aug 18 '23 at 12:09
  • 2
    Maybe have a look at subfiles and split your document into smaller files and only compile the section/chapter/whatever you are currently working on? – samcarter_is_at_topanswers.xyz Aug 18 '23 at 12:11
  • related https://tex.stackexchange.com/questions/8791/speeding-up-latex-compilation – samcarter_is_at_topanswers.xyz Aug 18 '23 at 12:14
  • Most suggestions end up revolving around what a document author can do to speed up the compilation of that particular document. If you're hosting a compilation service for others, implementing some of those suggestions behind the scenes might be a bit more difficult. – Teepeemm Aug 18 '23 at 14:00

1 Answers1

0

The other thing I've found that helps (and might help here a bit) is to (i) compile the preamble into a .fmt file (using the mylatexformat package), and then (ii) compile my document using this .fmt file. For my bigger projects (books, mostly), I often have 20, 30 or more packages in the preamble, such that reading in those packages (and various associated options and such) is the rate-limiting step of compiling the document. For example, a 160 page set of lecture notes (which I just tested) -- compile time for the full document is cut by almost 65-70% if I use a pre-compiled preamble, relative to including the preamble 'as is, the normal way'.

Just grist for the mill...