37

Is it possible to make the bookmarks in the PDF go a level deeper than the table of contents goes? I'm using KOMA-script, scrreprt if that matters.

If the table of contents displays two levels:

1. Level 1
    1.1. Level 2
2. Level 1
    2.1. Level 2

Is it then possible to make the PDF bookmarks to display:

1. Level 1
    1.1. Level 2
        1.1.1 Level 3
2. Level 1

The bottom line is that I want them to have independent level depths, if that's possible.

Seldon
  • 103
  • 2
benregn
  • 6,082

1 Answers1

47

The package hyperref allows settings like this. The author is Heiko Oberdiek.

The package has the option bookmarksdepth

\documentclass{scrreprt}
\setcounter{tocdepth}{1}
\setcounter{secnumdepth}{2}
\usepackage[bookmarksopen,bookmarksdepth=3]{hyperref}

\begin{document}
\tableofcontents
\chapter{foo}
\section{foo bar}
\subsection{foo bar foo}

\chapter{bar}
\section{bar foo}
\subsection{bar foo bar}
\end{document}
Marco Daniel
  • 95,681
  • @Macro: I wonder what is screeprt? I tried to change it to article but somehow it gave me errors says, Something's wrong -- perhaps a missing \item, any idea? Thanks in advance. – roxrook Aug 02 '11 at 01:26
  • @chan: Dou you mean scrreprt? This is one of the documentclasses provided by KOMA. It is the equivalent to report. By changing the documentclass to article you have to compile more than once. An other important fact article doesn't define the element chapter. The highest level ist section (and part ;-) ). – Marco Daniel Aug 03 '11 at 13:54