<< Chapter < Page Chapter >> Page >

MathML also allows improvisation of an operator rendered by “mo” element. This generally makes use of other characters rendering elements such as “mi” or "mn" elements in addition to "mo" element and their combination with layout elements like “mfrac” and scripting elements (“msub”, “msup” etc.) Simply put, MathML treats an expression with a “mo” element at core and improvised by other elements - as an operator of class known as “embellished” operator.

Consider encoding for a differentiation operator "&DifferentialD;" . This operator when applied to a variable, say t, is represented as t In mathematics, however, t is itself considered to be an operator. The whole block consisting of “mfrac” element is, thus, an embellished operator.

<m:mfrac> <m:mo> &DifferentialD; </m:mo> <m:mrow> <m:mo> &DifferentialD; </m:mo> <m:mi> x </m:mi> </m:mrow> </m:mfrac>

Additional attribute : default values

Default values to the attributes of “mo” element are set in accordance with the values contained in “operator dictionary”, which specifies “form”, “fence”, “stretchy”, “lspace” and “rspace” attributes for different operators. The renderer maintains an operator dictionary for most of the operators. W3C recommends a prototype of operator dictionary. These recommendations can be viewed at www.w3.org/TR/MathML2/appendixf.html . If the dictionary does not provide the value for the attribute, then attribute is set with default value as given here:

    Default values

  • form : set by position/context
  • fence : false
  • separator : false
  • lspace : thickmathspace
  • rspace : thickmathspace
  • stretchy : false
  • symmetric : true
  • maxsize : infinity
  • minsize : 1
  • largeop : false
  • movablelimits : false
  • accent : false

Managing space around operators

    Attribute value types

  • form : prefix | infix | postfix
  • lspace : number h-unit | namedspace
  • rspace : number h-unit | namedspace

The "form" attribute specifies whether an operator shall be rendered as "prefix" or "postfix" or "infix" operator. These form types determine space around the operator (left and right of it). Each form type is associated with two attributes ("lspace" and "rspace"), which implements its left space ("lspace") and right space ("rspace"). It is important to understand that form types are basically specification about space around operator and about its role with respect to other elements.

The default value of “form” attribute is set in accordance with three rules, involving "mrow" element. The token elements, including "mo" element, is composed within explicit or inferred "mrow" element. The position of an operator within the "mrow" in horizontal sequence determines the form type of the operator. If operator is the first element, then its form is inferred as "prefix"; if it is in the intermediate position, then its form is inferred as "infix”; and if it is in the end position, then its form is inferred as "postfix". Corresponding to each form, operator library specifies "lspace" and "rspace". It is, however, not necessary that each of the operator has all the three form types. The nature of operator determines the type of forms that a particular operator should be associated with. For example, "+" operator has entries for "prefix" and "infix", but not for "postfix" in the operator dictionary, because "postfix" form of "+" operator is not expected to be placed at the end of an expression.

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