Possible Duplicate:
First chapter appearing before first line in table of contents
I am having issues with inserting a line into the TOC when including external files. \input and \include behave differently in this case.
My MWE
\documentclass{report}
\begin{filecontents}{appen.tex}
\chapter{Appendix 1}
This is the appendix
\end{filecontents}
\begin{document}
\tableofcontents
\chapter{Main}
This is the main part.
\appendix
\part*{Appendix}
\addtocontents{toc}{%
\protect\contentsline{chapter}{Appendix}{}{}}
\input{appen}
\end{document}
works like a charm and does what I want it to. When I change the \input command into an \include, however, the note "Appendix" appears AFTER the chapter "Appendix 1".
I could just work with \inputing the first chapter of the appendix and \includeing the rest (which does work fine), but I wonder if anyone can explain this behaviour and maybe has a solution, so that I can \include the first appendix chapter, too.