Skip to content

odt writer results in misinterpreted formulas in LibreOffice #11158

@cryptarch

Description

@cryptarch

Explain the problem.

I have a LaTeX document which uses the amsmath align environment. I need to convert it for inclusion in a LibreOffice odt document. Due to the way LibreOffice interprets MathML as formulas, characters are rendered as upside-down question marks, indicating missing arguments.

Example source:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
hello world
\begin{align*}
    y &= {(x+1)}^2 \\
      &= x^2 + 2x + 1.
\end{align*}
\end{document}

Example output generated by pdflatex:
Image

Command for conversion from LaTeX to odt:

pandoc -f latex -o main.odt main.tex

How the converted document looks in LibreOffice Writer:
Image

LibreOffice documentation indicates this is expected behavior from their side:

Therefore, unlike #6714 or #9235, I don't think the incorrect rendering would be accepted as a valid report by them this time.

I believe pandoc should be taught about LibreOffice's newline operator and/or the {}={} trick when generating mathml for odt. I understand if this isn't made default behavior; I suggest a flag such as --libreoffice-compat or so could accommodate the other software's expectations.

Pandoc version?
3.7.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugstatus:resolved?Feedback requested: please either close the issue or describe why the solution is insufficient.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions