2

I would like to use use index entry for factorial and i need to use $!$ in it. But exclamation mark is reserved for xindy to markup subitems, so this will not work

\index{*3*factorial@$!$ (factorial)}

What is a nice way to workaround it?

Yola
  • 481

1 Answers1

7

The character ! is special for Xindy and MakeIndex: it serves for making subindex entries (unless modified with a style file for those programs).

In index context " is the escape char so use \index{*3*factorial@$"!$ (factorial)}

egreg
  • 1,121,712
daleif
  • 54,450
  • Since LaTeX writes the .idx file verbatim, I'd say it is the other way around. – egreg Feb 08 '17 at 09:13
  • @egreg how, certain chars are special in index context in LaTeX. Where did I get my wording wrong? – daleif Feb 08 '17 at 10:03
  • The ! is by no means special for LaTeX. It is Xindy that considers it special. – egreg Feb 08 '17 at 10:09
  • @egreg it is also special in makeindex it is not just in xindy, that is what I'm refering to. – daleif Feb 08 '17 at 10:20
  • 1
    “Observe that ! is special for MakeIndex and Xindy, so that \index{a!b} can be used for making a subitem; in this case you want to avoid that MakeIndex or Xindy interpret ! in that way, so you need to escape it.” – egreg Feb 08 '17 at 10:26
  • 1
    Note that ! could be changed into any character you wish, by means of a MakeIndex or Xindy style. – egreg Feb 08 '17 at 10:44
  • @egreg Sorry to ask, but how to change ! into another character by a Xindy style? I know how to do this in a MakeIndex style, but I have no idea how to achieve this in a Xindy style. It looks contradict with https://tex.stackexchange.com/questions/257191/transfer-a-makeindex-example-to-a-xindy-example – Gau-Syu May 16 '23 at 21:05
  • @Gau-Syu Sorry, I don't know. I'd go to the manual of Xindy, if it existed. – egreg May 16 '23 at 21:21