How to properly format different “sub” .tex files to include them with the \input{Chapters} command

sectioning

I am a total latex beginner and I am having trouble understanding how to properly include and structure sections with the \input{chapter} command. I have been using this tutorial from overleaf (LINK). The tuturial suggests using seperate .tex files for all of the main-body chapters and then including them using the \input{chapter} command. The chapters I have created look like this:

enter image description here

To include the chapters, I use the: \chapter{Theory} \input{Chapters/Theory} command. But how do I structure these "sub" .tex files? For example, within the Theory.tex file, I tried something simple to see what it looks like:

\begin{document}
    \begin{section}
        \blindtext
    \end{section}
\end{document}

I included it using the \chapter{Theory} \input{Chapters/Theory} command. However, on the main.tex page it looks like this when I compile it:

enter image description here

How do I properly structure these "sub" .tex files, so when I include them, it doesn't look like everything is in the title?

Best Answer

first remove begin/end document in the included file, that'll raise an error (best case) or the main file ends after the included \end{document}.

I didn't know there was a section-Environment - the LaTeX tutorials (and Point-and-Click-Editors) I know of use \section{bla} to create a knew section (titled "bla").

Your Theory.tex should therefore look like:

\section{first} \blindtext
\section{second} \blindtext
...
Related Question