# PDF bookmarks for sections and subsections with the llncs class

The following code is in the preamble of my LaTeX document:

\documentclass{llncs}
\usepackage{amsmath,amssymb}
\usepackage{url}
\usepackage[algoruled,vlined]{algorithm2e}
\usepackage{graphicx,subfigure}

\usepackage{hyperref}

\numberwithin{equation}{section} % numbering according to the section
\bibliographystyle{plain}  %Choose a bibliograhpic style
\begin{document}

\title{The Title}
\maketitle
\section{A}
\label{sect:A}
\subsection{a}
\subsection{b}
% ...
\section{B}
\label{sect:B}
\subsection{a}
\subsection{b}
% ...
\section{C}
\label{sect:C}
\subsection{a}
\subsection{b}
% ...
\end{document}


Note that the text is organized into sections and subsection. However, after compiling the code, the Adobe PDF preview does not show the "tree" branching on the left. Instead, it just shows "The Title", and that option has no branching with the "+/-" sings. How could I achieve this?

-
Please always add a full but minimal working example (MWE) that illustrates your problem and makes it possible to recreate it. I added some dummy \sections and \subsections here. Please have a look if it is right. –  Martin Scharrer Apr 18 '12 at 11:03
The llncs class can be found at springer.com/computer/lncs?SGWID=0-164-6-793341-0 if someone wants to compile the example. –  Martin Scharrer Apr 18 '12 at 11:05
Thanks. I edited to emphasize that the \label is also used. So? –  boy Apr 18 '12 at 11:15
–  Martin Scharrer Apr 18 '12 at 11:49
See also No PDF bookmarks when using llncs class for other possible problems with llncs –  egreg Apr 18 '12 at 12:29

The llncs class sets tocdepth to 0. This setting controls which sectioning commands end up in the Table-Of-Contents (TOC), which is also used by hyperref for the PDF bookmarks depth by default. You need to set the bookmarksdepth manually to a higher value (higher means more deeper sectioning commands are included). An alternative is to raise tocdepth again, but this also affects the \tableofcontents command, which might be unwanted.

Here are correctly working example:

\documentclass{llncs}
\usepackage[bookmarks,bookmarksopen,bookmarksdepth=2]{hyperref}
\title{The Title}
\author{the author}
%\setcounter{tocdepth}{2}%  alternative (2 or higher)
\begin{document}
\maketitle
\section{A}
\label{sect:A}
\subsection{a}
\subsection{b}
% ...
\section{B}
\label{sect:B}
\subsection{a}
\subsection{b}
% ...
\section{C}
\label{sect:C}
\subsection{a}
\subsection{b}
% ...
\end{document}


A list of all depth numbers for the sectioning commands can be found in How to show subsections and subsubsections in TOC?

-
Works, thanks. It was the \setcounter{tocdepth}{3} command. –  boy Apr 18 '12 at 11:39
@boy: Note that I updated the answer. Using bookmarksdepth=2 (or higher) does it also and might be better. –  Martin Scharrer Apr 18 '12 at 11:40
thanks. I found that \subsubsection{a} doesn't show when setting bookmarksdepth=3. Is that just me? –  Tim May 16 at 6:04
@Tim: Are you using the llncs class like above or another one? The sectioning depth depends on the class. book style classes start to count at \chapter while article like classes start at \section. –  Martin Scharrer May 18 at 21:01