Wiris

Documentation

  • Demos
  • Visit our website
  • Contact us
  • MathType

    • WirisQuizzes

      • LearningLemur

        • CalcMe

          • MathPlayer

            • Store FAQ

              • VPAT for the electronic documentation

                • MathFlow

                  • BF FAQ

                    • Miscellaneous

                      • Wiris Integrations

                        • Home
                        • MathPlayer
                        • MathML 3 linebreaking and indentation examples
                        • MathML 3 linebreaking and indentation examples

                        Automatic and manual linebreaks

                        Reading time: 8min

                        In MathML 3, there is control for both manual and automatic linebreaking. For legacy reasons, manual linebreaks can be placed on mspace, but the focus of MathML 3 is line breaks that happen "at" an operator (mo). Of course, the linebreaks don't split an operator, they actually occur before the operator (so that the operator appears at the start of the next line) or after the operator (so that the operator appears at end of the current line). MathML even supports a style of linebreaking where the operator is placed at both the end of the current line and the beginning of the next line.

                        Control over manual linebreaks is done via the linebreak attribute. Although this value can be inherited, it typically would only be set on an operator to either force or prevent a linebreak at that operator. In contrast, the other linebreaking attributes (lineleading, linebreakstyle, and linebreakmultchar would often be inherited and affect both manual and automatic linebreaks.

                        Changing the linebreakstyle is demonstrated in the following two examples:

                        linebreakstyle value

                        before after

                        The MathML for these examples is shown below. There are three things to note in the MathML:

                        1. The width for linebreaking is set on the math element
                        2. The character to use (×) if an "invisible times" is the breakpoint set on the math element.
                        3. The line breaking style is set on the math element and inherited.

                        <div><tt><math xmlns='http://www.w3.org/1998/Math/MathML'<br></br> maxwidth='200px' linebreakmultchar='×' linebreakstyle='before'><br></br> <mrow><br></br> <mrow><br></br> <mo>(</mo><br></br> <mrow><br></br> <msup> <mi>x</mi> <mn>4</mn> </msup><br></br> <mo>-</mo><br></br> <mrow><br></br> <mn>4</mn><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>x</mi> <mn>3</mn> </msup><br></br> <mo>&#x2062;</mo><br></br> <mi>y</mi><br></br> </mrow><br></br> <mo>+</mo><br></br> <mrow><br></br> <mn>6</mn><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>x</mi> <mn>2</mn> </msup><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>y</mi> <mn>2</mn> </msup><br></br> </mrow><br></br> <mo>-</mo><br></br> <mrow><br></br> <mn>4</mn><br></br> <mo>&#x2062;</mo><br></br> <mi>x</mi><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>y</mi> <mn>3</mn> </msup><br></br> </mrow><br></br> <mo>+</mo><br></br> <msup> <mi>y</mi> <mn>4</mn> </msup><br></br> </mrow><br></br> <mo>)</mo><br></br> </mrow><br></br> <mo>&#x2062;</mo><br></br> <mrow><br></br> <mo>(</mo><br></br> <mrow><br></br> <msup> <mi>x</mi> <mn>4</mn> </msup><br></br> <mo>+</mo><br></br> <mrow><br></br> <mn>4</mn><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>x</mi> <mn>3</mn> </msup><br></br> <mo>&#x2062;</mo><br></br> <mi>y</mi><br></br> </mrow><br></br> <mo>+</mo><br></br> <mrow><br></br> <mn>6</mn><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>x</mi> <mn>2</mn> </msup><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>y</mi> <mn>2</mn> </msup><br></br> </mrow><br></br> <mo>+</mo><br></br> <mrow><br></br> <mn>4</mn><br></br> <mo>&#x2062;</mo><br></br> <mi>x</mi><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>y</mi> <mn>3</mn> </msup><br></br> </mrow><br></br> <mo>+</mo><br></br> <msup> <mi>y</mi> <mn>4</mn> </msup><br></br> </mrow><br></br> <mo>)</mo><br></br> </mrow><br></br> </mrow><br></br></math></tt></div>

                        The second example differs from the first only in the value of linebreakstyle. The difference is shown below:

                        <div><tt><math xmlns='http://www.w3.org/1998/Math/MathML'<br></br> maxwidth='200px' linebreakmultchar='×' linebreakstyle=<span>'after'</span>><br></br> …<br></br></math></tt></div>

                        The linebreaking in the above examples was done automatically by the renderer (for the images above, that is MathPlayer). Different renderers might break the expression differently. You can control the line breaks manually. For example, suppose you want to break the sums in the middle and avoid a linebreak at the multiplication, you do that by setting explicit linebreaks as shown below (the changes to make that happen are highlighted):

                        <div><tt><math xmlns='http://www.w3.org/1998/Math/MathML'<br></br> maxwidth='200px' linebreakmultchar='×' linebreakstyle='before'><br></br> <mrow><br></br> <mrow><br></br> <mo>(</mo><br></br> <mrow><br></br> <msup> <mi>x</mi> <mn>4</mn> </msup><br></br> <mo>-</mo><br></br> <mrow><br></br> <mn>4</mn><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>x</mi> <mn>3</mn> </msup><br></br> <mo>&#x2062;</mo><br></br> <mi>y</mi><br></br> </mrow><br></br> <mo>+</mo><br></br> <mrow><br></br> <mn>6</mn><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>x</mi> <mn>2</mn> </msup><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>y</mi> <mn>2</mn> </msup><br></br> </mrow><br></br> <mo<span>linebreak='newline'</span>>-</mo><br></br> <mrow><br></br> <mn>4</mn><br></br> <mo>&#x2062;</mo><br></br> <mi>x</mi><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>y</mi> <mn>3</mn> </msup><br></br> </mrow><br></br> <mo>+</mo><br></br> <msup> <mi>y</mi> <mn>4</mn> </msup><br></br> </mrow><br></br> <mo>)</mo><br></br> </mrow><br></br> <mo<span>linebreak='newline'</span>>&#x2062;</mo><br></br> <mrow><br></br> <mo>(</mo><br></br> <mrow><br></br> <msup> <mi>x</mi> <mn>4</mn> </msup><br></br> <mo>+</mo><br></br> <mrow><br></br> <mn>4</mn><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>x</mi> <mn>3</mn> </msup><br></br> <mo>&#x2062;</mo><br></br> <mi>y</mi><br></br> </mrow><br></br> <mo<span>linebreak='newline'</span>>+</mo><br></br> <mrow><br></br> <mn>6</mn><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>x</mi> <mn>2</mn> </msup><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>y</mi> <mn>2</mn> </msup><br></br> </mrow><br></br> <mo>+</mo><br></br> <mrow><br></br> <mn>4</mn><br></br> <mo>&#x2062;</mo><br></br> <mi>x</mi><br></br> <mo>&#x2062;</mo><br></br> <msup> <mi>y</mi> <mn>3</mn> </msup><br></br> </mrow><br></br> <mo>+</mo><br></br> <msup> <mi>y</mi> <mn>4</mn> </msup><br></br> </mrow><br></br> <mo>)</mo><br></br> </mrow><br></br> </mrow><br></br></math></tt></div>

                        Was this article helpful?

                        Give feedback about this article

                        Related Articles

                        • Linebreaking and indentation
                        • Autoformat
                        • Calculus
                        • Controlling indentation

                        Empowering STEM education

                        MathType

                        • Office Tools
                        • LMS
                        • XML
                        • HTML

                        WirisQuizzes

                        Learning Lemur

                        Integrations

                        Solutions

                        • Education
                        • Publishing houses – platforms and interactive
                        • Publishing houses – Print and digital
                        • Technical writers

                        Pricing

                        Downloads

                        Blog

                        • Success stories

                        About us

                        • Careers
                        • Partnership

                        Contact Us

                        Contact Sales

                        European union (European Regional Development Fund) and 1EdTech (TrustEd Apps Certified)
                        • Cookie Policy
                        • Terms of Use
                        • Privacy Policy / GDPR
                        • Student Data Privacy
                        • Compliance
                        • Cookie Settings

                        © Wiris 2026

                        Expand