[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.
- 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 <=
- 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, 2022/10/14
- 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