GeneralErrors when including chapters

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
bluebarca
Posts: 2
Joined: Sun May 24, 2009 1:29 pm

Errors when including chapters

Post by bluebarca »

i've written book chapters, each in a separete .tex file. Each works on its own and gives output. I've created a .tex file to include all the chapters made but this always gives errors!

Code: Select all

\documentclass[12pt, a4paper, oneside]{book}
\usepackage{fullpage}
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{latexsym}

\begin{document}
\pagenumbering{arabic}
\include{chapter1}
\include{chapter2}
\include{chapter3}
\include{chapter4}
\include{chapter5}
\bibliographystyle{plain}
\bibliography{references}
\end{document}
Errors:

Code: Select all

!LaTeX Error: Can only be used in preamble.
1.1 \documentclass[12pt,a4paper,oneside]{book}

Code: Select all

!LaTeX Error: Can only be used in preamble.
1.3 \usepackage{url}

Code: Select all

!LaTeX Error: Can only be used in preamble.
1.5 \usepackage{hyperref}

Code: Select all

!LaTeX Error: Can only be used in preamble.
1.11 \begin{document}
How can i solve this problem ?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Errors when including chapters

Post by localghost »

Obviously your included files are complete LaTeX documents singularly. Files for inclusion must not contain a preamble.


Best regards and welcome to the board
Thorsten
bluebarca
Posts: 2
Joined: Sun May 24, 2009 1:29 pm

Re: Errors when including chapters

Post by bluebarca »

Thank you for the help Thorsten
Post Reply