[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: spurious space after macro expansion in math mode for TeX output
From: |
Vincent Lefevre |
Subject: |
Re: spurious space after macro expansion in math mode for TeX output |
Date: |
Sat, 12 Nov 2022 12:26:28 +0100 |
User-agent: |
Mutt/2.2.8+49 (040ba998) vl-149028 (2022-11-07) |
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 <vincent@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)
texinfo.tex.patch
Description: Text Data
- Re: spurious space after macro expansion in math mode for TeX output, (continued)
- Re: spurious space after macro expansion in math mode for TeX output, Vincent Lefevre, 2022/11/07
- Re: spurious space after macro expansion in math mode for TeX output, Gavin Smith, 2022/11/08
- Re: spurious space after macro expansion in math mode for TeX output, Vincent Lefevre, 2022/11/08
- Re: spurious space after macro expansion in math mode for TeX output, Gavin Smith, 2022/11/08
- Re: spurious space after macro expansion in math mode for TeX output, Vincent Lefevre, 2022/11/08
- Re: spurious space after macro expansion in math mode for TeX output, Patrice Dumas, 2022/11/09
- Re: spurious space after macro expansion in math mode for TeX output, Vincent Lefevre, 2022/11/09
- Re: spurious space after macro expansion in math mode for TeX output, Vincent Lefevre, 2022/11/09
- Re: spurious space after macro expansion in math mode for TeX output, Vincent Lefevre, 2022/11/09
- Re: spurious space after macro expansion in math mode for TeX output, Gavin Smith, 2022/11/12
- Re: spurious space after macro expansion in math mode for TeX output,
Vincent Lefevre <=
- Re: spurious space after macro expansion in math mode for TeX output, Gavin Smith, 2022/11/12
- Re: spurious space after macro expansion in math mode for TeX output, Gavin Smith, 2022/11/12
- Re: spurious space after macro expansion in math mode for TeX output, Gavin Smith, 2022/11/09
- Re: spurious space after macro expansion in math mode for TeX output, Gavin Smith, 2022/11/09
- Re: spurious space after macro expansion in math mode for TeX output, Gavin Smith, 2022/11/12
- Re: spurious space after macro expansion in math mode for TeX output, Vincent Lefevre, 2022/11/12
- Re: spurious space after macro expansion in math mode for TeX output, Gavin Smith, 2022/11/12
- Re: spurious space after macro expansion in math mode for TeX output, Vincent Lefevre, 2022/11/09