Skip to content

mathml

Rendering of formulas and Content MathML.

A common problem in rendering MathML is that the content MathML is difficult to read. The presentation MathML has a much better rendering and improves understandability. This module uses stylesheets for the conversion of content MathMl -> presentation MathML.

see also: https://docs.sympy.org/dev/modules/printing.html#module-sympy.printing.mathml

formula_to_astnode

formula_to_astnode(formula, model=None)

Convert formula string to ASTNode.

:param formula: SBML formula string :param model: libsbml.Model :return: libsbml.ASTNode

formula_to_latex

formula_to_latex(formula, model=None)

Convert formula string to latex.

cmathml_to_astnode

cmathml_to_astnode(cmathml)

Convert Content MathML string to ASTNode.

:param cmathml: SBML Content MathML string :return: libsbml.ASTNode

astnode_to_latex

astnode_to_latex(astnode)

Convert ASTNode to Latex using XSLT transformation.

cmathml_to_latex cached

cmathml_to_latex(cmml_str)

Content MathML to latex conversion using XSLT transformation.

symbol_to_latex

symbol_to_latex(symbol)

Convert symbol to latex by packing in mathit and escaping underscores.