You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I generate a docx file containing math with Pandoc (v3.5) and open it in LibreOffice Writer (v7.4.7.2), every right-hand delimiters turns into right parenthesis, even when it could be something else, such as a square bracket or vertical bar. I tracked the problem down to the order in which TeXMath writes the subelements of the dPr element. TeXMath uses the order (begChr, endChr, sepChr), while LibreOffice is expecting (begChr, sepChr, endChr). The right parenthesis is a default fallback in the LibreOffice code.
I'm not an expert at OMML or XML Schemas, but I found this page that puts the contents of dPr in a sequence, which I take to mean that sepChr should precede endChr:
When I generate a docx file containing math with Pandoc (v3.5) and open it in LibreOffice Writer (v7.4.7.2), every right-hand delimiters turns into right parenthesis, even when it could be something else, such as a square bracket or vertical bar. I tracked the problem down to the order in which TeXMath writes the subelements of the
dPr
element. TeXMath uses the order (begChr
,endChr
,sepChr
), while LibreOffice is expecting (begChr
,sepChr
,endChr
). The right parenthesis is a default fallback in the LibreOffice code.This is the code in TeXMath that writes the elements in the order (
begChr
,endChr
,sepChr
):/~https://github.com/jgm/texmath/blob/0.12.8.11/src/Text/TeXMath/Writers/OMML.hs#L209-L216
This is the code in LibreOffice that expects the order (
begChr
,sepChr
,endChr
) and supplies")"
as a default:https://git.libreoffice.org/core/+/refs/tags/libreoffice-24.8.3.2/starmath/source/ooxmlimport.cxx#301
I'm not an expert at OMML or XML Schemas, but I found this page that puts the contents of
dPr
in asequence
, which I take to mean thatsepChr
should precedeendChr
:This is a small reproduction recipe:
In my LibreOffice Writer, it renders like this:
When I double-click the formula, this is how it's serialized in the editor:
OMML output
If I hack word/document.xml inside the .docx file and swap the order of
endChr
andsepChr
, then the delimiters render correctly.The text was updated successfully, but these errors were encountered: