I'm using xindy
to generate indexes for a manual that gets translated into multiple languages. Unfortunately, hyperref
and xindy
don't like to play nicely together. I found some older mailing list threads that suggest that fixing this in xindy
would require too much effort.
My question is: how can I get xindy
and hyperref
to play nicely together. What is the best workaround for this incompatibility?
An example document will demonstrate the problem:
\documentclass{article}
\usepackage{lipsum}
\usepackage{makeidx}
\usepackage{hyperref}
\makeindex
\begin{document}
\index{single}
\index{range|(}
\lipsum
\index{range|)}
\printindex
\end{document}
I compile this document (named x.tex
) using xelatex
and xindy
:
xelatex x
xindy -C utf8 -M texindy -L english x.idx
xelatex x
xelatex x
Page numbers that are part of a range are missing from the index:
The xindy
output makes a few complaints:
WARNING: Found no :close-range matching an already opened one!
Location-reference is 1 in keyword (range).
Maybe I lost some of the regular location-references.
WARNING: Found a :close-range in the index that wasn't opened before!
Location-reference is 2 in keyword (range)
I'll continue and ignore this.
These errors make sense when we look at the x.idx
file:
\indexentry{single|hyperpage}{1}
\indexentry{range|(hyperpage}{1}
\indexentry{range|)}{2}
The hyperpage
command isn't used in the close-range entry.
In order of preference, here are my desired outcomes:
xindy
andhyperref
work perfectly together and generate indexes with hyperlinked page numbers without any external processing.xindy
andhyperref
can generate indexes with hyperlinked page numbers with the aid of an external script to pre- or post-process the index files before/after passing them through xindy. (I'm not currently using any special formatting for page numbers if that simplifies things.)xindy
can be pacified by removing hyperlinks from the page numbers (with or without the use of an external script).
Alternatively, is there a different indexing program that can work with UTF-8-encoded files, hyperref
, and knows to collate various languages?
(
in the regex. I escaped the(
with backslashes, but then it just made a message of the.idx
file..idx
file shown above.xindy
reports the following:WARNING: unknown cross-reference-class
hyperindexformat'! (ignored)' and the pagae range still doesn't appear in the index.hyperpage
from\indexentry{range|(hyperpage}{1}
?