Integrating MathML Into a Publishing Workflow

Keywords: browser, conversion, DocBook, document creation, editor, encoding, GUI, markup, mathematics, MathML, metadata, publishing, accessibility, Unicode, XHTML

Bob Mathews
Director of Training
Design Science, Inc.
Long Beach
California
United States of America
bobm@dessci.com

Biography

Bob Mathews is the Director of Training for software developer Design Science, Inc. A former career military officer, he has served as an Instructor Pilot in T-38 and KC-135 aircraft, as a Flight Commander, and as Deputy Chief of the Strategic Air Command Instrument Flight Course. Transitioning from the stratosphere to the lower atmosphere, Bob spent the next several years teaching high school mathematics and serving as department chair.With an undergraduate degree in Electrical Engineering and a graduate degree in Management & Human Relations, Bob enjoys teaching and has taught in such diverse environments as the cockpit of a supersonic jet, a high school mathematics classroom, a corporate boardroom, and a Sunday School class. He has led seminars and presented papers at conferences on three continents, and is often an invited speaker at math teacher conferences and software user group meetings. His current interests include using a standards-based approach to technical publishing and designing interactive math applications for web pages and distance learning environments.


Abstract


Originally published as a Recommendation by the World Wide Web Consortium (W3C) in 1998, MathML was the first XML application to achieve Recommendation status. Although the language has been around for almost six years, it has only been within the last two years that MathML has seen a rapid increase in use and acceptance.

Several high-profile organizations now utilize XML-MathML workflows, including the US Patent Office and the American Institute of Physics. MathML is attractive to Scientific, Technical, and Medical (STM) publishers for several reasons, including ease of integration with standard XML workflow software, value enhancements for online documents, and increased accessibility for sight-impaired individuals.


Table of Contents


1. Introduction
2. What Is MathML?
     2.1 What does MathML look like?
3. Structure is everything
4. Advantages of MathML
     4.1 Ease of Integration
     4.2 Reusability
     4.3 Enhanced Accessibility
     4.4 Enhanced search capacity
     4.5 Browser support
5. Commercial deployment of MathML
6. Conclusion
Bibliography

1. Introduction

The Mathematical Markup Language, or MathML, was intended from the start to enhance information dissemination in Scientific, Technical, and Medical (STM) documents. Introduced in 1998 as the first application of the then-new XML Recommendation, the goal of MathML was to "enable mathematics to be served, received, and processed on the Web, just as HTML has enabled this functionality for text."[MathML1] Now in its third revision since the initial Recommendation, MathML offers even more promise to publishers wishing to streamline their workflows, offer more value to readers of their online documents and journals, and enhance accessibility for the visually-impaired.

Mathematical content is perhaps the most distinguishing characteristic of STM documents, and has traditionally been represented with TeX, PowerMath, math parts of various DTDs, or with MathType. Now that many publishers and corporations are moving to XML workflows, the only logical choice for math is to use MathML.[DSI1]

2. What Is MathML?

The simple answer is that it is a markup language intended to describe mathematics. That oversimplifies the subject though, as MathML is much more than just another markup language. MathML is verbose, which is its only real disadvantage. It is precisely because of that verbosity however, that MathML realizes its greatest strengths and offers the publisher full control—not only control over the display and structure of the math, but the mathematical meaning behind the structure.

The MathML specification defines some 30 elements of "presentation markup" intended to precisely define the display of the mathematics. Fifty attributes are available to fine-tune presentation markup to the exact look required. By using presentation markup, a publisher can display and print even the most complex formulas found in STM literature.

In addition to the 30 presentation elements, there are roughly 120 elements of "content markup" designed to convey mathematical meaning unambiguously.[MathML2] Content markup allows users to use the MathML in computer algebra systems for evaluation.

2.1 What does MathML look like?

Being an XML-based language, MathML follows XML syntax rules. In spite of its apparent complexity, MathML is simple enough to be read and understood by humans, though the designers never intended hand-authoring to be common practice[MathML2]. Here is a small example of MathML:

<math>
  <msqrt>
    <msup>       
      <mi>a</mi>
      <mn>2</mn>
    </msup>
    <mo>+</mo>
    <msup> 
      <mi>b</mi>       
      <mn>2</mn>
    </msup>
  </msqrt>
</math>

The text equivalent of the example markup is "the square root of a squared plus b squared". The mathematical expression is simple enough, but in order to provide the necessary flexibility and utility, the minimum MathML markup requires 104 characters (compared with 35 characters in the text equivalent). Font properties (such as font size and font face) are inherited from the document or are set in a style sheet. MathML allows an author to override inherited style and gives control over non-inherited attributes such as table column alignment and fence stretching.

3. Structure is everything

MathML becomes part of the structure of the surrounding document, but it also adds structure to the expressions it encodes. For example, the expression (x + y)2 would not be ambiguous to a human familiar with such syntax, but for a software application parsing the expression or trying to determine its meaning, it would be unclear whether the superscript were applied to the entire parenthetical expression or only to the closing parentheses. The structure of MathML leaves no room for doubt that the superscript is to be applied to the entire parenthetical expression:

tree.gif

The <mrow> element in the markup above serves to group the parenthetical expression so that it acts as a single child argument for the <msup> element (superscript). The figure to the right shows this relationship diagrammatically.

As another example of structure adding meaning to a MathML expression, consider the term f(x + y). Does this mean "the variable f multiplied by the quantity x + y", or is (x + y) used as an argument for the function f? Again, MathML makes it clear the latter is the correct interpretation:

<math>
  <mi>f</mi>
  <mo>&ApplyFunction;</mo>
  <mrow>
    <mo>(</mo>
    <mi>x</mi>
    <mo>+</mo>
    <mi>y</mi>
    <mo>)</mo>
  </mrow>
</math>

This distinction is important in making the expression more accessible (see below).

4. Advantages of MathML

Compared with other methods of displaying math in print and on the web, MathML offers several distinct advantages.

4.1 Ease of Integration

MathML and MathML tools can be easily and economically integrated with standard XML workflow software. Design Science's MathType product facilitates bringing author submissions in Microsoft Word into an XML workflow. Several commercial and open-source MathML equation editor components integrate with industry leading XML editors, and provide MathML support in Web browsers. A variety of composition software systems facilitate cross-media publishing of mathematics[Implementations].

In a typical scenario, a publisher using Arbortext's Epic XML authoring system might receive a manuscript from an author in Microsoft Word format. The publisher would import the Word document into Epic by using Epic Interchange, and any formulas or equations in the original document would be converted to MathML by Design Science's MathFlow Exchange product. The result would be an XML document based, for example, on a subset of the DocBook DTD. Any other DTD or schema may be used, as long as it properly references the MathML DTD[DSI2]. Edits to the math may be accomplished directly within Epic by using the Design Science MathFlow Editor. Composition may be performed using the Epic Composer in tandem with Design Science's MathFlow Composer to produce either XHTML + MathML for the web or PDF for print.

In this scenario, the ease of integrating MathML import from Word with MathML editing and composition components in an XML workflow is significant, since over 75% of manuscript submissions to STM publishers are in Microsoft Word format[DSI3].

4.2 Reusability

Mathematics marked up with MathML can be copied, calculated, analyzed, and graphed. This in itself adds a new dimension to the document not possible when the math is displayed as an image. These capabilities are magnified when the document is displayed in Internet Explorer with the Design Science MathPlayer displaying the math. Via MathPlayer, the reader can copy the equation to paste into a MathML-savvy application, such as Wolfram Research's Mathematica, for use in live workbooks. MathPlayer also allows opening the equation in Design Science's WebEQ or MathType products, and the equation may then be used in other documents.

4.3 Enhanced Accessibility

MathML opens several important doors for enhanced accessibility. About 60% of all working-age adults have mild or severe "impairments". One-fourth of these impairments are vision-related[Microsoft]. Since MathML is highly structured and information-rich, equations can be exposed to screen-reading software in powerful ways, for a greatly enhanced reading and learning experience.

Design Science is currently working to add accessibility features to its software as part of a project to make mathematics more accessible. This project is funded by a Small Business Infrastructure Research (SBIR) grant from the National Science Foundation (NSF)[DSI4]. MathPlayer 2.0 implements Microsoft's Active Accessibility (MSAA) interface so that assistive software, such as screen readers, can take advantage of MathPlayer's math-to-speech technology. For example, a sight-impaired individual using the JAWS screen reader can access a web page written to the XHTML specification, with the math included as MathML "islands" within the page's XHTML. When the MathML markup is encountered, JAWS queries MathPlayer for the text string to speak and JAWS then sends that string to the text-to-speech engine it uses. This requires no additional action on the part of the individual.

Two additional features that Design Science is investigating for the future are user navigation of expressions for better comprehension of complex mathematical expressions and support for various mathematical Braille formats for output to Braille displays and embossers. Users with certain learning disabilities would benefit from synchronized speech and subexpression highlighting, and Design Science is investigating including this into MathPlayer as well.[DSI5]

Partially sighted individuals also benefit from this technology. Since the math is not displayed as an image it can be resized along with the text of the web page, corresponding to the browser settings or style sheet. MathPlayer further enhances MathML display in web pages by allowing the individual to click on an equation to zoom in to 150% of the normal size.

4.4 Enhanced search capacity

Design Science is currently leading a project to improve searching of mathematics using MathML. This project is funded under the National Science Digital Library (NSDL) program of the National Science Foundation (NSF). The ultimate goal of the project is to facilitate searching for mathematical formulas and notations in scientific literature, the same way in which one can now do full-text keyword searches.

This project is under the direction of Dr. Robert Miner, Design Science's Director of New Product Development. With better searching, researchers in one area have a much better chance of discovering connections with other seemingly unrelated fields. For example, one can imagine a heart researcher might find the same equations describing cardiac electrical signals turning up in the work of astronomers studying solar flares where the problems have already been solved. Without math-aware searching, finding such unexpected connections is largely a matter of chance. Yet, the history of science shows again and again that unexpected connections often lead to major breakthroughs.[DSI6]

4.5 Browser support

Viewing a web page with image-based equations is often more utilitarian than aesthetically pleasing. Resizing the page's text in the browser will not cause the image to resize, thus resulting in equations being displayed in a different size than the text font. With few notable exceptions (Design Science's MathPage technology[DSI7] being one), the images do not align properly with the baseline of the text, and print at low resolution. By contrast, a web page coded as XHTML + MathML eliminates all these issues: the math will re-size with the text of the document, picks up fonts and sizes from user settings (either browser preferences or style sheets), prints at normal printer resolution, and is infinitely easier to manage than dozens (sometimes hundreds) of images.

Long-standing interoperability problems between MathML-enabled browsers have been significantly reduced, making it possible to publish a single, self-contained XHTML + MathML document that can be displayed on Netscape/Mozilla, as well as Microsoft Internet Explorer. This is made possible by Design Science's MathPlayer, a free download from the Design Science web site.[DSI8] There are well over a million copies of MathPlayer installed today.

5. Commercial deployment of MathML

One way to assess the feasibility of integrating a new technology into an existing workflow is to look at the success others have had with it. Although MathML-capable publishing software has only recently become available, there are still several high-profile organizations using the technology today.

The US Patent Office is one of the oldest and largest volume workflows using MathML, operated under contract by Reed-Elsevier for nearly five years. They produce over 10,000 pages a week, with over 1,000 of them containing math. Reed uses Mathematica to create both printed and electronic forms of mathematical formulas for patents. A custom-designed user interface gives them efficient and accurate formula entry for the 3,500-4,000 patents processed each week, dramatically reducing the training time of production floor workers, and automatically creating multiple electronic files for each formula, including MathML.[WRI]

A mammoth project recently completed by the American Physical Society (APS) is the Physical Review Online Archive (PROLA). Completed in 2001 after nearly ten years from concept to reality, PROLA contains "every paper in every journal that APS has published since 1893 (excepting the present and past three years, which are held separately for current subscribers) mounted online in a friendly, powerful, fully searchable system."[APS] For this project, APS used their own internally-developed DTD that incorporates MathML. For legacy documents, this gave the capability of mapping the formulas into MathML if needed. For new documents, all math markup is in MathML.[PROLA]

More recently, a number of other technical publishers such as the American Institute of Physics and John Wiley & Sons have begun using MathML in their workflows, particularly for higher-volume journal publishing contexts.

The trend to MathML is also being fueled by its incorporation into several important industry-standard XML-based document formats, including the Journal Archiving and Interchange format used by the National Library of Medicine and its PubMed system. The Archiving and Interchange format was written as a set of XML DTD "modules", each of which is a separate physical file. The modules were developed as part of an effort to create XML applications through which materials on health-related disciplines can be shared and reused electronically[DTD]—precisely the type of application for which MathML was intended.

There is evidence of significant investment to incorporate MathML into private content holdings as well. Microsoft is using MathML to deliver high-school math help in its MSN Encarta Premium service.[MathML3] The MathML notation in MSN Math Help is displayed via the Design Science MathPlayer.[DSI9]

6. Conclusion

The decision to incorporate a new technique or new technology into an existing workflow is normally not easy to make. The new technology must not only be better than the old, but it must be the clear choice among all extant alternatives. When the workflow in question is an XML publishing workflow and the documents include mathematics, MathML is the clear winner. Not only is MathML a W3C-approved XML application, making its incorporation into XML DTDs and schemas a fairly trivial matter, but its other advantages position it so that there really are no alternatives.

Bibliography

[MathML1]
Mathematical Markup Language (MathML) 1.01 Specification, Patrick Ion et al.,Worldwide Web Consortium,1999.
[DSI1]
MathML Workflows in STM Publishing, Paul Topping,Design Science, Inc.,2004.
[MathML2]
Mathematical Markup Language (MathML) Version 2.0 (Second Edition), David Carlisle et al.,Worldwide Web Consortium,2003.
[Implementations]
W3C MathML Implementations, Patrick Ion et al..
[DSI2]
MathFlow Documentation; Design Science, Inc.; 2004.
[DSI3]
Figure is no doubt higher now. 70% is based on a survey conducted by Design Science, Inc. in 1999.
[Microsoft]
Accessible Technology Market Research; Research report commissioned by Microsoft Corporation and conducted by Forrester Research, Inc.; 2003.
[DSI4]
Design Science Awarded NSF Grant to Research Mathematics Accessibility; Press Release (NSF Small Business Innovation Research Grant No. 0340439) , December 9, 2003.
[DSI5]
MathPlayer Documentation2003.
[DSI6]
Design Science Awarded NSF Grant for Enhancing Searching for Mathematics; Press Release (National Science Digital Library program grant No. 0333645) , December 1, 2003.
[DSI7]
MathPage: From Word to the Web.
[DSI8]
MathPlayer information page.
[WRI]
Market Background: Wolfram Research2004.
[APS]
Keeping the Promise: Phys Rev Completes Online ArchiveAPS News Online, American Physical Society, August 2001.
[PROLA]
PROLA: Database ReviewMark Doyle, as quoted by Ian D. Gordon, James A. Gibson Library, Brock University, Spring 2002.
[DTD]
Archive Tag Library, Mulberry Technologies, Inc., 2003.
[MathML3]
Math Activity StatementMax Froumentin, Worldwide Web Consortium, 2004.
[DSI9]
Microsoft and Design Science Bring Math Help to Students Through MSNPress Release, December 16, 2003.

XHTML rendition made possible by SchemaSoft's Document Interpreter™ technology.