How to use the latex2mathml.aggregator.aggregate function in latex2mathml

To help you get started, weโ€™ve selected a few latex2mathml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github roniemartinez / latex2mathml / tests / test_aggregator.py View on Github external
def test_missing_right(name: str, latex: str, exception: Exception):
    with pytest.raises(exception):
        aggregate(latex)
github roniemartinez / latex2mathml / tests / test_aggregator.py View on Github external
def test_aggregator(name: str, latex: str, expected: list):
    assert aggregate(latex) == expected
github roniemartinez / latex2mathml / latex2mathml / converter.py View on Github external
def convert(
    latex: str,
    xmlns: str = "http://www.w3.org/1998/Math/MathML",
    display: str = "inline",
) -> str:
    math = Element("math", xmlns=xmlns, display=display)
    row = SubElement(math, "mrow")
    _classify_subgroup(aggregate(latex), row)
    return _convert(math)