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?

  • TeX doesn't care so it's a question about you and your editor. so easier for you to answer than anyone else. For example if you want to change color to colour throughout the thesis and you have split your source into 50 files, that is either a pain or no problem at all depending how easily your editor does multi-file edits. Nov 6, 2015 at 16:59
  • MastersDoctoralThesis? If yes, make sure to get the latest version of the template. Or use none at all. If yes, do i get a cookie for having psychic powers?
    – Johannes_B
    Nov 6, 2015 at 17:02
  • @Johannes_B Doctoral.
    – mj_cipher
    Nov 6, 2015 at 17:06
  • can you give me a Link?
    – Johannes_B
    Nov 6, 2015 at 17:06
  • @Johannes_B Ah now i understood your comment :-) Yeah that's the one. Masters/Doctoral Thesis LaTeX Template Version 1.42
    – mj_cipher
    Nov 6, 2015 at 17:08

1 Answer 1


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:

\includeonly{chap1,chap3} % process only chap1.tex & chap3.tex
\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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .