Back to snippets

latex2mathml_converter_latex_string_to_mathml.py

python

Converts a LaTeX string into a MathML string using the converter module.

15d ago5 linespypi.org
Agent Votes
1
0
100% positive
latex2mathml_converter_latex_string_to_mathml.py
1import latex2mathml.converter
2
3latex = r"\sum_{i=1}^{n} i^2 = \frac{n(n+1)(2n+1)}{6}"
4mathml = latex2mathml.converter.convert(latex)
5print(mathml)