On Fri, Oct 19, 2007 at 09:14:40AM +0300, Martin Vermeer wrote:
> On Fri, Oct 19, 2007 at 04:53:04AM +0200, Enrico Forestieri wrote:
> > On Fri, Oct 19, 2007 at 04:09:22AM +0200, Enrico Forestieri wrote:
> > > On Fri, Oct 19, 2007 at 02:44:49AM +0200, Enrico Forestieri wrote:
> > > 
> > > > Commands such as \url and \index don't like latex macros in their
> > > > argument
> > > 
> > > Sorry, that is true for \url only.
> > 
> > Hmmm... that's more complicated. I had the impression that a macro
> > could be used in the @ part of an entry, but
> > 
> > \index{Bibliography ! [EMAIL PROTECTED]
> > 
> > works, whereas
> > 
> > \index{Bibliography ! [EMAIL PROTECTED]
> > 
> > doesn't work.
> 
> Funny... I could swear I had used font commands directly in an index
> entry, without any @.

The story seems to be as follows.

When \index is not in the argument of any other command, its argument
can contain any characters. But when \index is itself contained in the
argument of another command (for example, it appears in a footnote),
then its own argument cannot contain any of TeX's ten special
characters #$%~_^\{}. However, in this last case, robust commands
can be placed in the @ part of an entry.

Moreover, \index is fragile, so any fragile command appearing in its
argument must be protected. That is to say that

\index{Bibliography ! Bib\TeX}

doesn't work, but

\index{Bibliography ! Bib\protect\TeX}

does work.

-- 
Enrico

Reply via email to