The tag elements used in MathML allow the MathML processor to display the different mathematical items properly. Also, they allow a mathmatical expression parcer to properly process the different items. But what if you just want to add some general text to an expression? One place text would be used in a mathmatical expression is in a conditional statement.
The mtext element is used to display plain text. Shown below is an example of a conditional statement.
<math> <mrow> <mtext>if</mtext><mspace width="0.5ex"/> <mi>n</mi><mspace width="0.5ex"/> <mtext>is a positive integer</mtext> <mspace linebreak='newline'/> <mtext>then</mtext><mspace width="0.5ex"/> <mo>(</mo> <msup> <mi>n</mi> <mn>2</mn> </msup> <mo>-</mo> <mi>n</mi> <mo>+</mo> <mn>41</mn> <mo>)</mo><mspace width="0.5ex"/> <mtext>is a prime number</mtext> </mrow> </math>
When using the mtext element, it is common to need to add some space before and after the text. Note the use of the mspace element in the code. Each mspace element has a with attribute that specifies how much space to put. The unit that I used for this is the ex unit. The ex unit is the height of a lowercase letter.
By the way, in the conditional statement shownabove, in the case where n=41 the statement is false, so the statement is false.
<math> <mi>x</mi> <munder> <mo>→</mo> <mtext>maps to</mtext> </munder> <mi>y</mi> </math>
The example below shows how to use the munder element and mtext to place text under a symbol. → is hex character code for a right arrow. Note how the mo stretched horizontally to cover the size of the text.
Shown below are the character codes for some other arrow symbols.
Symbol | Meaning | Character Code |
→ | Right Arrow | → |
← | Left Arrow | ← |
↔ | Double Arrow | ↔ |
More Graphics Design Tips:
• How to Create a Product Box in Photoshop
• MathML Elements to Display Subscripts and Superscripts
• Inkscape Exercise: Draw Photorealistic Sphere
• Inscape Text in a Shape
• Create GIF Animations With Free GIMP Image Editing Program
• The Blender Gamekit
• SVG Example Code to Scale Elements
• Graphics File Formats for Your Web Page
• Getting Started with Krita
• MathML Element to Display a Radical