6

I'm writting a document with the report class, and I'm using untitled appendices.

\appendix
\chapter{}
%this is Appendix A
\chapter{}
%this is Appendix B

With this method, pdflatex correctly names them as Appendix A and B, both in-text and in the table of contents. All the appendices, and their respective sections/subsections, show up correctly (and automatically) in the TOC.
My problem is that these appendices don't show up in the pdf index (bookmark) links. I've tried using both hiperref and bookmark packages, but they both present exactly the same behavior.

If I give the appendix a title it than shows up normally in the index, but I want to keep them untitled. Is there way to have untitled appendices show up in the pdf bookmark/index?

I don't want to add them manually, because these appendices also have a lot of sections and subsections, which I want added as well. They all show up automatically in the TOC, so there must be a way for them to show up in the pdf bookmarks as well.

2
  • How about using \chapter[Appendix~\thechapter]{}?
    – Werner
    Apr 10, 2012 at 18:11
  • @Werner that solves the bookmark issue, but creates a new one. My table of content now reads: A Appendix A
    – Malabarba
    Apr 10, 2012 at 18:16

2 Answers 2

5

With the following code I am getting two (empty) bookmarks:

\documentclass{report}

\usepackage{hyperref}

\begin{document}
\tableofcontents
\appendix
\chapter{}
%this is Appendix A
\chapter{}
%this is Appendix B

\end{document}

Note that hyperref doesn't add the chapter/section numbers to the bookmarks by default.

Using the bookmarksnumbered option as in

\usepackage[bookmarksnumbered]{hyperref}

will make the letters A, B appear.

1
  • I'm sorry if I was unclear. This does solve my problem. Appendices weren't showing up at all in the bookmarks, and I just wanted them to show up (I don't really care if it shows up as A or as Appendix A). As I said, this solves it, and they show up as A and B.
    – Malabarba
    Apr 10, 2012 at 18:27
2
\documentclass{report}

\usepackage{hyperref}
\usepackage{bookmark}

\begin{document}
\tableofcontents
\appendix
\chapter{\texorpdfstring{}{Appendix \Alph{chapter}}}
%this is Appendix A
\chapter{\texorpdfstring{}{Appendix \Alph{chapter}}}
%this is Appendix B

\end{document}

It's usually convenient to load the bookmark package (after hyperref), but it's not required.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .