12

When using hyperref together with Springer's LNCS class (llncs), only the title of the document shows up in the PDF bookmarks.

Here is a MWE:

\documentclass{llncs}
\usepackage{hyperref}
\title{Foobar}

\begin{document}
\maketitle
\section{Foo}
\section{Bar}
\end{document}

When you compile this document, the only entry in the PDF bookmarks is one for "Foobar" (which shouldn't be there) and there are no entries for the sections.

Does anybody have an idea what the problem could be?

I'm using TeX Live 2011 and llncs 2.17.

mtvec
  • 539

2 Answers2

13

If you want to employ llncs for your personal use, then

\documentclass{llncs}

\usepackage{etoolbox}
\makeatletter
\let\llncs@addcontentsline\addcontentsline
\patchcmd{\maketitle}{\addcontentsline}{\llncs@addcontentsline}{}{}
\patchcmd{\maketitle}{\addcontentsline}{\llncs@addcontentsline}{}{}
\patchcmd{\maketitle}{\addcontentsline}{\llncs@addcontentsline}{}{}
\setcounter{tocdepth}{2}
\makeatother
\usepackage{hyperref}
\usepackage{bookmark}

will remove the bookmarks for author and title, while giving those for sections and subsections.

egreg
  • 1,121,712
  • 1
    That's what I needed! But somehow, I didn't get author bookmarks, and I only needed tocdepth. That's with llncs 2.18 released last week, but they don't document related changes. – Blaisorblade Oct 08 '13 at 20:00
  • 1
    The history.txt from llncs2e.zip says that version 2.15 (from March 2010) “fixed broken hyperref interoperability.” So tocdepth is probably the only necessary thing now. – Luke Maurer Feb 18 '14 at 23:37
  • Note that three patches are necessary in order to replace all occurrences of \addcontentsline. – egreg Aug 27 '19 at 09:56
  • Thank you very much ! This is exactly what I needed to generate bookmarks in a paper with documentclass as llncs – programmer Jan 14 '24 at 23:58
11

I think this behaviour is intended. The llncs document class is used to put multiple articles into one volume. Each article title appears in the table of contents and the pdf bookmarks, but sections within the articles do not.

\documentclass{llncs}
\usepackage{hyperref}
\begin{document}
\tableofcontents
%
\title{Sheep}
\maketitle
\section{Black sheep}
\section{White sheep}
%
\title{Goats}
\maketitle
\end{document}
Marijn
  • 37,699
Ian Thompson
  • 43,767