I am writing a long document with many chapters. They are all included from a root document using \input{chapterX.tex}
etc. Compiling everything takes pretty long.
As a workaround to make compilation faster, I typically comment out most \input
commands and include only the chapter I'm currently working on. But that's a bad method because then the references to chapters that are not currently included won't work, and the table of contents is almost empty.
I'm wondering if there is a method that does precompilation? Ideally, it would detect that, while I am working on chapter1.tex
, nothing in chapter2.tex
etc. has changed, and reuse the results from previous compilation runs.
Is that possible? It would be like separate compilation units in languages like C
.
newclude
if you want to use\include
and\includeonly
, as two answers suggested. Standard\include
is very finicky about component source file locations;newclude
redefines it to avoid path problems, and provides other potentially useful benefits. – Mars May 21 '19 at 18:00