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: Gavin Smith
Subject: Re: behavior of @math with HTML output
Date: Thu, 13 Oct 2022 19:17:13 +0100

On Thu, Oct 13, 2022 at 11:57:26AM +0200, Vincent Lefevre wrote:
> On 2022-10-13 06:48:49 +0100, Gavin Smith wrote:
> > This is the default if MathJax is not turned on or tex4ht or latex2html
> > are not used.  The <em> tag marks the text as separate.  There is not
> > much more that could be done - texi2any does not itself interpret
> > TeX math notation at all and is not going to format e.g. digits
> > differently.
> > 
> > My advice is to use MathJax when generating the manual as described in
> > the same part of the manual.
> 
> 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.  I suggest changing
this to

@ifnottex
@macro m {T,N}
\N\
@end macro

> In any case, if one goes back to the texinfo example
> 
>   \sin 2\pi \equiv \cos 3\pi
> 
> a better treatment for HTML would be to replace \xxx by the Unicode
> character when it exists (there could be a table for that), and the
> other backslashes could be removed in the output. So one would get
> 
>   sin 2π ≡ cos 3π
> 

No, we are not going to do this in texi2any, unless it is via an
external program that does it automatically.  There are already
three options for displaying math formulas for HTML output; we don't
need to implement our own version to convert TeX math to HTML.



reply via email to

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