On 2022-11-08 23:07:51 +0100, Vincent Lefevre wrote:
> ------------------------------------------------------------
> \input texinfo @c -*-texinfo-*-
>
> @tex
> \gdef\texatan{\mathop{\rm atan}}
> @end tex
>
> @iftex
> @macro atan
> \\mathop{\\rm atan}
> @end macro
> @end iftex
>
> Spacing test with atan.
>
> @math{\mathop{\rm atan}(x)}
>
> @math{\texatan(x)}
>
> @math{@atan{}(x)}
>
> @bye
> ------------------------------------------------------------
>
> I get:
>
> Spacing test with atan.
> atan(x)
> atan(x)
> atan (x)
>
> So, one gets the expected behavior with the TeX macro (no space added).
> But with the Texinfo macro, a space is added. This is unexpected: one
> should have got the same behavior as with the Tex macro. This means
> that Texinfo is adding something else in its macro expansion.
Actually in the PDF rendering, that's
Spacing test with atan.
atan(x)
atan(x)
atan (x)
i.e. the Texinfo macro generates a space both before and after "atan".
But pdftotext shows a space only after "atan" (perhaps because this is
based on a heuristic).
--
Vincent Lefèvre <[email protected]> - 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)