MathML: How to insert line breaks?

Questions about XML that are not covered by the other forums should go here.
Frank Ralf
Posts: 392
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: 6579
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: 392
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: 392
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: 6579
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: 392
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

Post Reply