2

I have problems with my appendices and references which do not appear as parts in my TOC (chapter layout instead of part layout, see figure below) and the bookmarks in the pdf file (appendices and references appear as part of part II), even I used the 'page' and 'toc'. If I use the bookmark package I could solve the bookmark problem but introduces the problem the separate appendices are not a part (chapters) of the 'appendices' part anymore (see 2nd figure below). The command '\addtocontents{toc}{\bigskip}' makes a step like a new part but the font size does not change.

Any suggestions and better solutions?

Here is an example code with the relevant things:

\documentclass{book}

%%% preamble %%%
\usepackage{bookmark,hyperref}
\usepackage[toc,page,title,titletoc]{appendix}
\RequirePackage[square, numbers, sort&compress]{natbib}
...

%%% Document %%%
\begin{document}

%% Frontmatter %%
\frontmatter
...

%% Mainmatter %%
\mainmatter
\part{this is part 1}
    \include{Chapter1}
    ...
\part{this is part 2}
    \include{Chapter5}
    ...

%% Appendices %%
\bookmarksetup{startatroot}
\addtocontents{toc}{\bigskip}
\renewcommand*\thesection{\arabic{section}}
\addtocontents{toc}{\protect\setcounter{tocdepth}{1}}

\begin{appendices} 
    \include{Appendix1}
    \include{Appendix2}
    \include{Appendix3}
\end{appendices}

%% Bibl %%
\bibliographystyle{unsrt}
\cleardoublepage
\bibliography{References} 

enter image description here

Excerpt of 2pages of the TOC (see the difference between part II and appendices)

enter image description here

The problem after the bookmark packages. The separate appendices are not part of the appendix title.

  • I can't compile your example do to the \include commands. – Ulrike Fischer Apr 13 '15 at 10:50
4

Package bookmark provides a way to raise the level of "Appendices":

\bookmarksetupnext{rellevel=-1}
\begin{appendices}
  \chapter{First appendix}
  ...
\end{appendices}

\bookmarksetupnext is applied to the next bookmark and the following appendix chapters will be sorted below "Appendices" in the outline tree.

Patching \addappheadtotoc

A different way, which also uses part formatting for the entry in the table of contents for \begin{appendices}, is to patch \addappheadtotoc to use part instead of chapter. This also fixes the bookmark issue:

\usepackage[toc,page,title,titletoc]{appendix}

\RequirePackage{etoolbox}
\patchcmd\addappheadtotoc{%
  \addcontentsline{toc}{chapter}%
}{%
  \addcontentsline{toc}{part}%
}{}{\errmessage{Could not patch \string\addappheadtotoc}}
  • Thanks, and what about the layout in the TOC? – Dries_VB Apr 23 '15 at 15:43
  • Perfect, the last solution works well! – Dries_VB May 13 '15 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.