My index does not become ordered correctly:

An incorrectly sorted index

As you can see, the keyword "fluid" ends up in the beginning of the index instead of right before "fluid flux", where it should be. What can possibly cause this behavior?

  • 1
    Could you make a MWE and post it. A good way to do so is to make a copy of your file, and then start stripping it down until it exhibits the behaviour you're describing
    – cmhughes
    Jun 13 '12 at 15:34

I found out that there are two possible reasons (at least) for this behavior:

  1. An invisible character (like a space) has accedentally been before the first letter of the key, which causes the index key to be sorted differently, or
  2. A value that the index key should be sorted by has specified. This can be useful when the index key contains characters which may not have a well defined sorting order but resembles a character that does. (see Controlling sorting)

In this case, I had accidentally put a space before the index key.

  • 2
    If you use the -c command line option for makeindex, leading spaces will be ignored and multiple spaces will be compressed.
    – egreg
    Jun 13 '12 at 16:20
  • @egreg -- thanks! (learn something new every day.) i can think of reasons (that i think are good ones) to want to use explicit multiple/initial/terminal spaces, but if i think some more about the problem, i can probably come up with alternatives, allowing this to be the default. Jun 13 '12 at 16: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.