Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Gentle Introduction to MathML

Gentle Introduction to MathML

Ratings: (0)|Views: 58|Likes:
Published by toba_sayed
MathML is about encoding the structure of mathematical expressions so that they can be displayed, manipulated and shared over the World Wide Web. A carefully encoded MathML expression can be evaluated in a computer algebra system, rendered in a Web browser, edited in your word processor, and printed on your laser printer. Mathematical software vendors are adding MathML support at a rapid pace, and MathML is fast becoming the lingua franca of scientific publication on the Web.
MathML is about encoding the structure of mathematical expressions so that they can be displayed, manipulated and shared over the World Wide Web. A carefully encoded MathML expression can be evaluated in a computer algebra system, rendered in a Web browser, edited in your word processor, and printed on your laser printer. Mathematical software vendors are adding MathML support at a rapid pace, and MathML is fast becoming the lingua franca of scientific publication on the Web.

More info:

Published by: toba_sayed on May 05, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

05/29/2010

pdf

text

original

 
Gentle Introduction to MathML
 by Robert Miner and Jeff Schaeffer (
revised 9/2000)
MathML is about encoding the structure of mathematical expressions so that they can be displayed,manipulated and shared over the World Wide Web. A carefully encoded MathML expression can be evaluatedin a computer algebra system, rendered in a Web browser, edited in your word processor, and printed on your laser printer. Mathematical software vendors are adding MathML support at a rapid pace, and MathML is fast becoming the
lingua franca
of scientific publication on the Web.
MathML Tutorial
The MathML 1.01 Specification is quite long, complex and technical. To make it easier to get started withMathML, the following tutorial emphasizes the main ideas with graphics and lots of examples.
MathML Language Reference
The WebEQ MathML Language Reference describes the WebEQ implementation of MathML. MathML is thenative input languages for the WebEQ Math Viewer. While MathML has many advantages for encodingequations for the Web, authors who want to write equation markup by hand will probably find it easier to useWebTeX.WebTeX can also be used as an input language for the Math Viewer, and it can be translated toMathML by the Page Wizard.A description of each MathML element is given below. This description contains both general informationabout the role of each element in MathML, and specific information about how each element and its attributesare implemented in the WebEQ rendering engine.WebEQ implementsMathML 1.01, based on the specification developed by the World Wide Web Consortium.There a few features of MathML that WebEQ does not implement, and a few extra features that WebEQ adds.However, at the time of this writing, WebEQ provides the most complete and compliant implementation of MathML available.The element descriptions are grouped according to their MathML function:
The Big Picture
 
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 
 f 
composed with
 g 
", or, if the student is really at sea, you can say "write
 f 
 prime, open paren,
 g 
of 
 x
, close paren,
 g 
prime of 
 x
". 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
mfrac
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
plus
and
sin
. Others representmathematical objects like
set
and
vector
. 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.
Expression Trees
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
layout schemata
. The best way to understand how this works is to look at an example:
(
a
+
b
)
2
This expression naturally breaks into a "base," the (
a
+
b
), 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.
 
The MathML presentation encoding of this expression is:
 <msup> <mfenced> <mi>a</mi> <mo>+</mo> <mi>b</mi> </mfenced> <mn>2</mn> </msup> 
The top-level structure is an expression with a superscript. This is encoded by the fact that the outermost tags inthe MathML mark-up are the
 <msup> 
and
 </msup> 
tags. The mark-up in between the start tag and the end tagdefines the base and the superscript.The first subexpression is an
mfenced
element, which displays its contents surrounded by parentheses. The secondexpression is the character 2, enclosed in
 <mn> 
tags, which tell a renderer to display it like a number. Similarly, thesubexpressions contained in the
mfenced
element are all individual characters, wrapped in tags to indiciate thatthey should be displayed as identifiers (
 <mi> 
) and operators (
 <mo> 
) respectively.Though we won't go into this until later, the content markup for the same exmple might be:
 <apply> <power/> <apply> <plus/> <ci>a</ci> <ci>b</ci> </apply> <cn>2</cn> </apply> 
As you see, content mark-up uses the same kind of syntax as presentation markup. Each layout schemata or content construction corresponds to a pair of start and end tags (except for so-called
empty elements
like
 <plus/> 
,which we will encounter later). The the mark-up for subexpressions is enclosed between the start and end tags, andthe order they appear in determines what roles they play, e.g. the first child is the base and the second shild is thesuperscript in an
msup
schema.As the indentation of the MathML examples suggests, it is natural to think about MathML expressions as treestructures. Each node in the tree corresponds to a particular layout schema, and its "branches" or child nodescorrespond to its subexpressions.This abstract expression tree is a handy thing to have in the back of your mind. It also describes how the MathMLtags should be nested to encode the expression, and how typesetting "boxes" should be nested on the screen todisplay the notation.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->