5

Is it possible to have \subsubsections add their bookmarks at different levels? In my case it is at the respectively lowest level that interesting features become visible, but these are (in absolute terms) not the same levels

\documentclass{report}
\usepackage{hyperref}
\setcounter{tocdepth}{4}

\begin{document}

\chapter{Sample One}
\subsubsection{Characteristic One}
\subsubsection{Characteristic Two}
\subsubsection{Characteristic Three}
\subsubsection{Characteristic Four}

\chapter{Sample Two}
\section{Subsample One}
\subsubsection{Characteristic One}
\subsubsection{Characteristic Two}
\subsubsection{Characteristic Three}
\subsubsection{Characteristic Four}
\section{Subsample Two}
\subsubsection{Characteristic One}
\subsubsection{Characteristic Two}
\subsubsection{Characteristic Three}
\subsubsection{Characteristic Four}

\chapter{Sample Three}
\section{Subsample One}
\subsection{Subsubsample One}
\subsubsection{Characteristic One}
\subsubsection{Characteristic Two}
\subsubsection{Characteristic Three}
\subsubsection{Characteristic Four}
\subsection{Subsubsample Two}
\subsubsection{Characteristic One}
\subsubsection{Characteristic Two}
\subsubsection{Characteristic Three}
\subsubsection{Characteristic Four}

\end{document}

The reason why I would like to have it all in \subsections is that I would like to underline the similarities by eye-catchingly typesetting the section headers,

\titleformat{\subsubsection}[<shape>]{<format>}{<label>}{<sep>}{<before-code>}[<after-code>]

but then the bookmark tree looks very unfortunate, enter image description here

My idea would be to overcome this letting \subsubsection using \belowpdfbookmark{text}{name} instead of \pdfbookmark[level]{text}{name}, but how do I do that? Or are there better approaches?

1 Answer 1

4

Package hyperref requires that intermediate section levels are present. Thus you get some warnings.

Package bookmark reimplements hyperref's bookmark managing using a more robust algorithm and can therefore handle the case of missing intermediate section levels:

\documentclass{report}
\usepackage{hyperref}
\setcounter{tocdepth}{4}

\usepackage{bookmark}
\bookmarksetup{
  open,
  numbered
}

\begin{document}

\chapter{Sample One}
\subsubsection{Characteristic One}
\subsubsection{Characteristic Two}
\subsubsection{Characteristic Three}
\subsubsection{Characteristic Four}

\chapter{Sample Two}
\section{Subsample One}
\subsubsection{Characteristic One}
\subsubsection{Characteristic Two}
\subsubsection{Characteristic Three}
\subsubsection{Characteristic Four}
\section{Subsample Two}
\subsubsection{Characteristic One}
\subsubsection{Characteristic Two}
\subsubsection{Characteristic Three}
\subsubsection{Characteristic Four}

\chapter{Sample Three}
\section{Subsample One}
\subsection{Subsubsample One}
\subsubsection{Characteristic One}
\subsubsection{Characteristic Two}
\subsubsection{Characteristic Three}
\subsubsection{Characteristic Four}
\subsection{Subsubsample Two}
\subsubsection{Characteristic One}
\subsubsection{Characteristic Two}
\subsubsection{Characteristic Three}
\subsubsection{Characteristic Four}

\end{document}

Result

2
  • Imho in your example \usepackage{bookmark} is missing. May 31, 2013 at 10:44
  • @UlrikeFischer Thanks. Cut&paste error, the unmodified example was pasted. May 31, 2013 at 11:45

You must log in to answer this question.

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