[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: @math{-} does not produce a minus sign in Info

From: Vincent Lefevre
Subject: Re: @math{-} does not produce a minus sign in Info
Date: Tue, 25 Oct 2022 15:28:33 +0200
User-agent: Mutt/2.2.7+51 (a318ca5a) vl-149028 (2022-10-21)

On 2022-10-25 12:46:31 +0100, Gavin Smith wrote:
> On Tue, Oct 25, 2022 at 01:25:35PM +0200, Vincent Lefevre wrote:
> > If I write @math{-2} (where "-" is the ASCII HYPHEN-MINUS character),
> > I do not get a minus sign in Info, contrary to @minus{}2, while the
> > Texinfo manual suggests the use of @math with the regular '-' character
> > instead of @minus:
> > 
> > 11.8.9 '@minus' (-): Inserting a Minus Sign
> > -------------------------------------------
> > [...]
> >    If you actually want to typeset some math that does a subtraction, it
> > is better to use '@math'.  Then the regular '-' character produces a
> > minus sign, as in '@math{a-b}' (*note Inserting Math::).
> Why does it matter if the Unicode minus character is not used in Info?
> The ASCII hyphen is just as good.  It's wrong to say that - isn't a minus
> sign because it looks just like one.

With some fonts, such as DejaVu Sans Mono, the ASCII - is a very narrow
dash (e.g. 2×4 pixels), which is fine when used as an hyphen, but looks
too much like a dot in math expressions. With this font, the minus sign
is larger (2×8 pixels), thus easier to read in math expressions.

Another reason is to avoid false positives when searching for a minus

> > BTW, it contradicts
> > 
> >   11.7 '@math' and '@displaymath': Formatting Mathematics
> > 
> > which says that "the '@math' command has no special effect on the Info
> > output".
> The @minus node wasn't specifically discussing Info output.  We can change
> it to
> diff --git a/doc/texinfo.texi b/doc/texinfo.texi
> index bc1eebac87..1b7f029ba4 100644
> --- a/doc/texinfo.texi
> +++ b/doc/texinfo.texi
> @@ -10308,8 +10308,7 @@ @node @code{@@minus}
>  @end display
>  If you actually want to typeset some math that does a subtraction, it
> -is better to use @code{@@math}.  Then the regular @samp{-} character
> -produces a minus sign, as in @code{@@math@{a-b@}} (@pxref{Inserting
> +is better to use @code{@@math}, as in @code{@@math@{a-b@}} (@pxref{Inserting
>  Math}).
> to eliminate discussion of what character - may be output as.

This would be better.

There's another bug in the manual:

Use the '@minus{}' command to generate a minus sign.  In a fixed-width
font, this is a single hyphen, but in a proportional font, the symbol is
the customary length for a minus sign--a little longer than a hyphen,
shorter than an em-dash:

     '-' is a minus sign generated with '@minus{}',

(where '-' is the ASCII hyphen-minus), which is incorrect: in the
MPFR manual, I get the real minus sign '−'. I suspect that the
difference is due to the chosen encoding. But the manual is silent
on this point.

> > So I suppose that either @math{-} should generate a minus sign in Info
> > (and HTML) output or the manual should suggest the use of both @math
> > and @minus: @math{a@minus{}b}.
> Neither of these are a good idea.  As it's been stated many times before,
> no interpretation of the argument takes place for @math in Info, and
> @math{a@minus{}b} is clearly worse than @math{a-b} so we are not going
> to recommend that usage to people.
> If we needed to have consistency between @math{-} and @minus{} in Info
> output, the only way to achieve this would be to make @minus{} output
> an ASCII hyphen.  This wouldn't do anything for HTML output, though.

I was mainly pointing at the consistency, as in the MPFR manual,
we are already using @minus{} outside of any math formatting.

But IMHO, a real minus character in all cases would be much better
(that way, no information is lost). If the end user really wants an
ASCII hyphen-minus, I would say that it is up to the info reader to
do an optional transcoding. Similar considerations may be done with
other special math characters such as @geq (≥) and @leq (≤).

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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]