Page 1 of 1

MathML: How to insert line breaks?

Posted: Thu Apr 26, 2018 3:04 pm
by Frank Ralf
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

Re: MathML: How to insert line breaks?

Posted: Thu Apr 26, 2018 4:16 pm
by Radu
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

Re: MathML: How to insert line breaks?

Posted: Thu Apr 26, 2018 5:45 pm
by Frank Ralf
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

Re: MathML: How to insert line breaks?

Posted: Thu Apr 26, 2018 6:46 pm
by Frank Ralf
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.

Re: MathML: How to insert line breaks?

Posted: Mon Apr 30, 2018 11:31 am
by Radu
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

Re: MathML: How to insert line breaks?

Posted: Wed May 23, 2018 4:47 pm
by Frank Ralf
Hi Radu,

Many thanks for this pointer and testing.

Best regards,
Frank

Re: MathML: How to insert line breaks?

Posted: Mon Sep 21, 2020 9:51 pm
by chrispitude
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.

Re: MathML: How to insert line breaks?

Posted: Tue Sep 22, 2020 6:49 pm
by chrispitude
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).

Re: MathML: How to insert line breaks?

Posted: Fri Sep 25, 2020 12:51 pm
by julien_lacour
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

Re: MathML: How to insert line breaks?

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

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

Re: MathML: How to insert line breaks?

Posted: Mon Oct 12, 2020 2:51 am
by chrispitude
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.

Re: MathML: How to insert line breaks?

Posted: Mon Oct 12, 2020 3:43 pm
by julien_lacour
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