[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: |
Gavin Smith |
Subject: |
Re: spurious space after macro expansion in math mode for TeX output |
Date: |
Sat, 12 Nov 2022 16:46:36 +0000 |
On Sat, Nov 12, 2022 at 12:26:28PM +0100, Vincent Lefevre wrote:
> 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.
I've implemented this suggestion in commit 668adc6e65.
> (Not sure whether the \bgroup in \norecurse should also be concerned,
> and ditto for the other \bgroup and \egroup in the texinfo.tex file.)
I don't think the \norecurse macro is actually used anywhere in texinfo.tex.
- 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/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, 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 <=
- 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