I see that there a number of questions (A, B, C, D, E) on best practices, none of them answer the issue I am going to talk about.
We all need to prepare large documents (or slides) from time-to-time. And once you have reached a certain number of pages, you find that compiling the whole document takes a substantial time, which you need to do to check that the part you have written is error free, specially if it contains a number of images.
To circumvent the situation, I have used the following practices over years to keep compile time at minimum.
Divide the document in to many chapters: The chapters are put in separate files. Only the one I am working one is uncommented.
\documentclass{book} \begin{document} %\input {chapterone.tex} \input {chaptertwo.tex} %\input {chapterthree.tex} %\input {chapterfour.tex} \end{document}
The above technique can also be used for \include
.
- Keep a preamble replica of the main file in a temporary file (build file): I use this technique when I am preparing a presentation with many slides, say a hundred. Prepare a main file, copy it to another build file. Delete everything between
\begin{document}
and\end{document}
in the build file. Prepare a slide (or a group of slides) in the build file. Cut and paste the contents between\begin{document}
and\end{document}
in the build file to relevant location in the main file only when satisfied with the output (image locations, overfull boxes etc.)
We can hear your inputs about the best practices you practice when a you are preparing a document or presentation from scratch.
Now, I have failed to find a good answer in the case when you have finished the whole document or presentation and now you need tweaking the small things, may be edit a text here, add an image there. What will be your best practice?
Perhaps, again keeping only one chapter uncommented will be usable here. But what about large presentations? May be adding a \end{document}
just after the point-of-change will be beneficial, but only if you can put that before midpoint of the file.
Commenting a part of the file will also work, but that is error-prone, at least for me.
\includeonly
.