How to use the latex2mathml.commands.COMMANDS 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 / latex2mathml / converter.py View on Github external
mtr = SubElement(parent, "mtr")
    iterable = iter(range(len(row)))  # type: Iterator[int]
    if single_mtd:
        mtd = SubElement(mtr, "mtd")
    for i in iterable:
        element = row[i]
        if alignment:
            column_align = {"r": "right", "l": "left", "c": "center"}.get(
                alignment, ""
            )  # type: str
            mtd = SubElement(mtr, "mtd", columnalign=column_align)
        elif not single_mtd:
            mtd = SubElement(mtr, "mtd")
        if isinstance(element, list):
            _classify_subgroup(element, mtd)
        elif element in COMMANDS:
            _convert_command(element, row, i, iterable, mtd)
        else:
            _classify(element, mtd)