<< Chapter < Page Chapter >> Page >

Now, consider the example of "+" operator appearing twice in an expression in the manner as typed below :

+a + b

The first "+" sign in the above case assumes "prefix" form, while the second "+" sign assumes "infix" form. Once, the form of the operator is determined from the context within "mrow" element, spacing around the operator is determined as specified by "lspace" and "rspace" values given in the operator dictionary. The dictionary suggests following values for these forms of “+” operator :

"+" form="infix" lspace="mediummathspace" rspace="mediummathspace" "+" form="prefix" lspace="0em" rspace="veryverythinmathspace"

Evidently, "infix" form separates its neighboring elements by "mediummathspace", whereas "prefix" form separates the following element with a very small space specified by "veryverythinmathspace".

Let us now code the example in MathML and see the output :

Determining "form" of an operator

<m:math display="block"> <m:mrow> <m:mo> + </m:mo> <m:mi> a </m:mi> <m:mo> + </m:mo> <m:mi> b </m:mi> </m:mrow> </m:math>

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

+ a + b

As expected first “+” is almost attached to “a”, where as second instance of “+” renders some amount of space around itself. This type of detailing in rendering mathematical expression is vital and critical to maintain highest order of rendering consistencey, which is commensurate with the exact nature of mathematics and the meaning that a mathematical expression conveys. Note that the mark-up paradigm of MathML automatically forces codification in such a manner that no extra effort is required towards maintaining conventions of mathematical display - almost ruling out the possibilities that an expression is displayed in a non-conforming way.

A particular operator does not require to have entries for all the forms in the operator dictionary. Many of the operators in mathematics operate on other entities in forward direction. For example, integration, differentiation, partial differentiation etc. operates on identifiers following it. For this reason, such operators are inherently “prefix” in nature. On the other hand, operators classified as fences are either “prefix” or “postfix” commensurate with their role in mathematical expression. It is very unlikely that a closing bracket “]” is used in the beginning of an expression and as such it has “postfix” form. Dictionary entries for these operators are given here to understand : why there is very small space or no space between these operators and the identifiers on which they operate.

"&DifferentialD;" form="prefix" lspace="0em" rspace="verythinmathspace" "&PartialD;" form="prefix" lspace="0em" rspace="verythinmathspace" "&Integral;" form="prefix" largeop="true" stretchy="true" lspace="0em" "(" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em" ")" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em" "[" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em" "]" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em" "{" form="prefix" fence="true" stretchy="true" lspace="0em" rspace="0em" "}" form="postfix" fence="true" stretchy="true" lspace="0em" rspace="0em"

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