Mathematical Markup Language (MathML)
presented by:
MohammadTaghi Hajiaghayi,
Department of Computer Science,
University of Waterloo,
http://www.cs.uwaterloo.ca/~mhajiaghayi/mathml/mathmlp.html
page 1
Outline
-
Introduction to MathML
-
Definition
-
Why MathML?
-
Features
-
What do you need to use MathML?
-
Overview
-
Presentation and Content Encoding
-
Expression Trees
-
Elements and Attributes
-
Boxes
-
Containers, Functions, Characters
-
The MathML Interface Issues
-
Conclusion
-
References
page 2
Introduction
Definition
-
MathML is markup language for expressing mathematical and
scientific content over the WWW.
-
Two released versions by W3C:
-
MathML 1.0 Recommendation (7th April 1998)
-
MathML 1.01 Recommendation (7th July 1999)
Why MathML?
-
Current methods for expressing mathematical equations
and scientific formulas, are not good enough (Using GIF images in HTML).
-
Copy and Paste are not easy.
-
MathML can be interpreted into alternative media such as
speech or Braille (visual disabilities).
-
Transferring mathematical content over different machines
on the Web.
page 3
Introduction(continued)
Features
-
External software can use it and process formulas,
expressions, and scientific calculations.
-
It increases the type of media that can be presented and
used on the Internet.
-
Standard notation instead of images can be used.
What do you need to
use MathML?
-
MathML is new and not a lot of support in more common browsers.
-
Now W3C's Amaya, E-Lite by ICEsoft and Netscape's new
unreleased browser, titled Gecko Support it.
-
Organizations that have expressed for MathML are:
-
IBM makers of the Techexplorer Scientific Browser.
-
Wolfram Research, makers of Mathematica 3.0.
-
Waterloo Maple, makers of Maple V.
-
Hewlett-Packard, makers of the EzMath plug-in.
-
American Mathematical Society, developers of a LaTeX to MathML
translator.
-
etc.
page 4
MathML Overview
Presentation and Content
Encoding
-
Example: talking about f'(g(x))g'(x) has two approaches:
-
use the chain rule to write down the derivative of f
composed with g (content encoding).
-
write f prime, open paren, g of x, close paren, g prime of
x (presentation encoding).
-
Content encoding tries to communicate the sense or meaning,
and leaves the notation up to someone.
-
Around 75 content elements, with about a dozen attributes.
-
Many of them represent mathematical operations and functions,
such as plus and sin.
-
Others represent mathematical objects like set and
vector.
-
Presentation encoding tries to convey the notation, so that
by looking at it, someone can grasp the sense.
-
28 MathML presentation elements, with about 50 attributes.
-
They represent templates or patterns for laying out subexpressions
such as mfrac.
page 5
MathML Overview(continued)
Two Examples :
-
The presentation encoding for (a + b)^2:
<msup>
<mfenced>
<mi>a</mi>
-
The content encoding for (a + b)^2:
<apply>
page 6
MathML Overview(continued)
Expression
Trees
-
Think about MathML expressions as tree structures.
-
Each node in the tree corresponds to a particular layout
schema.
-
Branches or child nodes correspond to its subexpressions.
page 7
MathML Elements and Attributes
-
In MathML, because of the nature of the subject matter (Mathmatics),
the ratio of tags to text is much higher than in HTML, but the start
tag/end tag syntax and the use of attributes is the same.
-
Two kinds of elements:
-
Most elements have start and end tags of the form: <element_name>
... </element_name>
They
can have other data in between the start and end tag, such as text, extended
characters, or other elements.
-
Some elements are empty elements of the form: <element_name/>
-
They can have attributes in the form of:
<element_name
attrib_name1='val1' attrib_name2='val2' ... >
-
For example, in mfrac, attribute "linethickness"
specifies the thickness of the fraction line.
page
8
Boxes
-
MathML presentation mark-up is based around the idea of a
layout
box.
-
Think of a layout box as a sort of abstract bounding box.
-
Layout boxes naturally fall into categories based on their
contents:
-
Simple layout boxes just contain individual characters, and
their dimensions depend only on the font being used.
-
More complicated layout boxes arrange their "child boxes"
according to some algorithm. For these cases, the actual dimensions of
a layout box depend recursively on the sizes of the child boxes.
-
For example, a fraction box arranges two child boxes to be
vertically stacked with a line between, and centered horizontally.
-
Roughly speaking, presentation elements correspond to the
media-independent aspects of a typesetting layout box (Logical Abstraction
View).
-
A renderer then turns these logical relations into specific
algorithms for physically laying out equations on the screen.
-
The attributes of an element essentially specify parameters
to the layout algorithm.
page 9
Containers,
Functions, Characters
Containers
-
Container elements represent basic mathematical objects
and data types. In general, container elements represent things like sets
which are constructed out of other data.
-
The main examples are:
-
Sets: <set> [<elt1> <elt2> ... | <condition>]
</set>
The
elements can either be a list of tokens and containers which represent
the individual elements of the set, or a set recursively.
-
Intervals: <interval> <pt1>
<pt2> </interval>
pt1
and pt2 are two point in a line.
-
Vectors: <vector> <elt1> <elt2> ... </vector>
By
convention, in MathML vectors are column vectors for matrix multiplication.
-
Matrices: <matrix> <row1> <row2> ... </matrix>
-
Example:
Markup:
<reln> <eq/>
<apply><times/>
<vector>
<cn>1 </cn> <cn>2 </cn>
</vector>
<matrix>
<matrixrow>
<cn>0 </cn> <cn>1 </cn> </matrixrow>
<matrixrow>
<cn>1 </cn> <cn>0 </cn> </matrixrow>
</matrix>
</apply>
<apply> <transpose/>
<vector>
<cn>2 </cn> <cn>1 </cn>
</vector>
</apply>
</reln>
page 10
Containers,
Functions, Characters(continued)
Operators and Functions
-
There are around 50 empty operator elements in content markup,
which represent commonly used functions and operators.
-
The only other operator element is fn, which is used
to create user-defined functions.
-
There is basically no difference between functions and operators
in MathML.
Expression:
Markup:
<apply>
<fn>
<mfenced>
<apply><plus/>
<sin/>
<cos/>
</apply>
</mfenced>
</fn>
<ci>x</ci>
</apply>
-
The fn element is used to declare that its child element
should be regarded as an operator element.
-
In this case, a computer algebra system would probably recognize
the sine and cosine functions, and treat the result of adding them together
as a function again.
page
11
Containers,
Functions, Characters(continued)
Characters
-
Notation and symbols are very important for mathematics and
mathematics makes use of a very large collection of symbols.
-
It is difficult to read mathematics if corresponding glyphs
are not available for presentation on specific display devices.
-
MathML Characters are defined to be either Unicode characters
legal in XML documents or mglyph elements. The latter are used to represent
characters that do not have a Unicode encoding.
-
But, because the Unicode UCS provides approximately one thousand
special alphabetic characters for the use of mathematics , and will provide
over 900 special symbols in Unicode 3.2, the need for mglyph should be
rare.
page 12
The
MathML Interface Issues
-
MathML must work well with a wide variety of renderers,
processors, translators and editors.
-
The most important interface issues are related to embedding
MathML in [HTML4] and [XHTML].
-
Three kinds of interface issues that arise in embedding MathML
in other XML documents:
-
MathML must be semantically integrated. MathML markup must
be recognized as valid embedded XML content, and not as an error.
-
MathML rendering must be integrated into browser software.
-
The tools for generating and processing MathML must be able
to intercommunicate and must be easily generated by user-friendly tools.
-
The above issues must be considered in developing
new MathML interfaces.
page
13
Conclusion
-
Some MathML issues were briefly discussed
-
Said that MathML is very good standard for using and showing
mathematics in the WEB.
-
A problem remains is that MathML codes are not so readable,
and so we must use other softwares and interfaces to create, manipulate
and show them.
-
Now a Question: It wouldn't be better if we use a quite
perfect alternative already exists in Mathematica or Maple -i.e.
use only a <mathematics use=Mathematica> and </mathematics>
bracket in HTML (with possible other values, like Maple) ?
-
I think the answer of above question is "not", because
of copyright, ..., but still needs more thought.
page 14
References:
[1]:
Mathematical Markup Language (MathML[tm]) 1.01 Specification W3C Recommendation,
revision of 7 July 1999.
[2]:
Mathematical Markup Language (MathML) Version 2.0 W3C Proposed Recommendation
8 January 2001.
[3]:
Gentle Introduction to MathML.
[4]: MathML
International Conference 2000.
[5]:
The Interchange of Mathematics in XML: MathML, OpenMath and their Application.
[6]:
MathML - What's in it for us?.
[7]:
The Disappointment and Embarrassment of MathML - update: Including Reactions
and Answers
[8]:
MathML Resources.
[9]:
Putting Mathematical Notation on the Web.
page 15