[Tex/LaTex] How to jump exactly where I click in the toc (the toc links are generated with {hyperref})

hyperreftable of contents

I am working on a book that has 6 levels of headings to be shown in the toc: parts, chapters, sections, subsections, subsubsections and paragraphs. To refer to those headings in the toc I am using hyperref with the option linktocpage.

Now, when I click the part and chapter links in the resulting toc, I jump exactly where I supposed to, i.e. to the beginning of the corresponding part or chapter heading.

However, when I click anything of section-paragraph range, I go to the beginning of the text right below the corresponding heading, rather than to the beginning of the heading itself, which is hidden in this case above the upper border of the screen.

It does not matter where I click: in the toc, parttoc, minitoc, or in the navigation pane of either Acrobat or Evince — the behaviour is just the same.

I wonder if anything can be done about it, as I find this behaviour quite confusing.

I am using pdfLaTeX on Suse Linux Desktop 11SP2 with the following preamble:

\documentclass{book}
\frenchspacing
\usepackage[warn]{mathtext}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}
\usepackage{indentfirst}
\usepackage{minitoc}
\setcounter{secnumdepth}{-2}
\setcounter{tocdepth}{4}
\usepackage[unicode]{hyperref}
\hypersetup{linktocpage,    
            pdfborder = {0 0 0}
            }
\includeonly{01,02}

\begin{document}

\noindent

\frontmatter

\doparttoc
\dominitoc
\tableofcontents

\mainmatter

\part[Документы МСФО с номенклатурой IAS]{Документы МСФО \\с номенклатурой\\ IAS}
\parttoc

\include{01}
\include{02}
\include{03}
...

Best Answer

Do you want to jump to the page or to the title? I changed the depth of the toc to 5 so that you can see all 6 Levels in your table of content. Hyperlinks work just fine. Are you referring to those 6 levels or did you find something even deeper?

\documentclass{book}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}
\usepackage{blindtext}
\setcounter{secnumdepth}{-2}
\setcounter{tocdepth}{5}
\usepackage[unicode]{hyperref}
\hypersetup{linktocpage,    
            pdfborder = {0 0 0}
            }

\begin{document}

\tableofcontents

\part{Part}
\chapter{Chapter}
\blindtext
\section{Section}
\blindtext
\subsection{Subsection}
\blindtext
\subsubsection{Subsubsection}
\blindtext
\paragraph{Paragraph}
\blindtext
\subparagraph{Subparagraph}
\blindtext
\end{document}

Edit If you want to jump to pages via bookmarks in the pdf reader, just add: \hypersetup{bookmarks=true, bookmarksnumbered=true,}. For correct linking to captions in figures add \usepackage[all]{hypcap}

Related Question