I am working on a multi-chaptered document, tied together with a main tex file that pulls the chapters in via \include. To build the entire document, in its current draft form, can take upwards of 15-20 minutes, depending on the machine I am working on. I am wondering if there is a way that I could choose to typeset only one specific chapter at a time without having to restructure my whole setup. Any ideas?
2 Answers
If you are using \include
for your chapters, then you can use \includeonly
to include just specific chapters.
e.g.
\documentclass{book}
\includeonly{Chap2} % will cause just Chap 2 to be included
\begin{document}
\include{Chap1}
\include{Chap2}
\include{Chap3}
\end{document}
-
2or altenatively also
\excludeonly
which needs the package of the same name.– user2478Jan 6, 2011 at 16:37
Include all chapters in the body using \include
macro (to make cross references work properly) and specify the chapter to be rendered using \includeonly
in the preamble.
Cross references will still work properly even thought you just render only one chapter.
\documentclass{book}
\includeonly{ch01}
\begin{document}
\include{ch01}
\include{ch02}
\include{ch03}
\end{document}
-
4You have to run at least one time all chapters to create the auxiliary files.– user2478Jan 6, 2011 at 16:40
\includeonly
in the preamble. Done!draft
as optional argument for the documentclass or alternatively as option for\includegraphics
for single big images and change it in a final run tofinal
or simply delete the draft option.