[Tex/LaTex] What’s the best way to split the thesis into multiple tex files

sectioningthesis

I am using a LaTeX template for my thesis and it has separate tex files for each chapter which are added to a main.tex file using \input. I would like to know if it's a good idea to do the same for each section of a chapter. Is it recommended? How about one file for every subsection? What are the advantages or drawbacks?

Best Answer

First of all use \include instead of \input for your chapter files; included files always start a new page so that's OK for chapters. You can use the \includeonly macro in the preamble to specify which particular files are to be included for processing. For instance:

\documentclass{...}
\includeonly{chap1,chap3} % process only chap1.tex & chap3.tex
...
\begin{document} 
\include{chap1} % processed this time
\include{chap2} % not processed this time
\include{chap3} % processed this time

Excluded files will be treated as unchanged so that numbering, etc., will be consistent across the whole document.

After that it is up to you whether you like a smaller number of larger files or a larger number of smaller files; see David Carlisle's comment about this. However you can only \input subsidiary files into an included file.