Hacker News new | past | comments | ask | show | jobs | submit login

The idea is the MathML is generated by a computer algebra system or similar which has all that data, not manually.



What if you do not have any computer algebra system in your pipeline? LaTeX can be written and read by actual humans, MathML cannot.


You can use latex to author mathml, like we everywhere use markdown to author HTML.


The first hit in Google for "latex mathml converter" is 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.


Is that the canonical mathml way of expressing vectors? Then yikes, I thought it's more semantic than that


LaTeX is isn't semantic, so how could MathML computed from LaTEX be semantic?


\vec{x} is quite semantic.


I 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.


<mover> has a boolean accent attribute so I guess you can write:

    <mover accent="true">
      <mi>B</mi>
      <mo>→</mo>
    </mover>


So maybe that's a problem with a particular latex->mathml convertor, but the idea itself should work.


What is anyone going to do with that information?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: