The Problem
I have the following MWE which does the pageranging wrong:
\documentclass{scrartcl}
\usepackage{blindtext}
\usepackage{makeidx}
\makeindex
\begin{document}
\index{Eine Seite|(}\index{Drei Seiten|(}
\blindtext
\index{Eine Seite|)}
\index{Zwei Seiten|(}\index{Zweimalig}
\Blindtext[4]
\index{Zwei Seiten|)}\index{Zweimalig}
\Blindtext[5]
\index{Drei Seiten|)}
\printindex
\end{document}
Compiled with xelatex main && xindy -M texindy -M range-pages -C utf8 -L german-duden main.idx && xelatex main
it creates the following index:
Index
D
Drei Seiten, 1–3
E
Eine Seite, 1
Z
Zwei Seiten, 1, 2
Zweimalig, 1, 2
This seems odd to me, since it suggests, that I have at least two independent entrys of "Zwei Seiten" on the pages 1 and 2.
Using makeindex
instead creates an index as I would do it by "hand":
Index
Drei Seiten, 1–3
Eine Seite, 1
Zwei Seiten, 1–2
Zweimalig, 1, 2
Here we can see clearly, that "Zwei Seiten" has an explanation that begins at page 1 and ends at page 2 whilest "Zweimalig" is mentioned independently at least two times at pages 1 and 2.
How can I make xindy
behave exactly as makeindex
does with the page-ranges? I still need xindy
s caption of the lettergroup and unicode capabilities (If there weren't the last requirement I had already switched to makeindex
).
Exactly the same behaviour means:
- If we have a spanning index (
\index{a|(}\index{a|)}
that spans multiple pages, I want to see a range like "1-2" or "2-5" or whatever. - If there are onetime mentions (
\index{a}
) on consecutive pages, I want to have them listed separated by commas like "1, 2", "2, 3, 4", but I am fine if large numbers of 5 or more consecutive pages would be consolidated to a range.
Before answering or commenting
Please compare the output of xindy
and makeindex
especially with "Zweimalig" und "Zwei Seiten", I want the output of makeindex
but want to use xindy
!
min-range-length
in a style file.xindy
to be exactly likemakeindex
contradicts your request for non-range forming.xindy
andmakeindex
only behave differently in the case of two sequential pages.makeindex
will convert 1,2,3 to 1--3.