# How to display proper ranges in index using Xindy and XeLaTeX?

When I generate my index with XeLaTeX using xindy as described here: How to use xindy with XeTeX/LuaTeX? I struggle with proper ranges being displayed. Essentially, the dashes are missing and the page numbers stick to each other.

Example:

\documentclass{article}
\usepackage{xltxtra}
\usepackage{makeidx}
\makeindex
\begin{document}
index a
\index{a}
\clearpage
index a b
\index{a}\index{b}
\clearpage
index a b ä
\index{a}\index{b}\index{ä}
\clearpage
index a b ä ü
\index{a}\index{b}\index{ä}\index{ü}

\printindex
\end{document}


This results in the following output:

As you can see, the a is shown with 14 instead of 1-4. My call to xindy was the following:

xindy -M texindy -C utf8 -L german-duden xindy.idx


The xindy.idx file looks good to me:

\indexentry{a}{1}
\indexentry{a}{2}
\indexentry{b}{2}
\indexentry{a}{3}
\indexentry{b}{3}
\indexentry{ä}{3}
\indexentry{a}{4}
\indexentry{b}{4}
\indexentry{ä}{4}
\indexentry{ü}{4}


But the resulting xindy.ind file already shows the problem:

\begin{theindex}
\providecommand*\lettergroupDefault[1]{}
\providecommand*\lettergroup[1]{%
\par\textbf{#1}\par
\nopagebreak
}

\lettergroup{A}
\item a, 14
\item ä, 3, 4

\indexspace

\lettergroup{B}
\item b, 24

\indexspace

\lettergroup{U}
\item ü, 4

\end{theindex}


What am I missing here?

It looks as if you must load an ranges module. E.g.

xindy  -M texindy -M page-ranges -C utf8 -L german-din test-utf8.idx


or

xindy  -M texindy -M ff-ranges -C utf8 -L german-din test-utf8.idx


(From the latex companion I would have expected the first to be loaded automatically but it doesn't seem to be the case).

• You are absolutely right. page-ranges is not loaded automatically (for whatever reason) and when I include it explicitely, it works as expected. – kongo09 Sep 21 '11 at 19:17
• By the way, one funny thing I noticed is that my xindy reports version 2.4 while on the xindy.org website sourceforge.net/projects/xindy/files it says the latest version is 2.3. Strange... – kongo09 Sep 21 '11 at 19:21
• OK, this helped me a lot. But how can I find more modules on my system? page-ranges displays a 2 page entry as on page “1, 2”, which is wrong. It should be “1–2”. “1,2” suggests independent 2 occurences, while “1–2” implies a long text that spans 2 pages. Is there a module that does know exact this difference? – NobbZ Jul 29 '14 at 23:09

I run

texindy -C utf8 -L german-duden <file>.idx


then I get the following output: