[Tex/LaTex] Putting the \chapter in main .tex file or inside included files

best practiceschaptersinclude

What is the usual way of making chapters when working with large .tex files?

Do you put \chapter{Chapter 1} inside the main .tex file, or in the included files?

What is the norm, and are there any differences or advantages of doing it one way or another?

\documentclass[a4paper,12pt,twoside,openright]{book}
\begin{document}

\chapter{Chapter 1}
\input{Chapter1}

\end{document}

Or do you put \chapter{Chapter 1} inside the Chapter1.tex separate file?

Best Answer

If you are writing a book or a thesis, which usually has more than one chapter it is a -- in my opinion -- very good strategy to write an central dokument, including document class, praeambel (perhaps an own file), \begin{document}, the chapters, each in one file (names like preface.tex, ìntroduction.tex, conclusion.tex. Do not use chapter1.tex or 3.tex etc. because it could happen you have to change the order of your chapters). Make the central document understandable at once.

Each chapter file includes the hole chapter including chapter heading!

If you use \include{introduction} you can not forget to start a new chapter on a new (or right) side, because \include does it for you.

So the central document should be:

\documentclass[options]{documentclass}
\input{praeambel.tex}

\begin{document}

\frontmatter % if book or scrbook
\include{preface} % starts on new page!
\tableofcontents

\mainmatter % if book or scrbook
\include{introduction}
% ...

\end{document}

and the file intrduction.tex contains:

\chapter{Introduction}%
\label{sec:introduction} 

the chapter text ...

and so on.

Just keep things together which belong together and devide (build logical units) were it is possible.