Formulas on the Web:
An Introduction to MathML

Richard Mercer
Department of Mathematics and Statistics
Wright State University
Dayton, Ohio
http://www.math.wright.edu/
richard.mercer@wright.edu

•What Is MathML?

•MathML stands for "Mathematical Markup Language".

•MathML is "HTML for formulas".

•MathML is a Protocol for representing Math on the Web (and elsewhere).

•MathML represents formulas in a Plain Text format (ASCII).

•MathML is an Open Standard, recognized and approved by W3C, the World Wide Web Consortium.

•MathML is  The Right Way of putting Math on the Web.

•Goals and Disclaimers

•Raise Awareness of MathML

•Encourage Use of Products Supporting MathML

•I am not an Expert

•The MathML Vision

•Lecture

Your lecture on the normal distribution is captured by camcorder, and the boardwork is  converted by handwriting recognition software into a word processing file. The formulas are likewise captured into properly structured formulas.

•Homework

You post a homework set on the class web site involving the normal density function n(x) = 1/((2 π)^(1/2) σ) e^(-(x - μ)^2/(2 σ^2)).

Students copy this formula from your web page and paste it into their CAS program of choice. Students use CAS program in working assigned problems. It works because the "e" is recognized as the base of the natural exponential function.

The students copies this formula directly into a word processing document to include in a homework assignment.

•Discussion

One student sends email asking a question: "Where does the constant 1/((2 π)^(1/2) σ) come from? "

Student includes this expression in email by cutting or pasting (or dragging and dropping).
This expression is correctly rendered by everyone's email clients.

The instructor copies the students question into a posted message in a course managment program (e.g. WebCT) for distribution to the rest of the class.

•Interaction

The student selects the formula 1/((2 π)^(1/2) σ) e^(-(x - μ)^2/(2 σ^2))on your web page, and brings up a context-generated menu, from which "plot" is selected. The plotting applet recognizes x as the variable and asks for a plot interval. It also recognizes μ and σ as parameters and requests a value or range of values for each. If a range of values is given, a slider is provided.

Variation: the student edits the formula on the web page to give values to μ and σ, then selects plot.

•Search

Several months later, a student from your class wants to use the normal distribution, but doesn't remember the exact formula, only that it had (2 π)^(1/2) in it.

The student searchs for "(2 π)^(1/2)" in (choose one) [your class notes]
[a CD based version of the class text][an online resource site] and finds the formula.

•Accessibility

The formula 1/((2 π)^(1/2) σ) e^(-(x - μ)^2/(2 σ^2)) is correctly read by a screen reader for a visually impaired student.

•How?

Provide a standard method for representing structured mathematical formulas that is widely supported.

•Testimonial

"The benefit for us of ... MathML is that it enables us to have algorithmic questions using math. ... So for example a question could ask a student to evaluate the integral of x^n from a to b, where a, b, and n are all picked at random ... when the question is assigned. Without dynamically rendered math, there would be no way to put the values of the parameters a and b in place on the integral sign."

•What MathML Is Not

•MathDL: A Resource

"The Mathematical Sciences Digital Library is an online resource managed by the Mathematical Association of America with funding by the National Science Foundation."
http://www.mathdl.org/

•MathXL: A Product

A web-based tutorial product from Addison-Wesley. I'm sure they'd be glad to explain it to you!

•What's Inside

•Presentation Tags

Presentation tags are used when presentation is more important than semantics.  

Presentation tags are similar to Mathematica boxes.  Tags include <mrow>, <msup>, <mfrac>, and <mn>.

Underscript[lim, x -> 0] (sin (x))/x

<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
  <munder>
   <mi>lim</mi>
   <mrow>
    <mi>x</mi>
    <mo>&rarr;</mo>
    <mn>0</mn>
   </mrow>
  </munder>
  <mo>&af;</mo>
  <mfrac>
   <mrow>
    <mi>sin</mi>
    <mo>&af;</mo>
    <mo>(</mo>
    <mi>x</mi>
    <mo>)</mo>
   </mrow>
   <mi>x</mi>
  </mfrac>
</mrow>
</math>

Because accessibility is important, presentation tags contain a few characters that are semantically-oriented such as &af; and &dd; so that math can be spoken accurately.

•Content (Semantic) Tags

Content tags are used when semantics are important and you don't care about the presentation.

a/b vs. a/b vs. a b^(-1)

For common math, either set of tags will do.  Examples of content tags include <int/>, <gcd/>, <cos/>, and <limit/>.

Example of the same expression using content tags

Underscript[lim, x -> 0] (sin (x))/x

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <apply>
    <limit/>
    <bvar>
      <ci> x </ci>
    </bvar>
    <lowlimit>
      <cn> 0 </cn>
    </lowlimit>
    <apply>
      <divide/>
      <apply>
        <sin/>
        <ci> x </ci>
      </apply>
      <ci> x </ci>
    </apply>
  </apply>
</math>

Content and presentation tags can be freely mixed.

•Semantics Tag

The semantics tag provides a way to specify both the presentation and content (semantics) of an expression.

<math>
  <semantics>
    <apply> <divide/>
       <ci> a </ci>
       <ci> b </ci>
    </apply>
    <annotation-xml encoding="MathML-Presentation">
       <mfrac>
        <mi> a </mi>
        <mi> b </mi>
       </mfrac>
    </annotation-xml>
    <annotation encoding="Mathematica">
        a/b
    </annotation>
    <annotation encoding="TeX">
        {a \over b}
    </annotation>
  </semantics>
</math>

•Characters and Fonts

Surprisingly hard problem to deal with (fonts problems, sheer number of characters)

About 2,000 technical characters
•  hundreds of new characters will be part of Unicode 3.2
   including d, i (distinct from the double struck d, i), etc.

•Examples

MathMLForm[1/((2 π)^(1/2) σ) e^(-(x - μ)^2/(2 σ^2))]

<math xmlns='http://www.w3.org/1998/Math/MathML'>
<semantics>
  <mfrac>
   <msup>
    <mi>&#8519;</mi>
    <mrow>
     <mo>-</mo>
     <mfrac>
      <msup>
       <mrow>
        <mo>(</mo>
        <mrow>
         <mi>x</mi>
         <mo>-</mo>
         <mi>&#956;</mi>
        </mrow>
        <mo>)</mo>
       </mrow>
       <mn>2</mn>
      </msup>
      <mrow>
       <mn>2</mn>
       <mo>&#8290;</mo>
       <msup>
        <mi>&#963;</mi>
        <mn>2</mn>
       </msup>
      </mrow>
     </mfrac>
    </mrow>
   </msup>
   <mrow>
    <msqrt>
     <mrow>
      <mn>2</mn>
      <mo>&#8290;</mo>
      <mi>&#960;</mi>
     </mrow>
    </msqrt>
    <mo>&#8290;</mo>
    <mi>&#963;</mi>
   </mrow>
  </mfrac>
  <annotation-xml encoding='MathML-Content'>
   <apply>
    <times/>
    <apply>
     <power/>
     <exponentiale/>
     <apply>
      <times/>
      <cn type='integer'>-1</cn>
      <apply>
       <times/>
       <apply>
        <power/>
        <apply>
         <plus/>
         <ci>x</ci>
         <apply>
          <times/>
          <cn type='integer'>-1</cn>
          <ci>&#956;</ci>
         </apply>
        </apply>
        <cn type='integer'>2</cn>
       </apply>
       <apply>
        <power/>
        <apply>
         <times/>
         <cn type='integer'>2</cn>
         <apply>
          <power/>
          <ci>&#963;</ci>
          <cn type='integer'>2</cn>
         </apply>
        </apply>
        <cn type='integer'>-1</cn>
       </apply>
      </apply>
     </apply>
    </apply>
    <apply>
     <power/>
     <apply>
      <times/>
      <apply>
       <power/>
       <apply>
        <times/>
        <cn type='integer'>2</cn>
        <pi/>
       </apply>
       <cn type='rational'>1<sep/>2</cn>
      </apply>
      <ci>&#963;</ci>
     </apply>
     <cn type='integer'>-1</cn>
    </apply>
   </apply>
  </annotation-xml>
</semantics>
</math>

•Current Status of MathML

•Browsers

Internet Explorer -- relies on plugins to provide MathML functionality.

Netscape/Mozilla -- current versions of Mozilla support MathML, including MacOSX.
Netscape 7.0 supports MathML on Windows and Linux.

Amaya -- browser from W3C that supports MathML.

•Browser Plug-Ins

MathPlayer (DSI) -- Plugin for IE 5.5 and higher, Windows only. Allows display of MathML.

techExplorer -- future uncertain

•Other Applications -- A Sampling

Mathematica and Maple both have substantial MathML support, still evolving.

MathType -- exports MathML presentation tags

eGrade -- online testing program that uses MathML

WebCT -- online course management software that recently announced MathML support

•Other Presentations

S181: Saturday 5:00-5:45, Dogwood
"Tools and Techniques for Your Math on the Web Project"
Bob Mathews, Design Science, Inc.

•Resources

•W3C MathML Site

http://www.w3.org/Math/

Among the highlights are:
-- a list of software implementations of MathML with links.
-- MathML FAQ.
-- the current MathML Test Suite.

•MathMLCentral Site

http://www.mathmlcentral.com/

•First MathML Conference

October 20-21, 2000 at University of Illinois, Urbana, IL

http://www.mathmlconference.org/2000/

Available are the schedule of presentations, an abstract of each presentation, and in many case presentation materials.

•Second MathML Conference

June 28-30, 2002, Lisle, IL

http://www.mathmlconference.org/2002/

Ditto.

•Math on the Web: A Status Report

http://www.dessci.com/webmath/status/

A valuable public service from Design Science, Inc. New editions appear roughly every six months.

From the September 2002 edition: "It is our belief that the HTML+MathML Platform is now fully supported in popular, modern web browsers and is well-positioned to become the dominant medium for online delivery of technical content, for both traditional, static research papers and dynamic interactive presentations."

•Final Word: Accept No Substitutes!

If you get nothing else from this talk...

ASK SOFTWARE VENDORS IF THEY SUPPORT MATHML!

Make them at least pay lip service to it!

Types of software that should support MathML: mathematical software, (mathematical) word processing, web browsers, distance learning tools, online testing, course management software, etc.


Converted by Mathematica  (November 8, 2002)