Text

(Excerpt from "The MathML Handbook" by Pavi Sandhu)

The mtext element is used to represent ordinary text that appears inside a mathematical expression. This element is useful for mixing text and mathematical notation, as in the following example:

Theorem 1: If x > 0 and y > 0, then xy > 0

<mrow>
  <mtext>Theorem 1:If</mtext>
  <mi>x</mi>
  <mo>&gt;</mo>
  <mn>0</mn>
  <mtext>and</mtext>
  <mi>y</mi>
  <mo>&gt;</mo>
  <mn>0</mn>
  <mtext>then</mtext>
  <mi>,</mi>
  <mi>x</mi>
  <mo>&InvisibleTimes;</mo>
  <mi>y</mi>
  <mo>&gt;</mo>
  <mn>0</mn>
</mrow>

Another common use of mtext elements is for including literal whitespace, since MathML automatically removes whitespace that is included directly. You can include whitespace of varying widths using the named character entities such as &VeryThinSpace;, &ThinSpace;, &MediumSpace;, or &ThickSpace;, as shown here:

<mtext>&ThinSpace;</mtext>

Alternatively, you can insert whitespace of arbitrary width, height, and depth, using the mspace element, as discussed on the next page.

   

<< back next >>

 

 

 


 

Copyright © CHARLES RIVER MEDIA, INC., Massachusetts (USA) 2003
Printing of the online version is permitted exclusively for private use. Otherwise this chapter from the book "The MathML Handbook" is subject to the same provisions as those applicable for the hardcover edition: The work including all its components is protected by copyright. All rights reserved, including reproduction, translation, microfilming as well as storage and processing in electronic systems.


CHARLES RIVER MEDIA, INC., 20 Downer Avenue, Suite 3, Hingham, Massachusetts 02043, United States of America