# Redefining ordering in index

I'm generating an index of Bible references (using the bibleref) package. Bible references are usually not sorted by alphabetical order of book, but rather by order of appearance in the Bible (Genesis, Deuteronomy, etc.). The verses inside each chapter should be sorted numerically.

Currently, my index looks like (it's in French):

Actes
1, 20
1.4, 20
Apocalypse
3.20, 56
5, 62
1 Corinthiens
2.9, 69
Daniel
12.4, 29


Daniel
12.4, 29
Actes
1, 20
1.4, 20
1 Corinthiens
2.9, 69
Apocalypse
3.20, 56
5, 62


ordered by Bible book as they appear in the Bible. I think xindy can do that (and imakeidx can use xindy). How would I go about doing it?

Edit:

The bibleref package provides a \biblerefmap command to fix the index. This works fine in general, but French Bible book names have accents, and \biblerefmap concatenates the book name as found in the index to create a macro name, like:

\newcommand*{\biblerefmap}[2]{%
\expandafter\def\csname @bibleref@map@#1\endcsname{#2}%
}


So, this fails because of accents:

\biblerefmap{Genèse}{1@Ancien Testament!01}
\biblerefmap{Exode}{1@Ancien Testament!02}
\biblerefmap{Lévitique}{1@Ancien Testament!03}


When generating the index, bibleref then considers the \@bibleref@map@bookname macros and replaces the book name with the contents if they exist. Since the key entry is the full book name as present in the index, I don't see how to not use accentuated characters in French.

Is there a way I could circumvent the accents issue?

-
An example of what you are trying to achieve would be welcome. –  egreg May 28 '11 at 11:26
@egreg: example added. –  ℝaphink May 28 '11 at 11:32
@Raphink Please, add the customization you have up to now, as the default of bibleref give different results. –  egreg May 28 '11 at 11:55
@egreg: Well, I'm using bibleref-french, which might explain. –  ℝaphink May 28 '11 at 11:57
@egreg: Actually, I just saw that the bibleref package provides a \biblerefmap command to order books. I might try that. –  ℝaphink May 28 '11 at 12:01

I patched the bibleref module locally:

--- a/bibleref/bibleref.sty
+++ b/bibleref/bibleref.sty
@@ -800,7 +800,7 @@ defined}{}}}
\PackageError{bibleref}{Unknown book '#1'}{}%
}%
{%
-    \@bv@idxsort{\csname br@#1\endcsname}%
+    \@bv@idxsort{#1}%
\def\@bv@chidxsort{}%
\BRbooktitlestyle{\csname br@#1\endcsname}%
\let\@bv@org@bookof\BRbookof


This way, it's the abbreviated form that is used for keys, which then allows me to use \biblerefmap as:

\biblerefmap{Gn}{1@Ancien Testament!01}
\biblerefmap{Ex}{1@Ancien Testament!02}
\biblerefmap{Lv}{1@Ancien Testament!03}
etc.


which solves my problem.

-