XML-Technologien / MathML / Presentation markup / Token elements / 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.

   

 

 

 

 

nach oben