Back to snippets
latex2mathml_converter_latex_string_to_mathml.py
pythonConverts a LaTeX string into a MathML string using the converter module.
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)