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
  • 1
    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
  • 1
    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
  • Related: When should I use \input vs. \include? – 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
% pdflatex -synctex=1 -interaction=nonstopmode --extra-mem-top=60000000 %.tex|"C:/Program Files/Adobe/Reader 9.0/Reader/AcroRd32.exe" %.pdf

% Vorspann
% ----------------------------------------------


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

    % Zum Schluss laden!

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

% Eigene Einstellungen
% ----------------------------------------------
% ----------------------------------------------


% Eigentliches Dokument
% ----------------------------------------------

    % Bookmark-Formatierung initialisieren


    % Kopf- und Fußzeile einschalten
    % Römische (xii) Nummerierung   
    % Zählung beginnt hier ab 1


    % Arabische (12) Nummerierung   
    % Zählung beginnt hier wieder ab 1








    % Letzes 'richtiges' Kapitel
    % Stopp der Zwischen-TOCs



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

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/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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.