sbmlutils.report.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
Module Contents¶
Functions¶
|
Convert formula string to ASTNode. |
|
Convert formula string to latex. |
|
Convert Content MathML string to ASTNode. |
|
Convert ASTNode to Latex using XSLT transformation. |
|
Content MathML to latex conversion using XSLT transformation. |
|
Convert symbol to latex by packing in mathit and escaping underscores. |
|
Heuristic replacements for better latex rendering. |
|
Get variables from ASTNode. |
Attributes¶
- sbmlutils.report.mathml.formula_to_astnode(formula, model=None)[source]¶
Convert formula string to ASTNode.
- Parameters
formula (str) – SBML formula string
model (Optional[libsbml.Model]) – libsbml.Model
- Returns
libsbml.ASTNode
- Return type
libsbml.ASTNode
- sbmlutils.report.mathml.formula_to_latex(formula, model=None)[source]¶
Convert formula string to latex.
- Parameters
formula (str) –
model (Optional[libsbml.Model]) –
- Return type
str
- sbmlutils.report.mathml.cmathml_to_astnode(cmathml)[source]¶
Convert Content MathML string to ASTNode.
- Parameters
cmathml (str) – SBML Content MathML string
- Returns
libsbml.ASTNode
- Return type
libsbml.ASTNode
- sbmlutils.report.mathml.astnode_to_latex(astnode)[source]¶
Convert ASTNode to Latex using XSLT transformation.
- Parameters
astnode (libsbml.ASTNode) –
- Return type
str
- sbmlutils.report.mathml.cmathml_to_latex(cmml_str)[source]¶
Content MathML to latex conversion using XSLT transformation.
- Parameters
cmml_str (str) –
- Return type
str
- sbmlutils.report.mathml.greek_symbols = ['alpha', 'beta', 'gamma', 'Gammadelta', 'Delta', 'epsilon', 'zeta', 'eta', 'theta', 'iota',...[source]¶
- sbmlutils.report.mathml.symbol_to_latex(symbol)[source]¶
Convert symbol to latex by packing in mathit and escaping underscores.
- Parameters
symbol (str) –
- Return type
str