From b3bf971eb0c887c1f4a6628d078624a6162df29c Mon Sep 17 00:00:00 2001 From: Rafael Teixeira de Lima Date: Mon, 27 Jan 2025 10:22:28 +0100 Subject: [PATCH] Add pylatexenc to exceptions list --- docling/backend/docx_latex/omml.py | 4 ++-- pyproject.toml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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