bug-texinfo
[Top][All Lists]
Advanced

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

Re: behavior of @math with HTML output


From: Vincent Lefevre
Subject: Re: behavior of @math with HTML output
Date: Thu, 13 Oct 2022 23:20:24 +0200
User-agent: Mutt/2.2.7+47 (8681885b) vl-149028 (2022-10-10)

On 2022-10-13 19:17:13 +0100, Gavin Smith wrote:
> On Thu, Oct 13, 2022 at 11:57:26AM +0200, Vincent Lefevre wrote:
> > The GMP manual has the following:
> > 
> > @c  @m{T,N} is $T$ in tex or @math{N} otherwise.  Commas in N or T don't 
> > work,
> > @c  but @C{} can be used instead.
> > @iftex
> > @macro m {T,N}
> > @tex$\T\$@end tex
> > @end macro
> > @end iftex
> > @ifnottex
> > @macro m {T,N}
> > @math{\N\}
> > @end macro
> > @end ifnottex
> > 
> > with for instance a use like that:
> > 
> > Set @var{rop} to @m{@var{op1} \times 2^{op2}, @var{op1} times 2 raised to
> > @var{op2}}.
> > 
> > So, if a PDF is generated, then TeX is used and everything is OK, but
> > if HTML is generated, then one gets something like
> > 
> >   @math{@var{op1} times 2 raised to @var{op2}}
> > 
> > so MathJax would not make much sense on that. And since this is like
> > normal text, I don't see why <em> makes sense.
> 
> How is that a fault with texi2any?  You deliberately output different
> output for HTML.
> 
> It doesn't make much sense to use @math in your @ifnottex block if you
> are not going to use TeX math syntax in its argument.

This is code that dates back from 2000, and was apparently working
as designed at that time (according to the documentation I could
find). I don't know why @math{...} was used, as it was described
to do nothing in HTML. I'm just maintaining code that was written
22 years ago and got slightly broken.

Note that the Texinfo manual doesn't say @math is there to use
exclusively TeX math syntax (at least for Info and HTML).

> I suggest changing this to
> 
> @ifnottex
> @macro m {T,N}
> \N\
> @end macro

I've started to do that for MPFR (I also reported the issue for GMP).
But for consistency, I also need to convert the @math occurrences.
Unfortunately, the documentation is buggy: about macros,

   The newline characters after the '@macro' line and before the '@end
macro' line are ignored, that is, not included in the macro body.

is not true. More precisely, I would expect

@macro ttie
@end macro

to generate nothing, but inserting @ttie{} in a TeX expression
modifies the spacing in the generated PDF.

-- 
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]