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.

1
  • 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}}
2
  • 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.
https://tex.stackexchange.com/questions/238339/appendices-and-references-as-parts-in-toc-and-bookmarks
tex.stackexchange.com
crawl=CC-MAIN-2021-31
168770
application/http; msgtype=response
sha1:H5EDIKBJFBN44L3MKAL3ZBSNVCYEJEVS
<urn:uuid:e87c4f8f-1a00-49c3-859e-21f97baf5ca1>
2021-07-30T08:37:17Z
151.101.193.69
text/html
sha1:NEEZCT5QEKLJ6KTUFWIP52L3YZSLONFJ
<urn:uuid:de5a3d57-6614-4528-b24c-3b4c334e941a>
https://tex.stackexchange.com/questions/238339/appendices-and-references-as-parts-in-toc-and-bookmarks
response
<urn:uuid:2d27b050-6a40-4f0f-b8cb-750063baa374>
isPartOf: CC-MAIN-2021-31
publisher: Common Crawl
description: Wide crawl of the web for July/August 2021
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-169.ec2.internal
software: Apache Nutch 1.18 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.2-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/