8

I have an appendix with multiple chapters, while I like it that the main chapters of the document appear on the highest hierarchy level in the bookmarks, I would like the appendix chaptes to be children of the appendix bookmark. It would be even better if i could prefix the chapter number

I have this for the bookmarks

Appendices
Additional Images
Additional Code

and would like this

Appendices
|-A Additional Images
|-B Additional Code

MNWE

\documentclass{report}
\usepackage{hyperref}
\usepackage[toc,page]{appendix}
\begin{document}
\begin{appendices}
    \chapter{Additional Images}
    blah
    \chapter{Additional Code}
\end{appendices}
\end{document}
ted
  • 3,377

1 Answers1

10

With package bookmark, the level of the next bookmark entry can be changed via \bookmarksetupnext. In this case, the level of the appendix bookmark should behave as \part (numeric value -1):

\bookmarksetupnext{level=part}
\begin{appendices}
  \chapter{...}

Full example:

\documentclass{report}
\usepackage{hyperref}
\usepackage[toc,page]{appendix}
\usepackage{bookmark}
\bookmarksetup{open,numbered}
\begin{document}
\chapter{Introduction}
\section{Section A}
\chapter{Summary}
\bookmarksetupnext{level=part}
\begin{appendices}
    \chapter{Additional Images}
    blah
    \chapter{Additional Code}
\end{appendices}
\end{document}

Result

Heiko Oberdiek
  • 271,626
  • nice highquality awnser. Explanation, example and screenshot. – ted Jun 29 '13 at 23:20
  • bookmarksopenlevel=0 behaves oddly with this, for all chapters before the appendix it shows them collapsed, however the Appendices bookmark is open. While I like this behaviour, could explain it/ how to change it? – ted Jun 29 '13 at 23:27
  • 1
    @ted: Appendices is a part entry. If you want to have the bookmarks collapsed, just use the default or \bookmarksetup{open=false} or \bookmarksetup{openlevel=-1}. – Heiko Oberdiek Jun 30 '13 at 00:03
  • When I click on for instance an appendix content like A Additional images in your answer, It goes to cover page instead. Is there any further option needed here? – enthu Nov 11 '14 at 16:06
  • @EnthusiasticStudent All bookmarks are going to the correct page in my example, compiled with pdflatex or dvips/ps2pdf. How do you compile the example? Are the packages up-to-date? – Heiko Oberdiek Nov 11 '14 at 17:50
  • @HeikoOberdiek I solved my problem by adding \appendix after \begin{appendices} with aid of \bookmarksetup{startatroot} – enthu Nov 12 '14 at 08:52
  • I have a bibliography chapter after the appendix, but it gets collapsed below the appendix. Any idea how to fix this ? – Overdrivr Mar 20 '17 at 14:23
  • 2
    @Overdrivr Add \bookmarksetup{startatroot} before the bibliography. – Heiko Oberdiek Mar 20 '17 at 17:32