0

In the MWE below, the hyperlink from the index page does not take you to the correct page to where the index is:

\documentclass{book}
\usepackage{lipsum, fancyhdr}

\usepackage{makeidx} 
\makeindex 

\usepackage{hyperref}
\hypersetup{hidelinks,backref=true,pagebackref=true,hyperindex=true,hypertexnames=false,colorlinks=false,breaklinks=true,bookmarks=true,bookmarksopen=false,pdftitle={Title},pdfauthor={Author}}

\begin{document}

\pagestyle{empty}
% pagestyle{plain}
\frontmatter

\lipsum[1]

\mainmatter
\pagestyle{fancy}

\chapter{1}
\section{1}
\lipsum
This is index ONE\index{One}
\newpage
This is index TWO\index{Two}


\backmatter
\pagestyle{empty}
%\pagestyle{plain}

\lipsum[1]

\cleardoublepage
\setlength{\columnsep}{0.75cm}
\addcontentsline{toc}{chapter}{Index}
\printindex

\end{document} 

If you click on the "2" in the index, you get taken to page ii instead of page 2 to where the index is.

Can you offer a solution so that if you click on the hyperlink in the index, you will be taken to the correct page?

1

With hypertexnames=false also correct index links are disabled, use the default value true instead.

Option breaklinks does not magically add support for breaking links across lines, if the driver does not support this. Then the text is broken across lines, but the link areas are quite wrong.

The data for the PDF information keys should be set after package hyperref is loaded via \hypersetup. Otherwise LaTeX will hard expand the values and garbage can be the result.

Option setting backref=true and pagebackref=true is contradictory. Either use the former with section back references or the latter with page number back references.

Also I recommend package bookmark for faster updated bookmarks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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