Links
- https://www.w3.org/Math/
- MathML Core (https://www.w3.org/TR/mathml-core/) - Seems to be the minimal subset used by browsers
- Tools for editing math (https://www.w3.org/wiki/Math_Tools)
- Temml.org - A tool for converting TeX to MathML
- AsciiMath is probably easier to type than LaTeX.
- Mathup may be more modular than AsciiMath
- Guillaume Fortin-Debigaré has a pretty decent page about MathML, and covers stuff like representing function applications.
- Pandoc uses texmath (online texmath demo)
Example
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mn> 2 </mn>
<mo> + </mo>
<mfrac>
<mn> 1 </mn>
<mn> 3 </mn>
</mfrac>
</math>
Aligning equations
Align equations by using “<mtable/>” like so:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mtable style="math-style: normal;">
<mtr>
<mtd><mi>x</mi></mtd>
<mtd><mo>=</mo></mtd>
<mtd><mfrac><mn>2</mn><mn>3</mn></mfrac></mtd>
</mtr>
<mtr>
<mtd><mi>y</mi></mtd>
<mtd><mo>=</mo></mtd>
<mtd><mn>3</mn></mtd>
</mtr>
<mtr>
<mtd><mi>z</mi><mo>+</mo><mi>x</mi></mtd>
<mtd><mo>=</mo></mtd>
<mtd><mn>5</mn></mtd>
</mtr>
</mtable>
</math>
Make sure to set the CSS math-style: normal; (thanks to this stackoverflow answer).
This gives you:
LaTeX to MathML
You can use LaTeXML (as mentioned by this stackoverflow answer.
nix-shell -p perl538Packages.LaTeXML
latexmlmath '2+\frac{1}{3}'
You can also use Pandoc (see my Pandoc notes).
echo '$2 + \\frac{1}{3}$' | pandoc -f html+tex_math_dollars --mathml
TeXZilla converts LaTeX in the browser.
contenteditable
You can’t seem to directly set contenteditable on a <math> tag (since it’s an HTML thing), but you can wrap it in something like a <div> like:
mrow parentheses
Misc
- MathML is used in ConTeXt (see /ConTeXt). See http://www.pragma-ade.nl/general/manuals/mmlprime.pdf Though I get the sense that they’re less excited about it because of backwards-incompatible changes.