5 ms·
Depending on your goal, I quite like using pandoc [1] for rendering math in HTML. I can write something like: Equation: $$x=\frac{1}{2}$$ Unfortu
by bArray 5y ago
Depending on your goal, I quite like using pandoc [1] for rendering math in HTML. I can write something like:
Equation:
$$x=\frac{1}{2}$$
Unfortunately there is no common in-browser Math rendering and as the referenced article points out, pictures of equations are not the solution [2]. A common mathematics rendering format is desperately needed but nobody really seems motivated to solve it.
My approach is to use MathML that is rendered natively by Firefox and use JS to render in other browsers [3]. MathJax is way too heavy the last time I checked (growing towards 1MB) [4]. Instead I use math-ml, a JS library that is somewhat complete/abandoned but mostly works in about 80kB [5].
My rational for supporting Firefox's approach is that it's the browser I use, MathML is supported by W3C [6], MathML is supported by pandoc and there is a lightweight workaround for other browsers.
[1] https://pandoc.org/ https://pandoc.org/
[2] https://danilafe.com/blog/math_rendering_is_wrong/ https://danilafe.com/blog/math_rendering_is_wrong/
[3] https://coffeespace.org.uk/projects/mathml-render.html https://coffeespace.org.uk/projects/mathml-render.html
[4] https://www.mathjax.org/ https://www.mathjax.org/
[5] https://github.com/pshihn/math-ml https://github.com/pshihn/math-ml
[6] http://www.w3.org/1998/Math/MathML http://www.w3.org/1998/Math/MathML
- IshKebab 5y agoI agree, I spent ages trying to find a Markdown solution that supported equations and images and so on. Pandoc was the only one that worked really well.