I am using imakeidx to create my indices. It works great except for the fact that it does not create normal orders with numbers.

Instead of:





it creates:





Is there a way to change this?

Here is my MWE:

\usepackage{imakeidx}% MULTIPLE INDICES
\makeindex[name=band1-bibelstellen,title=Bibelstellen, intoc, options=-c -s untitled.ist]
\makeindex[name=band1-themen,title=Themen, intoc, options=-c -s untitled.ist]
\makeindex[name=band1-personen,title=Personen, intoc, options=-c -s untitled.ist]
\blindtext\index[band1-themen]{Augustine!Sermones!1, 12}
\blindtext\index[band1-themen]{Augustine!Sermones!3, 34}
\blindtext\index[band1-themen]{Augustine!Sermones!10, 1}
\blindtext\index[band1-themen]{Augustine!Sermones!30, 2}

My untitled.ist looks like this at the moment:

delim_0 ":\\quad "
delim_1 ":\\quad "
delim_2 ":\\quad "

Makeindex sorts the entries as text and not as numbers. The entry 1, 12 starts with a digit, but it is not a number.

The symbol @ can be used to add a sort key to get the desired sort order:

\blindtext\index[band1-themen]{Augustine!Sermones!01, 12@1, 12}
\blindtext\index[band1-themen]{Augustine!Sermones!03, 34@3, 34}
\blindtext\index[band1-themen]{Augustine!Sermones!10, 1}
\blindtext\index[band1-themen]{Augustine!Sermones!30, 2}

The sort keys are now:

01, 12
03, 34
10, 1
30, 2

And the result is:

1, 12
3, 34
10, 1
30, 2
| improve this answer | |
  • Yes I am aware of this but unfortunately I have over thousand entries, and they are rather complicated. It would take a month to change all entries to what you suggested. There must be an automatic way to do this! – eklisiarh Nov 24 '17 at 19:16
  • 1
    @eklisiarh The question only contains less than 4 ‰ of the over thousand entries. That does not allow to derive any rules for an automatic way. Develop such rules. Then, for example, you can write a script/program in the programming language of your choice to post-process either the .tex files (if the markup is clear) or the .idx files to add or update the sort keys for the index entries. – Heiko Oberdiek Nov 24 '17 at 19:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.