MathML: How to insert line breaks?

Questions about XML that are not covered by the other forums should go here.
Frank Ralf
Posts: 412
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

MathML: How to insert line breaks?

Post by Frank Ralf » Thu Apr 26, 2018 3:04 pm

Hi,

I've tried both recommended methods to insert a line break in MathML but this is neither rendered in oXygen 16.1 nor in the PDF output when including the MathML in a DITA document.

Code: Select all

<mspace linebreak='newline' />

<mo linebreak='newline' linebreakstyle='after'>+</mo>
Am I missing something?

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

Radu
Posts: 7145
Joined: Fri Jul 09, 2004 5:18 pm

Re: MathML: How to insert line breaks?

Post by Radu » Thu Apr 26, 2018 4:16 pm

Hi Frank,

Line breaks seem to be a feature added in MathML 3.0 and the Apache JEuclid library used by default by Oxygen to render MathML equations in the Author mode and when producing the PDF does not have support for MathML 3.0:

http://jeuclid.sourceforge.net/faq.html

Oxygen also has support for installing a commercial MathFlow editor to be used for editing and rendering in the Author editing mode:
https://www.oxygenxml.com/doc/versions/ ... odes2.html

and possibly Mathflow could also be used somehow to convert the Mathml equation to an SVG in order to include it in a PDF. But I do not know if Mathflow supports this type of line breaks in equations, they would need to be contacted and asked further.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Frank Ralf
Posts: 412
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: MathML: How to insert line breaks?

Post by Frank Ralf » Thu Apr 26, 2018 5:45 pm

Hi Radu,

Many thanks for your quick reply. Actually, <mspace linebreak='newline' /> should also work with MathML 2.0. However, most rendering engines don't seem to support line breaking (yet), for example Firefox. But according to http://jeuclid.sourceforge.net/jeuclid- ... break3.xml, jeuclid renders line breaks correctly.

MathFlow provides some useful information about MathML 3 Linebreaking and Indentation Examples.

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

Frank Ralf
Posts: 412
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: MathML: How to insert line breaks?

Post by Frank Ralf » Thu Apr 26, 2018 6:46 pm

Regarding JEuclid, the strange thing is that line breaks do render in the MathML 2.0 test suite but not in the MathML 3.0 test suite.
Frank Ralf
parson AG
www.parson-europe.com

Radu
Posts: 7145
Joined: Fri Jul 09, 2004 5:18 pm

Re: MathML: How to insert line breaks?

Post by Radu » Mon Apr 30, 2018 11:31 am

Hi Frank,

JEuclid also distributes a MathViewer based on its own libraries. Here's the Windows version for it:

https://sourceforge.net/projects/jeucli ... p/download

and neither of the samples from their test suite seems to generate a line break when using it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Frank Ralf
Posts: 412
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: MathML: How to insert line breaks?

Post by Frank Ralf » Wed May 23, 2018 4:47 pm

Hi Radu,

Many thanks for this pointer and testing.

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

chrispitude
Posts: 245
Joined: Thu May 02, 2019 2:32 pm

Re: MathML: How to insert line breaks?

Post by chrispitude » Mon Sep 21, 2020 9:51 pm

Hmmm, I need a solution to this too! We have multi-line equations in our books that are not breaking in the PDF Chemistry output using any of the methods I've tried.

chrispitude
Posts: 245
Joined: Thu May 02, 2019 2:32 pm

Re: MathML: How to insert line breaks?

Post by chrispitude » Tue Sep 22, 2020 6:49 pm

Some additional data - the LibreOffice Math open-source equation editor does not understand the <mspace linebreak='newline' /> element, but the MathFlow commercial equation editor does (including creating multi-line equations).

julien_lacour
Posts: 116
Joined: Wed Oct 16, 2019 3:47 pm

Re: MathML: How to insert line breaks?

Post by julien_lacour » Fri Sep 25, 2020 12:51 pm

Hello,

I have logged an issue in our tracking system, I will let you know as soon as a fix will be available.
At the moment, the only solution is to split the equation in multiple blocks using <equation-block> elements.

Regards,
Julien

chrispitude
Posts: 245
Joined: Thu May 02, 2019 2:32 pm

Re: MathML: How to insert line breaks?

Post by chrispitude » Thu Oct 08, 2020 11:45 pm

MathJax 2.x renders the linebreak but MathJax 3.x does not. I added a comment here:

https://github.com/mathjax/MathJax/issues/2495

chrispitude
Posts: 245
Joined: Thu May 02, 2019 2:32 pm

Re: MathML: How to insert line breaks?

Post by chrispitude » Mon Oct 12, 2020 2:51 am

chrispitude wrote:
Thu Oct 08, 2020 11:45 pm
MathJax 2.x renders the linebreak but MathJax 3.x does not. I added a comment here:

https://github.com/mathjax/MathJax/issues/2495
Here's the reply to my comment in the MathJax issue discussion:
It is scheduled for second-quarter next year.

julien_lacour
Posts: 116
Joined: Wed Oct 16, 2019 3:47 pm

Re: MathML: How to insert line breaks?

Post by julien_lacour » Mon Oct 12, 2020 3:43 pm

Hello Chris,

At the moment Oxygen PDF Chemistry does not include MathJax library.
I will let you know if in the future, we integrate MathJax as MathML rendering tool.

Regards,
Julien

Post Reply