Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Since the link of TOC itself in TOC looks stupid,

enter image description here

\usepackage[nottoc]{tocbibind}  % no `Contents` in TOC

is used to remove it.

However, The Bookmark Contents will disappear in the index (on the left side).

and

\pdfbookmark{\contentsname}{toc}
\tableofcontents

seems solved this problem, BUT it points to the page before TOC.

So how to figure this out?

PS: book class is used in Texlive 2012.

share|improve this question
3  
Use \clearpage or \cleardoublepage before \pdfbookmark. –  Ulrike Fischer Feb 6 '13 at 12:53
    
@UlrikeFischer, it worked out! Thanks –  KOF Feb 6 '13 at 12:58
add comment

1 Answer

up vote 5 down vote accepted

Just for the sake of closure...

As Ulrike Fischer mentioned in the comments, using \clearpage or \cleardoublepage before \pdfbookmark avoids the misinterpretation of the correct page.

The code should look like this:

\documentclass{article}


\usepackage{hyperref}
\usepackage[nottoc]{tocbibind}  % no `Contents` in TOC

\begin{document}
    \begin{titlepage}
        This is the title page
    \end{titlepage}

    \clearpage
    \pdfbookmark{\contentsname}{toc}
    \tableofcontents

    \newpage
    \section{a sample section}
        This is the beginning of a section

\end{document}

share|improve this answer
    
@doncherry sure, I'll edit the answer to include a MWE –  Mario S. E. Apr 10 '13 at 7:53
    
Yes, it’s “community wiki”. When you start an answer or make an edit, then on the lower right you can activate this. (Older comment deleted.) –  Speravir Apr 10 '13 at 16:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.