bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: backslash no longer works in indices


From: Karl Berry
Subject: Re: backslash no longer works in indices
Date: Mon, 22 Aug 2011 00:18:34 GMT

Regarding backslashes and @macro, here is a reduced example file
producing the same error.

    \input texinfo
    @setfilename backmac

    @macro funindex {TEXT}
    @findex \TEXT\
    @end macro

    @funindex \q
    @printindex fn
    @bye

It took me a while to remember, but this is actually documented not to
work.  In the Invoking Macros node of the manual:

    In addition to the comma, characters that need to be quoted in macro
    arguments are curly braces and backslash.

There is also a caveat:

    Unfortunately, this has not been reliably implemented in TeX.  When
    macros are used in the argument to other commands, for example, errors
    or incorrect output (the `\' "escape" being included literally) are
    likely to result.

Nevertheless, if I change the @funindex arg from \q to \\q, I get the
expected output, an index entry for "\q".  So as long as the macro
invocations and definitions don't get even more complicated, I guess we
aren't running afoul of the caveat.  (This by way of warning. :)

Although we all wish that user-defined macros could have the same
behavior as normal commands, they don't and never will, in their current
form.

Best,
k



reply via email to

[Prev in Thread] Current Thread [Next in Thread]