From 344f34c0430d96def4f9629bcd0d154b74f51ccd Mon Sep 17 00:00:00 2001 From: Adam Fourney Date: Fri, 28 Mar 2025 15:07:19 -0700 Subject: [PATCH] Small fixes. --- packages/markitdown/pyproject.toml | 1 + .../src/markitdown/converter_utils/docx/math/latex_dict.py | 4 ++-- .../src/markitdown/converter_utils/docx/math/omml.py | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/markitdown/pyproject.toml b/packages/markitdown/pyproject.toml index d5754db..79f67d2 100644 --- a/packages/markitdown/pyproject.toml +++ b/packages/markitdown/pyproject.toml @@ -38,6 +38,7 @@ all = [ "pandas", "openpyxl", "xlrd", + "lxml", "pdfminer.six", "olefile", "pydub", diff --git a/packages/markitdown/src/markitdown/converter_utils/docx/math/latex_dict.py b/packages/markitdown/src/markitdown/converter_utils/docx/math/latex_dict.py index 3db84c1..9b47382 100644 --- a/packages/markitdown/src/markitdown/converter_utils/docx/math/latex_dict.py +++ b/packages/markitdown/src/markitdown/converter_utils/docx/math/latex_dict.py @@ -258,7 +258,7 @@ RAD = "\\sqrt[{deg}]{{{text}}}" RAD_DEFAULT = "\\sqrt{{{text}}}" -ARR = "\\begin{{array}}{{c}}{text}\end{{array}}" +ARR = "\\begin{{array}}{{c}}{text}\\end{{array}}" LIM_FUNC = { "lim": "\\lim_{{{lim}}}", @@ -270,4 +270,4 @@ LIM_TO = ("\\rightarrow", "\\to") LIM_UPP = "\\overset{{{lim}}}{{{text}}}" -M = "\\begin{{matrix}}{text}\end{{matrix}}" +M = "\\begin{{matrix}}{text}\\end{{matrix}}" diff --git a/packages/markitdown/src/markitdown/converter_utils/docx/math/omml.py b/packages/markitdown/src/markitdown/converter_utils/docx/math/omml.py index 6e6ccbd..03043a8 100644 --- a/packages/markitdown/src/markitdown/converter_utils/docx/math/omml.py +++ b/packages/markitdown/src/markitdown/converter_utils/docx/math/omml.py @@ -73,7 +73,6 @@ def get_val(key, default=None, store=CHR): class Tag2Method(object): - def call_method(self, elm, stag=None): getmethod = self.tag2meth.get if stag is None: @@ -126,7 +125,6 @@ class Tag2Method(object): class Pr(Tag2Method): - text = "" __val_tags = ("chr", "pos", "begChr", "endChr", "type") @@ -341,7 +339,7 @@ class oMath2Latex(Tag2Method): """ rows = [] for stag, t, e in self.process_children_list(elm): - if stag is "mPr": + if stag == "mPr": pass elif stag == "mr": rows.append(t)