On 2022-11-12 10:23:13 +0000, Gavin Smith wrote: > On Wed, Nov 09, 2022 at 04:44:07PM +0100, Vincent Lefevre wrote: > > It seems that Texinfo adds something like {} at the beginning of > > the Texinfo macro expansion > > Yes, this appears to be the case. I expect it is the \bgroup and \egroup > used in \defmacro, in this code: > > \or % 1 > \expandafter\xdef\csname\the\macname\endcsname{% > \bgroup > \noexpand\braceorline > \expandafter\noexpand\csname\the\macname @@@\endcsname}% > \expandafter\xdef\csname\the\macname @@@\endcsname##1{% > \egroup > \noexpand\scanmacro{\macrobody}% > }% > > These grouping commands are needed to isolate the catcode changes for > reading the macro arguments.
The first comment in https://tex.stackexchange.com/a/1932/58921 says "\begingroup...\endgroup also behaves differently in math mode, in which {...} or \bgroup...\egroup create a subformulae with different spacing. A good rule of thumb would be to avoid using \bgroup...\egroup unless you know you need them." So the "subformulae with different spacing" from \bgroup...\egroup seems to be the issue. Indeed, the attached patch fixes the issue on my test file. (Not sure whether the \bgroup in \norecurse should also be concerned, and ditto for the other \bgroup and \egroup in the texinfo.tex file.) -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
diff --git a/doc/texinfo.tex b/doc/texinfo.tex index b1bf41ff5..c604b27cd 100644 --- a/doc/texinfo.tex +++ b/doc/texinfo.tex @@ -3,7 +3,7 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2022-11-07.17} +\def\texinfoversion{2022-11-12.12} % % Copyright 1985, 1986, 1988, 1990-2022 Free Software Foundation, Inc. % @@ -8428,21 +8428,21 @@ might help (with 'rm \jobname.?? \jobname.??s')% \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup + \begingroup \noexpand\spaceisspace \noexpand\endlineisspace \noexpand\expandafter % skip any whitespace after the macro name. \expandafter\noexpand\csname\the\macname @@@\endcsname}% \expandafter\xdef\csname\the\macname @@@\endcsname{% - \egroup + \endgroup \noexpand\scanmacro{\macrobody}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup + \begingroup \noexpand\braceorline \expandafter\noexpand\csname\the\macname @@@\endcsname}% \expandafter\xdef\csname\the\macname @@@\endcsname##1{% - \egroup + \endgroup \noexpand\scanmacro{\macrobody}% }% \else % at most 9 @@ -8453,7 +8453,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% % @MACNAME@@@ removes braces surrounding the argument list. % @MACNAME@@@@ scans the macro body with arguments substituted. \expandafter\xdef\csname\the\macname\endcsname{% - \bgroup + \begingroup \noexpand\expandafter % This \expandafter skip any spaces after the \noexpand\macroargctxt % macro before we change the catcode of space. \noexpand\expandafter @@ -8467,7 +8467,7 @@ might help (with 'rm \jobname.?? \jobname.??s')% \expandafter\xdef \expandafter\expandafter \csname\the\macname @@@@\endcsname\paramlist{% - \egroup\noexpand\scanmacro{\macrobody}}% + \endgroup\noexpand\scanmacro{\macrobody}}% \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}%