[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: incorrect @math spacing for PDF output with an empty macro
From: |
Gavin Smith |
Subject: |
Re: incorrect @math spacing for PDF output with an empty macro |
Date: |
Fri, 14 Oct 2022 21:42:27 +0100 |
On Fri, Oct 14, 2022 at 01:15:03PM +0200, Vincent Lefevre wrote:
> ----------------------------------------
> \input texinfo @c -*-texinfo-*-
>
> @macro ttie {}
> @end macro
>
> @deftypefun int f1 ()
> @math{@var{n}=-2}.
> @end deftypefun
>
> @deftypefun int f2 ()
> @math{@var{n}@ttie{}=@ttie{}-2}.
> @end deftypefun
>
> @bye
> ----------------------------------------
>
> I've tested this with texinfo.tex 2022-10-01.15 (current version).
> PDF generated with "texi2dvi --pdf test.texi".
>
> pdftotext shows
> * for f1: n = −2.
> * for f2: n = − 2.
>
> The incorrect spacing for f2 is also visible with a PDF viewer.
>
> I suspect that for f2, TeX regards the minus sign as a subtraction
> instead of the unary negation.
>
> FYI, the goal is to have @ttie{} equivalent to @tie{} except for
> PDF output (where @tie{} also gives incorrect spacing).
I see. As ever, using Texinfo commands inside @math is not advisable.
Even defining ttie as a simple \gdef had the same spacing problem.
It appears you are are right abut TeX treating the minus sign as a binary
operator. You can format it correctly using \mathord:
@deftypefun int f3 ()
@math{@var{n}@ttie{}=@ttie{}\mathord-2}
@end deftypefun
In your use case, you can avoid line breaks using the @w command:
@deftypefun int f4 ()
@w{@math{@var{n} = -2}}.
@end deftypefun
- behavior of @math with HTML output, Vincent Lefevre, 2022/10/11
- Re: behavior of @math with HTML output, Patrice Dumas, 2022/10/12
- Re: behavior of @math with HTML output, Gavin Smith, 2022/10/13
- Re: behavior of @math with HTML output, Vincent Lefevre, 2022/10/13
- Re: behavior of @math with HTML output, Gavin Smith, 2022/10/13
- Re: behavior of @math with HTML output, Vincent Lefevre, 2022/10/13
- Re: behavior of @math with HTML output, Gavin Smith, 2022/10/14
- incorrect @math spacing for PDF output with an empty macro, Vincent Lefevre, 2022/10/14
- Re: incorrect @math spacing for PDF output with an empty macro,
Gavin Smith <=
- Re: incorrect @math spacing for PDF output with an empty macro, Vincent Lefevre, 2022/10/14
- Re: incorrect @math spacing for PDF output with an empty macro, Jacob Bachmeyer, 2022/10/14
- Re: incorrect @math spacing for PDF output with an empty macro, Gavin Smith, 2022/10/15
- Re: incorrect @math spacing for PDF output with an empty macro, Vincent Lefevre, 2022/10/15
- Re: incorrect @math spacing for PDF output with an empty macro, Gavin Smith, 2022/10/16
- Re: incorrect @math spacing for PDF output with an empty macro, Vincent Lefevre, 2022/10/25
- Re: incorrect @math spacing for PDF output with an empty macro, Gavin Smith, 2022/10/25
- Re: incorrect @math spacing for PDF output with an empty macro, Vincent Lefevre, 2022/10/25
- Re: incorrect @math spacing for PDF output with an empty macro, Gavin Smith, 2022/10/26
- Re: incorrect @math spacing for PDF output with an empty macro, Vincent Lefevre, 2022/10/26