Skip to content

bug: DOCX math converter crashes with NotImplementedError on unknown functions #1982

@hanhan761

Description

@hanhan761

Description

The OMML-to-LaTeX converter crashes with NotImplementedError when encountering math functions not in the hardcoded FUNC dictionary. The FUNC dict only contains sin, cos, tan, arcsin, arccos, arctan, arccot, sinh, cosh, tanh, coth, sec, csc - but not common functions like log, ln, exp, det, gcd, lcm, etc.

Root Cause

In omml.py line 275: raise NotImplementedError("Not support func %s" % t). Any DOCX file with a math equation using an unrecognized function name will crash the entire conversion.

Proposed Fix

Instead of raising NotImplementedError, fall back to rendering the function name as plain text using \operatorname{}.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions