Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to line break in MathML?

I'm working on a website to solve some kind of exercises that has a programming function appearance, so I need to write multiple lines, but I dont know how to make it, as it displays everything in a single like, maybe some CSS would make it? Any help would be so apreciated, thanks in advance :)

like image 948
Dane411 Avatar asked Dec 17 '12 14:12

Dane411


1 Answers

To create such a linebreak, all you need is the following.

<mspace linebreak='newline' />

If you would rather provide hints to the rendering engine and let it break lines on its own, you can use the following values for the linebreak attribute:

Value       Description
nobreak     Forbid a line break at this location.
badbreak    Try to prevent a line break at this location.
goodbreak   Suggest a line break at this location.

Since linebreaks often occur at operators, MathML lets you use all of these attributes on the <mo> element, too. But, since you’re now breaking on a visible symbol, you’ll need the linebreakstyle attribute to specify whether the newline should be before the operator, after the operator, or if the operator should be duplicated and appear on both lines. Valid values are (respectively): before, after, and duplicate.

So, instead of using an <mspace/> as in the previous example, you could specify it directly on the last operator in the line:

<mo linebreak='newline' linebreakstyle='after'>+</mo>
like image 66
Aditya Parmar Avatar answered Sep 22 '22 14:09

Aditya Parmar