The “mtext” element plays similar role of rendering characters like “mo” amd “mn” elements, but with a difference. It does not convey the notional or symbolic aspect of mathematical identities and numbers, which require specific presentation and manipulation to convey mathematical meaning. The “mtext” element is used to present plain text, which may be used for comments and clarification.
This element is also useful to deliver white space and mixing verbose mathematical rendering consisting of word string. For example, we would need to say “The presentation of alpha character in MathML looks like : α”.
<m:math display="block">
<m:mtext>The presentation of alpha character in
MathML is : </m:mtext>
<m:mi>α</m:mi>
</m:math>
Save the file after editing as “test4.xml”. The display looks like :
Though “mtext” element manages the empty space within the string of words, but not around it. In order to enhance, readability, style and presentation, we may add empty space, using "&ThinSpace" entity character.
<m:math display="block">
<m:mtext>The presentation of alpha character in MathML
is :   </m:mtext>
<m:mi>α</m:mi>
</m:math>
Save the file after editing as “test4.xml”. The display looks like :
Color and size management of the content of “mtext” element is implemented with the common attributes of the token element i.e. mathvariant, mathsize, mathcolor and mathbackground directly on "mtext" element.
<m:math display="block">
<m:mtext mathvariant='bold' mathcolor='#fff' mathsize='12pt'
mathbackground='#f55'>
Example : </m:mtext>
<m:mtext mathsize='10pt'> The above example illustrates
application of “mfrac” element. </m:mtext>
</m:math>
Save the file after editing as “test.xml”. The display looks like :
In general, mixing of text with mathematics may be implemented, using any of the three possibilities discussed here. First, we can rely on the rendering facility of the document in which “MathML” is embedded. This document could be any valid “xml” document, including HTML. Second, we may use the text rendering by “mtext” element as explained above. This is appropriate for text, which is neither the part of the general text flow in the document nor the part of the notional display of mathematical expression. It suits the requirement of text rendering, used for qualifying mathematical expression or comments. Third, displaying text with “mi” element, which is inline with the mathematical expression or a part of it.
This element is provided to render a blank space of any size, which can be controlled with the help of attribute values. It is a more flexible mechanism in comparison to the space rendering characters like " ", "&emsp", "&emsp14".
The “mspace” element has three attributes to control the size of the blank space (width, height and depth). Significantly, its default values are set such that its rendering does not affect normal presentation. It means that if we want to affect the layout, we would have to assign attribute values for the size. Size attribute accept numbers in variety of ways, using different units.
The “linebreak” attribute, on the other hand, suggests different line breaking options for the renderer to implement.
Consider the example given here,
<m:math display="block">
<m:mfrac>
<m:mrow>
<m:mi>a</m:mi>
<m:mspace width="0.5in"/>
<m:mi>b</m:mi>
</m:mrow>
<m:mrow>
<m:mi>c</m:mi>
<m:mspace height="1.27cm"/>
<m:mi>d</m:mi>
</m:mrow>
</m:mfrac>
</m:math>
Save the file after editing as “test.xml”. The display looks like :
Besides, there is an important issue with regard to uses of “mspace” and also other elements, which introduce space on rendering. Space rendering has no visual lymphs or character display, but despite this, space rendering elements are counted as far as counting of arguments are concerned. The element “mfrac”, which is used to display ratio, takes only two arguments – one of which forms the numerator and other forms the denominator of the ratio. In the example below, we simply introduce “mspace” between the “mfrac” tags. The MathML parser (renderer) counts “mspace” and as such fails to implement code as there are three arguments as against the requirement of exactly two arguments for “mfrac” element. As expected, the browser notifies that the code is "invalid-markup".
<m:math display="block">
<m:mfrac>
<m:mi>a</m:mi>
<m:mspace height="0.5in"/>
<m:mi>b</m:mi>
</m:mfrac>
</m:math>
Save the file after editing as “test.xml”. The display looks like :
Thus, in order to meet the requirement of elements with fixed arguments, we would have to group child elements with the help of “mrow” element.
<m:mfrac>
<m:mi>a</m:mi>
<m:mrow>
<m:mspace height="0.5in"/>
<m:mi>b</m:mi>
</m:mrow>
</m:mfrac>
This is also a character rendering element, but with a double quote around. This is provided for interpretation of MathML data by other programs and may not be very useful for the authors or for the requirements limited to diplay.
By default, both the left and right quote characters are standard double quote character ,". We can change the surrounding characters with the lquote and rquote attributes respectively.
Let us now work with the example given here to view the output for few cases.
<m:math display="block">
<m:mrow>
<m:ms>A</m:ms>
<m:mo>+</m:mo>
<m:ms lquote='|' rquote='|'>A</m:ms>
<m:mo>+</m:mo>
<m:ms>&</m:ms>
<m:mo>+</m:mo>
<m:ms>Hello, I have come to meet you.</m:ms>
<m:mo>+</m:mo>
<m:ms>ⅆ</m:ms>
<m:mo>+</m:mo>
<m:ms lquote='a' rquote='b'>∫</m:ms>
</m:mrow>
</m:math>
Save the file after editing as “test4.xml”. The display looks like :
The "mglyph" element is intended for creating new character in addition to what is available with Unicode character set. With the expanding horizon of mathematics, it is possible that a character with new "glyph" is required to represent new mathematical idea or concept. On the working level, the "mglmph" element draws on the existing Unicode character or some "font style", which must be supported by the renderer. For our course, though, we feel that this topic may not be very useful. As such, this element is not discussed in any more detail here.