TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

See MWE below. The symbol ! in the \index causes an error. This is only the case in align environments (not in equation). So it seems to have to do something with amsmath. If ! is put in an \mbox there is no error. But then of course the font size is not adjusted to subindices. Curiously enough, \index{$C_{K!!}$} (two exclamation marks) doesn't cause any error.


Any solutions suggested?

share|improve this question
up vote 9 down vote accepted

For makeindex the symbol ! has a specific meaning.

The manual of makeindex (texdoc makeindex) has the following example / explanation:

To produce a subentry, the argument of the \index command should contain both the main entry and the subentry, separated by a ! character.

Page 7:  \index{gnat!size of}  || gnat, 32
Page 32: \index{gnat}          ||     anatomy, 35
Page 35: \index{gnat!anatomy}  ||     size of, 7
         \index{gnus!good}     || gnus
Page 38: \index{gnus!bad}      ||    bad, 38
                               ||    good, 35

To print out the symbol ! the manual shows

To put a !, @, or | character in an index entry, quote it by preceding the character with a ".

So the correct usage of your example is:


The quoted character can be changed my setting up the following line in the style file:

 quote '+'

Now the quoted character is +. E.g. for German language it's important than "a becomes ä.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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