# Does splitting tex documents into multiple ones improve build performance

I've seen this mentioned often, for example, in several answers here. But I have my doubts. Do LaTeX engines (latex/pdflatex/xelatex/lualatex) do incremental compilation at all? Besides, even if they do, any file included in the main tex file with \input{} could redefine macros used in later included files, so how would the engines know when to recompile a partial file?

• As you can see in the answer that you are referring to, it speeds up the compilation if you do compile selectively: "For one thing you can significantly speed up compilation time by including only certain files, e.g. when you have tons of graphics." So it's easier to comment out parts temporarily for example. – Dr. Manuel Kuehner Apr 15 '18 at 12:50
• Elaborating on @Dr.ManuelKuehner ' s comment: I think the primary reason for splitting (large) documents into pieces is to create a good workflow, allowing you to focus intellectual attention on one part of the document at a time. Speeding up the build is a secondary benefit. Check out questions with the workflow tag. – Ethan Bolker Apr 15 '18 at 14:01
• it only speeds things up during drafts when you can make partial documents. If you are making a full document then it can not speed things up at all – David Carlisle Apr 15 '18 at 18:22
• – Alan Munn Apr 15 '18 at 19:24
• Are there still open questions? – Dr. Manuel Kuehner Apr 16 '18 at 18:17

Real life example: Here's the main document of my Phd thesis, I will not explain the details, I just want to show the idea.

%% Kommandozeilenaufruf in texmaker

% Vorspann
% ----------------------------------------------
\input{01_Vorspann/Dokumentenklasse.tex}
\input{01_Vorspann/Seitenlayout.tex}
\input{01_Vorspann/WeitereLayoutAnpassungen.tex}
\input{01_Vorspann/Standardpakete.tex}
\input{01_Vorspann/Mathezeugs.tex}
\input{01_Vorspann/GleitumgebungenUndVerzeichnisseAnpassen.tex}
\input{01_Vorspann/KopfUndFusszeile.tex}
\input{01_Vorspann/Schriften_und_Symbole_Typografie.tex}
\input{01_Vorspann/Bibliografie-Zeugs.tex}

\input{01_Vorspann/WeiterePakete.tex}

%   % Neu
%   % http://tex.stackexchange.com/questions/64188/what-are-good-ways-to-make-pdflatex-output-copy-and-pasteable
%   \usepackage{cmap}

\input{01_Vorspann/PDF-Zeugs.tex}

% ----------------------------------------------

% Eigene Einstellungen
% ----------------------------------------------
\input{01_Vorspann/BezeichnungenAnpassen.tex}
\input{01_Vorspann/Styleguide_EigeneBefehle_und_Farbdefinitionen.tex}
\input{01_Vorspann/Trennmuster.tex}
% ----------------------------------------------

\myVersionMitAnmerkungen{off}

% Eigentliches Dokument
% ----------------------------------------------
\begin{document}

% Bookmark-Formatierung initialisieren
\bookmarksetup{style=myBookmarkNormal}

\pagenumbering{Roman}
\input{02_Inhalt/Titelseite.tex}
\cleardoublepage

% Kopf- und Fußzeile einschalten
% Römische (xii) Nummerierung
\pagenumbering{roman}
% Zählung beginnt hier ab 1
\setcounter{page}{1}

\input{02_Inhalt/Vorwort.tex}
\input{02_Inhalt/Danksagung.tex}
\input{02_Inhalt/Kurzfassung.tex}
\input{02_Inhalt/Verzeichnisse.tex}

\cleardoublepage
% Arabische (12) Nummerierung
\pagenumbering{arabic}
% Zählung beginnt hier wieder ab 1
\setcounter{page}{1}

\startcontents[chapters]
\input{02_Inhalt/Einleitung.tex}

\startcontents[chapters]
\input{02_Inhalt/StandDerForschung.tex}

\startcontents[chapters]
\input{02_Inhalt/Haptik.tex}

\startcontents[chapters]
\input{02_Inhalt/Statistik.tex}

\startcontents[chapters]
\input{02_Inhalt/Psychophysik.tex}

\startcontents[chapters]
\input{02_Inhalt/Versuchsaufbau.tex}

\startcontents[chapters]
\input{02_Inhalt/Experimente.tex}

% Letzes 'richtiges' Kapitel
% Stopp der Zwischen-TOCs
\stopcontents[chapters]
\input{02_Inhalt/Zusammenfassung.tex}

\input{02_Inhalt/Literaturverzeichnis.tex}

\input{02_Inhalt/Anhang.tex}

\end{document}
% ----------------------------------------------


If I am working on a chapter, let's say statistics (\input{02_Inhalt/Statistik.tex}), then it would look like this:

%   \startcontents[chapters]
%   \input{02_Inhalt/StandDerForschung.tex}
%
%    \startcontents[chapters]
%   \input{02_Inhalt/Haptik.tex}

\startcontents[chapters]
\input{02_Inhalt/Statistik.tex}

%   \startcontents[chapters]
%   \input{02_Inhalt/Psychophysik.tex}
%
%   \startcontents[chapters]
%   \input{02_Inhalt/Versuchsaufbau.tex}


There are other solutions as well, for example, to put \end{document} in a different position (higher).

• I'm not sure if this (or any) answer will help OP. But you should look into the \include command (see the link further up on this page). If you use \input in your preamble and \include in your document, you'd be able to add \includeonly to the preamble to automatically comment out chapters you aren't working on. As a bonus, the numbering would still work properly. – Teepeemm Jun 14 '18 at 18:51
• Include adds a page break which I personally dislike. But I see your point. Anyway, the OP seems to be not interested anymore. – Dr. Manuel Kuehner Jun 14 '18 at 21:32