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 elementary math examples
                        • MathML 3 elementary math examples

                        Addition, subtraction, and multiplication problems

                        Reading time: 1min

                        Here's a simple addition problem that spaces the "+" away from the operand by using the element none:

                        <mstack> <mn>496</mn> <msrow> <mo>+</mo> <none/> <mn>28</mn> </msrow> <msline/> </mstack>

                        Here's a more complicated subtraction problem that shows carries and borrows and crossouts:

                        <mstack> <mscarries location="nw"> <none/> <mscarry crossout="updiagonalstrike" location="n"> <mn>2</mn> </mscarry> <mn>1</mn> <none/> </mscarries> <mn>2,327</mn> <msrow> <mo>-</mo> <mn> 1,156</mn> </msrow> <msline/> <mn>1,171</mn> </mstack>

                        Notice that the carry/borrow default of "n" (north/above) is changed to the "nw" (northwest) position by mscarries, but that is overridden for the borrow and changed back to "n". The carry/borrow can be in any compass position. Several different styles for crossouts are possible.

                        Here's a multiplication problem that shows multiple rows of carries:

                        <mstack charspacing="loose"> <mscarries position="1"> <mn>1</mn> </mscarries> <mscarries position="1"> <mn>1</mn> <mn>3</mn> </mscarries> <mn>435</mn> <msrow> <mo>&#xD7;</mo> <none/> <mn>25</mn> </msrow> <msline/> <mscarries position="2"> <mn>1</mn> </mscarries> <mn>2185</mn> <msrow position="1"><mn>874</mn></msrow> <msline/> <mn>10925</mn> </mstack>

                        There are a few things to note about this example:

                        • We specified loose spacing between the characters on the mstack tag; absolute values such as "10px" can also be given.
                        • The carries are shifted over; we could also have used an msrow and none, but specifying a position is simpler.
                        • The '874' uses msrow to shift the number over one column, but a "0" could have been added and this would not have been needed; alternatively, msgroup with shift="1" could have been used, similar to what is done in the long division problem in our next example.

                        Was this article helpful?

                        Give feedback about this article

                        Related Articles

                        • Arithmetic
                        • The four basic operations
                        • Examples
                        • MathML makes elementary math accessible

                        Making people’s STEM work more meaningful

                        MathType

                        • MathType for Office Tools
                        • MathType for Mac
                        • MathType for Microsoft 365
                        • MathType for Google Workspace
                        • MathType for LMS
                        • MathType for XML Editors
                        • Arabic notation
                        • Our products accessibility
                        • MathType is online

                        WirisQuizzes

                        Learning Lemur

                        Solutions for Education

                        • Blackboard Learn
                        • Brightspace by D2L
                        • Canvas
                        • Google Classroom
                        • Moodle
                        • Schoology

                        Solutions for Publishing Houses

                        Solutions for Technical Writers

                        Solutions for Chemistry

                        Integrations

                        • HTML Editors
                        • MathType in WordPress

                        Pricing

                        Company

                        Careers

                        Blog

                        Contact Us

                        Buy Now

                        Plugin Downloads

                        © Wiris 2025

                        • Cookie Settings
                        • Cookie Policy
                        • Terms of Use
                        • Privacy Policy / GDPR
                        • Student Data Privacy
                        • Compliance
                        • Powered by Helpjuice
                        Expand