[texhax] Bug in makeidx

Lars Madsen daleif at imf.au.dk
Thu Nov 17 09:41:44 CET 2005


Rick Zaccone :

> The following example illustrates what appears to be a bug in the
> makeidx package.  The problem occurs if the index term contains a
> tie. The \index command generates a different entry in the body and in
> the footnote, resulting in two entries in the index.
>
> \documentclass{article}
> \usepackage{makeidx}
> \makeindex
> \begin{document}
> foo bar\index{foo~bar}\footnote{foo bar\index{foo~bar}}
> \printindex
> \end{document}
>
> This example produces the following .idx file:
>
> \indexentry{foo~bar}{1}
> \indexentry{foo\nobreakspace  {}bar}{1}
>
> As a result, there are two entries in the index.  If I replace the tie
> with a space, it works properly
>
> Is this a bug, or am I missing something?
>
> Rick
>

a footnote is a moving entity, so you have to protect yourself

\footnote{foo bar\index{foo\protect~bar}}

worked in my test

/daleif

``You cannot help men permanently by doing for them 
what they could and should do for themselves. ''
  -- Abraham Lincoln



More information about the texhax mailing list