Suppose I want to replace the delimiters between pages in my index, so that instead of commas I use semicolons. The following code works well.
\documentclass{article}
\begin{filecontents}{\jobname.mst}
delim_n "; "
\end{filecontents}
\usepackage{imakeidx}
%\usepackage{hyperref}
\makeindex
\begin{document}
Some words. A test.
\index{words}
\index{phrases|see{words}}
\newpage
Words and sentences.\index{words}\index{sentences}
\newpage
Sentences.\index{sentences}
\index{sentences|seealso{words}}
\printindex
\end{document}
However, once I uncomment the hyperref page, things get weird.
We get the log-entry
(./testidx3.ind) [4] (./testidx3.aux) )pdfTeX warning (dest): name{page.1;2} has been referenced but does not exist, replaced by a fixed oneTracing the source, we find that in the generated
.indfile\begin{theindex}\item phrases, \hyperindexformat{\see{words}}{1}
\indexspace
\item sentences, \hyperpage{2}; \hyperindexformat{\seealso{words}}{3}; \hyperpage{3}
\indexspace
\item words, \hyperpage{1; 2}
\end{theindex}
The culprit is of course \hyperpage{1; 2}. It seems that \hyperref is relying on the standard choice of delimiters to allow a page range to be passed to \hyperpage in one go, instead of having it listed as \hyperpage{1}; \hyperpage{2}.
Question: Any ideas on how to work around this?
\hyperpagethat use the comma syntax? (b) I am a bit surprised that the lack of recursion works; why is it that for two-consecutive pages I get\hyperpage{1; 2}but for non-consecutive ones it outputs\hyperpage{1}; \hyperpage{3}? – Willie Wong Feb 24 '21 at 21:12