Home      Discussion      Topics      Dictionary      Almanac
Signup       Login
MathML

MathML

Overview
Mathematical Markup Language (MathML) is an application of XML
XML
XML is a set of rules for encoding documents electronically. It is defined in the produced by the W3C and several other related specifications; all are fee-free open standards....

 for describing mathematical
Mathematics
Mathematics is the science and study of quantity, structure, space, and change. Mathematicians seek out patterns, formulate new conjectures, and establish truth by rigorous deduction from appropriately chosen axioms and definitions....

 notations and capturing both its structure and content. It aims at integrating mathematical formulae into World Wide Web
World Wide Web
The World Wide Web is a system of interlinked hypertext documents accessed via the Internet. With a web browser, one can view Web pages that may contain text, images, videos, and other multimedia and navigate between them using hyperlinks...

 documents. It is a recommendation of the W3C math working group
Working group
A working group is an interdisciplinary collaboration of researchers working on new research activities that would be difficult to develop under traditional funding mechanisms . The lifespan of the WG can last anywhere between a few months and several years...

.

MathML 1 was released as a W3C recommendation in April 1998 as the first XML
XML
XML is a set of rules for encoding documents electronically. It is defined in the produced by the W3C and several other related specifications; all are fee-free open standards....

 language to be recommended by the W3C. Version 1.01 of the format was released in July 1999 and version 2.0 appeared in February 2001.
Discussion
Ask a question about 'MathML'
Start a new discussion about 'MathML'
Answer questions from other users
Full Discussion Forum
 
Encyclopedia
Mathematical Markup Language (MathML) is an application of XML
XML
XML is a set of rules for encoding documents electronically. It is defined in the produced by the W3C and several other related specifications; all are fee-free open standards....

 for describing mathematical
Mathematics
Mathematics is the science and study of quantity, structure, space, and change. Mathematicians seek out patterns, formulate new conjectures, and establish truth by rigorous deduction from appropriately chosen axioms and definitions....

 notations and capturing both its structure and content. It aims at integrating mathematical formulae into World Wide Web
World Wide Web
The World Wide Web is a system of interlinked hypertext documents accessed via the Internet. With a web browser, one can view Web pages that may contain text, images, videos, and other multimedia and navigate between them using hyperlinks...

 documents. It is a recommendation of the W3C math working group
Working group
A working group is an interdisciplinary collaboration of researchers working on new research activities that would be difficult to develop under traditional funding mechanisms . The lifespan of the WG can last anywhere between a few months and several years...

.

History


MathML 1 was released as a W3C recommendation in April 1998 as the first XML
XML
XML is a set of rules for encoding documents electronically. It is defined in the produced by the W3C and several other related specifications; all are fee-free open standards....

 language to be recommended by the W3C. Version 1.01 of the format was released in July 1999 and version 2.0 appeared in February 2001. In October 2003, the second edition of MathML Version 2.0 was published as the final release by the W3C math working group. In June 2006 the W3C has rechartered the MathML Working Group to produce a MathML 3 Recommendation until February 2008 and in November 2008 extended the charter to April 2010. A sixth Working Draft of the MathML 3 revision was published in June 2009.

MathML was originally designed before the finalization of XML namespaces. As such, MathML markup is often not namespaced, and applications that deal with MathML, such as the Mozilla browsers, do not require a namespace. For applications that wish to namespace MathML, the recommended namespace URI is http://www.w3.org/1998/Math/MathML.

Presentation and semantics


MathML deals not only with the presentation but also the meaning of formula components (the latter part of MathML is known as “Content MathML”). Because the meaning of the equation is preserved separate from the presentation, how the content is communicated can be left up to the user. For example, web pages with MathML embedded in them can be viewed as normal web pages with many browsers but visually impaired users can also have the same MathML read to them through the use of screen readers ( e. g. using the MathPlayer
MathPlayer
MathPlayer is a program by Design Science that enables the display of MathML mathematical formulae in Internet Explorer. MathML is a recommendation of the W3C for displaying formulae on the World Wide Web...

 plugin
Plugin
In computing, a plug-in consists of a computer program that interacts with a host application to provide a certain, usually very specific, function "on demand"...

 for Internet Explorer
Internet Explorer
Windows Internet Explorer , is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems starting in 1995...

, Opera
Opera (web browser)
Opera is a web browser and internet suite developed by the Opera Software company. The browser handles common Internet-related tasks such as displaying websites, sending and receiving e-mail messages, managing contacts, IRC online chatting, downloading files via BitTorrent, and reading web feeds...

 9.50 build 9656+ or the Fire Vox
Fire Vox
Fire Vox is a free and open source extension for the Mozilla Firefox web browser that transforms it into a self-voicing application. Easy to install and operate, it works on Windows, Mac, and Linux. It can work independently, or together with screen readers such as Orca. Since its debut in 2005,...

 extension for Firefox).

Presentation MathML


Presentation MathML focuses on the display of an equation, and has about 30 elements, and 50 attributes. The elements all begin with m and include token element: x - identifiers; +
- operators; 2 - number. Tokens are combined using layout elements that include: - a row; - superscripts; mfrac - fractions. The attributes mainly control fine details of the presentation. A large number of entities are available that represent letters π, symbols → and some non-visible character such as ⁢ representing multiplication.

For valid XML documents as per the W3C specifications, a MathML file must have a doctype declaration:


"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">


Thus, the expression could be represented in a valid MathML file as:


"http://www.w3.org/Math/DTD/mathml2/mathml2.dtd">


a


x
2

+
b

x
+
c



Content MathML


Content MathML focuses on the semantic meaning of the expression. Central to Content MathML is the element that represents a function or operator, given in the first child, applied to the remaining child elements. For example x represents and x5 represents x+5. The element represents an identifier, a number, and there are over a hundred different elements for different functions and operators. Content MathML uses only a few attributes.

The expression could be represented as



Example and Comparison to other formats


The well-known quadratic formula:

would be marked up using LaTeX
LaTeX
LaTeX is a document markup language and document preparation system for the TeX typesetting program. Within the typesetting system, its name is styled as ....

 syntax like this:
x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
in troff
Troff
troff is a document processing system developed by AT&T for the Unix operating system.-History:troff can trace its origins back to a text formatting program called RUNOFF, written by Jerome H. Saltzer for MIT's CTSS operating system in the mid-1960s...

/eqn
Eqn
Part of the troff suite of Unix document layout tools, eqn is a preprocessor that formats equations for printing. A similar program, neqn, accepted the same input as eqn, but produced output tuned to look better in nroff...

 like this:
x={-b +- sqrt{b sup 2 - 4ac}} over 2a
in OpenOffice.org Math
OpenOffice.org Math
OpenOffice.org Math is a tool for creating and editing mathematical formulae, similar to Microsoft Equation Editor and is part of the OpenOffice.org office suite. The created formulae can then be embedded inside other OpenOffice.org documents, such as those created by Writer...

 like this (both are valid):
x={-b plusminus sqrt {b^2 - 4 ac}} over {2 a}
x={-b +- sqrt {b^2 - 4ac}} over 2a

although the less elegant:
x={-b+-sqrt{b^2 -{4}ac} }over {2a}


x={-b plusminus sqrt {b^2 - 4 ac}} over {2 a}



In the expression tree above, elements like times are defined by the MathML specification and stand for mathematical functions that are applied to sibling expressions that are interpreted as arguments. The csymbol element is a generic extension element that means whatever is specified in the document referred to in the definitionURL attribute.

Although less compact than TeX, the XML structuring promises to make it widely usable and allows for instant display in applications such as Web browser
Web browser
A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...

s and facilitates a straightforward interpretation of its meaning in mathematical software products. MathML is not intended to be written or edited directly by humans.

Embedding MathML in XHTML files


MathML, being XML, can be embedded inside other XML files such as XHTML files using XML namespaces. Recent browsers such as Firefox 3+ and Opera 9.6+ (support incomplete) can display Presentation MathML embedded in XHTML.

eg. math-test.xhtml:


PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">





Example of MathML embedded in an XHTML file


Example of MathML embedded in an XHTML file



Given the quadratic equation


a


x
2

+
b

x
+
c


, the roots are given by


x
=



b
±


b
2


4

a

c



2

a




.






Editors


Some editors with native MathML support (including copy and paste of MathML) are Publicon
Publicon
Publicon is a technical publication software marketed by Wolfram Research. It is designed for engineers, physicists, chemists, bioscientists and people who work frequently with technical documents. Although the document technology in Publicon is identical to Mathematica's, the two software packages...

 from Wolfram Research and SciWriter from soft4science.

MathML is also supported by major office products such as OpenOffice.org
OpenOffice.org
OpenOffice.org , commonly known as OpenOffice, is an office application suite available for a number of different computer operating systems. It is distributed as free software and written using its own GUI toolkit...

, KOffice
KOffice
KOffice is a cross-platform office suite for the K Desktop Environment . All its components are released under free software/open source licenses and use OpenDocument as their native file format when possible. The latest version of KOffice is 2.0.2, which was released on August 13, 2009...

, and MS Office 2007
Microsoft Office 2007
Microsoft Office 2007 is the most recent Windows version of the Microsoft Office System, Microsoft's productivity suite. Formerly known as Office 12 in the initial stages of its beta cycle, it was released to volume license customers on November 30, 2006 and made available to retail customers on...

, as well as by mathematical software products such as Mathematica
Mathematica
Mathematica is a computational software program used in scientific, engineering, and mathematical fields and other areas of technical computing...

 and the Windows version of the Casio ClassPad 300
Casio ClassPad 300
The Casio ClassPad 300 is the first and only stylus based calculator. HP worked on a pen based calculator called the HP-Xpander, as did Texas Instruments under their , yet both projects were cancelled before they were released to the market...

. The W3C Browser/Editor Amaya
Amaya (web browser)
Amaya is a free and open source WYSIWYG web authoring tool with browsing abilities, created by a structured editor project at Institut National de Recherche en Informatique et en Automatique , a French national research institution, and later adopted by World Wide Web Consortium , the main...

 can also be mentioned as a WYSIWYG
WYSIWYG
WYSIWYG , is an acronym for What You See Is What You Get. The term is used in computing to describe a system in which content displayed during editing appears very similar to the final output, which might be a printed document, web page, slide presentation or even the lighting for a theatrical...

 MathML-as-is editor.

FireMath, an addon for Firefox, provides a WYSIWYG
WYSIWYG
WYSIWYG , is an acronym for What You See Is What You Get. The term is used in computing to describe a system in which content displayed during editing appears very similar to the final output, which might be a printed document, web page, slide presentation or even the lighting for a theatrical...

 MathML editor.

Most editors will only produce presentation MathML. The MathDox formula editor is an
OpenMath editor also providing presentation and content MathML.

Conversion


Several utilities for converting mathematical expressions to MathML are available, including converters between TeX
TeX
TeX is a typesetting system designed and mostly written by Donald Knuth...

 and MathML. ConTeXt
ConTeXt
ConTeXt is a document markup language and document preparation system based on the TeX typesetting system. It is designed with the same general-purpose aims as LaTeX of providing an easy to use interface to the high quality typesetting engine provided by TeX...

 does the reverse and uses TeX
TeX
TeX is a typesetting system designed and mostly written by Donald Knuth...

 for typesetting MathML (usually resulting in PDF documents). MathType
MathType
MathType, created by Design Science, is a proprietary interactive tool for Windows and Macintosh that allows the creation of mathematical notation for word processing, web pages, desktop publishing, and presentations, as well as for TeX, LaTeX, and MathML documents...

 from Design Science
Design Science
Design science may refer to:* The American technology company* A social philosophy developed by R. Buckminster Fuller* An information technology based research methodology* Design Science Interdisciplinary PhD Program at the University of Michigan...

 allows users to create equations in a WYSIWYG
WYSIWYG
WYSIWYG , is an acronym for What You See Is What You Get. The term is used in computing to describe a system in which content displayed during editing appears very similar to the final output, which might be a printed document, web page, slide presentation or even the lighting for a theatrical...

 window and export them as MathML. Also, Wolfram Research provides a web page to convert typed mathematical expressions to MathML.

GNU TeXmacs is a WYSIWYG
WYSIWYG
WYSIWYG , is an acronym for What You See Is What You Get. The term is used in computing to describe a system in which content displayed during editing appears very similar to the final output, which might be a printed document, web page, slide presentation or even the lighting for a theatrical...

 editor with extensive support for mathematics. Converters exist for presentation MathML in both directions. TeXmacs can be used to write mathematical articles that are exported to XHTML
XHTML
Extensible Hypertext Markup Language, or XHTML, is a family of XML markup languages that mirror or extend versions of the widely used Hypertext Markup Language , the language in which web pages are written....

 with embedded MathML.
Another WYSIWYG
WYSIWYG
WYSIWYG , is an acronym for What You See Is What You Get. The term is used in computing to describe a system in which content displayed during editing appears very similar to the final output, which might be a printed document, web page, slide presentation or even the lighting for a theatrical...

 MathML-as-is editor, Formulator MathML Weaver
Formulator MathML Weaver
Formulator MathML Weaver is a free software by Hermitech Laboratory that enables editing of MathML mathematical formulae in WYSIWYG way. MathML is a recommendation of the W3C for displaying formulae on the World Wide Web....

 provides a means for importing/exporting MathML with support for some abstract entities such as and .

Web browsers


Of the major web browser
Web browser
A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...

s, those that directly support the format are recent versions of Gecko browsers (e.g., Firefox and Camino
Camino
Camino is a free, open source, GUI-based Web browser based on Mozilla's Gecko layout engine and specifically designed for the Mac OS X operating system...

), and the Opera web browser
Opera (web browser)
Opera is a web browser and internet suite developed by the Opera Software company. The browser handles common Internet-related tasks such as displaying websites, sending and receiving e-mail messages, managing contacts, IRC online chatting, downloading files via BitTorrent, and reading web feeds...

 since version 9.5.

For Gecko-based browsers, the user is currently required to download special fonts in order to display MathML correctly; this is likely to change in late 2009 with the release of the STIX fonts.

Opera
Opera (web browser)
Opera is a web browser and internet suite developed by the Opera Software company. The browser handles common Internet-related tasks such as displaying websites, sending and receiving e-mail messages, managing contacts, IRC online chatting, downloading files via BitTorrent, and reading web feeds...

, since version 9.5, supports MathML for CSS profile, but it is unable to position diacritical marks properly. Before version 9.5 it required User JavaScript to emulate MathML support.

Internet Explorer
Internet Explorer
Windows Internet Explorer , is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems starting in 1995...

 does not support MathML out of the box. Support can be added by installing the MathPlayer
MathPlayer
MathPlayer is a program by Design Science that enables the display of MathML mathematical formulae in Internet Explorer. MathML is a recommendation of the W3C for displaying formulae on the World Wide Web...

 plugin.

Web conversion


ASCIIMathML
ASCIIMathML
ASCIIMathML is a client-side mathematical markup language for displaying mathematical expressions in web browsers.Using the JavaScript script ASCIIMathML.js, ASCIIMathML markup is converted to MathML at the time the page is loaded by the browser, natively in Mozilla Firefox and via a plug-in in IE7...

 provides a JavaScript
JavaScript
JavaScript is an object-oriented scripting language used to enable programmatic access to objects within both the client application and other applications. It is primarily used in the form of client-side JavaScript, implemented as an integrated component of the web browser, allowing the...

 library to rewrite a convenient Wiki-like text syntax used inline in web pages into MathML on the fly; it works in Gecko-based
Gecko (layout engine)
Gecko is a layout engine currently developed by Mozilla Corporation, known as the layout engine of the Firefox web browser, Mozilla Application Suite, Nvu, Mozilla Thunderbird and many more...

 browsers, and Internet Explorer
Internet Explorer
Windows Internet Explorer , is a series of graphical web browsers developed by Microsoft and included as part of the Microsoft Windows line of operating systems starting in 1995...

 with MathPlayer
MathPlayer
MathPlayer is a program by Design Science that enables the display of MathML mathematical formulae in Internet Explorer. MathML is a recommendation of the W3C for displaying formulae on the World Wide Web...

. LaTeXMathML does the same for (a subset of) the standard LaTeX
LaTeX
LaTeX is a document markup language and document preparation system for the TeX typesetting program. Within the typesetting system, its name is styled as ....

 mathematical syntax. ASCIIMathML
ASCIIMathML
ASCIIMathML is a client-side mathematical markup language for displaying mathematical expressions in web browsers.Using the JavaScript script ASCIIMathML.js, ASCIIMathML markup is converted to MathML at the time the page is loaded by the browser, natively in Mozilla Firefox and via a plug-in in IE7...

 syntax would also be quite familiar to anyone used to electronic scientific calculators.

Blahtex is a TeX-to-MathML converter intended for use with MediaWiki
MediaWiki
MediaWiki is a web-based wiki software application used by all projects of the Wikimedia Foundation, and many other wikis. Originally developed to serve the needs of the free content Wikipedia encyclopedia, today it has also been deployed by companies for internal knowledge management, and as a...

.

Equation Server for .NET from soft4science can be used on the server side (ASP.NET
ASP.NET
ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages ...

) for TeX-Math (Subset of LaTeX
LaTeX
LaTeX is a document markup language and document preparation system for the TeX typesetting program. Within the typesetting system, its name is styled as ....

 math syntax) to MathML conversion. It can also create bitmap images (Png, Jpg, Gif, etc.) from TeX-Math or MathML input.

LaTeXML is a perl utility to convert LaTeX documents to HTML, optionally either using MathML or converting mathematical expressions to bitmap images.

Support of software developers


Support of MathML format accelerates software application development in such various topics, as computer-aided education (distance learning, electronic textbooks and other classroom materials); automated creation of attractive reports; computer algebra systems; authoring, training, publishing tools (both for web and desktop-oriented), and many other applications for mathematics, science, business, economics, etc. Several software vendors propose a component edition of their MathML editors, thus providing the easy way for software developers to insert mathematics rendering/editing/processing functionality in their applications. For example, Formulator ActiveX Control
Formulator ActiveX Control
Formulator ActiveX Control is a software component by Hermitech Laboratory that enables software developers to insert MathML edit control into their applications. MathML is a recommendation of the W3C for displaying formulae on the World Wide Web....

 from Hermitech Laboratory
Hermitech Laboratory
Hermitech Laboratory was founded in Zhytomyr, Ukraine, in 2003 to develop the mathematical software tools. Currently, the main software line of Hermitech Laboratory is Formulator MathML Suite, that supports entering mathematics using natural mathematical notation and provides an easy way for...

 can be incorporated into an application as a MathML-as-is editor, Design Science
Design Science
Design science may refer to:* The American technology company* A social philosophy developed by R. Buckminster Fuller* An information technology based research methodology* Design Science Interdisciplinary PhD Program at the University of Michigan...

 propose a toolkit for building web pages that include interactive math (WebEQ Developers Suite,).

Other standards


Another standard called OpenMath
OpenMath
OpenMath is the name of a markup language for specifying the meaning of mathematical formulae. Among other things, it can be used to complement MathML, a standard which mainly focuses on the presentation of formulae, with information about their semantic meaning...

 that has been designed (largely by the same people who devised Content MathML) more specifically for storing formulae semantically can also be used to complement MathML. OpenMath data can be embeded in MathML using the element. OpenMath content dictionaries can be used to define the meaning of elements. The following would define P1(x) to be the first Legendre polynomial



P1

x



The OMDoc
OMDoc
OMDoc is a semantic markup format for mathematical documents. While MathML only covers mathematical formulae and the related OpenMath standard only supports formulae and “content dictionaries” containing definitions of the symbols used in formulae, OMDoc covers the whole range of written...

 format has been created for markup of larger mathematical structures than formulae, from statements like definitions, theorems, proofs, or example, to theories and text books. Formulae in OMDoc documents can either be written in Content MathML or in OpenMath; for presentation, they are converted to Presentation MathML.

The ISO
International Organization for Standardization
The International Organization for Standardization , widely known as ISO , is an international-standard-setting body composed of representatives from various national standards organizations. Founded on 23 February 1947, the organization promulgates worldwide proprietary industrial and commercial...

/IEC
International Electrotechnical Commission
The International Electrotechnical Commission is a not-for-profit, non-governmental international standards organization that prepares and publishes International Standards for all electrical, electronic and related technologies – collectively known as "electrotechnology"...

 standard Office Open XML (OOXML) defines a different XML math syntax, derived from Microsoft Office
Microsoft Office
Microsoft Office is an office suite of interrelated desktop applications, servers and services for the Microsoft Windows and Mac OS X operating systems. Microsoft Office was introduced by Microsoft in 1989 for Mac OS, with a version for Windows in 1990...

 products. However, it is partially compatible through relatively simple XSL Transformations
XSL Transformations
XSL Transformations is a declarative XML-based language used for the transformation of XML documents into other XML documents. The original document is not changed; rather, a new document is created based on the content of an existing one. The new document may be serialized by the processor in...

.

See also

  • CSS
    CSS
    -Computing:*Cascading Style Sheets, a language used to describe the style of document presentations in web development*Central Structure Store in the PHIGS 3D API*Closed source software, software that is not distributed with source code...

  • List of document markup languages
  • Comparison of document markup languages
    Comparison of document markup languages
    The following tables compare general and technical information for a number of document markup languages. Please see the individual markup languages' articles for further information.-General information:...

  • Formula editor
    Formula editor
    A formula editor is a name for a computer program that is used to typeset mathematical works or formulae.Formula editors typical serve two purposes:...

    s
  • GELLMU
  • LaTeX2HTML
    LaTeX2HTML
    LaTeX2HTML is a converter written in Perl that converts LaTeX documents to HTML. This way, e.g., scientific papers--primarily typeset for printing--can be put on the Web for online viewing. Support ended in 2001...

  • List of computer standards

Software

  • Mozilla Firefox, web browser.
  • OpenOffice.org, office suite.
  • Opera, web browser.
  • Sun Microsystems — StarOffice, office suite.
  • W3C — Amaya, web editor (jointly developed by W3C and INRIA.
  • MathMagic
    MathMagic
    MathMagic, with its text form logotype [Math+Magic], is an equation editor for Windows and Mac OS including Mac OS X.MathMagic is a bit similar with MathType in terms of user interface but it seems to focus more on high quality printing - targeting publishing market, and higher productivity with...

     - WYSIWYG MathML equation editor for Technical writing
    Technical writing
    Technical writing, a form of technical communication, is a style of formal writing used in fields as diverse as computer hardware and software, chemistry, the aerospace industry, robotics, finance, consumer electronics, and biotechnology. Technical writers explain technology and related ideas to...

    and publishing

Miscellaneous