5

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
\addcontentsline{toc}{chapter}{Appendices}

\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.

Bookmark structure

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:

Table of Contents

Thanks in advance!

2

1 Answer 1

5

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
\addcontentsline{toc}{part}{Appendices}
\chapter{Summary}
\chapter{Bibliography}

\end{document} 

enter image description here

8
  • 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
  • 1
    @CsabaFaragó: \phantomsection is crucial here!
    – user31729
    Jan 8, 2016 at 10:16

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.