On Fri, Oct 09, 2020 at 01:00:03AM +0200, Patrice Dumas wrote:
> On Wed, Oct 07, 2020 at 08:00:50PM +0100, Gavin Smith wrote:
> > I've implemented basic MathJax support in texi2any in commit
> > 7ff3cbdc4.
>
> Should there be new @-environement commands for display math and
> equation ($$...$$ and \[...\] in Mathjax and Tex/LaTeX)? If not, I guess
> that users will use @tex (possibly with LaTeX in @tex blocks)
> or custom @macros and still not use the now 'native' mathjax support.
There needs to be some way of getting display math, either with
a new command (@displaymath?) or by putting @math inside @display (but
then it's not clear what
@display
line @math{a+b} text
@end display
should do).
In fact, an alternative is to detect when there is input like
@tex
$$a+b$$
@end tex
and process this as display math.
I think the display math problem is a lesser problem than how/whether to
distribute MathJax.
DocBook has the <equation> element which could be used for DocBook
output (
https://tdg.docbook.org/tdg/4.5/equation.html).
> I wanted to check the mathjax support for the singular manual for
> example, which has maths written in LaTeX, but it uses @tex all over,
> and not @math.
>
>
> I propose to add a test with mathjax in tp/tests/layout/list-of-tests:
> formatting_mathjax formatting.texi --html -c HTML_MATH=mathjax
> Would that be ok?
>
> The @math is rendered in that example correctly with mathjax.
>
Yes, please.
> 3 remarks:
>
> In _convert_math_command, the condition
> if (!defined($self->get_conf('L2H'))) {
> will never be true. Indeed, if L2H is set, latex2html.pm should be
> loaded, in that file texinfo_register_command_formatting('math', ..) is
> called which means that Texinfo::Convert::HTML::_convert_math_command
> will not be called.
OK.
I think -c HTML_MATH=l2h should be made a synonym for -c L2H=1, but I haven't
looked at how to do this.
>
> I think that there should not be a warning if there is @math in a
> document and HTML_MATH is not set.
I don't have strong feelings about this and it seems fairly harmless
to keep things as they are, with no warning.
>
> Another remark, I think that the class that enables mathjax should be
> specific and not 'math', as we may want, for example to have the math
> class be added to @math element irrespective of mathjax being handled
> or not. For example, tex2jax_process could be used to be similar with
> tex2jax_ignore.
So <em class='math'> by default, and
<em class='math' class='tex2jax_process'> for MathJax?