4 ms·
The first hit in Google for "latex mathml converter" is https://temml.org/ https://temml.org/ . The list of supported LaTeX constructs looks fine, but the outpu
by Kwpolska 4y ago
The first hit in Google for "latex mathml converter" is https://temml.org/ https://temml.org/ . The list of supported LaTeX constructs looks fine, but the output… The example LaTeX converts to 67 lines of MathML. The vectors (arrows above B, l, E) are built like this:
<mover>
<mi>B</mi>
<mo stretchy="false" style="transform:scale(0.75) translate(10%, 30%);">→</mo>
</mover>
But the hat above n is:
<mover>
<mi>n</mi>
<mo stretchy="false" style="math-style:normal;math-depth:0;">^</mo>
</mover>
Markdown is great, but I can always take the HTML produced by a Markdown→HTML converter and edit it by hand, since HTML is human-readable and human-editable. MathML is neither.
The output of MathML is also uglier than KaTeX’s, with wonky spacing. In Firefox, there’s an ugly space after all \d's (derivative sign). It’s better in Edgium, but there is still an ugly space in \d\vec{l}.
If I need an intermediary tooling/format for math, I’d prefer beautiful LaTeX-esque output, and keep LaTeX code that wold be converted by KaTeX on the fly to whatever ugly HTML is required.
- throwaway290 4y agoIs that the canonical mathml way of expressing vectors? Then yikes, I thought it's more semantic than that
- hgsgm 4y agoLaTeX is isn't semantic, so how could MathML computed from LaTEX be semantic?
- Kwpolska 4y ago\vec{x} is quite semantic.
- throwaway290 4y agoI guess <mover> is semantic enough, actually? Though I don't get why the engine doesn't just know to render the arrow appropriately and it needs all those <mo stretchy> things with inline styling.
- runarberg 4y ago<mover> has a boolean accent attribute so I guess you can write: <mover accent="true"> <mi>B</mi> <mo>→</mo> </mover>
- throwaway290 4y agoSo maybe that's a problem with a particular latex->mathml convertor, but the idea itself should work.