W3C

Mathematical Markup Language (MathML) Version 3.0

W3C Working Draft 14 December 2007

This version:
http://www.w3.org/TR/2007/WD-MathML3-20071214/
Latest MathML 3 version:
http://www.w3.org/TR/MathML3/
Latest MathML Recommendation:
http://www.w3.org/TR/MathML/
Previous version:
http://www.w3.org/TR/2007/WD-MathML3-20071005/
Editors:
David Carlisle, NAG
Patrick Ion, Mathematical Reviews, American Mathematical Society
Robert Miner, Design Science, Inc.
Principal Authors:
Ron Ausbrooks, Bert Bos, Olga Caprotti, David Carlisle, Giorgi Chavchanidze, Ananth Coorg, Stéphane Dalmas, Stan Devitt, Sam Dooley, Margaret Hinchcliffe, Patrick Ion, Michael Kohlhase, Azzeddine Lazrek, Dennis Leas, Paul Libbrecht, Manolis Mavrikis, Bruce Miller, Robert Miner, Murray Sargent, Kyle Siegrist, Neil Soiffer, Stephen Watt, Mohamed Zergaoui

Please refer to the errata for this document, which may include some normative corrections.

In addition to the HTML version, this document is also available in these non-normative formats: XHTML+MathML version.

See also translations.


Abstract

This specification defines the Mathematical Markup Language, or MathML. MathML is an XML application for describing mathematical notation and capturing both its structure and content. The goal of MathML is to enable mathematics to be served, received, and processed on the World Wide Web, just as HTML has enabled this functionality for text.

This specification of the markup language MathML is intended primarily for a readership consisting of those who will be developing or implementing renderers or editors using it, or software that will communicate using MathML as a protocol for input or output. It is not a User's Guide but rather a reference document.

MathML can be used to encode both mathematical notation and mathematical content. About thirty-five of the MathML tags describe abstract notational structures, while another about one hundred and seventy provide a way of unambiguously specifying the intended meaning of an expression. Additional chapters discuss how the MathML content and presentation elements interact, and how MathML renderers might be implemented and should interact with browsers. Finally, this document addresses the issue of special characters used for mathematics, their handling in MathML, their presence in Unicode, and their relation to fonts.

While MathML is human-readable, in all but the simplest cases, authors use equation editors, conversion programs, and other specialized software tools to generate MathML. Several versions of such MathML tools exist, and more, both freely available software and commercial products, are under development.

Status of this Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

This document is a W3C Public Working Draft produced by the W3C Math Working Group as part of the W3C Math Activity. The goals of the W3C Math Working Group are discussed in the W3C Math WG Charter (revised July 2006). A list of participants in the W3C Math Working Group is available.

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or made obsolete by other documents at any time. It is inappropriate to cite this document as other than work in progress.

This third Public Working Draft specifies a new version of the the Mathematical Markup Language, MathML 3.0 which is at present under active development. The Math WG hopes this draft will permit informed feedback. There is a description of some considerations underlying this work in the W3C Math WG's public Roadmap [roadmap]. Feedback should be sent to the Public W3C Math mailing list .

The MathML 2.0 (Second Edition) specification has been a W3C Recommendation since 2001. After its recommendation, a W3C Math Interest Group collected reports of experience with the deployment of MathML and identified issues with MathML that might be ameliorated. The rechartering of a Math Working Group allows the revision to MathML 3.0 in the light of that experience, of other comments on the markup language, and of recent changes in specifications of the W3C and in the technological context. MathML 3.0 does not signal any change in the overall design of MathML. The major additions in MathML 3 are support for bidirectional layout, better linebreaking and explicit positioning, elementary math notations, and a new strict content MathML vocabulary with well-defined semantics generated from formal content dictionaries. The MathML 3 Specification has also been restructured.

Public discussion of MathML and issues of support through the W3C for mathematics on the Web takes place on the public mailing list of the Math Working Group (list archives). To subscribe send an email to www-math-request@w3.org with the word subscribe in the subject line.

Please report errors in this document to www-math@w3.org.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

The basic chapter structure of this document is based on the earlier MathML 2.0 Recommendation [MathML2]. That MathML 2.0 itself was a revision of the earlier W3C Recommendation MathML 1.01 [MathML1]; MathML 3.0 is a revision of the W3C Recommendation MathML 2.0. It differs from it in that all previous chapters have been updated, some new elements and attributes added and some deprecated. This Public Working Draft differs in structure from the initial Public Working Draft as renewed efforts to separate the formal from the explanatory have resulted in eight chapters not seven. Much has been moved to separate documents containing Primer material, material on Characters and Entities and on the MathML DOM. First Working Drafts of these documents will be published soon. A current list of open issues, pointing into the relevant places in the draft, follows the Table of Contents.

Table of Contents

1 Introduction
    1.1 Mathematics and its Notation
    1.2 Origins and Goals
        1.2.1 Design Goals of MathML
2 MathML Fundamentals
    2.1 MathML Syntax and Grammar
        2.1.1 MathML Syntax and Grammar
        2.1.2 Children versus Arguments
        2.1.3 MathML Attribute Values
        2.1.4 Attributes Shared by all MathML Elements
        2.1.5 Collapsing Whitespace in Input
    2.2 Interfacing
    2.3 Conformance
        2.3.1 MathML Conformance
        2.3.2 Handling of Errors
        2.3.3 Attributes for unspecified data
    2.4 Future Extensions
        2.4.1 Macros and Style Sheets
        2.4.2 XML Extensions to MathML
    2.5 Embedding MathML in other Documents
        2.5.1 MathML and Namespaces
        2.5.2 The Top-Level math Element
3 Presentation Markup
    3.1 Introduction
        3.1.1 What Presentation Elements Represent
        3.1.2 Terminology Used In This Chapter
        3.1.3 Required Arguments
        3.1.4 Elements with Special Behaviors
        3.1.5 Directionality
        3.1.6 Summary of Presentation Elements
    3.2 Token Elements
        3.2.1 MathML characters in token elements
        3.2.2 Mathematics style attributes common to token elements
        3.2.3 Identifier (mi)
        3.2.4 Number (mn)
        3.2.5 Operator, Fence, Separator or Accent (mo)
        3.2.6 Text (mtext)
        3.2.7 Space (mspace)
        3.2.8 String Literal (ms)
        3.2.9 Using images to represent symbols (mglyph)
        3.2.10 Line mline
    3.3 General Layout Schemata
        3.3.1 Horizontally Group Sub-Expressions (mrow)
        3.3.2 Fractions (mfrac)
        3.3.3 Radicals (msqrt, mroot)
        3.3.4 Style Change (mstyle)
        3.3.5 Error Message (merror)
        3.3.6 Adjust Space Around Content (mpadded)
        3.3.7 Making Sub-Expressions Invisible (mphantom)
        3.3.8 Expression Inside Pair of Fences (mfenced)
        3.3.9 Enclose Expression Inside Notation (menclose)
    3.4 Script and Limit Schemata
        3.4.1 Subscript (msub)
        3.4.2 Superscript (msup)
        3.4.3 Subscript-superscript Pair (msubsup)
        3.4.4 Underscript (munder)
        3.4.5 Overscript (mover)
        3.4.6 Underscript-overscript Pair (munderover)
        3.4.7 Prescripts and Tensor Indices (mmultiscripts)
    3.5 Tabular Math
        3.5.1 Table or Matrix (mtable)
        3.5.2 Row in Table or Matrix (mtr)
        3.5.3 Labeled Row in Table or Matrix (mlabeledtr)
        3.5.4 Entry in Table or Matrix (mtd)
        3.5.5 Alignment Markers
        3.5.6 mcolumn
    3.6 Enlivening Expressions
        3.6.1 Bind Action to Sub-Expression (maction)
    3.7 Elementary Math
        3.7.1 Addition, Subtraction, and Multiplication
        3.7.2 Long Division
        3.7.3 Repeating decimal
    3.8 Semantics and Presentation
4 Content Markup
    4.1 Introduction
    4.2 Strict Content MathML
        4.2.1 The structure of MathML3 Content Expressions
        4.2.2 Encoding OpenMath Objects
        4.2.3 Numbers
        4.2.4 Symbols and Identifiers
        4.2.5 Function Application
        4.2.6 Bindings and Bound Variables
        4.2.7 Qualifiers
        4.2.8 Structure Sharing
        4.2.9 Attribution via semantics
        4.2.10 In Situ Error Markup
    4.3 Pragmatic Content MathML
        4.3.1 Numbers with constant type
        4.3.2 csymbol Elements with Presentation MathML
        4.3.3 Symbols and Identifiers With Presentation MathML
        4.3.4 Elementary MathML Types on Tokens
        4.3.5 Token Elements
        4.3.6 Tokens with Attributes
        4.3.7 Container Markup
        4.3.8 Domain of Application in Applications
        4.3.9 Domain of Application in Bindings
        4.3.10 Integrals with Calling patterns
        4.3.11 degree
        4.3.12 Upper and Lower Limits
        4.3.13 Lifted Associative Commutative Operators
        4.3.14 Declare (declare)
    4.4 The MathML3 Content Dictionaries and Operators
        4.4.1 The content dictionarybasic_content_elements.mcd for the basic content elements.
        4.4.2 The content dictionary algebra-logic for arithmetic, algebra and logic.
        4.4.3 The content dictionary relations for relations.
        4.4.4 The content dictionary calculus_veccalc for calculus and vector calculus.
        4.4.5 The content dictionary sets for theory of sets.
        4.4.6 The content dictionary sequences_series for sequences and series.
        4.4.7 The content dictionary specfun for elementary classical functions.
        4.4.8 The content dictionary statistics for statistics.
        4.4.9 The content dictionary linear_algebra for linear algebra.
        4.4.10 The content dictionary constants for constant and symbol elements.
        4.4.11 The content dictionary errors for general error codes.
5 Combining Presentation and Content Markup
    5.1 Motivation
    5.2 Semantic Annotations for Alternate Representations
        5.2.1 The annotation-xml element
        5.2.2 Annotation references
    5.3 Semantic Annotations beyond Alternate Representations
    5.4 Mixed Markup
        5.4.1 Reasons to Mix Markup
        5.4.2 Presentation Markup in Content Markup
        5.4.3 Content Markup in Presentation Markup
    5.5 Parallel Markup
        5.5.1 Top-level Parallel Markup
        5.5.2 Parallel Markup via Cross-References: xml:id and xref
6 Characters, Entities and Fonts
    6.1 Introduction
    6.2 Unicode Character Data
    6.3 Entity Declarations
    6.4 Special Characters Not in Unicode
    6.5 Mathematical Alphanumeric Symbols
    6.6 Non-Marking Characters
7 MathML interactions with the Wide World
    7.1 Invoking MathML Processors: namespace, extensions, and mime-types
        7.1.1 Recognizing MathML in an XML Model
        7.1.2 Resource Types for MathML Documents
    7.2 Transferring MathML in Desktop Environments
        7.2.1 Basic Flavors' Names and Contents
        7.2.2 Recommended Behaviours when Transferring
        7.2.3 Discussion
        7.2.4 Examples
    7.3 Combining MathML and Other Formats
        7.3.1 Mixing MathML and HTML
        7.3.2 Linking
        7.3.3 Images
        7.3.4 MathML and Graphical Markup
    7.4 Using CSS with MathML
8 MathML3 Content Dictionaries
    8.1 Introduction
    8.2 MathML3 Content Dictionaries Infrastructure and Metadata
    8.3 Symbol Declarations
    8.4 Type Declarations
    8.5 Symbol Roles
    8.6 Rendering of Content Elements
        8.6.1 Notation Specifications
        8.6.2 Precedence-based Elisions
        8.6.3 Rendering Cross-References for Parallel Markup
        8.6.4 General Rules
        8.6.5 Limitations and Extensions of Notation Documents

Appendices

A Parsing MathML
    A.1 Use of MathML as Well-Formed XML
    A.2 Using the RelaxNG Schema for MathML3
        A.2.1 The Schema Driver
        A.2.2 The Grammar for Presentation MathML
        A.2.3 The Grammar for Strict Content MathML3
        A.2.4 The Grammar for Pragmatic MathML
        A.2.5 The Grammar for Deprecated MathML Elements
        A.2.6 A Generated Grammar for Arity Checking
        A.2.7 MathML as a module in a RelaxNG Schema
    A.3 Using the MathML DTD
    A.4 Using the MathML XML Schema
B Operator Dictionary (Non-Normative)
    B.1 Format of operator dictionary entries
    B.2 Indexing of operator dictionary
    B.3 Choice of entity names
    B.4 Notes on lspace and rspace attributes
    B.5 Operator dictionary entries
C Sample CSS Style Sheet for MathML (Non-Normative)
D Glossary (Non-Normative)
E Working Group Membership and Acknowledgments (Non-Normative)
    E.1 The Math Working Group Membership
    E.2 Acknowledgments
F Changes (Non-Normative)
    F.1 Changes between MathML 2.0 Second Edition and MathML 3.0
G References (Non-Normative)
H Index (Non-Normative)
    H.1 MathML Elements
    H.2 MathML Attributes


Open Issues

The following is a list of open issues which are highlighted in this draft. The issue name links to the text of the issue in this specification. There is also a W3C member-only link to the Math Working Group wiki. (Note that in many cases the wiki does not have a page discussing the issue, but will offer to create such pages on demand.) In some cases there is also a (member only) link to the Math Working Group's Issue tracking system.

MathML Fundamentals

update_fundamentals   wiki (member only)
Update MathML Fundamentals
update_interface   wiki (member only)
Update Interface
linebreak-control   wiki (member only)
linebreak control
indent-control   wiki (member only)
indent control

Presentation Markup

linebreak-op   wiki (member only)
linebreak operators
mline-generalization   wiki (member only)
mline generalization
mpadded-clipping   wiki (member only)
Bounding Box as Clipping Rectangle
mpadded-examples   wiki (member only)
mpadded examples
mphantom-mcolumn   wiki (member only)
mcolumn mphantom
deprecate_maction   wiki (member only)
Deprecate maction
elem-ldiv-img   wiki (member only)
Images/Examples Needed

Content Markup

default_cd   wiki (member only)
Current CD default for csymbol
MathML_CDs_URI   wiki (member only)
What is the official URI for MathMLCDs
definitionURL_encoding   wiki (member only)   ISSUE-17 (member only)
URI encoding of cdbase/cd/name triplet
cdbase-default   wiki (member only)   ISSUE-13 (member only)
cdbase default value
csymbol_pmathml_strict   wiki (member only)
Strict equivalent for csymbol with pMathML content
lifted_operators   wiki (member only)   ISSUE-8 (member only)
New Symbols for Lifted Operators
large_ops   wiki (member only)   ISSUE-18 (member only)
Large Operators

MathML interactions with the Wide World

specify-encoding-names-in-details   wiki (member only)
Encoding Names jungle
Linking-and-marking-ids   wiki (member only)
Linking and Marking IDs

MathML3 Content Dictionaries

mcd_text_format   wiki (member only)
Text Format for MathML CDs?
mathml_roles   wiki (member only)
More Roles for MathML?
style-selector   wiki (member only)
Style Selector Specified?

Parsing MathML

update_schema   wiki (member only)
DTD and W3C XML Schema
permissive_units   wiki (member only)
more permissive lengths/widths
rnc_units-patterns   wiki (member only)
rnc_mathvariant   wiki (member only)
mglyph_alt   wiki (member only)
rnc_leftover-max   wiki (member only)
rnc_token-content   wiki (member only)
rnc_cn   wiki (member only)
rnc_cd-generated   wiki (member only)
rnc_set-type   wiki (member only)
rnc_mathmltype   wiki (member only)

Operator Dictionary

update_opdict   wiki (member only)
Update Operator Dictionary

Changes

update_changes   wiki (member only)
Changes between MathML 2 and 3 need to be logged