3

I try to implement the authors of sections into the index of my book. To achieve this each section starts with an index entry with opening parenthesis and ends with a closing one. But I cannot get rid of the error-message:

WARNING: Found no :close-range matching an already opened one! Location-reference is 1 in keyword (A). Maybe I lost some of the regular location-references

This MWE:

\documentclass{scrbook}
\usepackage[english]{babel}
\usepackage[makeindex, protected]{splitidx}

\newcommand{\pws}[1]{#1}

\begin{document}

\index{A|(pws}

Text spanning from page one to page two
                            \newpage
Rest of Text

\index{A|)pws}

\section{Two}
Some other text

\section{Three}
\index{A|(pws}

Another Text of author A

\index{A|)pws}

 \printindex                        

\end{document}

produces the following idx file:

\indexentry{A|(pws}{1}

\indexentry{A|)pws}{2}

\indexentry{A|(pws}{2}

\indexentry{A|)pws}{2}

when I run texindy

texindy -M test.xdy -M ff-ranges -L english -t test.ilg test.idx

with this style-file

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

                      (markup-range :open "\range{" :sep "}{" :close "}")
; list of allowed attributes

(define-attributes ("pws"))

; define format to use for locations

(markup-locref :open "\pws{" :close "}" :attr "pws")

; location list separators

(markup-attribute-group-list :sep "; ")

... doesn't compile correctly but logs the error. I suppose it has to do with the two ranges, one ending on the second page, one starting and ending there, because if I separate the ranges with a pagebreak all is fine.

1 Answers1

1

As no one came up with a solution I somehow solved it though it has to be deemed a hack and proper solutions are still very welcome.

Basically if one changes the second entries to another attribute:

\index{A|(pwsa}

Another Text of author A

\index{A|)pwsa}

and then adds a drop rule in the .xdy-file so that pwsa is dropped when there is a pws it produces the desired output without error:

(merge-to "pws" "pwsa" :drop)