diff --git a/docling/backend/docx_latex/omml.py b/docling/backend/docx_latex/omml.py index 471b241a..5a5e24c1 100644 --- a/docling/backend/docx_latex/omml.py +++ b/docling/backend/docx_latex/omml.py @@ -6,7 +6,7 @@ """ import lxml.etree as ET -import pylatexenc # type: ignore +from pylatexenc.latexencode import UnicodeToLatexEncoder from docling.backend.docx_latex.latex_dict import ( ALN, @@ -177,7 +177,7 @@ class oMath2Latex(Tag2Method): _t_dict = T __direct_tags = ("box", "sSub", "sSup", "sSubSup", "num", "den", "deg", "e") - u = pylatexenc.latexencode.UnicodeToLatexEncoder( + u = UnicodeToLatexEncoder( replacement_latex_protection="braces-all", unknown_char_policy="keep", unknown_char_warning=False, diff --git a/pyproject.toml b/pyproject.toml index 27515378..794532f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -156,7 +156,8 @@ module = [ "deepsearch_glm.*", "lxml.*", "bs4.*", - "huggingface_hub.*" + "huggingface_hub.*", + "pylatexenc.*" ] ignore_missing_imports = true