Pdfbookmark for abstract and table of contents (toc)

I am trying to set a bookmark of my abstract and my table of contents. The bookmark for the abstracts works fine but the bookmark for the toc links to the abstract instead to the toc. If I remove


the contents bookmark links fine to the toc...

I do not see where the mistake is and am thankful for any help!

Her is my MWE:

\documentclass{article} \usepackage{hyperref, bookmark}  \begin{document} %%%%%%%%%%%%%%%%%%% Abstract %%%%%%%%%%%%%%%%%% \cleardoublepage \phantomsection \pdfbookmark[section]{Abstract}{toc} \begin{abstract} \end{abstract}  %%%%%%%%%%%%%%%%%%% Contents %%%%%%%%%%%%%%%%%% \cleardoublepage \phantomsection \pdfbookmark[section]{\contentsname}{toc} \tableofcontents  %%%%%%%%%%%%%%%%%%% Chapters %%%%%%%%%%%%%%%%%% \cleardoublepage \section{Introduction} \cleardoublepage \section{Sec 2} \cleardoublepage \section{Sec 3}  \end{document} 


The last argument of \pdfbookmark becomes the main part of the intern anchor name for the bookmark. The two invocations of \pdfbookmark use both toc with the same level. Therefore the document has two destinations with the same name, but a destination name must be unique. Thus instead of toc, the first \pdfbookmark could use abstract. Also \phantomsection is not needed, because \pdfbookmark already creates an anchor.


\usepackage{hyperref, bookmark}

%%%%%%%%%%%%%%%%%%% Abstract %%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%% Contents %%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%% Chapters %%%%%%%%%%%%%%%%%%
\section{Sec 2}
\section{Sec 3}


Category: hyperref Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.207 (s). 12 q(s)