I would like to use hyperref
with hypertexnames=false
. This leads to a problem with indexes: The correct pages are printed, but they lead to the wrong location. MWE:
\documentclass[index=totoc]{scrbook}
\usepackage{fontspec}
\usepackage{lipsum}
\usepackage{makeidx}
\makeindex
\usepackage[hypertexnames=false]{hyperref}
\begin{document}
\frontmatter
\title{Title}
\maketitle
\mainmatter
\chapter{Chapter 1}
\index{BeginningChapter1}\lipsum\index{EndChapter1}
\chapter{Chapter 2}
\index{BeginningChapter2}\lipsum\index{EndChapter2}
\printindex
\end{document}
It is clear from the documentation that hyperref
has problems with the page anchors. By removing hypertexnames=false
the problem is solved in the MWE, but in a large 500-page document I have relied heavily on this option to work (e.g. minitocs, KOMA-Script \addchap
etc.).
Is it possible to make hypertexnames=false
compatible with indexes? I have two guesses, but couldn’t evaluate/implement them:
- Would it be possible to set up the relative page counter for the link (roman numerals for frontmatter, arabic numerals for the mainmatter, possibly Roman numerals for a backmatter), whilst retaining the functionalies of
hypertexnames=false
for the sectioning-commands? - Is there an option to activate
hypertexnames=false
after\frontmatter
?