# How to jump exactly where I click in the toc (the toc links are generated with {hyperref})?

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

-
Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}). –  Claudio Fiandrino Jan 20 '13 at 10:57
thanks, Claudio, I was just struggling to find out what I've done wrong –  askoleg Jan 20 '13 at 10:58
@askoleg, what happens if you click on the page number? –  Sigur Jan 20 '13 at 11:43
in fact, the page number is the only clickable element in a toc line -- this is achieved by using {linktocpage} setting of the {hyperref} package –  askoleg Jan 20 '13 at 11:46
just tried commenting out the {linktocpage} option -- nothing changed in terms of links destinations: they all remain below the now clickable headings of the toc, the same as described in my question –  askoleg Jan 20 '13 at 12:00

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

-