Bug 116547 - Filesave DOCX: Export of mathematical formula of sum displayed differently in Word (LO not outputting m:oMathPara?)
Summary: Filesave DOCX: Export of mathematical formula of sum displayed differently in...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: implementationError
Depends on:
Blocks: DOCX-Corrupted
  Show dependency treegraph
 
Reported: 2018-03-21 17:44 UTC by Alex Thurgood
Modified: 2023-06-08 08:52 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Test Writer document with formulae (14.78 KB, application/vnd.oasis.opendocument.text)
2018-03-21 17:45 UTC, Alex Thurgood
Details
Test docx export of Writer document containing formulae (4.61 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-03-21 17:46 UTC, Alex Thurgood
Details
DOCX exported with 3.5.0 (oldest of 43all repo) (3.86 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-06-27 17:59 UTC, Buovjaga
Details
How testformuladisplay.docx is displayed in LibreOffice 6.2 (31.53 KB, image/png)
2018-07-01 15:11 UTC, himajin100000
Details
How testformuladisplay35.docx is displayed in LibreOffice 6.2 (25.05 KB, image/png)
2018-07-01 15:12 UTC, himajin100000
Details
How testformuladisplay.docx is displayed in Word 2016 (42.04 KB, image/png)
2018-07-01 15:13 UTC, himajin100000
Details
How testformuladisplay35.docx is displayed in Word 2016 (40.39 KB, image/png)
2018-07-01 15:14 UTC, himajin100000
Details
Display (3.82 KB, text/xml)
2018-08-19 08:54 UTC, himajin100000
Details
Inline (3.83 KB, text/xml)
2018-08-19 08:54 UTC, himajin100000
Details
screenshots which show described bug (52.50 KB, application/msword)
2020-03-06 10:23 UTC, libreoffice
Details
Original docx file with MathType formulas (21.03 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-03-06 10:24 UTC, libreoffice
Details
Docx file edited with LibreOffice on Linux (18.26 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-03-06 10:25 UTC, libreoffice
Details
Test compared in LO and MSO (165.46 KB, image/png)
2021-06-08 09:50 UTC, Timur
Details
bug filesave docx (194.53 KB, image/jpeg)
2023-06-08 08:46 UTC, Sophie Sipasseuth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Thurgood 2018-03-21 17:44:57 UTC
Description:
I had to create a series of mathematical formulae for a translation in a Writer document (ODT) and then save the document as DOCX to pass on to a client.

When I opened the DOCX document in Word, I was surprised and understandably rather annoyed to discover that the equations were no longer displayed as they appeared in Writer.

I am enclosing a sample of the formulae as entered in Writer and as exported to DOCX along with screenshots.

Steps to Reproduce:
1. Open the Writer document containing the formulae and sample text.
2. Save as DOCX.
3. Open in Word and compare the difference between the Writer document display and the Word document display. Note how the lower limit of the sum symbol has been displaced to right hand side of the sum symbol.

Actual Results:  
Incorrect display of the equation when exported to docx.

Expected Results:
Identical display of the formulae both in Writer and Word.


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:59.0) Gecko/20100101 Firefox/59.0
Comment 1 Alex Thurgood 2018-03-21 17:45:54 UTC
Created attachment 140796 [details]
Test Writer document with formulae
Comment 2 Alex Thurgood 2018-03-21 17:46:32 UTC Comment hidden (obsolete)
Comment 3 Jacques Guilleron 2018-03-22 16:03:00 UTC
Hi Alex,

I reproduce too with
LO 6.0.2.1 Build ID: f7f06a8f319e4b62f9bc5095aa112a65d2f3ac89
Threads CPU : 2; OS : Windows 6.1; UI Render : par défaut; 
Locale : fr-FR (fr_FR); Calc: CL
There is a better renderer with a .doc format.
Comment 4 Alex Thurgood 2018-03-27 14:10:12 UTC Comment hidden (obsolete)
Comment 5 Alex Thurgood 2018-05-29 08:08:20 UTC Comment hidden (obsolete)
Comment 6 Buovjaga 2018-06-27 17:59:33 UTC
Created attachment 143172 [details]
DOCX exported with 3.5.0 (oldest of 43all repo)

Alex: can you open this in Word? If it shows the problem, bibisectRequest can be changed to preBibisect.
Comment 7 himajin100000 2018-07-01 15:11:56 UTC Comment hidden (obsolete)
Comment 8 himajin100000 2018-07-01 15:12:48 UTC Comment hidden (obsolete)
Comment 9 himajin100000 2018-07-01 15:13:33 UTC Comment hidden (obsolete)
Comment 10 himajin100000 2018-07-01 15:14:27 UTC Comment hidden (obsolete)
Comment 11 himajin100000 2018-07-01 16:48:58 UTC
um, can you make the same equation if you create it from scratch entirely on Word 2016?

Steps A(for comparison)
a-1. Open Word 2016
a-2. Click Insert tab
a-3. Click Equation in Symbols group
a-4. Click "Large Operator"
a-5. Click the icon with "Summation with Lower limit" tooltip
a-6. Take a look at the equation. entry area for the lower limit is correctly placed under the Σ sign

Steps B
b-1. Open Word 2016
b-2. Click Insert tab
b-3. Click Equation in Symbols group
b-4. Click "Fraction"
b-5. Click the icon with "Stacked Fraction" tooltip
b-6. Click the numerator entry area in the equation.
b-7. Click "Large Operator"
b-8. Click the icon with "Summation with Lower limit" tooltip
b-9. Take a look at the equation. entry area for the lower limit is NOT placed under the Σ sign but is placed like subscript, and this is consistent with the attached image "How testformuladisplay.docx is displayed in Word 2016"

so, I'm guessing this as NOTABUG
Comment 12 himajin100000 2018-07-01 17:00:32 UTC
Additional note:

Microsoft introduced new Equation editor in Office 2007 I guess, throwing away legacy MathType ones.

If I load the attached docx, save the file in doc format, and load in Word 2016, the lower limit is placed under the Σ sign, probably because MathType supports such placement.

(In reply to Alex Thurgood from comment #4)
> Export to Word 97/2000 format with OpenOffice321 shows a correctly displayed
> formula when opened in a current version of Word.

I think "Export to Word 97/2000" is different from "Export to docx", and I don't think the mechanism worked in the past version of Libreoffice. so, not a regression.
Comment 13 Alex Thurgood 2018-07-10 08:26:24 UTC
(In reply to Buovjaga from comment #6)
> Created attachment 143172 [details]
> DOCX exported with 3.5.0 (oldest of 43all repo)
> 
> Alex: can you open this in Word? If it shows the problem, bibisectRequest
> can be changed to preBibisect.


I can open it in Word 2016, but there is no summation symbol displayed at all, so I'm not sure I understand the value of this test document.
Comment 14 Alex Thurgood 2018-07-10 08:32:06 UTC
Hmm, if I've understood the MS volunteer moderator's response here:

https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_other-mso_2007/summation-symbol-wont-stay-as-written/dd29ed58-fdda-48fe-86d0-63fae0776a8c

It would seem like this is/was a known problem with Microsoft's fantastic new equation engine.
Comment 15 Alex Thurgood 2018-07-10 08:33:28 UTC Comment hidden (obsolete)
Comment 16 Alex Thurgood 2018-07-10 08:33:49 UTC Comment hidden (obsolete)
Comment 17 Alex Thurgood 2018-07-10 08:45:17 UTC
I would add that the exported docx file provided by LO always seems to code the equation as "inline" when surrounded by other text characters on the same line. In theory, it should be possible to use "Professional" from the dropdown display tool in Word 2016 to allow the formula to be displayed correctly, however, this action does nothing with the docx file created by LO.


See this thread for information on how it is supposed to work:

https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_win10-mso_2016/sum-in-math-equation-editor/edb9e93d-e445-44a5-bb12-632e964c10ca
Comment 18 Alex Thurgood 2018-07-10 08:54:17 UTC
Switching between Inline and Display mode in Word 2016 also changes nothing with regard to the exported formulae. They remain unchanged irrespective of the entry chosen.

Why is LO exporting these formulae as Inline and unmodifiable ? Is there some attribute missing in the exported XML ?
Comment 19 Alex Thurgood 2018-07-10 08:56:12 UTC Comment hidden (no-value)
Comment 20 himajin100000 2018-08-19 08:54:29 UTC
Created attachment 144278 [details]
Display
Comment 21 himajin100000 2018-08-19 08:54:55 UTC
Created attachment 144279 [details]
Inline
Comment 22 himajin100000 2018-08-19 08:58:26 UTC
>Why is LO exporting these formulae as Inline
>Is there some attribute missing in the exported XML ?

probably because LibreOffice is not outputting m:oMathPara element.
see the attachments "Display" and "Inline". These are the files extracted from docx files from Word 2016

https://opengrok.libreoffice.org/xref/core/starmath/source/ooxmlexport.cxx?r=b5867945#33
Comment 23 QA Administrators 2019-09-02 09:23:23 UTC Comment hidden (obsolete)
Comment 24 Alex Thurgood 2019-09-04 10:45:24 UTC Comment hidden (obsolete)
Comment 25 libreoffice 2020-03-06 10:11:04 UTC Comment hidden (off-topic)
Comment 26 Buovjaga 2020-03-06 10:20:37 UTC Comment hidden (off-topic)
Comment 27 libreoffice 2020-03-06 10:23:05 UTC Comment hidden (off-topic)
Comment 28 libreoffice 2020-03-06 10:24:29 UTC Comment hidden (off-topic)
Comment 29 libreoffice 2020-03-06 10:25:12 UTC Comment hidden (off-topic)
Comment 30 libreoffice 2020-03-06 10:27:25 UTC Comment hidden (off-topic)
Comment 31 libreoffice 2020-03-06 10:40:12 UTC Comment hidden (off-topic)
Comment 32 Timur 2021-06-08 09:50:56 UTC
Created attachment 172698 [details]
Test compared in LO and MSO

Repro 7.2+. As seen, shown OK when reopen in LO and not fully correct in MSO.
DOC is OK. Not a regression, but incomplete implementation in 3.5
Comment 33 Sophie Sipasseuth 2023-06-08 08:46:14 UTC
Created attachment 187778 [details]
bug filesave docx

When I open the first document in Writer (with the formulas math), save it in Docx, and try to open this new file in Word, Word cannot open it.

Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: f97a7b965be154824e108802b386e3132b0a237a
CPU threads: 4; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded
Comment 34 Sophie Sipasseuth 2023-06-08 08:50:40 UTC
I finally succeeded to do it.
With Word 2007 option to save rather than Word 2010-365 document option to save.
Comment 35 Sophie Sipasseuth 2023-06-08 08:52:38 UTC
And there is still a difference between Writer and Word, in the formulas math presentation.