Converting LaTeX Mathematical Formulas to SVG: Methods and Limitations
By
henry_flower
A five-star bake. Worth schmearing, sharing, saving.
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 pulledPandoc 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.
You might also wanna read
Backend Application Not Found - Deployment Status and Troubleshooting
This appears to be an error message or placeholder content from a web hosting or deployment platform, indicating that a backend application
WebSparks: An AI-Powered Tool for Building Web Applications Without Extensive Coding
WebSparks is an AI-powered software engineer that transforms ideas into fully functional web applications without requiring extensive coding
innovirtuoso.com·18h agoJoost de Valk publishes open Website Specification: 128 rules for modern, future-proof websites
Joost de Valk, creator of Yoast SEO, published the Website Specification (specification.website) — an open, platform-agnostic reference docu
ZX Spectrum BASIC interpreter rebuilt from scratch to run natively in web browsers
A developer has rebuilt the ZX Spectrum's BASIC interpreter from scratch to run in a web browser, without emulating the original Z80 hardwar
How to Set Up an Apache Reverse Proxy for an Ecommerce Website
This article provides a comprehensive, start-to-finish guide on setting up an Apache reverse proxy specifically for ecommerce websites. It c
blog.radwebhosting.com·2d agoImplementing live text search in React with Firestore Enterprise's built-in search pipeline
Firebase's Firestore Enterprise edition now includes built-in text search support. This article demonstrates how to implement live text sear
firebase.blog·2d ago