<< Chapter < Page Chapter >> Page >

The elements, which implements inferred “mrow” are : “msqrt”, “mstyle”, “merror”, “menclose”, “mpadded”, “mphantom”, “mtd”, and “math”. Important to note here is the inclusion of top level “math” element in the list. It means that putting “mrow” tag just after “math” element is actually redundant.

If we look closely at the elements, which implement inferred “mrow”, then we observe that all these elements require to treat everything inside it as a single unit. This is the reason that they would otherwise require a pair of “mrow” tags to combine all child elements as one group. It is, therefore, good thinking on the part of MathML developers to enforce “mrow” inexplicitly and save on coding and avoid cluttering with “mrow” tags.

”mfrac” layout element

Specific attributes :   linethickness numalign denomalign bevelled symmetric

The “mfrac” element renders fraction in p q form. The element requires two arguments to implement the fraction. The first argument is numerator, while the second is denominator of the fraction. The syntax of the element is as given below :

<mfrac> numerator denominator </mfrac>

The “mfrac” element is an extremely flexible element to produce very complicated fraction, in which numerator or denominator may themselves be a fraction. Such implementation is affected by nested “mfrac” as shown in the example here.

Nested "mfrac" display

<m:math display="block"> <m:mi> x </m:mi> <m:mo> = </m:mo> <m:mfrac> <m:mrow> <m:mn> 1 </m:mn> <m:mo> + </m:mo> <m:mfrac> <m:mn> 3 </m:mn> <m:mn> 10 </m:mn> </m:mfrac> </m:mrow> <m:mrow> <m:mfrac> <m:mn> 2 </m:mn> <m:mn> 7 </m:mn> </m:mfrac> <m:mo> + </m:mo> <m:mfrac> <m:mn> 12 </m:mn> <m:mn> 5 </m:mn> </m:mfrac> </m:mrow> </m:mfrac> </m:math>

Save the file after editing as “test.xml”. The display looks like :

x = 1 + 3 10 2 7 + 12 5

In the example, the numerator of the outermost “mfrac” element contains expression consisting of another “mfrac” element, while the denominator consists of two “mfrac” elements. Also note the use of “mrow” element to ensure that a “mfrac” elements takes exactly two arguments.

Changing bar thickness

    Attribute value types

  • linethickness (default = 1) : number | thin | medium | thick

The fraction is displayed with a fraction bar or rule, separating numerator and denominator. Appearance of this bar can be changed using “linethickness” attribute. The default thickness of the bar is set by the rendering enviornment. When set to zero, no bar is shown.

A thicker bar, in relation to default thickness, can be shown assigning values to “linethickness” attribute. MathML provides predetermined thin, medium and thick values, which is a preferred technique to display different thicknesses of the bar. This way, we can maintain uniformity in our display. Normally, bar thickness is not required to be changed except when nested “mfrac” is implemented. In that case, there are more than one bar and as such it may be required to distinguish the central bar from others. The example given here encapsulates these aspects of “mfrac” display. .

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, A primer in mathml. OpenStax CNX. Apr 19, 2006 Download for free at http://cnx.org/content/col10345/1.16
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'A primer in mathml' conversation and receive update notifications?

Ask