# Putting appendix outside the last part

I have the following LaTeX structure:

\documentclass{book}

\usepackage{hyperref}

\begin{document}

\tableofcontents

\chapter{Introduction}

\part{Fruits}
\chapter{The Apple}
\chapter{The Peach}
\chapter{The Banana}

\part{Animals}
\chapter{The Dog}
\chapter{The Cat}
\chapter{The Horse}

\appendix

\chapter{Summary}
\chapter{Bibliography}

\end{document}


The problem with this is the structure of the bookmark in the final pdf: all the appendices are found within part II.

Is it somehow possible to put the Appendices to the outermost level, i.e. parallel with I Fruits, II Animals, and not inside II Animals?

I want to keep the numbering of the table of contents as it is now, i.e. no numbers for chapters within appendix:

• Welcome to TeX.SX! You have a numbering of appendix chapters and for your request, \addcontentsline{toc}{part}{\appendixname} should do
– user31729
Jan 7, 2016 at 12:49
• Jan 7, 2016 at 18:39

Use \addcontentsline{toc}{part}{Appendices} instead of \addcontentsline{toc}{chapter}{Appendices}.

Alternatively use the appendix package.

\documentclass{book}

\usepackage{hyperref}

\begin{document}

\tableofcontents

\chapter{Introduction}

\part{Fruits}
\chapter{The Apple}
\chapter{The Peach}
\chapter{The Banana}

\part{Animals}
\chapter{The Dog}
\chapter{The Cat}
\chapter{The Horse}

\cleardoublepage
\phantomsection
\appendix
\chapter{Summary}
\chapter{Bibliography}

\end{document}


• This is logical, and this is what I want to reach. However, unfortunately it does not work at me. The Appendices went within The Horse, i.e. on the innermost level. I'm using pdflatex, Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9). Jan 7, 2016 at 13:52
• @CsabaFaragó: does not work is not really helpful. I have the same pdflatex version and it apparently does work for me. Do you have done two compilations? Do you have some other setup?
– user31729
Jan 7, 2016 at 14:02
• Sorry, I was not specific enough. First I deleted all intermediary files, only the tex source remains. Then I executed pdflatex three times (I've tried it once and two times as well, with the same result). I tried it also with a deeper structure, and the appendices are put below the last subsection. I.e. it is not always on the third level, but on the innermost level. The pdflatex version see above. My operating system is 64 bit English Windows 7. I open the result pdf using Adobe Acrobat Reader DC, version 2015.009.20079, which speaks Hungarian. Jan 7, 2016 at 14:24
• @CsabaFaragó: Well, there's nothing I can do with this. I changed to code a little bit and the .pdf shows the Appendices bookmark at the right place, both with Acrobat Reader on Linux and Okular
– user31729
Jan 7, 2016 at 15:17
• @CsabaFaragó: \phantomsection is crucial here!
– user31729
Jan 8, 2016 at 10:16