I'm trying to figure out how to manage the interaction of numbering features of various document parts, e.g., parts, chapters, sections, etc. and the bookmarks generated for a PDF document.
First, the number of document partition is only showing up for parts in the bookmarks. The numbers of chapters and section are not part of the names that are displayed. Is there a way to fix this?
Also, I've noticed that if a partition is not numbered (e.g., an unnumbered subsection) it doesn't show up as a bookmark. I would like to be able to have unnumbered subsections, for example, but still have them show up as bookmarks. Is there a way to do this?
To be clear on what I want to achieve, consider the following example:
\documentclass{book}
\begin{document}
\part{A} %Shows up as a bookmark named "I A"; this is fine
\chapter{B} %Shows up as a bookmark named "B"; what I want is "1 B"
\section{C} %Shows up as a bookmark named "C"; what I want is "1.1 C"
\subsection*{D} %Doesn't show up as bookmark; what I want is "D"
\part{E} %Shows up as a bookmark named "II B"; this is fine
\chapter{F} %Shows up as bookmark named "F"; what I want is "2 F"
%...and so on
\end{document}
Best Answer
Assuming that you're using
hyperref
already*, the documentation states:The manual setting is performed using
where
\part
is level-1
,\chapter
is level0
,\section
is level1
, ... It places<text>
in the bookmarks and can be referenced internally (via a hyperlink) as<name>
. Or, if you want to place it at a level relative to the current one, usewhere
<text>
and<name>
have similar meanings as before.In the following MWE,
hyperref
creates sectional bookmarks for every unstarred heading up tosecnumdepth
and only the numbered, unstarred versions show up in the ToC. The starred versions, removed from the ToC by default, are included using some variation of\...pdfbookmark
:For the inclusion of sectional numbers in the PDF bookmark panel, use the
bookmarksnumbered
option ofhyperref
:The above MWE will then produce:
* If not, the
bookmark
package provides similar, stand-alone functionality for inclusion of PDF bookmarks in your document. In fact,hyperref
suggests using it as improved bookmark organization.