Bug 104194 - MathML <mspace width="2.0em"> not rendered by the equation edito
Summary: MathML <mspace width="2.0em"> not rendered by the equation edito
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: MathML
  Show dependency treegraph
 
Reported: 2016-11-27 03:34 UTC by Denis J. Navas
Modified: 2023-11-25 03:15 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Original text document with markdown markup (674 bytes, text/plain)
2016-11-27 03:34 UTC, Denis J. Navas
Details
ODT generated by Pandoc (9.56 KB, application/vnd.oasis.opendocument.text)
2016-11-27 03:42 UTC, Denis J. Navas
Details
ODT with formula spacing written by hand (21.69 KB, application/vnd.oasis.opendocument.text)
2016-11-27 03:43 UTC, Denis J. Navas
Details
docx generated by Pandoc (16.44 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-11-27 03:44 UTC, Denis J. Navas
Details
qqad space as generated by TeX (5.71 KB, application/pdf)
2018-01-29 04:11 UTC, Denis J. Navas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Denis J. Navas 2016-11-27 03:34:54 UTC
Created attachment 129040 [details]
Original text document with markdown markup

This is a bug similar but I think not equal to bug 76296 titled 'FILEOPEN: Open or import of MathML file does not write ~ or ` for the <mspace>

The case originated with a formula written with TeX sintaxis in markdown markup converted to docx and odt with Pandoc. The discussion is accesible in this link: https://groups.google.com/forum/?hl=es-419#!topic/pandoc-discuss/H7lXXLR3k90

Was reported by a user with LO 5.2.3.3. and by me with LO 5.1.5.2; consists in that MS word docx represents correctly the 2 em space between the formula and the manual number included with the formula, but LibreOffice does not. 

After some tests I found two things:

a) LibreOffice receive from Pandoc conversion to odt the following specification "<mspace width="2.0em">" within the formula's MathML but does not express it as an space at all. Don't throw errors also.

b) Recreating the formula with LibreOffice, required me to use eight (8) "~" 
to get a similar space as generated by MS. 

The space used in the formula with TeX sintax is 2 em (the width of letter 'M') using command '\qquad'.

I include four files:

a) Original markdown file (mwcado.txt).
b) MS docx file which render the space(mwcado.docx).
c) LO odt file which does not render the space (mwcado-original.odt).
d) LO odt file modified by me (mwcado-modified.odt).

Additionally, attracts my attention that the formula that I recreated includes StarMath 5.0 markup, to recreate the space but it isn't an space specified in terms of ems thats the space unit used.

Here I reproduce the content of my considerations that published in Pandoc's newsgroup:

LibreOffice does not understand '<mspace width="2.0em">', comparing the 
following MathML texts (copied from the unzipped odt).

Therefore, I must accept that LibreOffice does not correctly interpret \ qquad 
or that at least, '<mspace width="2.0em">' is an unimplemented instruction 
in LibreOffice.


## Markdown source

This is the markdown I used to produce the ecuation in question:

	For example, the \qquad in the following equation is ignored:

	$$ y = mx + b \qquad (1) $$

	Y otra ecuación sin el espacio qquad para cotejar diferencias:

	$$ y = mx + b (1) $$


## Results

This is what Pandoc produces when the ecuation has \qquad:

<?xml version='1.0' ?>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>y</mi><mo>=</mo><mi>m</mi><mi>x</mi><mo>+</mo><mi>b</mi><mspace width="2.0em"></mspace><mo stretchy="false" form="prefix">(</mo><mn>1</mn><mo stretchy="false" form="postfix">)</mo></mrow></math>

And this is what Pandoc produces without \qquad:

<?xml version='1.0' ?>
<math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mi>y</mi><mo>=</mo><mi>m</mi><mi>x</mi><mo>+</mo><mi>b</mi><mo stretchy="false" form="prefix">(</mo><mn>1</mn><mo stretchy="false" form="postfix">)</mo></mrow></math>


And this is what I got using the '~' space command with LibreOffice:

<?xml version="1.0" encoding="UTF-8"?>
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mi>y</mi><mo stretchy="false">=</mo><mi>m</mi></mrow><mrow><mi>x</mi><mo stretchy="false">+</mo><mi>b</mi></mrow><mspace width="16em"/><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><annotation encoding="StarMath 5.0">{y = m x + b ~~~~~~~~ \( 1 \)}</annotation></semantics></math>
Comment 1 Denis J. Navas 2016-11-27 03:42:59 UTC
Created attachment 129041 [details]
ODT generated by Pandoc
Comment 2 Denis J. Navas 2016-11-27 03:43:58 UTC
Created attachment 129042 [details]
ODT with formula spacing written by hand
Comment 3 Denis J. Navas 2016-11-27 03:44:53 UTC
Created attachment 129043 [details]
docx generated by Pandoc
Comment 4 Buovjaga 2016-12-01 18:32:46 UTC
(In reply to Denis J. Navas from comment #1)
> Created attachment 129041 [details]
> ODT generated by Pandoc

Confirmed.

Arch Linux 64-bit, KDE Plasma 5
Version: 5.4.0.0.alpha0+
Build ID: 368de904974b18dc5a8d237e046c0ed005f7c85d
CPU Threads: 8; OS Version: Linux 4.8; UI Render: default; VCL: kde4; Layout Engine: new; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on November 26th 2016

Arch Linux 64-bit
LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 5 Regina Henschel 2016-12-02 16:14:37 UTC
The commit https://cgit.freedesktop.org/libreoffice/core/commit/?id=074f0ab1d76f16fe92493868e2f2de75e67792ef has fixed the import of mspace as ~ and `. The .odt file looks good for me.

Viewing the formula in the docx-file is a different problem. The formula in the docx file uses the character U+2001 to generate the space.
Comment 6 QA Administrators 2017-12-03 18:57:53 UTC Comment hidden (obsolete)
Comment 7 Denis J. Navas 2018-01-28 06:05:47 UTC
Answering the mail asking to review the bug report, I regret to inform that 
THE BUG IS STILL PRESENT. The informatin of "About LibreOffice" is the following:

	Version: 5.4.4.2
	Id. de compilación: 2524958677847fb3bb44820e40380acbe820f960
	Subprocs. 2 CPU; SO: Windows 6.1; Repres. IU: predet.;
	Configuración regional: es-NI (es_NI); Calc: group
Comment 8 Denis J. Navas 2018-01-28 07:10:10 UTC
This bug was present with LO: 

    LibreOffice 3.3.4 
    OOO330m19 (Build:401)
    tag libreoffice-3.3.4.1

Tested with portable LibreOffice, without any changes in configuration except the use of java. 

Therefore I will apply: 

    4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
Comment 9 Denis J. Navas 2018-01-29 04:11:00 UTC
Created attachment 139420 [details]
qqad space as generated by TeX

I include a pdf that shows XeLaTeX output with qqad space between equation and number positioned manually, just to reafirm that the space provided by equation editor is not the adecuate.

OjO: I don't believe that this bug has been solved at 2017--01--28.
Comment 10 Denis J. Navas 2018-11-23 13:10:50 UTC
Comment on attachment 129040 [details]
Original text document with markdown markup

---
title:	Math whitespace commands and docx output
author:	Thomas J Duck on Pandoc newsgroup
date:	2016-11-25
# UPDATE the document to comply with Pandoc
# pandoc -s qquad-space.txt -o qquad-space.odt
...

NOTE: This document has been updated to comply with Pandoc 2.4; 
also to clarify that LibreOffice does not have a known way to me, 
to insert spaces in mathematical formulae. Therefore, its convertion 
from markdown to LibreOffice, is the way to show that LibreOffice does 
not implement the qquad space of LaTex mark-up. I tested again with 
LO 6.1.2.1, and the problem persist.

Hi there,

Pandoc seems to ignore math commands when the output format is docx (as viewed with LibreOffice 5.2.3.3).  For example, the `\qquad` in the following equation is ignored:

$y = mx + b \qquad (1)$

Y otra ecuación sin el espacio qquad para cotejar diferencias:

$y = mx + b (1)$

It works for LaTeX and html output.

This is a simple example: Whitespace is used for many purposes in writing equations.

Is this a bug, or am I missing something?  Is there a workaround?

Thanks,
Comment 11 QA Administrators 2019-11-24 03:36:13 UTC Comment hidden (obsolete)
Comment 12 QA Administrators 2021-11-24 04:31:13 UTC Comment hidden (obsolete)
Comment 13 QA Administrators 2023-11-25 03:15:23 UTC
Dear Denis J. Navas,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug