fix(docx): parse integrals as n-ary objects without chr element (#2712)

Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
This commit is contained in:
Cesar Berrospi Ramis
2025-12-03 11:25:52 +01:00
committed by GitHub
parent f80c903c24
commit c97715f5fd
6 changed files with 248 additions and 5 deletions

View File

@@ -65,6 +65,11 @@ CHR_BO = {
"\u2210": "\\coprod",
"\u2211": "\\sum",
"\u222b": "\\int",
"\u222c": "\\iint",
"\u222d": "\\iiint",
"\u222e": "\\oint",
"\u222f": "\\oiint",
"\u2230": "\\oiiint",
"\u22c0": "\\bigwedge",
"\u22c1": "\\bigvee",
"\u22c2": "\\bigcap",

View File

@@ -381,7 +381,8 @@ class oMath2Latex(Tag2Method):
bo = ""
for stag, t, e in self.process_children_list(elm):
if stag == "naryPr":
bo = get_val(t.chr, store=CHR_BO)
# if <m:naryPr> contains no <m:chr>, the n-ary represents an integral
bo = get_val(t.chr, default="\\int", store=CHR_BO)
else:
res.append(t)
return bo + BLANK.join(res)