[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: |
Mon, 7 Nov 2022 16:33:56 +0000 |
On Mon, Nov 07, 2022 at 04:08:54PM +0100, Vincent Lefevre wrote:
> Consider the following test.texi file:
>
> ------------------------------------------------------------
> \input texinfo @c -*-texinfo-*-
>
> @tex
> \gdef\atan{\mathop{\rm atan}}
> @end tex
>
> @ifnottex
> @macro atan
> atan
> @end macro
> @end ifnottex
>
> @node Top
> @node Test
>
> Spacing test with atan.
>
> @math{@atan{}(x)}
>
> @math{\atan(x)}
>
> @bye
> ------------------------------------------------------------
>
> and run "texi2dvi --pdf test.texi".
>
> With \atan, everything is fine. But with @atan{}, I get a spurious
> space between "atan" and "(x)" in the generated PDF, though the
> result should be identical to \atan.
This is not actually a Texinfo problem, as you are not using
a Texinfo macro, but a TeX macro. The same output difference
would occur even without macros.
I suspect the braces are affecting the spacing in math mode. The
empty {} is treated as a symbol.
You may remove the braces thusly:
@tex
\gdef\atan#1{\mathop{\rm atan}}
@end tex
See how the #1 parameter will absorb the empty braces. With this
definition, @atan{} must be used, not just @atan (without braces).
- 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 <=
- 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