Pure Python library for LaTeX to MathML conversion

3.79.0 · active · verified Fri Apr 10

latex2mathml is a pure Python library for converting LaTeX math expressions to MathML. It supports a wide range of LaTeX commands and environments. The current version is 3.79.0 and it maintains an active release cadence, with recent updates.

Warnings

Install

Imports

Quickstart

Convert a simple LaTeX math string to MathML.

from latex2mathml.converter import convert

latex_input = r'E = mc^2'
mathml_output = convert(latex_input)
print(mathml_output)

view raw JSON →