I have multiple documents (file1.tex, file2.tex, etc.) and one main file (let's call it main.tex).
I would like to build a complex document that contains all file_i.tex files. I tried this (according to some online guide):
\documentstyle{report}
...
\begin{document}
\input{file1}
\input{file2}
...
\end{document}
I tried include command too, but I keep getting "LaTeX Error: Can be used only in preamble." What am I doing wrong?
Bonus question: I have headings structure in all my files like this:
File1:
1. Heading1
1.1. Subheading1
1.2. Subheading2
etc
File2:
1. Heading2
1.1. Subheading1
1.2. Subheading2
etc
When I build my document as described below. I want my heading to be updated like this:
1. Heading1
1.1. Subheading1
...
2. Heading2
2.1. Subheading2
...
And then generate index. Is there some easy way how to do this in LaTeX (I believe there is, when it was designed to do this but I cant seem to figure out the right command/structure).
