3

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 xindys 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!

3
  • As far as I can remember, by default, xindy only forms a range if it spans three or more consecutive pages. This can be changed using the min-range-length in a style file. Jul 30, 2014 at 13:01
  • Yupp, but than also "Zweimalig" is displayed as "1–2" which I explicitely consider as wrong!
    – NobbZ
    Jul 30, 2014 at 13:02
  • Your assertion that you want the output of xindy to be exactly like makeindex contradicts your request for non-range forming. xindy and makeindex only behave differently in the case of two sequential pages. makeindex will convert 1,2,3 to 1--3. Aug 1, 2014 at 9:57

1 Answer 1

3

I don't have a range-pages module in my xindy, it is called page-ranges.xdy.

Add

(define-location-class "arabic-page-numbers"
               ("arabic-numbers") :min-range-length 1)

to the module or to a copy to change the minimal range (the code is from the ff-ranges.xdy). As far as I know new modules must be either in the main texmf-root or in the current directory as xindy doesn't search other trees with kpathsea.

1
  • OK, range-pages 's pages-range was a typo. But again setting min-range-length does also typeset a range for "Zweimalig" while makeindex does not. So I don't want a range here. Please read the bullet point list where I describe how I want a single index and an index-range to be treated differently!
    – NobbZ
    Aug 1, 2014 at 8:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .