I have problem with table of contents and with bookmarks. In pdf file
-
table of contents shows wrong page number of Introduction and Bibliography,
-
Bookmarks: introduction and bibliography don't bring me to the correct page.
Part of my code
\documentclass[12pt,a4paper]{book}
\usepackage[polish]{babel}
\usepackage{polski}
\usepackage[cp1250]{inputenc}
\usepackage[pdftex,pagebackref=false,draft=false,pdfpagelabels=false,pdfstartview=FitH,pdfstartpage=1,bookmarks=true,pdfauthor={LiN},pdftitle={PD},pdfsubject={Titlei},pdfkeywords={words},unicode=true]{hyperref}
\usepackage{tocloft}
\begin{document}
\tableofcontents
\addcontentsline{toc}{chapter}{Introduction}
\chapter*{Introduction}
\chapter{Chapter1}
\section{Section}
\addcontentsline{toc}{chapter}{Bibliography}
\begin{thebibliography}{9999999}%
\bibitem{1}Author, \emph{Title of book}, Publisher.
\end{thebibliography}
\end{document}
How can I change that?
Best Answer
Put a
\cleardoublepage
before\addcontentsline
. Also a\phantomsection
is needed, since you are using hyperref:\clearpage
gives a wrong result if the Table of Contents has an odd number of pages;\cleardoublepage
avoids the problem altogether.Another way is to put
\addcontentsline
after\chapter*{Introduction}
; the same for the bibliography:The method
\cleardoublepage\phantomsection\addcontentsline
must be used for the lists of figures and tables and for the bibliography if it's done with BibTeX.