bug-texinfo
[Top][All Lists]
Advanced

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

Re: @inlinefmt(tex, foo)


From: Gavin Smith
Subject: Re: @inlinefmt(tex, foo)
Date: Wed, 10 Aug 2022 10:49:01 +0100

> If I do
> 
> @inlinefmt{tex, {\rm Ai}(x)}
> 
> The output is "\rm Ai(x)" in a normal roman font.

A workaround is to use a block conditional instead:

@iftex
@math{{\rm Ai}(x)
@end iftex

This appears to produces good results but you would have to try it in
your document to be sure.  If you don't want an extra space to appear then
you need to use

@iftex
@math{{\rm Ai}(x)@c
@end iftex

to comment out the newline.

The reason that the texinfo.tex implementation is flawed is that when
@inlinefmt reads its arguments, \ is not an escape character, and it
is not reinterpreted after checking the conditional.  This shows
a possible fix:

--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -3343,7 +3343,7 @@ $$%
 \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
 \long\def\doinlinefmt#1,#2,\finish{%
   \def\inlinefmtname{#1}%
-  \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
+  \ifx\inlinefmtname\outfmtnametex \ignorespaces \scantokens{#2}\fi
 }
 % 
 % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if

although I would rather not touch this code if possible.  It might be
better just to document the limitation and workaround in the manual.



reply via email to

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