{"record":{"id":"71a747348352e7ef","repo":"PaddlePaddle/PaddleOCR","slug":"not-support-lim-e","errorCode":null,"errorMessage":"Not support lim {e}","messagePattern":"Not support lim (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"paddleocr/_doc2md/math/omml.py","lineNumber":358,"sourceCode":"        if len(rows) == 1:\n            row = rows[0]\n            tag_match = re.search(r\"\\\\#\\s*\\(([^)]*)\\)\\s*$\", row)\n            if tag_match:\n                formula = row[: tag_match.start()].rstrip()\n                tag_content = tag_match.group(1)\n                return f\"{formula}\\\\tag{{{tag_content}}}\"\n            return row\n\n        return ARR.format(text=BRK.join(rows))\n\n    def do_limlow(self, elm):\n        \"\"\"\n        the Lower-Limit object\n        \"\"\"\n        t_dict = self.process_children_dict(elm, include=(\"e\", \"lim\"))\n        latex_s = LIM_FUNC.get(t_dict[\"e\"])\n        if not latex_s:\n            raise RuntimeError(\"Not support lim {}\".format(t_dict[\"e\"]))\n        else:\n            return latex_s.format(lim=t_dict.get(\"lim\"))\n\n    def do_limupp(self, elm):\n        \"\"\"\n        the Upper-Limit object\n        \"\"\"\n        t_dict = self.process_children_dict(elm, include=(\"e\", \"lim\"))\n        return LIM_UPP.format(lim=t_dict.get(\"lim\"), text=t_dict.get(\"e\"))\n\n    def do_lim(self, elm):\n        \"\"\"\n        the lower limit of the limLow object and the upper limit of the limUpp function\n        \"\"\"\n        return self.process_children(elm).replace(LIM_TO[0], LIM_TO[1])\n\n    def do_m(self, elm):\n        \"\"\"","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/paddleocr/_doc2md/math/omml.py#L340-L376","documentation":"Raised by the OMML (Office Math Markup Language) to LaTeX converter when a lower-limit construct (m:limLow) whose base expression is not one of the recognized functions. LIM_FUNC in paddleocr/_doc2md/math/latex_dict.py only maps \"lim\", \"max\", and \"min\", so any other base (e.g. \"sup\", \"inf\", \"gcd\" or a non-text run) cannot be converted and the converter aborts with RuntimeError. It occurs during doc-to-markdown conversion of Word documents containing equations.","triggerScenarios":"Converting a .docx with PaddleOCR's doc2md pipeline where an equation contains an m:limLow element whose m:e resolves to text not in {\"lim\", \"max\", \"min\"} (for example \\inf, \\sup, \\oint limits, or a nested construct instead of a plain run).","commonSituations":"Scientific/academic Word documents with \\inf_{n} or \\sup_{x} expressions; documents produced by different equation editors that emit limLow for unusual operators; conversion failing mid-document on one specific formula.","solutions":["Extend LIM_FUNC in paddleocr/_doc2md/math/latex_dict.py with the missing operator, e.g. add \"inf\": \"\\\\inf_{{{lim}}}\" and \"sup\": \"\\\\sup_{{{lim}}}\".","Wrap the doc2md math conversion call in try/except and skip/keep the original XML for the failing formula so the rest of the document still converts.","Edit the equation in the source document to use a form the converter supports (plain \\lim) and re-convert."],"exampleFix":"# paddleocr/_doc2md/math/latex_dict.py\n# before\nLIM_FUNC = {\n    \"lim\": \"\\\\lim_{{{lim}}}\",\n    \"max\": \"\\\\max_{{{lim}}}\",\n    \"min\": \"\\\\min_{{{lim}}}\",\n}\n# after\nLIM_FUNC = {\n    \"lim\": \"\\\\lim_{{{lim}}}\",\n    \"max\": \"\\\\max_{{{lim}}}\",\n    \"min\": \"\\\\min_{{{lim}}}\",\n    \"inf\": \"\\\\inf_{{{lim}}}\",\n    \"sup\": \"\\\\sup_{{{lim}}}\",\n    \"gcd\": \"\\\\gcd_{{{lim}}}\",\n}","handlingStrategy":"try-catch","validationCode":"from paddleocr._doc2md.math.latex_dict import LIM_FUNC\n\ndef limlow_convertible(base_text: str) -> bool:\n    return base_text in LIM_FUNC","typeGuard":null,"tryCatchPattern":"try:\n    md = converter.convert(docx_path)\nexcept RuntimeError as e:\n    if \"Not support lim\" in str(e):\n        logger.warning(\"Skipping unsupported limLow formula: %s\", e)\n        md = convert_without_math(docx_path)  # fallback mode\n    else:\n        raise","preventionTips":["Audit Word docs for \\inf/\\sup/\\gcd-style limit constructs before batch conversion","Extend LIM_FUNC once per newly encountered operator instead of skipping","Log the offending t_dict['e'] value from the chained exception to identify the operator to add"],"tags":["omml","latex","docx","math-conversion","runtimeerror"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}