appendix package with its toc option for a book document. If the first of several appendices is inserted by using \include, then the "Appendices" heading in the TOC incorrectly appears after the entries for the first appendix.This happens no matter whether I use the
\appendices command, as shown below, or else the appendices environment.The same thing happens if I don't use the
appendix package but instead just the \appendix command and use an \addcontentsline to insert the "Appendices" item in the TOC.This behavior does not occur if the body of the appendix is inserted directly in the main document.
The behavior does not occur, either, if instead of using
\include for the first appendix, I use \input. However, I really do want to use \include since my actual book-length document uses an \includeonly for selective processing of various chapters, including appendices, as I work.Here's a MWE:
Code: Select all
\documentclass{book}
\usepackage[toc]{appendix}
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{First things}
This comes first.
\appendices
\include{appendixA}
\chapter{Another addendum}
This is some more information.
\end{document}Code: Select all
\chapter{The initial stuff}
All about `A'.
\section{A section within the initial appendix}
Yet more.
\endinput\include for it.)In the actual situation, I have a number of appendices and each has many pages, so inserting their body in the main document is not really an option.
Is there some other work-around?