Presentation and Content
Think about trying to help a student with a math problem over the phone. Your first challenge is to make sure youare both talking about the same thing, and there are two natural approaches. You can say things like "use the chainrule to write down the derivative of
", or, if the student is really at sea, you can say "write
prime, open paren,
, close paren,
". The first method tries to communicate the sense or meaning,and leaves the notation up to the student. The second method tries to convey the notation, so that by looking at it,the student can grasp the sense.In MathML, these two styles of encoding are called content encodings and presentation encodings. Which kind of encoding is most appropriate for a given task will depend on the situation. MathML allows an author to use either kind of encoding, or mix them in a hybrid.There are 28 MathML presentation elements, with about 50 attributes. These elements are for encodingmathematical notation. Most elements represent templates or patterns for laying out subexpressions. For example,there is an
element, which as you would expect, is used for forming a fraction from two expressions by putting one over the other with a line in between. Using presentation elements, you can precisely control how anexpression will look when displayed in a browser, or printed on paper. Unfortunately, as with any layout-basedmark-up language, it is all too easy to get it to look right, without taking care to get the underlying structure right.In some cases this won't matter, but it is less likely a badly encoded expression could be spoken properly by avoice synthesizer, evaluated in a computer algebra system, or used by other applications which need to knowsomething of the sense of an expression, rather than just its appearance.For content markup, there are around 75 elements, with about a dozen attributes. Many of these elements come infamilies, and represent mathematical operations and functions, such as
. Others representmathematical objects like
. Content markup is intended for facilitating applications other thandisplay, like computer algebra, and speech synthesis. As a consequence, when using content mark-up, it is harder to directly control how an expression will be displayed.The WebEQ editor is presently set up to generate presentation markup. It is possible to using it to edit contentencodings as well, but that is not what it is currently designed to do.
If you look at a lot of math notation, you will soon notice that although there are a lot of math symbols, there areonly a few ways of arranging them -- a row, subscript and superscripts, fractions, matrices and a few others. Of course, these notational patterns or schemata often appear nested inside one another, such as a square root of afraction, and they generally have a number of parameters which depend on the context, such as the amount to shifta superscript for inline math vs. displayed math. The important point is that even complicated, nested expressionsare built-up from a handful of simple schemata.MathML presentation elements encode the way an expression is built-up from of the nested
. The best way to understand how this works is to look at an example:
This expression naturally breaks into a "base," the (
), and a "script," which is the single character '2' in thiscase. The base decomposes further into a sequence of two characters and three symbols. Of course, thedecomposition process terminates with indivisible expressions such as digits, letters, or other symbol characters.