7

I have a document document.tex which looks something like this:

...
\begin{document}
...
\include{chap1}
...
\end{document}

I create a .tex file called chap1.tex which contains exactly the following:

\begin{document}
\chapter{Plan A}
This chapter is your first plan...
\end{document}

When I compile I found errors that I cannot fix. Any helps please?

x.y.z...
  • 175
  • 2
    Don't have \begin{document}..\end{document} in it. Only the text you want included in your document. – Juri Robl Jul 02 '14 at 18:17
  • 1
    Please try to always include compilable, but minimal examples (i.e. here is just the \documentclas{...} missing) and the error messages you get (look in the .log file for lines starting with !). This helps the answers to identify the issue. – Martin Scharrer Jul 02 '14 at 18:20
  • remove the space at \chapter{Plan A} ie. \chapter{PlanA} It works in my case – Prashant May 31 '20 at 01:42

1 Answers1

12

The problem is the extra \begin{document}..\end{document} inside chap1.tex. It doesn't belong there. There is just one document -- created from one or multiple source files. Removing the extra environment should fix the errors.

Martin Scharrer
  • 262,582