[texhax] Two problems with \sidx

D. R. Evans doc.evans at gmail.com
Wed May 11 16:36:53 CEST 2011


Heiko Oberdiek said the following at 05/10/2011 09:13 AM :
> On Tue, May 10, 2011 at 08:35:41AM -0600, D. R. Evans wrote:
> 
>> I have two issues (using eplain TeX):
>>
>> 1. If I have the following explicit inline text in my file, it gives no error:
>>   {\sc nop}\sidx{{\sc nop} gate
>> This prints "NOP" in small caps and inserts the text "NOP gate" into the index.
>>
>> However, if I define \nop as:
>>   \def\nop{{\sc nop}\sidx{{\sc nop} gate}}
>> Then when the compiler reaches "\nop" in the text, TeX throws an error:
>>   ! Incomplete \iffalse; all text was ignored after line 1415.
> 
> \sidx reads its argument verbatim, but catcode changes does not
> have an effect if used inside other stuff like a definition.
> Thus \sc is read as command and executed if \nop is called.
> But \sc is not robust (in LaTeX sense) and breaks.

OK, thank you; I think I follow that explanation, but how does one work
around this restriction?

(I have a similar construct in many places, but the inline version is ugly
and makes the text very difficult to read and edit.)

  Doc

-- 
Web:  http://www.sff.net/people/N7DR

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://tug.org/pipermail/texhax/attachments/20110511/b71addaa/attachment.bin>


More information about the texhax mailing list