COMPUTING SCIENCE

# Writing Math on the Web

The Web would make a dandy blackboard if only we could scribble an equation

# Whatever Happened to MathML?

Typesetting mathematics with HTML and bitmap images is rather like turning a bicycle into a sailboat. You can’t help admiring the audacity of the attempt, but the result still doesn’t seem like the best vehicle for the purpose. Why not choose MathML, which was designed explicitly for this task?

MathML is a variety of XML (the eXtensible Markup Language). Compared with TeX, it is a more formal language, and it is also far more verbose. Consider the simple expression *x*+1, which might be encoded in TeX as $x+1$. (The dollar signs mark the content as mathematics rather than ordinary text.) In MathML the same expression takes this form:

<mrow>

<mi>x</mi>

<mo>+</mo>

<mn>1</mn>

</mrow>.

Each symbol is tagged to indicate its role—<mi> for an identifier, <mo> for an operator, <mn> for a number—and the expression as a whole is wrapped in an <mrow> tag to show that it belongs on a single line. Capturing this information is potentially useful, since identifiers, operators and numbers are accorded different typographic treatment. (TeX has to infer the role of each symbol, and occasionally gets it wrong.)

There’s more. The style of markup shown above is only half of MathML. It’s called the presentation language; there is also a content language, which attempts to express meaning rather than layout. The expression *x*+1 would have this content markup:

<apply>

<plus/>

<ci>x</ci>

<cn>1</cn>

</apply>.

Here <plus/> does not refer to the symbol + but to the mathematical operation of addition. In this structure we get a glimpse of a grand vision—Web pages with *active* mathematical content, where the menu of things you might do with an expression includes not just copying, pasting and printing but also solving an equation, graphing a function and factoring a polynomial.

MathML has an enthusiastic community of developers and users. There is commercial software for writing and editing MathML documents (notably from Design Science and Integre Technical Publishing) as well as a noncommercial translation program called ASCIIMathML, created by Peter Jipsen of Chapman University in Orange, Calif. Several large scholarly publishers, including the American Institute of Physics, have based their operations on XML and MathML; so has the U.S. Patent Office.

On the Web, however, MathML has not exactly swept away the competition. One reason is lack of support in browsers. In the early years, the only way to read MathML Web documents was with plug-in software. More recently a few browsers—notably those of the Mozilla family, such as Firefox—have gained native support for MathML. But there is still confusion over how MathML content should be embedded in an HTML document. Moreover, MathML has not solved the fonts problem; readers are still responsible for installing appropriate fonts.

Another factor inhibiting the spread of MathML is simply that TeX is deeply entrenched, particularly in physics, mathematics and computer science. If you live in a TeX-centric universe—I have a friend who even writes love letters in TeX—it’s hard to see any benefit of a new and very different language.

**IN THIS SECTION**

Community Guidelines: Disqus Comments

The Art and Science of Communicating Science

EMAIL TO A FRIEND :

**Of Possible Interest**

**Feature Article**: Fabrication at the Nano Scale with Molds and Imprinting

**Technologue**: A Wire Across the Ocean

**Arts Lab**: Bringing Postnatural History into View