1

I am using MikTex,pdfLaTex, WinXP_SP3. I want to create an index including foreign letters in correct alphabetical order. Using Xindy seems like a lot of hassle, so I would like to avoid it. How can I manually change the index file (.ind) after it is created, setting the entries in the correct alphabetical order?

I am going to answer my own question.

The preamble contains

\usepackage{imakeidx}
%\usepackage{makeidx}
\makeindex[columns=3,  intoc]

I have tried using makeidx, but it didn't work so I changed to imakeidx.

At the end of the file there is

\clearpage
\printindex

With this setup, an index file is created and printed, but with all words starting with foreign characters at the front, which is incorrect.

Open the .ind file with notepad. Manually copy-paste the incorrectly placed entries into proper places, adding \indexspace entries as required. (This is easier done in wordpad, actually). Now make the following changes to the preamble:

%\usepackage{imakeidx}
\usepackage{makeidx}
%\makeindex[columns=3,  intoc]

The otherwise failed makeidx now prints the manually altered index file. Even the TOC entry of the index remains. Job done.

1

XIndy

You may consider switching to XIndy, a much more powerful index generator, which supports sorting rules for many languages.

Helping Makeindex

The sorting of Makeindex can be influenced by specifying a sorting key. In the default setting, the character @ separates the sorting key from the word, which appears in the index, e.g.: \index{Strasse@Straße}, \index{Baecker@Bäcker}/\index{Backer@Bäcker} (depending on the sorting rule). Then Makeindex will sort the entries as Strasse and Baecker/Backer, but Straße and Bäcker will appear in the index.

Sorting of the .idx file

The previous method can also be used to write a script, which provides sort keys for the entries in the .idx file. However, new letter groups are not possible.

Sorting of the .ind file

Parsing the .ind file is more cumbersome. A style file could be written to add more logical markup to ease the parsing. After identifying the entries, the script could perform its own sorting, including adding new letter groups.

| improve this answer | |

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.