Created attachment 166060 [details] sample ODT file Creating a ODT document that contains this formula ... <?xml version='1.0' ?> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msubsup><mo>∫</mo><mn>1</mn><mn>2</mn></msubsup><mfrac><mn>3</mn><mn>4</mn></mfrac><mo>=</mo><mn>5</mn></mrow></math> ... the representation in LibreOffice is faulty. The formula visible is (written in the syntax as visible in LibreOffice) ... { int_1^2 3 over 4 = 5} ... where it should be ... { int_1^2 {3 over 4} = 5} Additional detail: I created the ODT file using PanDoc, converting this LaTeX-Document into ODT: %!TEX TS-program = xelatex %!TEX encoding = UTF-8 Unicode \documentclass[12pt]{article} \usepackage[german]{babel} \usepackage{a4} \begin{document} \[ \int_1^2 \frac{3}{4} = 5 \] \end{document}
Created attachment 166483 [details] Faulty display of formula
Created attachment 166484 [details] Correct display of formula
When opening the attached ODT file in LibreOffice 7.1.0.2 the formula looks like shown in attachment "Faulty Display of formula" (whatItIsLike.png) while it should look like shown in attachment "Correct display of formula" (whatItShouldBeLike.png) The faulty display reads like this in LibreOffice: { int_1^2 3 over 4 = 5} A correct display would read like this: { int_1^2 {3 over 4} = 5}
I am not actually sure.. The LaTeX code is suboptimal to begin with. \[ \int_1^2 \frac{3}{4} = 5 \] works by chance since it's one command and because it's an integral and one doesn't see the difference if the text is not covered by _int. Add a real big \frac or whatever and you'll see the \int will not adapt to that size because that "big thing" is not part of the \int. a \[ \sqrt \frac{1}{4} = \frac{1}{2} \] would also "work", unless you add more stuff after the fraction. You'll see that the root only covers the \frac. Strictly speaking, \[ \int_1^2 {\frac{3}{4}} = 5 \] would have been correct in LaTeX even. Your faulty display then shows that this abiguity is then followed wrong. I would assume that if you did {} the integral you would get the correct result with bracketed { 3 over 4 }?
It seems the LaTeX caused confusion instead of doing any good. Sorry for that. You may be right that the LaTeX might not be optimal. But what if you look at the ODT file (this file might be generated with any tool, no need for LaTeX at all) I read: <msubsup>...</msubsup><mfrac>...</mfrac>... I cannot see how the msubsup-section should be part of the mfrac. To me this clearly reads that i have the integral (msubsup) and then the fraction (mfrac), not the integral as part of the fraction
Also, i just checked with the LaTeX: both \[ \int_1^2 \frac{3}{4} = 5 \] and \[ \int_1^2 {\frac{3}{4}} = 5 \] look identical in LaTeX (corresponds to whatItShouldLookLike.png) and when converted to ODT via PanDoc produce the exact same result <?xml version='1.0' ?> <math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><msubsup><mo>∫</mo><mn>1</mn><mn>2</mn></msubsup><mfrac><mn>3</mn><mn>4</mn></mfrac><mo>=</mo><mn>5</mn></mrow></math> However ... as already mentioned i don't believe looking at LaTeX is necessary here (sorry again for the confusion), just look at the ODT file and see what LibreOffice shows.
{} the integral in LaTeX does not help either, this also yields the same result: \[ {\int_1^2} {\frac{3}{4}} = 5 \]
Gonna see if I can create the frac command, since it seems is not the over command what should be used.
"since it seems is not the over command what should be used." Are we talkig LaTeX here? Please note again, that the whole LaTeX-thing was just provided as additional info. My point is: look at the attached ODT-file, containing an mfrac-expression in MathML ... and look at what LibreOffice makes of it. In doubt please ignore the whole LaTeX-stuff, this was just to provide additional info in case someone would like to know how exactly i created the ODT.
(In reply to kleinesuniversum from comment #9) > "since it seems is not the over command what should be used." > > Are we talkig LaTeX here? Please note again, that the whole LaTeX-thing was > just provided as additional info. > > My point is: look at the attached ODT-file, containing an mfrac-expression > in MathML ... and look at what LibreOffice makes of it. In doubt please > ignore the whole LaTeX-stuff, this was just to provide additional info in > case someone would like to know how exactly i created the ODT. I do get it. When you use over command will take previous token and token after. If before there is something with product priority or superior, the tokens will be made in read order, so they would go in pack and be "misplaced". It's similar to latex "a { 1 \over 2 } b" wich is different from latex "a 1 \over 2 b". That's why a \frac command is needed to solve the mathml mistake, and also improve math usability.
This should solve it. https://gerrit.libreoffice.org/c/core/+/105255/3
dante committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d3abe0a1fb2f2b546b164280c5562443dc1f4300 Added frac command. Sould solve tdf#137234. It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
For commenters here: you may test yourself with LO 7.1+ master from https://dev-builds.libreoffice.org/daily/master/current.html and (after some days) for Linux also from 1-file https://libreoffice.soluzioniopen.com/daily-version/.