Index entries and footnotes in LaTeX

Mark A. Sheldon sheldon at psrg.lcs.mit.edu
Fri Jan 17 10:15:14 CET 2003


While we're on the subject of footnotes:

Does anyone know why otherwise identical \index commands are treated
differently in footnotes and in the body of the text?  Plain index
entries seem OK, it's when the indexed item contains a command:

Eg, 

\newcommand{\fooname}{{\sc Foo}}
Here is text in the body\index{Foo@\fooname} of a
document.\footnote{Foo\index{Foo@\fooname}}

Produces two distinct entries in the index:

  FOO  511
  FOO  511

When I first noticed this, I thought it was that \sc might is
differently bound in footnotes.  But here are the entries in the .idx
file: 

  \indexentry{Foo@\fooname}{511}
  \indexentry{Foo@{\sc Foo}}{511}


Why is \fooname expanded in the item from the \footnote and not
otherwise? 

Confession:  Yes, it's an old document and LaTeX is running in 2.0.9
compatibility mode, though it doesn't seem relevant given the expansions
above. 


-Mark




More information about the texhax mailing list