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.

2 Answers 2

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}
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.

4
  • 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. Commented Oct 8, 2013 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. Commented Feb 18, 2014 at 23:37
  • Note that three patches are necessary in order to replace all occurrences of \addcontentsline.
    – egreg
    Commented Aug 27, 2019 at 9:56
  • Thank you very much ! This is exactly what I needed to generate bookmarks in a paper with documentclass as llncs
    – programmer
    Commented Jan 14 at 23:58

You must log in to answer this question.

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