{"record":{"id":"513a87389fae6c5c","repo":"microsoft/markitdown","slug":"not-support-func-s","errorCode":null,"errorMessage":"Not support func %s","messagePattern":"Not support func (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"packages/markitdown/src/markitdown/converter_utils/docx/math/omml.py","lineNumber":280,"sourceCode":"    def do_func(self, elm):\n        \"\"\"\n        the Function-Apply object (Examples:sin cos)\n        \"\"\"\n        c_dict = self.process_children_dict(elm)\n        func_name = c_dict.get(\"fName\")\n        return func_name.replace(FUNC_PLACE, c_dict.get(\"e\"))\n\n    def do_fname(self, elm):\n        \"\"\"\n        the func name\n        \"\"\"\n        latex_chars = []\n        for stag, t, e in self.process_children_list(elm):\n            if stag == \"r\":\n                if FUNC.get(t):\n                    latex_chars.append(FUNC[t])\n                else:\n                    raise NotImplementedError(\"Not support func %s\" % t)\n            else:\n                latex_chars.append(t)\n        t = BLANK.join(latex_chars)\n        return t if FUNC_PLACE in t else t + FUNC_PLACE  # do_func will replace this\n\n    def do_groupchr(self, elm):\n        \"\"\"\n        the Group-Character object\n        \"\"\"\n        c_dict = self.process_children_dict(elm)\n        pr = c_dict[\"groupChrPr\"]\n        latex_s = get_val(pr.chr, default=CHR_DEFAULT.get(\"GROUP_CHR_VAL\"), store=CHR)\n        return pr.text + latex_s.format(c_dict[\"e\"])\n\n    def do_rad(self, elm):\n        \"\"\"\n        the radical object\n        \"\"\"","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/microsoft/markitdown/blob/fd239d5d2be43d9b68329730206b9312c7d5a388/packages/markitdown/src/markitdown/converter_utils/docx/math/omml.py#L262-L298","documentation":"While converting OMML (Office Math Markup) equations in a DOCX to LaTeX, do_fname() maps the function-name run text through the FUNC dictionary (sin, cos, log, ...). A function name absent from FUNC raises NotImplementedError with the unmapped token. This marks a genuine gap in the OMML-to-LaTeX coverage rather than a problem with your call.","triggerScenarios":"Converting a .docx containing an equation whose m:f element has an unusual or localized function name (custom operators, non-English function names) not present in the converter's FUNC table.","commonSituations":"Scientific/financial documents authored in other locales or with add-in equation editors that emit non-standard function tokens.","solutions":["Upgrade markitdown to the newest release — the FUNC table grows over time","Pre-process the document: replace the unsupported equation with an image or plain text before conversion","As a workaround, monkey-patch/extend converter_utils.docx.math.omml.FUNC with your token before converting","File an issue upstream with the failing equation's OMML so the mapping is added"],"exampleFix":"# before\nmd.convert(\"math.docx\")  # NotImplementedError: Not support func <token>\n\n# after\nfrom markitdown.converter_utils.docx.math import omml\nomml.FUNC[\"<token>\"] = r\"\\\\operatorname{<token>}\"\nmd.convert(\"math.docx\")","handlingStrategy":"fallback","validationCode":"from markitdown.converter_utils.docx.math import omml\n\ndef docx_math_safe(path) -> bool:\n    # heuristic: extract document.xml and check function tokens against FUNC\n    import zipfile, re\n    xml = zipfile.ZipFile(path).read(\"word/document.xml\").decode(\"utf-8\", \"ignore\")\n    tokens = set(re.findall(r\"<m:t>([^<]+)</m:t>\", xml))\n    return all(t in omml.FUNC or not t.isalpha() for t in tokens)","typeGuard":null,"tryCatchPattern":"try:\n    result = md.convert(docx_path)\nexcept NotImplementedError as e:\n    if \"Not support func\" in str(e):\n        log.warning(\"unsupported equation token; retrying without math conversion\")\n        # e.g. strip math elements or convert equations to images, then retry\n        raise","preventionTips":["Wrap DOCX conversions that may contain exotic equations and provide a no-math fallback path","Standardize internal templates to common function names before publishing documents","Track upstream releases — the FUNC table is extended over time"],"tags":["omml","latex","docx","not-implemented"],"backgroundTag":null,"analyzedSha":"fd239d5d2be43d9b68329730206b9312c7d5a388","analyzedAt":"2026-08-14T15:47:51.745Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}