All Topics
All Topics
Technology
Technology
Design
Design
Programming
Programming
Science
Science
News
News
Gaming
Gaming
Entertainment
Entertainment
Business
Business
Finance
Finance
Sports
Sports
Health
Health
Food
Food
Travel
Travel
Art
Art
Music
Music
Books
Books
Education
Education
Politics
Politics
Personal
Personal
No algorithm. No AI slop. No ads. Just RSS. Pro-human. Indie writers. Real journalism. Open web. Chronological. Hand toasted.

Converting LaTeX Mathematical Formulas to SVG: Methods and Limitations

By

henry_flower

6mo ago· 3 min readen

Summary

The article discusses methods for converting LaTeX mathematical formulas to SVG format using MathJax, highlighting the limitations of MathJax's default approach which relies on external JavaScript and fails in offline scenarios or on devices without JavaScript support. It presents alternative solutions including using MathML (which has broad browser support) and converting LaTeX to SVG directly via tools like LaTeX2HTML5 or dvisvgm, which produce self-contained SVG files that work offline and across various devices including epub readers.

Key quotes

· 4 pulled
Pandoc can prepare LaTeX math for MathJax via its eponymous --mathjax option. It wraps formulas in <span class='math'> elements and injects a <script> tag that points to cdn.jsdelivr.net, which means rendering won't work offline or in case of the 3rd-party server failure.
At the same time, practically all browsers support MathML. Use it (pandoc's --mathml option) to embed formulas directly into HTML, but note that MathML is verbose and not all epub readers support it.
The best solution is to convert LaTeX to SVG directly. Use LaTeX2HTML5 or dvisvgm to produce self-contained SVG files that work offline and on any device, including epub readers.
SVG formulas are resolution-independent, accessible, and can be styled with CSS. They also work in epub readers that don't support JavaScript or MathML.
Snippet from the RSS feed
Latest update: 2025-10-08 17:10:31

You might also wanna read