bug-texinfo
[Top][All Lists]
Advanced

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

Re: MathJax support in texi2any


From: Christopher Dimech
Subject: Re: MathJax support in texi2any
Date: Tue, 13 Oct 2020 13:35:56 +0200

 
The distinction between the variant of Tex the user codes should remain.
 
For plain tex, the command should remain "@tex @end tex". As Latex Syntax
is much different, there should be some command like "@latex @end latex".
 
Mxing creates too many problems to those making modifications. One should
stick with the same syntax trype according to the variant a user is actually
coding with.
 
However, when transforming to html, texinfo should parse the respective variant
with having the user specify any html tags.
 
Regards
Christopher
 
---------------------
Christopher Dimech
Chief Administrator - Naiad Informatics - GNU Project (Geocomputation)
- Geophysical Simulation
- Geological Subsurface Mapping
- Disaster Preparedness and Mitigation
- Natural Resource Exploration and Production
- Free Software Advocacy
 
 
Sent: Tuesday, October 13, 2020 at 1:27 PM
From: "Gavin Smith" <gavinsmith0123@gmail.com>
To: "Patrice Dumas" <pertusus@free.fr>, "Texinfo" <bug-texinfo@gnu.org>, "Christopher Dimech" <dimech@gmx.com>, "Oliver Heimlich" <oheim@posteo.de>
Subject: Re: MathJax support in texi2any
On Tue, Oct 13, 2020 at 01:40:44AM +0200, Patrice Dumas wrote:
> @display already means something unrelated to math, I would suggest not
> using it especially.
>
> > In fact, an alternative is to detect when there is input like
> >
> > @tex
> > $$a+b$$
> > @end tex
> >
> > and process this as display math.
>
> That's exactly what I proposed to avoid...

It would also be incompatible with documents that already used this
syntax and provided other options for other output formats - the block
would be output twice.

> Indeed, instead of using a
> format specifc command, specific environements like
>
> @displaymath
> a+b
> @end displaymath
>
> @equation
> a+b
> @end equation
>
> could be used.

I like @displaymath better, as an equation would have to have an equals sign.

> Actually, it is not perfect, as the language used for
> the math in those @-command could be LaTeX or TeX, or something else,
> for example MathML, as there is nothing like a Texinfo math language.

There is the same issue with the existing command @math. I say just leave
it as plain TeX and worry about AMS-LaTex another time.

> > DocBook has the <equation> element which could be used for DocBook
> > output (https://tdg.docbook.org/tdg/4.5/equation.html).
>
> Indeed, but only if there is something similar in Texinfo, and also
> what is inside should be expanded to a format thta can be nested in
> <equation>. Looks like using an image would probably be the best in
> that case.

I see, so you wouldn't want TeX syntax in the DocBook output.

> > > 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?
>
> I would favor no class by default and class='tex2jax_process' for MathJax.
> I think that we should avoid using class='math' unless there is a need,
> such as a specific css style. Or we shold start doing that for all the
> @-commmands consistently.

I think <em class='math'> marks it as math and this would allow it to be
processed by some other tool. Just using <em> would give no way to find
the unprocessed TeX code in the file.

> Also I may be wrong, but it seems that <em class='math' class='tex2jax_process'>
> would not be correct, it should be
> <em class='math tex2jax_process'>
> Which means that it would probably be better to call _attribute_class
> if both a class for css that can be inlined and another class, such as
> tex2jax_process is needed, by adding, for example an array argument to
> _attribute_class to pass additional classes not corresponding to css
> style, and also maybe handling the case of the $class argument set to
> undef. No need to do anything until there is a concrete case, though.

I see. I only used <em class='tex2jax_process'> for HTML_MATH=mathjax
so that should be OK.

reply via email to

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