Mathml
Mathml
Mathml
0 3rd Edition
Abstract
This specification defines the Mathematical Markup Language, or MathML. MathML is a markup
language 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-
eight 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 ren-
derers 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, authors typically will use equation editors, conversion programs,
and other specialized software tools to generate MathML. Several versions of such MathML tools exist,
both freely available software and commercial products, and more are under development.
2
MathML was originally specified as an XML application and most of the examples in this specifica-
tion assume that syntax. Other syntaxes are possible most notably [HTML5] specifies the syntax for
MathML in HTML. Unless explictly noted, the examples in this specification are also valid HTML
syntax.
it in that all previous chapters have been updated, some new elements and attributes added and some
deprecated. Much has been moved to separate documents containing explanatory material, material on
characters and entities and on the MathML DOM. The discussion of character entities has led to the
document XML Entity Definitions for Characters [Entities], which is now a W3C Recommendation.
The concern with use of CSS with MathML has led to the document A MathML for CSS Profile
[MathMLforCSS], which was a W3C Recommendation accompanying MathML 3.0.
The biggest differences from MathML 2.0 (Second Edition) are in Chapters 4 and 5, although there
have been smaller improvements throughout the specification. A more detailed description of changes
from the previous Recommendation follows.
• Much of the non-normative explication that formerly was found in Chapters 1 and 2, and
many examples from elsewhere in the previous MathML specifications, were removed from
the MathML3 specification and planned to be incorporated into a MathML Primer to be
prepared as a separate document. It is expected this will help the use of this formal MathML3
specification as a reference document in implementations, and offer the new user better help
in understanding MathML’s deployment. The remaining content of Chapters 1 and 2 has
been edited to reflect the changes elsewhere in the document, and in the rapidly evolving
Web environment. Some of the text in them went back to early days of the Web and XML,
and its explanations are now commonplace.
• Chapter 3, on presentation-oriented markup, adds new material on linebreaking, and on
markup for elementary math notations used in many countries (mstack, mlongdiv and
other associated elements). Other changes include revisions to the mglyph, mpadded and
maction elements and significant unification and cleanup of attribute values. Earlier work,
as recorded in the W3C Note Arabic mathematical notation, has allowed clarification of the
relationship with bidirectional text and examples with RTL text have been added.
• Chapter 4, on content-oriented markup, contains major changes and additions. The meaning
of the actual content remains as before in principle, but a lot of work has been done on
expressing it better. A few new elements have been added.
• Chapter 5 has been refined as its purpose has been further clarified to deal with the mixing
of markup languages. This chapter deals, in particular, with interrelations of parts of the
MathML specification, especially with presentation and content markup.
• Chapter 6 is a new addition which deals with the issues of interaction of MathML with a host
environment. This chapter deals with interrelations of the MathML specification with XML
and HTML, but in the context of deployment on the Web. In particular there is a discussion
of the interaction of CSS with MathML.
• Chapter 7 replaces the previous Chapter 6, and has been rewritten and reorganized to reflect
the new situation in regard to Unicode, and the changed W3C context with regard to named
character entities. The new W3C specification XML Entity Definitions for Characters, which
incorporates those used for mathematics has become a a W3C Recommendation, [Entities].
• The Appendices, of which there are eight shown, have been reworked. Appendix A now
contains the new RelaxNG schema for MathML3 as well as discussion of MathML3 DTD
issues. Appendix B addresses media types associated with MathML and implicitly consti-
tutes a request for the registration of three new ones, as is now standard for work from the
W3C. Appendix C contains a new simplified and reconsidered Operator Dictionary. Ap-
pendices D, E, F, G and H contain similar non-normative material to that in the previous
specification, now appropriately updated.
• A fuller discussion of the document’s evolution can be found in Appendix F.
Contents
1 Introduction 9
1.1 Mathematics and its Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.2 Origins and Goals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2.1 Design Goals of MathML . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.3 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.4 A First Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2 MathML Fundamentals 14
2.1 MathML Syntax and Grammar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.1.1 General Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.1.2 MathML and Namespaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.1.3 Children versus Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.4 MathML and Rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.5 MathML Attribute Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1.6 Attributes Shared by all MathML Elements . . . . . . . . . . . . . . . . . . . 20
2.1.7 Collapsing Whitespace in Input . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2 The Top-Level <math> Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.2.1 Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.2.2 Deprecated Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.3 Conformance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.3.1 MathML Conformance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.3.2 Handling of Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.3.3 Attributes for unspecified data . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3 Presentation Markup 28
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.1.1 What Presentation Elements Represent . . . . . . . . . . . . . . . . . . . . . 28
3.1.2 Terminology Used In This Chapter . . . . . . . . . . . . . . . . . . . . . . . . 29
3.1.3 Required Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.1.4 Elements with Special Behaviors . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.1.5 Directionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.1.6 Displaystyle and Scriptlevel . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.1.7 Linebreaking of Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.1.8 Warning about fine-tuning of presentation . . . . . . . . . . . . . . . . . . . . 35
3.1.9 Summary of Presentation Elements . . . . . . . . . . . . . . . . . . . . . . . 37
3.1.10 Mathematics style attributes common to presentation elements . . . . . . . . . 38
3.2 Token Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.1 Token Element Content Characters, <mglyph/> . . . . . . . . . . . . . . . . . 39
3.2.2 Mathematics style attributes common to token elements . . . . . . . . . . . . 41
3.2.3 Identifier <mi> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4
CONTENTS 5
Introduction
9
10 Chapter 1. Introduction
writing right-to-left. Of course, conventions for the symbols used, particularly those naming functions
and variables, may tend to favor a local language and script. The largest variation from the most com-
mon is a form used in some Arabic-speaking communities which lays out the entire mathematical
notation from right-to-left, roughly in mirror image of the European tradition.
However, there is more to putting mathematics on the Web than merely finding ways of displaying
traditional mathematical notation in a Web browser. The Web represents a fundamental change in the
underlying metaphor for knowledge storage, a change in which interconnection plays a central role.
It has become important to find ways of communicating mathematics which facilitate automatic pro-
cessing, searching and indexing, and reuse in other mathematical applications and contexts. With this
advance in communication technology, there is an opportunity to expand our ability to represent, en-
code, and ultimately to communicate our mathematical insights and understanding with each other. We
believe that MathML as specified below is an important step in developing mathematics on the Web.
• Mathematical expression editors and converters should be developed to facilitate the creation
of Web pages containing MathML expressions.
The extent to which these goals are ultimately met depends on the cooperation and support of browser
vendors and other developers. The W3C Math Working Group has continued to work with other work-
ing groups of the W3C, and outside the W3C, to ensure that the needs of the scientific community will
be met. MathML 2 and its implementations showed considerable progress in this area over the situation
that obtained at the time of the MathML 1.0 Recommendation (April 1998) [MathML1]. MathML3
and the developing Web are expected to allow much more.
1.3 Overview
MathML is a markup language for describing mathematics. It is usually expressed in XML syntax,
although HTML and other syntaxes are possible. A special aspect of MathML is that there are two
main strains of markup: Presentation markup, discussed in Chapter 3, is used to display mathematical
expressions; and Content markup, discussed in Chapter 4, is used to convey mathematical meaning.
Content markup is specified in particular detail. This specification makes use of an XML format called
Content Dictionaries This format has been developed by the OpenMath Society, [OpenMath2004] with
the dictionaries being used by this specification involving joint development by the OpenMath Society
and the W3C Math Working Group.
Fundamentals common to both strains of markup are covered in Chapter 2, while the means for com-
bining these strains, as well as external markup, into single MathML objects are discussed in Chapter 5.
How MathML interacts with applications is covered in Chapter 6. Finally, a discussion of special sym-
bols, and issues regarding characters, entities and fonts, is given in Chapter 7.
√
−b ± b2 − 4ac
x=
2a
MathML offers two flavors of markup of this formula. The first is the style which emphasizes the actual
presentation of a formula, the two-dimensional layout in which the symbols are arranged. An example
of this type is given just below. The second flavor emphasizes the mathematical content and an example
of it follows the first one.
<mrow>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mrow>
<mo>-</mo>
<mi>b</mi>
</mrow>
<mo>±</mo>
<msqrt>
12 Chapter 1. Introduction
<mrow>
<msup>
<mi>b</mi>
<mn>2</mn>
</msup>
<mo>-</mo>
<mrow>
<mn>4</mn>
<mo>⁢</mo>
<mi>a</mi>
<mo>⁢</mo>
<mi>c</mi>
</mrow>
</mrow>
</msqrt>
</mrow>
<mrow>
<mn>2</mn>
<mo>⁢</mo>
<mi>a</mi>
</mrow>
</mfrac>
</mrow>
Consider the superscript 2 in this formula. It represents the squaring operation here, but the meaning
of a superscript in other situations depends on the context. A letter with a superscript can be used to
signify a particular component of a vector, or maybe the superscript just labels a different type of some
structure. Similarly two letters written one just after the other could signify two variables multiplied
together, as they do in the quadratic formula, or they could be two letters making up the name of a single
variable. What is called Content Markup in MathML allows closer specification of the mathematical
meaning of many common formulas. The quadratic formula given in this style of markup is as follows.
<apply>
<eq/>
<ci>x</ci>
<apply>
<divide/>
<apply>
<plus/>
<apply>
<minus/>
<ci>b</ci>
</apply>
<apply>
<root/>
<apply>
<minus/>
<apply>
<power/>
<ci>b</ci>
<cn>2</cn>
1.4. A First Example 13
</apply>
<apply>
<times/>
<cn>4</cn>
<ci>a</ci>
<ci>c</ci>
</apply>
</apply>
</apply>
</apply>
<apply>
<times/>
<cn>2</cn>
<ci>a</ci>
</apply>
</apply>
</apply>
Chapter 2
MathML Fundamentals
14
2.1. MathML Syntax and Grammar 15
HTML does not support namespace extensibility in the same way, the HTML parser has in-built
knowledge of the HTML, SVG and MathML namespaces. xmlns attributes are just treated as nor-
mal attributes. Thus when using the HTML serialisation of MathML, prefixed element names must not
be used. xmlns="http://www.w3.org/1998/Math/MathML" may be used on the math element,
it will be ignored by the HTML parser, which always places math elements and its descendents in
the MathML namespace (other than special rules described in Appendix Afor invalid input, and for
annotation-xml. If a MathML expression is likely to be in contexts where it may be parsed by an
XML parser or an HTML parser, it SHOULD use the following form to ensure maximum compatibility:
<math xmlns="http://www.w3.org/1998/Math/MathML">
...
</math>
Unit Description
em an em (font-relative unit traditionally used for horizontal lengths)
ex an ex (font-relative unit traditionally used for vertical lengths)
px pixels, or size of a pixel in the current display
in inches (1 inch = 2.54 centimeters)
cm centimeters
mm millimeters
pt points (1 point = 1/72 inch)
pc picas (1 pica = 12 points)
% percentage of the reference value
Some additional aspects of units are discussed further below, in Section 2.1.5.2.
The following constants, namedspaces, may also be used where a length is needed; they are typically
used for spacing or padding between tokens. Recommended default values for these constants are
shown; the actual spacing used is implementation specific.
namedspace Recommended default
"veryverythinmathspace" 1/18em
"verythinmathspace" 2/18em
"thinmathspace" 3/18em
"mediummathspace" 4/18em
"thickmathspace" 5/18em
"verythickmathspace" 6/18em
"veryverythickmathspace" 7/18em
"negativeveryverythinmathspace" -1/18em
"negativeverythinmathspace" -2/18em
"negativethinmathspace" -3/18em
"negativemediummathspace" -4/18em
"negativethickmathspace" -5/18em
"negativeverythickmathspace" -6/18em
"negativeveryverythickmathspace" -7/18em
If, and how, lengths might affect non-visual media is implementation specific.
Other italicized descriptions of default values which appear in the tables of attributes are explained
individually for each attribute.
The single or double quotes which are required around attribute values in an XML start tag are not
shown in the tables of attribute value syntax for each element, but are around attribute values in exam-
ples in the text, so that the pieces of code shown are correct.
Note that, in general, there is no mechanism in MathML to simulate the effect of not specifying at-
tributes which are inherited or automatic. Giving the words ‘inherited’ or ‘automatic’ explicitly will
not work, and is not generally allowed. Furthermore, the mstyle element (Section 3.3.4) can even be
used to change the default values of presentation attributes for its children.
Note also that these defaults describe the behavior of MathML applications when an attribute is not
supplied; they do not indicate a value that will be filled in by an XML parser, as is sometimes mandated
by DTD-based specifications.
In general, there are a number of properties of MathML rendering that may be thought of as overall
properties of a document, or at least of sections of a large document. Examples might be mathsize
(the math font size: see Section 3.2.2), or the behavior in setting limits on operators such as integrals
or sums (e.g., movablelimits or displaystyle), or upon breaking formulas over lines (e.g.
linebreakstyle); for such attributes see several elements in Section 3.2. These may be thought to
be inherited from some such containing scope. Just above we have mentioned the setting of default
values of MathML attributes as inherited or automatic; there is a third source of global default values
for behavior in rendering MathML, a MathML operator dictionary. A default example is provided in
Appendix C. This is also discussed in Section 3.2.5.7 and examples are given in Section 3.2.5.2.
specify the use of XML linking with MathML elements, so user agents that support XML linking
should continue to support the use of the xlink:href attribute with MathML 3 as well.
See also Section 3.2.2 for a list of MathML attributes which can be used on most presentation token
elements.
The attribute other, is deprecated (Section 2.3.3) in favor of the use of attributes from other names-
paces.
Name values default
other string none
DEPRECATED but in MathML 1.0.
2.2.1 Attributes
The math element accepts any of the attributes that can be set on Section 3.3.4, including the common
attributes specified in Section 2.1.6. In particular, it accepts the dir attribute for setting the overall
directionality; the math element is usually the most useful place to specify the directionality (See Sec-
tion 3.1.5 for further discussion). Note that the dir attribute defaults to "ltr" on the math element
(but inherits on all other elements which accept the dir attribute); this provides for backward compat-
ibility with MathML 2.0 which had no notion of directionality. Also, it accepts the mathbackground
attribute in the same sense as mstyle and other presentation elements to set the background color of
the bounding box, rather than specifying a default for the attribute (see Section 3.1.10)
In addition to those attributes, the math element accepts:
In cases where size negotiation is not possible or fails (for example in the case of an expression that is
too long to fit in the allowed width), the overflow attribute is provided to suggest a processing method
to the renderer. Allowed values are:
Value Meaning
"linebreak" The expression will be broken across several lines. See Sec-
tion 3.1.7 for further discussion.
"scroll" The window provides a viewport into the larger complete dis-
play of the mathematical expression. Horizontal or vertical
scroll bars are added to the window as necessary to allow the
viewport to be moved to a different position.
"elide" The display is abbreviated by removing enough of it so that
the remainder fits into the window. For example, a large poly-
nomial might have the first and last terms displayed with ‘+ ...
+’ between them. Advanced renderers may provide a facility
to zoom in on elided areas.
"truncate" The display is abbreviated by simply truncating it at the right
and bottom borders. It is recommended that some indication
of truncation is made to the viewer.
24 Chapter 2. MathML Fundamentals
Value Meaning
"scale" The fonts used to display the mathematical expression are
chosen so that the full expression fits in the window. Note that
this only happens if the expression is too large. In the case of
a window larger than necessary, the expression is shown at its
normal size within the larger window.
2.3 Conformance
Information nowadays is commonly generated, processed and rendered by software tools. The expo-
nential growth of the Web is fueling the development of advanced systems for automatically searching,
categorizing, and interconnecting information. In addition, there are increasing numbers of Web ser-
vices, some of which offer technically based materials and activities. Thus, although MathML can be
written by hand and read by humans, whether machine-aided or just with much concentration, the
future of MathML is largely tied to the ability to process it with software tools.
There are many different kinds of MathML processors: editors for authoring MathML expressions,
translators for converting to and from other encodings, validators for checking MathML expressions,
computation engines that evaluate, manipulate, or compare MathML expressions, and rendering en-
gines that produce visual, aural, or tactile representations of mathematical notation. What it means to
support MathML varies widely between applications. For example, the issues that arise with a validat-
ing parser are very different from those for an equation editor.
This section gives guidelines that describe different types of MathML support and make clear the
extent of MathML support in a given application. Developers, users, and reviewers are encouraged to
use these guidelines in characterizing products. The intention behind these guidelines is to facilitate
reuse by and interoperability of MathML applications by accurately setting out their capabilities in
quantifiable terms.
The W3C Math Working Group maintains MathML Compliance Guidelines. Consult this document
for future updates on conformance activities and resources.
We shall use the phrase ‘a MathML processor’ to mean any application that can accept or produce a
valid MathML expression. A MathML processor that both accepts and produces valid MathML expres-
sions may be able to ‘round-trip’ MathML. Perhaps the simplest example of an application that might
round-trip a MathML expression would be an editor that writes it to a new file without modifications.
Three forms of MathML conformance are specified:
1. A MathML-input-conformant processor must accept all valid MathML expressions; it should
appropriately translate all MathML expressions into application-specific form allowing na-
tive application operations to be performed.
2. A MathML-output-conformant processor must generate valid MathML, appropriately repre-
senting all application-specific data.
3. A MathML-round-trip-conformant processor must preserve MathML equivalence. Two MathML
expressions are ‘equivalent’ if and only if both expressions have the same interpretation (as
stated by the MathML Schema and specification) under any relevant circumstances, by any
MathML processor. Equivalence on an element-by-element basis is discussed elsewhere in
this document.
Beyond the above definitions, the MathML specification makes no demands of individual processors. In
order to guide developers, the MathML specification includes advisory material; for example, there are
many recommended rendering rules throughout Chapter 3. However, in general, developers are given
wide latitude to interpret what kind of MathML implementation is meaningful for their own particular
application.
To clarify the difference between conformance and interpretation of what is meaningful, consider some
examples:
1. In order to be MathML-input-conformant, a validating parser needs only to accept expres-
sions, and return ‘true’ for expressions that are valid MathML. In particular, it need not
render or interpret the MathML expressions at all.
2. A MathML computer-algebra interface based on content markup might choose to ignore all
presentation markup. Provided the interface accepts all valid MathML expressions including
those containing presentation markup, it would be technically correct to characterize the
application as MathML-input-conformant.
3. An equation editor might have an internal data representation that makes it easy to export
some equations as MathML but not others. If the editor exports the simple equations as valid
MathML, and merely displays an error message to the effect that conversion failed for the
others, it is still technically MathML-output-conformant.
Developers who choose not to implement parts of the MathML specification in a meaningful way are
encouraged to itemize the parts they leave out by referring to specific categories in the test suite.
For MathML-output-conformant processors, information about currently available tools to validate
MathML is maintained at the W3C MathML Validator. Developers of MathML-output-conformant
processors are encouraged to verify their output using this validator.
Customers of MathML applications who wish to verify claims as to which parts of the MathML specifi-
cation are implemented by an application are encouraged to use the test suites as a part of their decision
processes.
Presentation Markup
3.1 Introduction
This chapter specifies the ‘presentation’ elements of MathML, which can be used to describe the layout
structure of mathematical notation.
28
3.1. Introduction 29
Certain characters are used to name identifiers or operators that in traditional notation render the
same as other symbols or usually rendered invisibly. For example, the entities ⅆ,
ⅇ, and ⅈ denote notational symbols semantically distinct from visual-
ly identical letters used as simple variables. Likewise, the entities ⁢,
⁡, ⁣ and the character U+2064 (INVISIBLE PLUS) usually ren-
der invisibly but represent significant information. These entities have distinct spoken renderings, may
influence visual linebreaking and spacing, and may effect the evaluation or meaning of particular ex-
pressions. Accordingly, authors should use these entities wherever they are applicable. For instance, the
expression represented visually as ‘ f (x)’ would usually be spoken in English as ‘ f of x’ rather than just
‘ f x’. MathML conveys this meaning by using the ⁡ operator after the ‘ f ’, which, in
this case, can be aurally rendered as ‘of’.
The complete list of MathML entities is described in [Entities].
These elements are listed in Section 3.1.9. The content elements are the MathML elements defined in
Chapter 4.
A MathML expression is a single instance of any of the presentation elements with the exception of
the empty elements none or mprescripts, or is a single instance of any of the content elements which
are allowed as content of presentation elements (described in Section 5.3.2). A sub-expression of an
expression E is any MathML expression that is part of the content of E, whether directly or indirectly,
i.e. whether it is a ‘child’ of E or not.
Since layout schemata attach special meaning to the number and/or positions of their children, a child of
a layout schema is also called an argument of that element. As a consequence of the above definitions,
the content of a layout schema consists exactly of a sequence of zero or more elements that are its
arguments.
<mn> 1 </mn>
</mrow>
</msqrt>
This feature allows MathML data not to contain (and its authors to leave out) many mrow elements that
would otherwise be necessary.
Certain elements are considered space-like; these are defined in Section 3.2.7. This definition affects
some of the suggested rendering rules for mo elements (Section 3.2.5).
Certain elements, e.g. msup, are able to embellish operators that are their first argument. These elements
are listed in Section 3.2.5, which precisely defines an ‘embellished operator’ and explains how this
affects the suggested rendering rules for stretchy operators.
3.1.5 Directionality
In the notations familiar to most readers, both the overall layout and the textual symbols are arranged
from left to right (LTR). Yet, as alluded to in the introduction, mathematics written in Hebrew or in
locales such as Morocco or Persia, the overall layout is used unchanged, but the embedded symbols
(often Hebrew or Arabic) are written right to left (RTL). Moreover, in most of the Arabic speaking
world, the notation is arranged entirely RTL; thus a superscript is still raised, but it follows the base on
the left rather than the right.
MathML 3.0 therefore recognizes two distinct directionalities: the directionality of the text and symbols
within token elements and the overall directionality represented by Layout Schemata. These two facets
are discussed below.
Other features of Unicode and scripts that should be respected are ‘mirroring’ and ‘glyph shaping’.
Some Unicode characters are marked as being mirrored when presented in a RTL context; that is, the
character is drawn as if it were mirrored or replaced by a corresponding character. Thus an opening
parenthesis, ‘(’, in RTL will display as ‘)’. Conversely, the solidus (/ U+002F) is not marked as mir-
rored. Thus, an Arabic author that desires the slash to be reversed in an inline division should explicitly
use reverse solidus (\ U+005C) or an alternative such as the mirroring DIVISION SLASH (U+2215).
Additionally, calligraphic scripts such as Arabic blend, or connect sequences of characters together,
changing their appearance. As this can have an significant impact on readability, as well as aesthetics, it
is important to apply such shaping if possible. Glyph shaping, like directionality, applies to each token
element’s contents individually.
Please note that for the transfinite cardinals represented by Hebrew characters, the code points U+2135-
U+2138 (ALEF SYMBOL, BET SYMBOL, GIMEL SYMBOL, DALET SYMBOL) should be used.
These are strong left-to-right.
Section 3.2.2) on a token child of mfrac. Thus, the mathsize effectively overrides the effect of
scriptlevel. However, that change to scriptlevel changes the current font size, which affects the
meaning of an "em" length (see Section 2.1.5.2) and so the scriptlevel still may have an effect in
such cases. Note also that since mathsize is not constrained by scriptminsize, such direct changes
to font size can result in scripts smaller than scriptminsize.
Note that direct changes to current font size, whether by CSS or by the mathsize attribute (See Sec-
tion 3.2.2), have no effect on the value of scriptlevel.
TEX’s \displaystyle, \textstyle, \scriptstyle, and \scriptscriptstyle correspond to displaystyle and
scriptlevel as "true" and "0", "false" and "0", "false" and "1", and "false" and "2", re-
spectively. Thus, math’s display="block" corresponds to \displaystyle, while display="inline"
corresponds to \textstyle.
When a math element appears in an inline context, it may obey whatever paragraph flow rules are
employed by the document’s text rendering engine. Such rules are necessarily outside of the scope of
this specification. Alternatively, it may use the value of the math element’s overflow attribute. (See
Section 2.2.1.)
in platforms, font availability, and requirements particular to the agent itself (see Section 3.1). The
overuse of explicit rendering control may yield a ‘perfect’ layout on one platform, but give much worse
presentation on others. The following sections clarify the kinds of problems that can occur.
The above warning also applies to most uses of rendering attributes to alter the meaning conveyed by
an expression, with the exception of attributes on mi (such as mathvariant) used to distinguish one
variable from another.
token elements figure prominently in MathML markup. By contrast, in textual data, individual words
rarely need to be marked up or styled specially.
Frequently, tokens consist of a single character denoting a mathematical symbol. Other cases, e.g. func-
tion names, involve multi-character tokens. Further, because traditional mathematical notation makes
wide use of symbols distinguished by their typographical properties (e.g. a Fraktur ’g’ for a Lie algebra,
or a bold ’x’ for a vector), care must be taken to insure that styling mechanisms respect typographi-
cal properties which carry meaning. Consequently, characters, tokens, and typographical properties of
symbols are closely related to one another in MathML.
Token elements represent identifiers (mi), numbers (mn), operators (mo), text (mtext), strings (ms) and
spacing (mspace). The mglyph element may be used within token elements to represent non-standard
symbols by images. Preceding detailed discussion of the individual elements, the next two subsections
discuss the allowable content of token elements and the attributes common to them.
with certain combinations of BMP character data and the mathvariant attribute and tokens containing
SMP Math Alphanumeric Symbol characters. Processing applications that accept SMP characters are
required to treat the corresponding BMP and attribute combinations identically. This is particularly
important for applications that support searching and/or equality testing.
The mathvariant attribute is described in more detail in Section 3.2.2, and a complete technical
description of the corresponding characters is given in Section 7.5.
Attributes
The mglyph element accepts the attributes listed in Section 3.1.10, but note that mathcolor has no
effect. The background color, mathbackground, should show through if the specified image has trans-
parency.
mglyph also accepts the additional attributes listed here.
Name values default
src URI required
Specifies the location of the image resource; it may be a URI relative to the base-URI
of the source of the MathML, if any.
width length from image
Specifies the desired width of the glyph; see height.
height length from image
Specifies the desired height of the glyph. If only one of width and height are given,
the image should be scaled to preserve the aspect ratio; if neither are given, the image
should be displayed at its natural size.
valign length 0ex
Specifies the baseline alignment point of the image with respect to the current baseline.
A positive value shifts the bottom of the image above the current baseline while a nega-
tive value lowers it. A value of 0 (the default) means that the baseline of the image is at
the bottom of the image.
alt string required
Provides an alternate name for the glyph. If the specified image can’t be found or dis-
played, the renderer may use this name in a warning message or some unknown glyph
notation. The name might also be used by an audio renderer or symbol processing sys-
tem and should be chosen to be descriptive.
3.2. Token Elements 41
Note that the src and alt attributes are required for correct usage in MathML 3, however this is not
enforced by the schema due to the deprecated usage described below.
Example
The following example illustrates how a researcher might use the mglyph construct with a set of images
to work with braid group notation.
<mrow>
<mi><mglyph src="my-braid-23" alt="2 3 braid"/></mi>
<mo>+</mo>
<mi><mglyph src="my-braid-132" alt="1 3 2 braid"/></mi>
<mo>=</mo>
<mi><mglyph src="my-braid-13" alt="1 3 braid"/></mi>
</mrow>
This might render as:
Deprecated Attributes
Originally, mglyph was designed to provide access to non-standard fonts. Since this functionality was
seldom implemented, nor were downloadable web fonts widely available, this use of mglyph has been
deprecated. For reference, the following attributes were previously defined:
Name values
fontfamily string
the name of a font that may be available to a MathML renderer, or a CSS font specifi-
cation; See Section 6.5 and CSS [CSS21] for more information.
index integer
Specified a position of the desired glyph within the font named by the fontfamily
attribute (see Section 3.2.2.1).
In MathML 1 and 2, both were required attributes; they are now optional and should be ignored unless
the src attribute is missing.
Additionally, in MathML 2, mglyph accepted the attributes described in Section 3.2.2 (mathvariant
and mathsize, along with the attributes deprecated there); to make clear that mglyph is not a token
element, and since these attributes have no effect in any case, these attributes have been deprecated.
Section 7.5. These characters are described in detail in section 2.2 of UTR #25. The description of each
such character in the Unicode standard provides an unstyled character to which it would be equiva-
lent except for a font change that corresponds to a mathvariant value. A token element that uses the
unstyled character in combination with the corresponding mathvariant value is equivalent to a token
element that uses the mathematical alphanumeric symbol character without the mathvariant attribute.
Note that the appearance of a mathematical alphanumeric symbol character should not be altered by
surrounding mathvariant or other style declarations.
Renderers should support those combinations of character data and mathvariant values that corre-
spond to Unicode characters, and that they can visually distinguish using available font characters.
Renderers may ignore or support those combinations of character data and mathvariant values that
do not correspond to an assigned Unicode code point, and authors should recognize that support for
mathematical symbols that do not correspond to assigned Unicode code points may vary widely from
one renderer to another.
Since MathML expressions are often embedded in a textual data format such as XHTML, the surround-
ing text and the MathML must share rendering attributes such as font size, so that the renderings will
be compatible in style. For this reason, most attribute values affecting text rendering are inherited from
the rendering environment, as shown in the ‘default’ column in the table above. (In cases where the
surrounding text and the MathML are being rendered by separate software, e.g. a browser and a plug-
in, it is also important for the rendering environment to provide the MathML renderer with additional
information, such as the baseline position of surrounding text, which is not specified by any MathML
attributes.) Note, however, that MathML doesn’t specify the mechanism by which style information is
inherited from the rendering environment.
If the requested mathsize of the current font is not available, the renderer should approximate it in the
manner likely to lead to the most intelligible, highest quality rendering. Note that many MathML ele-
ments automatically change the font size in some of their children; see the discussion in Section 3.1.6.
3.2.3.2 Attributes
mi elements accept the attributes listed in Section 3.2.2, but in one case with a different default value:
Name values default
mathvariant "normal" | "bold" | "italic" | "bold- (depends on content; described below)
italic" | "double-struck" | "bold-fraktur" |
"script" | "bold-script" | "fraktur" | "sans-
serif" | "bold-sans-serif" | "sans-serif-italic"
| "sans-serif-bold-italic" | "monospace" |
"initial" | "tailed" | "looped" | "stretched"
Specifies the logical class of the token. The default is "normal" (non-slanted) unless
the content is a single character, in which case it would be "italic".
Note that the deprecated fontstyle attribute defaults in the same way as mathvariant, depending
on the content.
Note that for purposes of determining equivalences of Math Alphanumeric Symbol characters (See Sec-
tion 7.5 and Section 3.2.1.1) the value of the mathvariant attribute should be resolved first, including
the special defaulting behavior described above.
3.2.3.3 Examples
<mi>x</mi>
<mi>D</mi>
<mi>sin</mi>
<mi mathvariant=’script’>L</mi>
<mi></mi>
An mi element with no content is allowed; <mi></mi> might, for example, be used by an ‘expression
editor’ to represent a location in a MathML expression which requires a ‘term’ (according to conven-
tional syntax for mathematics) but does not yet contain one.
46 Chapter 3. Presentation Markup
Identifiers include function names such as ‘sin’. Expressions such as ‘sin x’ should be written using the
character U+2061 (which also has the entity names ⁡ and ⁡) as shown below; see
also the discussion of invisible operators in Section 3.2.5.
<mrow>
<mi> sin </mi>
<mo> ⁡ </mo>
<mi> x </mi>
</mrow>
Miscellaneous text that should be treated as a ‘term’ can also be represented by an mi element, as in:
<mrow>
<mn> 1 </mn>
<mo> + </mo>
<mi> … </mi>
<mo> + </mo>
<mi> n </mi>
</mrow>
When an mi is used in such exceptional situations, explicitly setting the mathvariant attribute may
give better results than the default behavior of some renderers.
The names of symbolic constants should be represented as mi elements:
<mi> π </mi>
<mi> ⅈ </mi>
<mi> ⅇ </mi>
3.2.4.2 Attributes
mn elements accept the attributes listed in Section 3.2.2.
3.2. Token Elements 47
3.2.4.3 Examples
<mn> 2 </mn>
<mn> 0.123 </mn>
<mn> 1,000,000 </mn>
<mn> 2.1e10 </mn>
<mn> 0xFFEF </mn>
<mn> MCMLXIX </mn>
<mn> twenty one </mn>
differently. The first one should render as a single character representing a less-than-or-equal-to sign,
and the second one as the two-character sequence <=.
All operators, in the general sense used here, are subject to essentially the same rendering attributes and
rules. Subtle distinctions in the rendering of these classes of symbols, when they exist, are supported
using the Boolean attributes fence, separator and accent, which can be used to distinguish these
cases.
A key feature of the mo element is that its default attribute values are set on a case-by-case basis from
an ‘operator dictionary’ as explained below. In particular, default values for fence, separator and
accent can usually be found in the operator dictionary and therefore need not be specified on each mo
element.
Note that some mathematical operators are represented not by mo elements alone, but by mo elements
‘embellished’ with (for example) surrounding superscripts; this is further described below. Conversely,
as presentation elements, mo elements can contain arbitrary text, even when that text has no standard
interpretation as an operator; for an example, see the discussion ‘Mixing text and mathematics’ in
Section 3.2.6. See also Chapter 4 for definitions of MathML content elements that are guaranteed to
have the semantics of specific mathematical operators.
Note also that linebreaking, as discussed in Section 3.1.7, usually takes place at operators (either before
or after, depending on local conventions). Thus, mo accepts attributes to encode the desirability of
breaking at a particular operator, as well as attributes describing the treatment of the operator and
indentation in case the a linebreak is made at that operator.
3.2.5.2 Attributes
mo elements accept the attributes listed in Section 3.2.2 and the additional attributes listed here. Since
the display of operators is so critical in mathematics, the mo element accepts a large number of at-
tributes; these are described in the next three subsections.
Most attributes get their default values from an enclosing mstyle element, math element, from the
containing document, or from the Section 3.2.5.7. When a value that is listed as ‘inherited’ is not
explicitly given on an mo, mstyle element, math element, or found in the operator dictionary for a
given mo element, the default value shown in parentheses is used.
3.2. Token Elements 49
Dictionary-based attributes
Name values default
form "prefix" | "infix" | "postfix" set by position of operator in an mrow
Specifies the role of the operator in the enclosing expression. This role and the operator
content affect the lookup of the operator in the operator dictionary which affects the
spacing and other default properties; see Section 3.2.5.7.
fence "true" | "false" set by dictionary (false)
Specifies whether the operator represents a ‘fence’, such as a parenthesis. This attribute
generally has no direct effect on the visual rendering, but may be useful in specific cases,
such as non-visual renderers.
separator "true" | "false" set by dictionary (false)
Specifies whether the operator represents a ‘separator’, or punctuation. This attribute
generally has no direct effect on the visual rendering, but may be useful in specific
cases, such as non-visual renderers.
lspace length set by dictionary (thickmathspace)
Specifies the leading space appearing before the operator; see Section 3.2.5.7. (Note
that before is on the right in a RTL context; see Section 3.1.5).
rspace length set by dictionary (thickmathspace)
Specifies the trailing space appearing after the operator; see Section 3.2.5.7. (Note that
after is on the left in a RTL context; see Section 3.1.5).
stretchy "true" | "false" set by dictionary (false)
Specifies whether the operator should stretch to the size of adjacent material; see Sec-
tion 3.2.5.8.
symmetric "true" | "false" set by dictionary (false)
Specifies whether the operator should be kept symmetric around the math axis when
stretchy. Note this property only applies to vertically stretched symbols. See Sec-
tion 3.2.5.8.
maxsize length | "infinity" set by dictionary (infinity)
Specifies the maximum size of the operator when stretchy; see Section 3.2.5.8. Unitless
or percentage values indicate a multiple of the reference size, being the size of the
unstretched glyph.
minsize length set by dictionary (100%)
Specifies the minimum size of the operator when stretchy; see Section 3.2.5.8. Unitless
or percentage values indicate a multiple of the reference size, being the size of the
unstretched glyph.
largeop "true" | "false" set by dictionary (false)
Specifies whether the operator is considered a ‘large’ operator, that is, whether it should
be drawn larger than normal when displaystyle="true" (similar to using TEX’s
\displaystyle). Examples of large operators include ∫ and ∏. See Sec-
tion 3.1.6 for more discussion.
movablelimits "true" | "false" set by dictionary (false)
Specifies whether under- and overscripts attached to this operator ‘move’ to the more
compact sub- and superscript positions when displaystyle is false. Examples of op-
erators that typically have movablelimits="true" are ∑, ∏, and lim. See
Section 3.1.6 for more discussion.
accent "true" | "false" set by dictionary (false)
Specifies whether this operator should be treated as an accent (diacritical mark) when
used as an underscript or overscript; see munder, mover and munderover.
50 Chapter 3. Presentation Markup
Linebreaking attributes
The following attributes affect when a linebreak does or does not occur, and the appearance of the
linebreak when it does occur.
Name values default
linebreak "auto" | "newline" | "nobreak" | "goodbreak" | auto
"badbreak"
Specifies the desirability of a linebreak occurring at this operator: the default "auto"
indicates the renderer should use its default linebreaking algorithm to determine
whether to break; "newline" is used to force a linebreak; For automatic linebreak-
ing, "nobreak" forbids a break; "goodbreak" suggests a good position; "badbreak"
suggests a poor position.
lineleading length inherited (100%)
Specifies the amount of vertical space to use after a linebreak. For tall lines, it is of-
ten clearer to use more leading at linebreaks. Rendering agents are free to choose an
appropriate default.
linebreakstyle "before" | "after" | "duplicate" | "infixlinebreak- set by dictionary (before)
style"
Specifies whether a linebreak occurs ‘before’ or ‘after’ the operator when a linebreaks
occur on this operator; or whether the operator is duplicated. "before" causes the oper-
ator to appears at the beginning of the new line (but possibly indented); "after" causes
it to appear at the end of the line before the break. "duplicate" places the operator at
both positions. "infixlinebreakstyle" uses the value that has been specified for in-
fix operators; This value (one of "before", "after" or "duplicate") can be specified
by the application or bound by mstyle ("before" corresponds to the most common
style of linebreaking).
linebreakmultchar string inherited (⁢)
Specifies the character used to make an ⁢ operator visible at a linebreak.
For example, linebreakmultchar="·" would make the multiplication visible
as a center dot.
linebreak values on adjacent mo and mspaceelements do not interact; linebreak="nobreak" on
a mo does not, in itself, inhibit a break on a preceding or following (possibly nested) mo or mspace
element and does not interact with the linebreakstyle attribute value of the preceding or following
mo element. It does prevent breaks from occurring on either side of the mo element in all other situations.
Indentation attributes
The following attributes affect indentation of the lines making up a formula. Primarily these attributes
control the positioning of new lines following a linebreak, whether automatic or manual. However,
indentalignfirst and indentshiftfirst also control the positioning of single line formula with-
out any linebreaks. When these attributes appear on mo or mspace they apply if a linebreak occurs at
that element. When they appear on mstyle or math elements, they determine defaults for the style
to be used for any linebreaks occurring within. Note that except for cases where heavily marked-up
manual linebreaking is desired, many of these attributes are most useful when bound on an mstyle or
math element.
Note that since the rendering context, such as the available width and current font, is not always avail-
able to the author of the MathML, a render may ignore the values of these attributes if they result in a
line in which the remaining width is too small to usefully display the expression or if they result in a
line in which the remaining width exceeds the available linewrapping width.
3.2. Token Elements 51
<mo> ) </mo>
</mrow>
</mrow>
</mfrac>
</mrow>
The reasons for using specific mo elements for invisible operators include:
• such operators should often have specific effects on visual rendering (particularly spacing
and linebreaking rules) that are not the same as either the lack of any operator, or spacing
represented by mspace or mtext elements;
• these operators should often have specific audio renderings different than that of the lack of
any operator;
• automatic semantic interpretation of MathML presentation elements is made easier by the
explicit specification of such operators.
For example, an audio renderer might render f (x) (represented as in the above examples) by speaking
‘f of x’, but use the word ‘times’ in its rendering of xy. Although its rendering must still be different
depending on the structure of neighboring elements (sometimes leaving out ‘of’ or ‘times’ entirely), its
task is made much easier by the use of a different mo element for each invisible operator.
There is no provision in MathML for specifying in which direction (horizontal or vertical) to stretch a
specific character or operator; rather, when stretchy="true" it should be stretched in each direction
for which stretching is possible and reasonable for that character. It is up to the renderer to know in
which directions it is reasonable to stretch a character, if it can stretch the character. Most characters
can be stretched in at most one direction by typical renderers, but some renderers may be able to stretch
certain characters, such as diagonal arrows, in both directions independently.
The minsize and maxsize attributes limit the amount of stretching (in either direction). These two at-
tributes are given as multipliers of the operator’s normal size in the direction or directions of stretching,
or as absolute sizes using units. For example, if a character has maxsize="300%", then it can grow to
be no more than three times its normal (unstretched) size.
The symmetric attribute governs whether the height and depth above and below the axis of the char-
acter are forced to be equal (by forcing both height and depth to become the maximum of the two).
An example of a situation where one might set symmetric="false" arises with parentheses around
a matrix not aligned on the axis, which frequently occurs when multiplying non-square matrices. In
this case, one wants the parentheses to stretch to cover the matrix, whereas stretching the parentheses
symmetrically would cause them to protrude beyond one edge of the matrix. The symmetric attribute
only applies to characters that stretch vertically (otherwise it is ignored).
If a stretchy mo element is embellished (as defined earlier in this section), the mo element at its core
is stretched to a size based on the context of the embellished operator as a whole, i.e. to the same
size as if the embellishments were not present. For example, the parentheses in the following example
(which would typically be set to be stretchy by the operator dictionary) will be stretched to the same
size as each other, and the same size they would have if they were not underlined and overlined, and
furthermore will cover the same vertical interval:
<mrow>
<munder>
<mo> ( </mo>
<mo> _ </mo>
</munder>
<mfrac>
<mi> a </mi>
<mi> b </mi>
</mfrac>
<mover>
<mo> ) </mo>
<mo> ‾ </mo>
</mover>
</mrow>
Note that this means that the stretching rules given below must refer to the context of the embellished
operator as a whole, not just to the mo element itself.
</mfrac>
<mo maxsize="100%"> ) </mo>
</mrow>
The above should render as ( ab ) as opposed to the default rendering a
b .
Note that each parenthesis is sized independently; if only one of them had maxsize="100%", they
would render with different sizes.
• In the case of an embellished stretchy operator, the preceding rule applies to the stretchy
operator at its core.
By default, most horizontal arrows and some accents stretch horizontally.
In the case of a stretchy operator in a table cell (i.e. within an mtd element), the above rules assume
each cell of the table column containing the stretchy operator covers exactly one column. (Equivalently,
the value of the columnspan attribute is assumed to be 1 for all the table cells in the table row, includ-
ing the cell containing the operator.) When this is not the case, the operator should only be stretched
horizontally to cover those table cells that are entirely within the set of table columns that the operator’s
cell covers. Table cells that extend into columns not covered by the stretchy operator’s table cell should
be ignored. See Section 3.5.4.2 for details about the rowspan attribute.
The rules for horizontal stretching include mtd elements to allow arrows to stretch for use in commu-
tative diagrams laid out using mtable. The rules for the horizontal stretchiness include scripts to make
examples such as the following work:
<mrow>
<mi> x </mi>
<munder>
<mo> → </mo>
<mtext> maps to </mtext>
</munder>
<mi> y </mi>
</mrow>
This displays as x −−−−→ y.
maps to
<mo id=’eq1-equals’>=</mo>
<mrow>
<msup>
<mrow> <mo>(</mo> <mrow> <mi>x</mi> <mo>+</mo> <mn>1</mn> </mrow> <mo>)</mo> </mrow>
<mn>4</mn>
60 Chapter 3. Presentation Markup
</msup>
<mo linebreak=’newline’ linebreakstyle=’before’
indentalign=’id’ indenttarget=’eq1-equals’>=</mo>
<mrow>
<msup> <mi>x</mi> <mn>4</mn> </msup>
<mo id=’eq1-plus’>+</mo>
<mrow> <mn>4</mn> <mo>⁢</mo> <msup> <mi>x</mi> <mn>3</mn> </msup> </mrow>
<mo>+</mo>
<mrow> <mn>6</mn> <mo>⁢</mo> <msup> <mi>x</mi> <mn>2</mn> </msup> </mrow>
3.2.6.2 Attributes
mtext elements accept the attributes listed in Section 3.2.2.
See also the warnings about the legal grouping of ‘space-like elements’ in Section 3.2.7, and about the
use of such elements for ‘tweaking’ in Section 3.1.8.
3.2. Token Elements 61
3.2.6.3 Examples
<mtext> Theorem 1: </mtext>
<mtext>   </mtext>
<mtext>      </mtext>
<mtext> /* a comment */ </mtext>
element is apt to be spaced more appropriately for taking the place of a term within a series than if it
appeared in an mtext element.
3.2.7.2 Attributes
In addition to the attributes listed below, mspace elements accept the attributes described in Sec-
tion 3.2.2, but note that mathvariant and mathcolor have no effect and that mathsize only affects
the interpretation of units in sizing attributes (see Section 2.1.5.2). mspace also accepts the indentation
attributes described in Section 3.2.5.2.
Name values default
width length 0em
Specifies the desired width of the space.
height length 0ex
Specifies the desired height (above the baseline) of the space.
depth length 0ex
Specifies the desired depth (below the baseline) of the space.
linebreak "auto" | "newline" | "nobreak" | "goodbreak" | "badbreak" auto
Specifies the desirability of a linebreak at this space. This attribute should be ignored if
any dimensional attribute is set.
Linebreaking was originally specified on mspace in MathML2, but controlling linebreaking on mo is
to be preferred starting with MathML 3. MathML 3 adds new linebreaking attributes only to mo, not
mspace. However, because a linebreak can be specified on mspace, control over the indentation that
follows that break can be specified using the attributes listed in Section 3.2.5.2.
The value "indentingnewline" was defined in MathML2 for mspace; it is now deprecated. Its mean-
ing is the same as newline, which is compatible with its earlier use when no other linebreaking at-
tributes are specified. Note that linebreak values on adjacent mo and mspace elements do not interact;
a "nobreak" on an mspace will not, in itself, inhibit a break on an adjacent mo element.
3.2.7.3 Examples
<mspace height="3ex" depth="2ex"/>
<mrow>
<mi>a</mi>
<mo id="firstop">+</mo>
<mi>b</mi>
3.2. Token Elements 63
3.2.8.2 Attributes
ms elements accept the attributes listed in Section 3.2.2, and additionally:
Name values default
lquote string "
Specifies the opening quote to enclose the content. (not necessarily ‘left quote’ in RTL
context).
rquote string "
Specifies the closing quote to enclose the content. (not necessarily ‘right quote’ in RTL
context).
Several elements automatically treat their arguments as if they were contained in an mrow element.
See the discussion of inferred mrows in Section 3.1.3. See also mfenced (Section 3.3.8), which can
effectively form an mrow containing its arguments separated by commas.
mrow elements are typically rendered visually as a horizontal row of their arguments, left to right in the
order in which the arguments occur within a context with LTR directionality, or right to left within a
context with RTL directionality. The dir attribute can be used to specify the directionality for a specific
mrow, otherwise it inherits the directionality from the context. For aural agents, the arguments would
be rendered audibly as a sequence of renderings of the arguments. The description in Section 3.2.5 of
suggested rendering rules for mo elements assumes that all horizontal spacing between operators and
their operands is added by the rendering of mo elements (or, more generally, embellished operators),
not by the rendering of the mrows they are contained in.
MathML provides support for both automatic and manual linebreaking of expressions (that is, to break
excessively long expressions into several lines). All such linebreaks take place within mrows, whether
they are explicitly marked up in the document, or inferred (See Section 3.1.3.1), although the control
of linebreaking is effected through attributes on other elements (See Section 3.1.7).
3.3.1.2 Attributes
mrow elements accept the attribute listed below in addition to those listed in Section 3.1.10.
Name values default
dir "ltr" | "rtl" inherited
specifies the overall directionality ltr (Left To Right) or rtl (Right To Left) to use to
layout the children of the row. See Section 3.1.5.1 for further discussion.
and the rules for determining the default value of the form attribute of an mo element; see Section 3.2.5
and Section 3.2.7. See also the discussion of equivalence of MathML expressions in Section 2.3.
3.3.1.4 Examples
As an example, 2x+y-z should be written as:
<mrow>
<mrow>
<mn> 2 </mn>
<mo> ⁢ </mo>
<mi> x </mi>
</mrow>
<mo> + </mo>
<mi> y </mi>
<mo> - </mo>
<mi> z </mi>
</mrow>
The proper encoding of (x, y) furnishes a less obvious example of nesting mrows:
<mrow>
<mo> ( </mo>
<mrow>
<mi> x </mi>
<mo> , </mo>
<mi> y </mi>
</mrow>
<mo> ) </mo>
</mrow>
3.3. General Layout Schemata 67
In this case, a nested mrow is required inside the parentheses, since parentheses and commas, thought
of as fence and separator ‘operators’, do not act together on their arguments.
3.3.2.2 Attributes
mfrac elements accept the attributes listed below in addition to those listed in Section 3.1.10. The
fraction line, if any, should be drawn using the color specified by mathcolor.
Name values default
linethickness length | "thin" | "medium" | "thick" medium
Specifies the thickness of the horizontal ‘fraction bar’, or ‘rule’ The default value is
"medium", "thin" is thinner, but visible, "thick" is thicker; the exact thickness of
these is left up to the rendering agent.
numalign "left" | "center" | "right" center
Specifies the alignment of the numerator over the fraction.
denomalign "left" | "center" | "right" center
Specifies the alignment of the denominator under the fraction.
bevelled "true" | "false" false
Specifies whether the fraction should be displayed in a beveled style (the numerator
slightly raised, the denominator slightly lowered and both separated by a slash), rather
than "build up" vertically. See below for an example.
Thicker lines (e.g. linethickness="thick") might be used with nested fractions; a value of "0" renders
without the bar such as for binomial coefficients. These cases are shown below:
a
a b
b c
d
In a RTL directionality context, the numerator leads (on the right), the denominator follows (on the
left) and the diagonal line slants upwards going from right to left (See Section 3.1.5.1 for clarification).
Although this format is an established convention, it is not universally followed; for situations where a
forward slash is desired in a RTL context, alternative markup, such as an mo within an mrow should be
used.
68 Chapter 3. Presentation Markup
3.3.2.3 Examples
The examples shown above can be represented in MathML as:
<mrow>
<mo> ( </mo>
<mfrac linethickness="0">
<mi> a </mi>
<mi> b </mi>
</mfrac>
<mo> ) </mo>
</mrow>
<mfrac linethickness="200%">
<mfrac>
<mi> a </mi>
<mi> b </mi>
</mfrac>
<mfrac>
<mi> c </mi>
<mi> d </mi>
</mfrac>
</mfrac>
<mfrac>
<mn> 1 </mn>
<mrow>
<msup>
<mi> x </mi>
<mn> 3 </mn>
</msup>
<mo> + </mo>
<mfrac>
<mi> x </mi>
<mn> 3 </mn>
</mfrac>
</mrow>
</mfrac>
<mo> = </mo>
<mfrac bevelled="true">
<mn> 1 </mn>
<mrow>
<msup>
<mi> x </mi>
<mn> 3 </mn>
</msup>
<mo> + </mo>
<mfrac>
<mi> x </mi>
<mn> 3 </mn>
</mfrac>
</mrow>
</mfrac>
3.3. General Layout Schemata 69
3.3.3.2 Attributes
msqrt and mroot elements accept the attributes listed in Section 3.1.10. The surd and overbar should
be drawn using the color specified by mathcolor.
an mstyle element sets the value that will be inherited by its child elements. Unless a child
element overrides this inherited value, it will pass it on to its children, and they will pass
it to their children, and so on. But if a child element does override it, either by an explicit
attribute setting or automatically (as is common for scriptlevel), the new (overriding)
value will be passed on to that element’s children, and then to their children, etc, unless it is
again overridden.
• Other attributes, such as linethickness on mfrac, have default values that are not nor-
mally inherited. That is, if the linethickness attribute is not set on the mfrac element, it
will normally use the default value of "1", even if it was contained in a larger mfrac ele-
ment that set this attribute to a different value. For attributes like this, specifying a value with
an mstyle element has the effect of changing the default value for all elements within its
scope. The net effect is that setting the attribute value with mstyle propagates the change to
all the elements it contains directly or indirectly, except for the individual elements on which
the value is overridden. Unlike in the case of inherited attributes, elements that explicitly
override this attribute have no effect on this attribute’s value in their children.
• Another group of attributes, such as stretchy and form, are computed from operator dictio-
nary information, position in the enclosing mrow, and other similar data. For these attributes,
a value specified by an enclosing mstyle overrides the value that would normally be com-
puted.
Note that attribute values inherited from an mstyle in any manner affect a descendant element in the
mstyle’s content only if that attribute is not given a value by the descendant element. On any element
for which the attribute is set explicitly, the value specified overrides the inherited value. The only
exception to this rule is when the attribute value is documented as specifying an incremental change to
the value inherited from that element’s context or rendering environment.
Note also that the difference between inherited and non-inherited attributes set by mstyle, explained
above, only matters when the attribute is set on some element within the mstyle’s contents that has
descendants also setting it. Thus it never matters for attributes, such as mathsize, which can only be
set on token elements (or on mstyle itself).
MathML specifies that when the attributes height, depth or width are specified on an mstyle ele-
ment, they apply only to mspace elements, and not to the corresponding attributes of mglyph, mpadded,
or mtable. Similarly, when rowalign, columnalign, or groupalign are specified on an mstyle el-
ement, they apply only to the mtable element, and not the mtr, mlabeledtr, mtd, and maligngroup
elements. When the lspace attribute is set with mstyle, it applies only to the mo element and not to
mpadded. To be consistent, the voffset attribute of the mpadded element can not be set on mstyle.
When the deprecated fontfamily attribute is specified on an mstyle element, it does not apply to the
mglyph element. The deprecated index attribute cannot be set on mstyle. When the align attribute
is set with mstyle, it applies only to the munder, mover, and munderover elements, and not to the
mtable and mstack elements. The required attributes src and alt on mglyph, and actiontype on
maction, cannot be set on mstyle.
As a presentation element, mstyle directly accepts the mathcolor and mathbackground attributes.
Thus, the mathbackground specifies the color to fill the bounding box of the mstyle element itself;
it does not specify the default background color. This is an incompatible change from MathML 2, but
we feel it is more useful and intuitive. Since the default for mathcolor is inherited, this is no change
in its behaviour.
3.3.4.2 Attributes
As stated above, mstyle accepts all attributes of all MathML presentation elements which do not have
required values. That is, all attributes which have an explicit default value or a default value which is
3.3. General Layout Schemata 71
Deprecated Attributes
MathML2 allowed the binding of namedspaces to new values. It appears that this capability was nev-
er implemented, and is now deprecated; namedspaces are now considered constants. For backwards
compatibility, the following attributes are accepted on the mstyle element, but are expected to have no
effect.
Name values default
veryverythinmathspace length 0.0555556em
verythinmathspace length 0.111111em
thinmathspace length 0.166667em
mediummathspace length 0.222222em
thickmathspace length 0.277778em
verythickmathspace length 0.333333em
veryverythickmathspace length 0.388889em
72 Chapter 3. Presentation Markup
3.3.4.3 Examples
The example of limiting the stretchiness of a parenthesis shown in the section on <mo>,
<mrow>
<mo maxsize="100%"> ( </mo>
<mfrac> <mi> a </mi> <mi> b </mi> </mfrac>
<mo maxsize="100%"> ) </mo>
</mrow>
can be rewritten using mstyle as:
<mstyle maxsize="100%">
<mrow>
<mo> ( </mo>
<mfrac> <mi> a </mi> <mi> b </mi> </mfrac>
<mo> ) </mo>
</mrow>
</mstyle>
3.3.5.2 Attributes
merror elements accept the attributes listed in Section 3.1.10.
3.3. General Layout Schemata 73
3.3.5.3 Example
If a MathML syntax-checking preprocessor received the input
<mfraction>
<mrow> <mn> 1 </mn> <mo> + </mo> <msqrt> <mn> 5 </mn> </msqrt> </mrow>
<mn> 2 </mn>
</mfraction>
which contains the non-MathML element mfraction (presumably in place of the MathML element
mfrac), it might generate the error message
<merror>
<mtext> Unrecognized element: mfraction;
arguments were: </mtext>
<mrow> <mn> 1 </mn> <mo> + </mo> <msqrt> <mn> 5 </mn> </msqrt> </mrow>
<mtext> and </mtext>
<mn> 2 </mn>
</merror>
Note that the preprocessor’s input is not, in this case, valid MathML, but the error message it outputs is
valid MathML.
3.3.6.2 Attributes
mpadded elements accept the attributes listed below in addition to those specified in Section 3.1.10.
74 Chapter 3. Presentation Markup
The rules given above imply that all of the following attribute settings have the same effect, which is to
leave the content’s dimensions unchanged:
<mpadded width="+0em"> ... </mpadded>
<mpadded width="+0%"> ... </mpadded>
<mpadded width="-0em"> ... </mpadded>
<mpadded width="-0height"> ... </mpadded>
<mpadded width="100%"> ... </mpadded>
<mpadded width="100%width"> ... </mpadded>
<mpadded width="1width"> ... </mpadded>
<mpadded width="1.0width"> ... </mpadded>
<mpadded> ... </mpadded>
Note that the examples in the Version 2 of the MathML specification showed spaces within the attribute
values, suggesting that this was the intended format. Formally, spaces are not allowed within these
values, but implementers may wish to ignore such spaces to maximize backward compatibility.
positioning point of the mpadded element and the content that follows it, and removes space after the
rendering of the child content. Setting the width to zero causes following content to be positioned at
the positioning point of the mpadded element. Decreasing the width should generally be avoided, as it
may cause overprinting of the following content.
The lspace attribute ("leading" space; see Section 3.1.5.1) specifies the horizontal location of the
positioning point of the child content with respect to the positioning point of the mpadded element.
By default they coincide, and therefore absolute values for lspace have the same effect as relative
values. Positive values for the lspace attribute increase the space between the preceding content and
the child content, and introduce padding before the rendering of the child content. Negative values for
the lspace attributes reduce the space between the preceding content and the child content, and may
cause overprinting of the preceding content, and should generally be avoided. Note that the lspace
attribute does not affect the width of the mpadded element, and so the lspace attribute will also affect
the space between the child content and following content, and may cause overprinting of the following
content, unless the width is adjusted accordingly.
The voffset attribute specifies the vertical location of the positioning point of the child content with
respect to the positioning point of the mpadded element. Positive values for the voffset attribute
raise the rendering of the child content above the baseline. Negative values for the voffset attribute
lower the rendering of the child content below the baseline. In either case, the voffset attribute may
cause overprinting of neighboring content, which should generally be avoided. Note that t he
voffset attribute does not affect the height or depth of the mpadded element, and so the voffset
attribute will also affect the space between the child content and neighboring content, and may cause
overprinting of the neighboring content, unless the height or depth is adjusted accordingly.
MathML renderers should ensure that, except for the effects of the attributes, the relative spacing be-
tween the contents of the mpadded element and surrounding MathML elements would not be modified
by replacing an mpadded element with an mrow element with the same content, even if linebreaking
occurs within the mpadded element. MathML does not define how non-default attribute values of an
mpadded element interact with the linebreaking algorithm.
The effects of the size and position attributes are illustrated below. The following diagram illustrates
the use of lspace and voffset to shift the position of child content without modifying the mpadded
bounding box.
3.3. General Layout Schemata 77
3.3.7.2 Attributes
mphantom elements accept the attributes listed in Section 3.1.10 (the mathcolor has no effect).
3.3.7.3 Examples
There is one situation where the preceding rules for rendering an mphantom may not give the desired
effect. When an mphantom is wrapped around a subsequence of the arguments of an mrow, the default
determination of the form attribute for an mo element within the subsequence can change. (See the
default value of the form attribute described in Section 3.2.5.) It may be necessary to add an explicit
form attribute to such an mo in these cases. This is illustrated in the following example.
In this example, mphantom is used to ensure alignment of corresponding parts of the numerator and
denominator of a fraction:
<mfrac>
<mrow>
<mi> x </mi>
<mo> + </mo>
<mi> y </mi>
<mo> + </mo>
<mi> z </mi>
</mrow>
<mrow>
<mi> x </mi>
<mphantom>
<mo form="infix"> + </mo>
<mi> y </mi>
</mphantom>
<mo> + </mo>
<mi> z </mi>
</mrow>
</mfrac>
This would render as something like
x+y+x
x +z
rather than as
x+y+z
x+z
The explicit attribute setting form="infix" on the mo element inside the mphantom sets the form
attribute to what it would have been in the absence of the surrounding mphantom. This is necessary
since otherwise, the + sign would be interpreted as a prefix operator, which might have slightly different
spacing.
Alternatively, this problem could be avoided without any explicit attribute settings, by wrapping each
of the arguments <mo>+</mo> and <mi>y</mi> in its own mphantom element, i.e.
<mfrac>
<mrow>
80 Chapter 3. Presentation Markup
<mi> x </mi>
<mo> + </mo>
<mi> y </mi>
<mo> + </mo>
<mi> z </mi>
</mrow>
<mrow>
<mi> x </mi>
<mphantom>
<mo> + </mo>
</mphantom>
<mphantom>
<mi> y </mi>
</mphantom>
<mo> + </mo>
<mi> z </mi>
</mrow>
</mfrac>
3.3.8.2 Attributes
mfenced elements accept the attributes listed below in addition to those specified in Section 3.1.10.
The delimiters and separators should be drawn using the color specified by mathcolor.
3.3. General Layout Schemata 81
3.3.8.3 Examples
(a+b)
<mfenced>
<mrow>
<mi> a </mi>
<mo> + </mo>
<mi> b </mi>
</mrow>
</mfenced>
3.3. General Layout Schemata 83
Note that the above mrow is necessary so that the mfenced has just one argument. Without it, this would
render incorrectly as ‘(a, +, b)’.
[0,1)
<mfenced open="[">
<mn> 0 </mn>
<mn> 1 </mn>
</mfenced>
f (x,y)
<mrow>
<mi> f </mi>
<mo> ⁡ </mo>
<mfenced>
<mi> x </mi>
<mi> y </mi>
</mfenced>
</mrow>
3.3.9.2 Attributes
menclose elements accept the attributes listed below in addition to those specified in Section 3.1.10.
The notations should be drawn using the color specified by mathcolor.
The values allowed for notation are open-ended. Conforming renderers may ignore any value they do
not handle, although renderers are encouraged to render as many of the values listed below as possible.
Name values default
notation ("longdiv" | "actuarial" | "phasorangle" | "radical" | "box" | longdiv
"roundedbox" | "circle" | "left" | "right" | "top" | "bottom" |
"updiagonalstrike" | "downdiagonalstrike" | "verticalstrike" |
"horizontalstrike" | "northeastarrow" | "madruwb" | text) +
Specifies a space separated list of notations to be used to enclose the children. See below
for a description of each type of notation.
Any number of values can be given for notation separated by whitespace; all of those given and
understood by a MathML renderer should be rendered. Each should be rendered as if the others were
not present; they should not nest one inside of the other. For example, notation="circle box"
should result in circle and a box around the contents of menclose; the circle and box may overlap.
This is shown in the first example below. Of the predefined notations, only the following are affected
by the directionality (see Section 3.1.5.1):
• "radical"
• "phasorangle"
84 Chapter 3. Presentation Markup
When notation has the value "longdiv", the contents are drawn enclosed by a long division symbol.
MathML 3 adds the mlongdiv element (Section 3.6.2). This element supports notations for long divi-
sion used in several countries and can be used to create a complete example of long division as shown
in Section 3.6.8.3. When notation is specified as "actuarial", the contents are drawn enclosed
by an actuarial symbol. A similar result can be achieved with the value "top right". The case of
notation="radical" is equivalent to the msqrt schema.
The values "box", "roundedbox", and "circle" should enclose the contents as indicated by the val-
ues. The amount of distance between the box, roundedbox, or circle, and the contents are not specified
by MathML, and is left to the renderer. In practice, paddings on each side of 0.4em in the horizontal
direction and .5ex in the vertical direction seem to work well.
The values "left", "right", "top" and "bottom" should result in lines drawn on those sides of the
contents. The values "northeastarrow", "updiagonalstrike", "downdiagonalstrike",
"verticalstrike" and "horizontalstrike" should result in the indicated strikeout lines being
superimposed over the content of the menclose, e.g. a strikeout that extends from the lower left corner
to the upper right corner of the menclose element for "updiagonalstrike", etc.
The value "northeastarrow" is a recommended value to implement because it can be used to im-
plement TeX’s \cancelto command. If a renderer implements other arrows for menclose, it is rec-
ommended that the arrow names are chosen from the following full set of names for consistancy and
standardization among renderers:
• "uparrow"
• "rightarrow"
• "downarrow"
• "leftarrow"
• "northwestarrow"
• "southwestarrow"
• "southeastarrow"
• "northeastarrow"
• "updownarrow"
• "leftrightarrow"
• "northwestsoutheastarrow"
• "northeastsouthwestarrow"
The value "madruwb" should generate an enclosure representing an Arabic factorial (‘madruwb’ is the
transliteration of the Arabic [ARABIC LETTER MEEM][ARABIC LETTER DAD][ARABIC LET-
TER REH][ARABIC LETTER WAW][ARABIC LETTER BEH] for factorial). This is shown in the
third example below.
The baseline of an menclose element is the baseline of its child (which might be an implied mrow).
3.3.9.3 Examples
An example of using multiple attributes is
<menclose notation=’circle box’>
<mi> x </mi><mo> + </mo><mi> y </mi>
</menclose>
which renders with the box and circle overlapping roughly as
3.4. Script and Limit Schemata 85
.
An example of using menclose for actuarial notation is
<msub>
<mi>a</mi>
<mrow>
<menclose notation=’actuarial’>
<mi>n</mi>
</menclose>
<mo>⁣</mo>
<mi>i</mi>
</mrow>
</msub>
which renders roughly as
ani
An example of "phasorangle", which is used in circuit analysis, is:
<mi>C</mi>
<mrow>
<menclose notation=’phasorangle’>
<mrow>
<mo>−</mo>
<mfrac>
<mi>π</mi>
<mn>2</mn>
</mfrac>
</mrow>
</menclose>
</mrow>
which renders roughly as
For purely visual layout, a single general-purpose element could suffice for positioning scripts and
embellishments in any of the traditional script locations around a given base. However, in order to
capture the abstract structure of common notation better, MathML provides several more specialized
scripting elements.
In addition to sub/superscript elements, MathML has overscript and underscript elements that place
scripts above and below the base. These elements can be used to place limits on large operators, or for
placing accents and lines above or below the base. The rules for rendering accents differ from those for
overscripts and underscripts, and this difference can be controlled with the accent and accentunder
attributes, as described in the appropriate sections below.
Rendering of scripts is affected by the scriptlevel and displaystyle attributes, which are part of
the environment inherited by the rendering process of every MathML expression, and are described in
Section 3.1.6. These attributes cannot be given explicitly on a scripting element, but can be specified
on the start tag of a surrounding mstyle element if desired.
MathML also provides an element for attachment of tensor indices. Tensor indices are distinct from
ordinary subscripts and superscripts in that they must align in vertical columns. Tensor indices can also
occur in prescript positions. Note that ordinary scripts follow the base (on the right in LTR context, but
on the left in RTL context); prescripts precede the base (on the left (right) in LTR (RTL) context).
Because presentation elements should be used to describe the abstract notational structure of expres-
sions, it is important that the base expression in all ‘scripting’ elements (i.e. the first argument expres-
sion) should be the entire expression that is being scripted, not just the trailing character. For example,
(x+y)2 should be written as:
<msup>
<mrow>
<mo> ( </mo>
<mrow>
<mi> x </mi>
<mo> + </mo>
<mi> y </mi>
</mrow>
<mo> ) </mo>
</mrow>
<mn> 2 </mn>
</msup>
3.4.1.2 Attributes
msub elements accept the attributes listed below in addition to those specified in Section 3.1.10.
3.4. Script and Limit Schemata 87
3.4.2.2 Attributes
msup elements accept the attributes listed below in addition to those specified in Section 3.1.10.
Name values default
superscriptshift length automatic
Specifies the minimum amount to shift the baseline of superscript up; the default is for
the rendering agent to use its own positioning rules.
3.4.3.2 Attributes
msubsup elements accept the attributes listed below in addition to those specified in Section 3.1.10.
Name values default
subscriptshift length automatic
Specifies the minimum amount to shift the baseline of subscript down; the default is for
the rendering agent to use its own positioning rules.
superscriptshift length automatic
Specifies the minimum amount to shift the baseline of superscript up; the default is for
the rendering agent to use its own positioning rules.
88 Chapter 3. Presentation Markup
3.4.3.3 Examples
The msubsup is most commonly used for adding sub/superscript pairs to identifiers as illustrated above.
However, another important use is placing limits on certain large operators whose limits are tradition-
ally displayed in the script positions even when rendered in display style. The most common of these
is the integral. For example,
Z 1
ex dx
0
would be represented as
<mrow>
<msubsup>
<mo> ∫ </mo>
<mn> 0 </mn>
<mn> 1 </mn>
</msubsup>
<mrow>
<msup>
<mi> ⅇ </mi>
<mi> x </mi>
</msup>
<mo> ⁢ </mo>
<mrow>
<mo> ⅆ </mo>
<mi> x </mi>
</mrow>
</mrow>
</mrow>
3.4.4.2 Attributes
munder elements accept the attributes listed below in addition to those specified in Section 3.1.10.
3.4. Script and Limit Schemata 89
3.4.4.3 Examples
The MathML representation for the example shown above is:
<mrow>
<munder accentunder="true">
<mrow>
<mi> x </mi>
<mo> + </mo>
<mi> y </mi>
<mo> + </mo>
<mi> z </mi>
</mrow>
<mo> ⏟ </mo>
</munder>
<mtext> versus </mtext>
<munder accentunder="false">
<mrow>
<mi> x </mi>
<mo> + </mo>
<mi> y </mi>
<mo> + </mo>
<mi> z </mi>
</mrow>
<mo> ⏟ </mo>
</munder>
</mrow>
3.4.5.2 Attributes
mover elements accept the attributes listed below in addition to those specified in Section 3.1.10.
Name values default
accent "true" | "false" automatic
Specifies whether overscript is drawn as an ‘accent’ or as a limit. An accent is drawn
the same size as the base (without incrementing scriptlevel) and is drawn closer to
the base.
align "left" | "right" | "center" center
Specifies whether the script is aligned left, center, or right under/over the base. As spec-
fied in Section 3.2.5.8, the core of overscripts that are embellished operators should
stretch to cover the base, but the alignment is based on the entire overscript.
ˆ These differences also apply to
The difference between an accent versus limit is shown here: x̂ versus x.
z }| { z }| {
‘mathematical accents’ such as bars or braces over expressions: x + y + z versus x + y + z. The MathML
representation for each of these examples is shown below.
The default value of accent is false, unless overscript is an mo element or an embellished operator (see
Section 3.2.5). If overscript is an mo element, the value of its accent attribute is used as the default
value of accent for mover. If overscript is an embellished operator, the accent attribute of the mo
element at its core is used as the default value.
3.4.5.3 Examples
The MathML representation for the examples shown above is:
<mrow>
<mover accent="true">
<mi> x </mi>
<mo> ^ </mo>
</mover>
<mtext> versus </mtext>
<mover accent="false">
<mi> x </mi>
<mo> ^ </mo>
</mover>
</mrow>
<mrow>
<mover accent="true">
<mrow>
<mi> x </mi>
3.4. Script and Limit Schemata 91
<mo> + </mo>
<mi> y </mi>
<mo> + </mo>
<mi> z </mi>
</mrow>
<mo> ⏞ </mo>
</mover>
<mtext> versus </mtext>
<mover accent="false">
<mrow>
<mi> x </mi>
<mo> + </mo>
<mi> y </mi>
<mo> + </mo>
<mi> z </mi>
</mrow>
<mo> ⏞ </mo>
</mover>
</mrow>
3.4.6.2 Attributes
munderover elements accept the attributes listed below in addition to those specified in Section 3.1.10.
92 Chapter 3. Presentation Markup
3.4.6.3 Examples
The MathML representation for the example shown above with the first expression made using separate
munder and mover elements, and the second one using an munderover element, is:
<mrow>
<mover>
<munder>
<mo> ∫ </mo>
<mn> 0 </mn>
</munder>
<mi> ∞ </mi>
</mover>
<mtext> versus </mtext>
<munderover>
<mo> ∫ </mo>
<mn> 0 </mn>
<mi> ∞ </mi>
</munderover>
</mrow>
3.4. Script and Limit Schemata 93
3.4.7.2 Attributes
Same as the attributes of msubsup. See Section 3.4.3.2.
The mmultiscripts element increments scriptlevel by 1, and sets displaystyle to "false",
within each of its arguments except base, but leaves both attributes unchanged within base. (See Sec-
tion 3.1.6.)
3.4.7.3 Examples
Examples of the use of mmultiscripts are:
0 F 1 (;a;z).
<mrow>
<mmultiscripts>
94 Chapter 3. Presentation Markup
<mi> F </mi>
<mn> 1 </mn>
<none/>
<mprescripts/>
<mn> 0 </mn>
<none/>
</mmultiscripts>
<mo> ⁡ </mo>
<mrow>
<mo> ( </mo>
<mrow>
<mo> ; </mo>
<mi> a </mi>
<mo> ; </mo>
<mi> z </mi>
</mrow>
<mo> ) </mo>
</mrow>
</mrow>
Ri j kl (where k and l are different indices)
<mmultiscripts>
<mi> R </mi>
<mi> i </mi>
<none/>
<none/>
<mi> j </mi>
<mi> k </mi>
<none/>
<mi> l </mi>
<none/>
</mmultiscripts>
1 1
123 X 123
<mmultiscripts>
<mi> X </mi>
<mn> 123 </mn>
<mn> 1 </mn>
<mprescripts/>
<mn> 123 </mn>
<mn> 1 </mn>
</mmultiscripts>
An additional example of mmultiscripts shows how the binomial coefficient
<mstyle dir="rtl">
<mmultiscripts><mo>ل</mo>
<mn>12</mn><none/>
<mprescripts/>
<none/><mn>5</mn>
</mmultiscripts>
</mstyle>
3.5.1.2 Attributes
mtable elements accept the attributes listed below in addition to those specified in Section 3.1.10. Any
rules drawn as part of the mtable should be drawn using the color specified by mathcolor.
96 Chapter 3. Presentation Markup
In the above specifications for attributes affecting rows (respectively, columns, or the gaps between rows
98 Chapter 3. Presentation Markup
or columns), the notation (...)+ means that multiple values can be given for the attribute as a space
separated list (see Section 2.1.5). In this context, a single value specifies the value to be used for all
rows (resp., columns or gaps). A list of values are taken to apply to corresponding rows (resp., columns
or gaps) in order, that is starting from the top row for rows or first column (left or right, depending on
directionality) for columns. If there are more rows (resp., columns or gaps) than supplied values, the
last value is repeated as needed. If there are too many values supplied, the excess are ignored.
Note that none of the areas occupied by lines frame, rowlines and columnlines, nor the spacing
framespacing, rowspacing or columnspacing, nor the label in mlabeledtr are counted as rows
or columns.
The displaystyle attribute is allowed on the mtable element to set the inherited value of the at-
tribute. If the attribute is not present, the mtable element sets displaystyle to "false" within the
table elements. (See Section 3.1.6.)
3.5.1.3 Examples
A 3 by 3 identity matrix could be represented as follows:
<mrow>
<mo> ( </mo>
<mtable>
<mtr>
<mtd> <mn>1</mn> </mtd>
<mtd> <mn>0</mn> </mtd>
<mtd> <mn>0</mn> </mtd>
</mtr>
<mtr>
<mtd> <mn>0</mn> </mtd>
<mtd> <mn>1</mn> </mtd>
<mtd> <mn>0</mn> </mtd>
</mtr>
<mtr>
<mtd> <mn>0</mn> </mtd>
<mtd> <mn>0</mn> </mtd>
<mtd> <mn>1</mn> </mtd>
</mtr>
</mtable>
<mo> ) </mo>
</mrow>
This might be rendered as:
1 0 0
0 1 0
0 0 1
Note that the parentheses must be represented explicitly; they are not part of the mtable element’s
rendering. This allows use of other surrounding fences, such as brackets, or none at all.
3.5. Tabular Math 99
3.5.2.2 Attributes
mtr elements accept the attributes listed below in addition to those specified in Section 3.1.10.
Name values default
rowalign "top" | "bottom" | "center" | "baseline" | "axis" inherited
overrides, for this row, the vertical alignment of cells specified by the rowalign at-
tribute on the mtable.
columnalign ("left" | "center" | "right") + inherited
overrides, for this row, the horizontal alignment of cells specified by the columnalign
attribute on the mtable.
groupalign group-alignment-list-list inherited
[this attribute is described with the alignment elements, maligngroup and
malignmark, in Section 3.5.5.]
3.5.3.2 Attributes
The attributes for mlabeledtr are the same as for mtr. Unlike the attributes for the mtable element,
attributes of mlabeledtr that apply to column elements also apply to the label. For example, in a one
column table,
<mlabeledtr rowalign=’top’>
means that the label and other entries in the row are vertically aligned along their top. To force a
particular alignment on the label, the appropriate attribute would normally be set on the mtd element
that surrounds the label content.
3.5.3.4 Example
<mtable>
<mlabeledtr id=’e-is-m-c-square’>
<mtd>
<mtext> (2.1) </mtext>
</mtd>
<mtd>
<mrow>
<mi>E</mi>
<mo>=</mo>
<mrow>
<mi>m</mi>
<mo>⁢</mo>
<msup>
<mi>c</mi>
<mn>2</mn>
</msup>
</mrow>
</mrow>
3.5. Tabular Math 101
</mtd>
</mlabeledtr>
</mtable>
This should be rendered as:
E = mc2 (2.1)
3.5.4.2 Attributes
mtd elements accept the attributes listed below in addition to those specified in Section 3.1.10.
Name values default
rowspan positive-integer 1
causes the cell to be treated as if it occupied the number of rows specified. The corre-
sponding mtd in the following "rowspan"-1 rows must be omitted. The interpretation
corresponds with the similar attributes for HTML 4.01 tables.
columnspan positive-integer 1
causes the cell to be treated as if it occupied the number of columns specified. The
following "rowspan"-1 mtds must be omitted. The interpretation corresponds with the
similar attributes for HTML 4.01 tables.
rowalign "top" | "bottom" | "center" | "baseline" | "axis" inherited
specifies the vertical alignment of this cell, overriding any value specified on the con-
taining mrow and mtable. See the rowalign attribute of mtable.
columnalign "left" | "center" | "right" inherited
specifies the horizontal alignment of this cell, overriding any value specified on the
containing mrow and mtable. See the columnalign attribute of mtable.
groupalign group-alignment-list inherited
[this attribute is described with the alignment elements, maligngroup and
malignmark, in Section 3.5.5.]
The rowspan and columnspan attributes can be used around an mtd element that represents the label
in a mlabeledtr element. Also, the label of a mlabeledtr element is not considered to be part of a
previous rowspan and columnspan.
The discussion that follows will use the example of a set of simultaneous equations that should be
rendered with vertical alignment of the coefficients and variables of each term, by inserting spacing
somewhat like that shown here:
8.44x + 55 y = 0
3.1 x - 0.7y = -1.1
If the example expressions shown above were arranged in a column but not aligned, they would appear
as:
8.44x + 55y = 0
3.1x - 0.7y = -1.1
For audio renderers, it is suggested that the alignment elements produce the analogous behavior of
altering the rhythm of pronunciation so that it is the same for several sub-expressions in a column, by
the insertion of the appropriate time delays in place of the extra horizontal spacing described here.
The expressions whose parts are to be aligned (each equation, in the example above) must be given as
the table elements (i.e. as the mtd elements) of one column of an mtable. To avoid confusion, the term
‘table cell’ rather than ‘table element’ will be used in the remainder of this section.
All interactions between alignment elements are limited to the mtable column they arise in. That is,
every column of a table specified by an mtable element acts as an ‘alignment scope’ that contains
within it all alignment effects arising from its contents. It also excludes any interaction between its own
alignment elements and the alignment elements inside any nested alignment scopes it might contain.
The reason mtable columns are used as alignment scopes is that they are the only general way in
MathML to arrange expressions into vertical columns. Future versions of MathML may provide an
malignscope element that allows an alignment scope to be created around any MathML element, but
even then, table columns would still sometimes need to act as alignment scopes, and since they are
not elements themselves, but rather are made from corresponding parts of the content of several mtr
elements, they could not individually be the content of an alignment scope element.
An mtable element can be given the attribute alignmentscope="false" to cause its columns not to
act as alignment scopes. This is discussed further at the end of this section. Otherwise, the discussion
in this section assumes that this attribute has its default value of "true".
Note that the division into alignment groups does not necessarily fit the nested expression structure of
the MathML expression containing the groups — that is, it is permissible for one alignment group to
consist of the end of one mrow, all of another one, and the beginning of a third one, for example. This
can be seen in the MathML markup for the present example, given at the end of this section.
The nested expression structure formed by mrows and other layout schemata should reflect the mathe-
matical structure of the expression, not the alignment-group structure, to make possible optimal render-
ings and better automatic interpretations; see the discussion of proper grouping in section Section 3.3.1.
Insertion of alignment elements (or other space-like elements) should not alter the correspondence be-
tween the structure of a MathML expression and the structure of the mathematical expression it repre-
sents.
Although alignment groups need not coincide with the nested expression structure of layout schemata,
there are nonetheless restrictions on where an maligngroup element is allowed within a table cell. The
maligngroup element may only be contained within elements (directly or indirectly) of the following
types (which are themselves contained in the table cell):
• an mrow element, including an inferred mrow such as the one formed by a multi-child mtd
element, but excluding mrow which contains a change of direction using the dir attribute;
• an mstyle element , but excluding those which change direction using the dir attribute;
• an mphantom element;
• an mfenced element;
• an maction element, though only its selected sub-expression is checked;
• a semantics element.
These restrictions are intended to ensure that alignment can be unambiguously specified, while avoiding
complexities involving things like overscripts, radical signs and fraction bars. They also ensure that a
simple algorithm suffices to accomplish the desired alignment.
Note that some positions for an maligngroup element, although legal, are not useful, such as an
maligngroup element that is an argument of an mfenced element. Similarly, when inserting an
maligngroup element in an element whose arguments have positional significance, it is necessary
to introduce a new mrow element containing just the maligngroup element and the child element it
precedes in order to preserve the proper expression structure. For example, to insert an maligngroup
before the denominator child of an mfrac element, it is necessary to enclose the maligngroup and
the denominator in an mrow to avoid introducing an illegal third child in the mfrac. In general, this
will be necessary except when the maligngroup element is inserted directly into an mrow or into an
element that can form an inferred mrow from its contents. See the warning about the legal grouping of
‘space-like elements’ in Section 3.2.7 for an analogous example involving malignmark.
For the table cells that are divided into alignment groups, every element in their content must be part
of exactly one alignment group, except for the elements from the above list that contain maligngroup
elements inside them and the maligngroup elements themselves. This means that, within any table
cell containing alignment groups, the first complete element must be an maligngroup element, though
this may be preceded by the start tags of other elements.
This requirement removes a potential confusion about how to align elements before the first
maligngroup element, and makes it easy to identify table cells that are left out of their column’s
alignment process entirely.
Note that it is not required that the table cells in a column that are divided into alignment groups each
contain the same number of groups. If they don’t, zero-width alignment groups are effectively added
on the right side (or left side, in a RTL context) of each table cell that has fewer groups than other table
cells in the same column.
104 Chapter 3. Presentation Markup
3.5.5.3 Table cells that are not divided into alignment groups
Expressions in a column that are to have no alignment groups should contain no maligngroup ele-
ments. Expressions with no alignment groups are aligned using only the columnalign attribute that
applies to the table column as a whole, and are not affected by the groupalign attribute described
below. If such an expression is wider than the column width needed for the table cells containing
alignment groups, all the table cells containing alignment groups will be shifted as a unit within the
column as described by the columnalign attribute for that column. For example, a column heading
with no internal alignment could be added to the column of two equations given above by preced-
ing them with another table row containing an mtext element for the heading, and using the default
columnalign="center" for the table, to produce:
equations with aligned variables
8.44x + 55 y = 0
3.1 x - 0.7y = -1.1
or, with a shorter heading,
some equations
8.44x + 55 y = 0
3.1 x - 0.7y = -1.1
respect to that. (See Chapter 4 and Chapter 5 for further details about mixing presentation and content
markup.)
malignmark elements are allowed to occur within the content of token elements, such as mn, mi, or
mtext. When this occurs, the character immediately before or after the malignmark element will carry
the alignment point; in all other cases, the element to its immediate left or right will carry the alignment
point. The rationale for this is that it is sometimes desirable to align on the edges of specific characters
within multi-character token elements.
If there is more than one malignmark element in an alignment group, all but the first one will be
ignored. MathML applications may wish to provide a mode in which they will warn about this situation,
but it is not an error, and should trigger no warnings by default. The rationale for this is that it would be
inconvenient to have to remove all unnecessary malignmark elements from automatically generated
data, in certain cases, such as when they are used to specify alignment on ‘decimal points’ other than
the ’.’ character.
inherited from an attribute on the mtable that was used to set up the alignment scope as a whole, or
from the mtr or mtd elements surrounding the alignment group. It is inherited via an ‘inheritance path’
that proceeds from mtable through successively contained mtr, mtd, and maligngroup elements.
There is exactly one element of each of these kinds in this path from an mtable to any alignment
group inside it. In general, the value of groupalign will be inherited by any given alignment group
from the innermost element that surrounds the alignment group and provides an explicit setting for this
attribute. For example, if an mtable element specifies values for groupalign and a maligngroup
element within the table also specifies an explicit groupalign value, then then the value from the
maligngroup takes priority.
Note, however, that each mtd element needs, in general, a list of groupalign values, one for each
maligngroup element inside it (from left to right, in an LTR context, or from right to left in an RTL
context), rather than just a single value. Furthermore, an mtr or mtable element needs, in general, a list
of lists of groupalign values, since it spans multiple mtable columns, each potentially acting as an
alignment scope. Such lists of group-alignment values are specified using the following syntax rules:
group-alignment = "left" | "right" | "center" | "decimalpoint"
group-alignment-list = group-alignment +
group-alignment-list-list = ( "{" group-alignment-list "}" ) +
As described in Section 2.1.5, | separates alternatives; + represents optional repetition (i.e. 1 or more
copies of what precedes it), with extra values ignored and the last value repeated if necessary to cover
additional table columns or alignment group columns; ’’ and ’’ represent literal braces; and ( and
) are used for grouping, but do not literally appear in the attribute value.
The permissible values of the groupalign attribute of the elements that have this attribute are specified
using the above syntax definitions as follows:
Element type groupalign attribute syntax default value
mtable group-alignment-list-list {left}
mtr group-alignment-list-list inherited from mtable attribute
mlabeledtr group-alignment-list-list inherited from mtable attribute
mtd group-alignment-list inherited from within mtr attribute
maligngroup group-alignment inherited from within mtd attribute
In the example near the beginning of this section, the group alignment values could be specified on every
mtd element using groupalign = ‘decimalpoint left left decimalpoint left left decimalpoint’, or on
every mtr element using groupalign = ‘decimalpoint left left decimalpoint left left decimalpoint’, or
(most conveniently) on the mtable as a whole using groupalign = ‘decimalpoint left left decimalpoint
left left decimalpoint’, which provides a single braced list of group-alignment values for the single
column of expressions to be aligned.
<mrow>
<mrow>
<mrow>
<maligngroup/>
<mn> 8.44 </mn>
<mo> ⁢ </mo>
<maligngroup/>
<mi> x </mi>
</mrow>
<maligngroup/>
<mo> + </mo>
<mrow>
<maligngroup/>
<mn> 55 </mn>
<mo> ⁢ </mo>
<maligngroup/>
<mi> y </mi>
</mrow>
</mrow>
<maligngroup/>
<mo> = </mo>
<maligngroup/>
<mn> 0 </mn>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mrow>
<mrow>
<mrow>
<maligngroup/>
<mn> 3.1 </mn>
<mo> ⁢ </mo>
<maligngroup/>
<mi> x </mi>
</mrow>
<maligngroup/>
<mo> - </mo>
<mrow>
<maligngroup/>
<mn> 0.7 </mn>
<mo> ⁢ </mo>
<maligngroup/>
<mi> y </mi>
</mrow>
</mrow>
<maligngroup/>
<mo> = </mo>
<maligngroup/>
3.5. Tabular Math 109
<mrow>
<mo> - </mo>
<mn> 1.1 </mn>
</mrow>
</mrow>
</mtd>
</mtr>
</mtable>
here applies to one mtable column, and takes into account the alignment elements, the
groupalign attribute described in this section, and the columnalign attribute described under
mtable (Section 3.5.1).
First, a rendering is computed for the contents of each table cell in the column, using zero width for all
maligngroup and malignmark elements. The final rendering will be identical except for horizontal
shifts applied to each alignment group and/or table cell. The positions of alignment points specified
by any malignmark elements are noted, and the remaining alignment points are determined using
groupalign values.
For each alignment group, the horizontal positions of the left edge, alignment point, and right edge
are noted, allowing the width of the group on each side of the alignment point (left and right) to be
determined. The sum of these two ‘side-widths’, i.e. the sum of the widths to the left and right of the
alignment point, will equal the width of the alignment group.
Second, each column of alignment groups is scanned. The ith scan covers the ith alignment group in
each table cell containing any alignment groups. Table cells with no alignment groups, or with fewer
than i alignment groups, are ignored. Each scan computes two maximums over the alignment groups
scanned: the maximum width to the left of the alignment point, and the maximum width to the right of
the alignment point, of any alignment group scanned.
The sum of all the maximum widths computed (two for each column of alignment groups) gives one
total width, which will be the width of each table cell containing alignment groups. Call the maximum
number of alignment groups in one cell n; each such cell is divided into 2n horizontally adjacent sec-
tions, called L(i) and R(i) for i from 1 to n, using the 2n maximum side-widths computed above; for
each i, the width of all sections called L(i) is the maximum width of any cell’s ith alignment group to
the left of its alignment point, and the width of all sections called R(i) is the maximum width of any
cell’s ith alignment group to the right of its alignment point.
Each alignment group is then shifted horizontally as a block to a unique position that places: in the
section called L(i) that part of the ith group to the left of its alignment point; in the section called R(i)
that part of the ith group to the right of its alignment point. This results in the alignment point of each
ith group being on the boundary between adjacent sections L(i) and R(i), so that all alignment points of
ith groups have the same horizontal position.
The widths of the table cells that contain no alignment groups were computed as part of the initial ren-
dering, and may be different for each cell, and different from the single width used for cells containing
alignment groups. The maximum of all the cell widths (for both kinds of cells) gives the width of the
table column as a whole.
The position of each cell in the column is determined by the applicable part of the value of the
columnalign attribute of the innermost surrounding mtable, mtr, or mtd element that has an explicit
value for it, as described in the sections on those elements. This may mean that the cells containing
alignment groups will be shifted within their column, in addition to their alignment groups having been
shifted within the cells as described above, but since each such cell has the same width, it will be shifted
the same amount within the column, thus maintaining the vertical alignment of the alignment points of
the corresponding alignment groups in each cell.
more than for higher level math. Furthermore, elementary math often presents examples in some inter-
mediate state and MathML must be able to capture these intermediate or intentionally missing partial
forms. Indeed, these constructs represent memory aids or procedural guides, as much as they represent
‘mathematics’.
The elements used for basic alignments in elementary math are:
mstack align rows of digits and operators
msgroup groups rows with similar alignment
msrow groups digits and operators into a row
msline draws lines between rows of the stack
mscarries annotates the following row with optional borrows/carries and/or crossouts
mscarry a borrow/carry and/or crossout for a single digit
mlongdiv specifies a divisor and a quotient for long division, along with a stack of the intermediate
computations
mstack and mlongdiv are the parent elements for all elementary math layout. Any children of mstack,
mlongdiv, and msgroup, besides msrow, msgroup, mscarries and msline, are treated as if implicitly
surrounded by an msrow (See Section 3.6.4 for more details about rows).
Since the primary use of these stacking constructs is to stack rows of numbers aligned on their digits,
and since numbers are always formatted left-to-right, the columns of an mstack are always processed
left-to-right; the overall directionality in effect (ie. the dir attribute) does not affect to the ordering of
display of columns or carries in rows and, in particular, does not affect the ordering of any operators
within a row (See Section 3.1.5).
These elements are described in this section followed by examples of their use. In addition to two-
dimensional addition, subtraction, multiplication, and long division, these elements can be used to
represent several notations used for repeating decimals.
A very simple example of two-dimensional addition is shown below:
424
+33
of carries to be applied to the following row; an msline represents a line separating rows. Any other
element is treated as if implicitly surrounded by msrow.
Each row contains ‘digits’ that are placed into columns. (see Section 3.6.4 for further details). The
stackalign attribute together with the position and shift attributes of msgroup, mscarries, and
msrow determine to which column a character belongs.
The width of a column is the maximum of the widths of each ‘digit’ in that column — carries do not
participate in the width calculation; they are treated as having zero width. If an element is too wide to
fit into a column, it overflows into the adjacent column(s) as determined by the charalign attribute.
If there is no character in a column, its width is taken to be the width of a 0 in the current language (in
many fonts, all digits have the same width).
The method for laying out an mstack is:
1. The ‘digits’ in a row are determined.
2. All of the digits in a row are initially aligned according to the stackalign value.
3. Each row is positioned relative to that alignment based on the position attribute (if any)
that controls that row.
4. The maximum width of the digits in a column are determined and shorter and wider entries
in that column are aligned according to the charalign attribute.
5. The width and height of the mstack element are computed based on the rows and columns.
Any overflow from a column is not used as part of that computation.
6. The baseline of the mstack element is determined by the align attribute.
3.6.1.2 Attributes
mstack elements accept the attributes listed below in addition to those specified in Section 3.1.10.
3.6. Elementary Math 113
3.6.2.2 Attributes
mlongdiv elements accept all of the attributes that mstack elements accept (including those specified
in Section 3.1.10), along with the attribute listed below.
The values allowed for longdivstyle are open-ended. Conforming renderers may ignore any value
they do not handle, although renderers are encouraged to render as many of the values listed below
as possible. Any rules drawn as part of division layout should be drawn using the color specified by
mathcolor.
Name values default
longdivstyle "lefttop" | "stackedrightright" | "mediumstackedrightright" | "short- lefttop
stackedrightright" | "righttop" | "left/\right" | "left)(right" | ":right=right"
| "stackedleftleft" | "stackedleftlinetop"
Controls the style of the long division layout. The names are meant as a rough mnemonic
that describes the position of the divisor and result in relation to the dividend.
See Section 3.6.8.3 for examples of how these notations are drawn. The values listed above are used
for long division notations in different countries around the world:
"lefttop" a notation that is commonly used in the United States, Great Britain, and elsewhere
"stackedrightright" a notation that is commonly used in France and elsewhere
"mediumrightright" a notation that is commonly used in Russia and elsewhere
"shortstackedrightright" a notation that is commonly used in Brazil and elsewhere
"righttop" a notation that is commonly used in China, Sweden, and elsewhere
"left/\right" a notation that is commonly used in Netherlands
"left)(right" a notation that is commonly used in India
":right=right" a notation that is commonly used in Germany
"stackedleftleft" a notation that is commonly used in Arabic countries
"stackedleftlinetop" a notation that is commonly used in Arabic countries
3.6.3.2 Attributes
msgroup elements accept the attributes listed below in addition to those specified in Section 3.1.10.
3.6. Elementary Math 115
3.6.4.2 Attributes
msrow elements accept the attributes listed below in addition to those specified in Section 3.1.10.
Name values default
position integer 0
specifies the horizontal position of the rows within this group relative the position de-
termined by the containing msgroup (according to its position and shift attributes).
The resulting position value is relative to the column specified by stackalign of the
containing mstack or mlongdiv. Positive values move each row towards the tens digit,
like multiplying by a power of 10, effectively padding with empty columns on the right;
negative values move towards the ones digit, effectively padding on the left. The decimal
point is counted as a column and should be taken into account for negative values.
mstack. It is an error for mscarries to be the last element of an mstack or mlongdiv element. Each
child of the mscarries applies to the same column in the following row. As these annotations are used
to adorn what are treated as numbers, the attachment of carries to columns proceeds from left-to-right;
The overall directionality does not apply to the ordering of the carries, although it may apply to the
contents of each carry; see Section 3.1.5.
Each child of mscarries other than mscarry or none is treated as if implicitly surrounded by
mscarry; the element none is used when no carry for a particular column is needed. The
mscarries element sets displaystyle to "false", and increments scriptlevel by 1, so the chil-
dren are typically displayed in a smaller font. (See Section 3.1.6.) It also changes the default val-
ue of scriptsizemultiplier. The effect is that the inherited value of scriptsizemultiplier
should still override the default value, but the default value, inside mscarries, should be "0.6".
scriptsizemultiplier can be set on the mscarries element, and the value should override the
inherited value as usual.
If two rows of carries are adjacent to each other, the first row of carries annotates the second (following)
row as if the second row had location="n". This means that the second row, even if it does not draw,
visually uses some (undefined by this specification) amount of space when displayed.
3.6.5.2 Attributes
mscarries elements accept the attributes listed below in addition to those specified in Section 3.1.10.
Name values default
position integer 0
specifies the horizontal position of the rows within this group relative the position deter-
mined by the containing msgroup (according to its position and shift attributes).
The resulting position value is relative to the column specified by stackalign of
the containing mstack or mlongdiv. The interpretation of the value is the same as
position for msgroup or msrow, but it alters the association of each carry with the
column below. For example, position=1 would cause the rightmost carry to be asso-
ciated with the second digit column from the right.
location "w" | "nw" | "n" | "ne" | "e" | "se" | "s" | "sw" n
specifies the location of the carry or borrow relative to the character below it in the
associated column. Compass directions are used for the values; the default is to place
the carry above the character.
crossout ("none" | "updiagonalstrike" | "downdiagonalstrike" | "verti- none
calstrike" | "horizontalstrike")*
specifies how the column content below each carry is "crossed out"; one or more values
may be given and all values are drawn. If "none" is given with other values, it is ignored.
See Section 3.6.8 for examples of the different values. The crossout is only applied for
columns which have a corresponding mscarry. The crossouts should be drawn using
the color specified by mathcolor.
scriptsizemultiplier number inherited (0.6)
specifies the factor to change the font size by. See Section 3.1.6 for a description of how
this works with the scriptsize attribute.
column; as such, it may extend beyond the column boundaries. Although it is usually implied, the
element may be used explicitly to override the location and/or crossout attributes of the containing
mscarries. It may also be useful with none as its content in order to display no actual carry, but still
enable a crossout due to the enclosing mscarries to be drawn for the given column.
3.6.6.2 Attributes
The mscarry element accepts the attributes listed below in addition to those specified in Section 3.1.10.
Name values default
location "w" | "nw" | "n" | "ne" | "e" | "se" | "s" | "sw" inherited
specifies the location of the carry or borrow relative to the character in the corresponding
column in the row below it. Compass directions are used for the values.
crossout ("none" | "updiagonalstrike" | "downdiagonalstrike" | "verticalstrike" | "hori- inherited
zontalstrike")*
specifies how the column content associated with the carry is "crossed out"; one or more
values may be given and all values are drawn. If "none" is given with other values,
it is essentially ignored. The crossout should be drawn using the color specified by
mathcolor.
3.6.7.2 Attributes
msline elements accept the attributes listed below in addition to those specified in Section 3.1.10. The
line should be drawn using the color specified by mathcolor.
118 Chapter 3. Presentation Markup
424
+ 33
123
456+
579
<mstack>
<mn>123</mn>
<msrow> <mn>456</mn> <mo>+</mo> </msrow>
<msline/>
<mn>579</mn>
</mstack>
Because the default alignment is placed to the right of number, the numbers align properly and none of
the rows need to be shifted.
The following two examples illustrate the use of mscarries, mscarry and using none to fill in a
column. The examples illustrate two different ways of displaying a borrow.
2 12 2
2,3 2 7 2,3127
−1,1 56 −1,156
1,1 71 1,1 71
The MathML for the first example is:
<mstack>
<mscarries crossout=’updiagonalstrike’>
<mn>2</mn> <mn>12</mn> <mscarry crossout=’none’> <none/> </mscarry>
</mscarries>
<mn>2,327</mn>
<msrow> <mo>-</mo> <mn> 1,156</mn> </msrow>
<msline/>
<mn>1,171</mn>
</mstack>
The MathML for the second example uses mscarry because a crossout should only happen on a single
column:
<mstack>
<mscarries location=’nw’>
<none/>
<mscarry crossout=’updiagonalstrike’ location=’n’> <mn>2</mn> </mscarry>
<mn>1</mn>
<none/>
</mscarries>
<mn>2,327</mn>
<msrow> <mo>-</mo> <mn> 1,156</mn> </msrow>
<msline/>
<mn>1,171</mn>
</mstack>
Here is an example of subtraction where there is a borrow with multiple digits in a single column and
a cross out. The borrowed amount is underlined (the example is from a Swedish source):
120 Chapter 3. Presentation Markup
10
5/2
−7
45
There are two things to notice. The first is that menclose is used in the carry and that none is used for
the empty element so that mscarry can be used to create a crossout.
<mstack>
<mscarries>
<mscarry crossout=’updiagonalstrike’><none/></mscarry>
<menclose notation=’bottom’> <mn>10</mn> </menclose>
</mscarries>
<mn>52</mn>
<msrow> <mo>-</mo> <mn> 7</mn> </msrow>
<msline/>
<mn>45</mn>
</mstack>
3.6.8.2 Multiplication
Below is a simple multiplication example that illustrates the use of msgroup and the shift attribute.
The first msgroup does nothing. The second msgroup could also be removed, but msrow would be
needed for its second and third children. They would set the position or shift attributes, or would
add none elements.
123
×321
123
2 46
369
<mstack>
<msgroup>
<mn>123</mn>
<msrow><mo>×</mo><mn>321</mn></msrow>
</msgroup>
<msline/>
<msgroup shift="1">
<mn>123</mn>
<mn>246</mn>
<mn>369</mn>
</msgroup>
<msline/>
</mstack>
This example has multiple rows of carries. It also (somewhat artificially) includes commas (",") as digit
separators. The encoding includes these separators in the spacing attribute value, along non-ASCII
values.
3.6. Elementary Math 121
11
11
1, 234
×4, 321
1 111 1
1, 234
24, 68
370, 2
4, 936
5, 332, 114
<mstack>
<mscarries><mn>1</mn><mn>1</mn><none/></mscarries>
<mscarries><mn>1</mn><mn>1</mn><none/></mscarries>
<mn>1,234</mn>
<msrow><mo>×</mo><mn>4,321</mn></msrow>
<msline/>
<mscarries position=’2’>
<mn>1</mn>
<none/>
<mn>1</mn>
<mn>1</mn>
<mn>1</mn>
<none/>
<mn>1</mn>
</mscarries>
<msgroup shift="1">
<mn>1,234</mn>
<mn>24,68</mn>
<mn>370,2</mn>
<msrow position="1"> <mn>4,936</mn> </msrow>
</msgroup>
<msline/>
<mn>5,332,114</mn>
</mstack>
The MathML for the first example is shown below. It illustrates the use of nested msgroups and how
the position is calculated in those usages.
<mlongdiv longdivstyle="lefttop">
<mn> 3 </mn>
<mn> 435.3</mn>
<mn> 1306</mn>
With the exception of the last example, the encodings for the other examples are the same except that
the values for longdivstyle differ and that a "," is used instead of a "." for the decimal point. For the
last example, the only difference from the other examples besides a different value for longdivstyle
is that Arabic numerals have been used in place of Latin numerals, as shown below.
<mstyle decimalpoint="٫">
<mlongdiv longdivstyle="stackedleftlinetop">
<mn> ٣ </mn>
<mn> ٤٣٥٫٣</mn>
<mn> ١٣٠٦</mn>
<msgroup position="2" shift="-1">
<msgroup>
<mn> ١٢</mn>
<msline length="2"/>
</msgroup>
<msgroup>
<mn> ١٠</mn>
<mn> ٩</mn>
<msline length="2"/>
</msgroup>
<msgroup>
<mn> ١٦</mn>
<mn> ١٥</mn>
<msline length="2"/>
<mn> ١٫٠</mn>
</msgroup>
<msgroup position=’-1’>
<mn> ٩</mn>
<msline length="3"/>
<mn> ١</mn>
</msgroup>
</msgroup>
</mlongdiv>
</mstyle>
0.333333
0.142857
124 Chapter 3. Presentation Markup
0.142857
0.1̇42857̇
The MathML for these involves using mstack, msrow, and msline in a straightforward manner. The
MathML for the preceding examples above is given below.
<mstack stackalign="right">
<msline length="1"/>
<mn> 0.3333 </mn>
</mstack>
<mstack stackalign="right">
<msline length="6"/>
<mn> 0.142857 </mn>
</mstack>
<mstack stackalign="right">
<mn> 0.142857 </mn>
<msline length="6"/>
</mstack>
<mstack stackalign="right">
<msrow> <mo>.</mo> <none/><none/><none/><none/> <mo>.</mo> </msrow>
<mn> 0.142857 </mn>
</mstack>
3.7.1.1 Attributes
maction elements accept the attributes listed below in addition to those specified in Section 3.1.10.
By default, MathML applications that do not recognize the specified actiontype should render the
selected sub-expression as defined below. If no selected sub-expression exists, it is a MathML error;
the appropriate rendering in that case is as described in Section 2.3.2.
3.7. Enlivening Expressions 125
The actiontype values are open-ended. If another value is given and it requires additional attributes,
the attributes must be in a different namespace in XML; in HTML the attributes must begin with "data-
". An XML example is shown below:
<maction actiontype="highlight" my:color="red" my:background="yellow"> expression
</maction>
In the example, non-standard attributes from another namespace are being used to pass ad-
ditional information to renderers that support them, without violating the MathML Schema
(see Section 2.3.3). The my:color attributes might change the color of the characters in the
presentation, while the my:background attribute might change the color of the background
behind the characters.
Content Markup
4.1 Introduction
4.1.1 The Intent of Content Markup
The intent of Content Markup is to provide an explicit encoding of the underlying mathematical mean-
ing of an expression, rather than any particular rendering for the expression. Mathematics is distin-
guished both by its use of rigorous formal logic to define and analyze mathematical concepts, and by
the use of a (relatively) formal notational system to represent and communicate those concepts. How-
ever, mathematics and its presentation should not be viewed as one and the same thing. Mathematical
notation, though more rigorous than natural language, is nonetheless at times ambiguous, context-
dependent, and varies from community to community. In some cases, heuristics may adequately infer
mathematical semantics from mathematical notation. But in many others cases, it is preferable to work
directly with the underlying, formal, mathematical objects. Content Markup provides a rigorous, ex-
tensible semantic framework and a markup language for this purpose.
The difficulties in inferring semantics from a presentation stem from the fact that there are many to
one mappings from presentation to semantics and vice versa. For example the mathematical construct
‘H multiplied by e’ is often encoded using an explicit operator as in H × e. In different presentational
contexts, the multiplication operator might be invisible ‘H e’, or rendered as the spoken word ‘times’.
Generally, many different presentations are possible depending on the context and style preferences
of the author or reader. Thus, given ‘H e’ out of context it may be impossible to decide if this is the
name of a chemical or a mathematical product of two variables H and e. Mathematical presentation
also varies across cultures and geographical regions. For example, many notations for long division are
in use in different parts of the world today. Notations may lose currency, for example the use of musical
sharp and flat symbols to denote maxima and minima [Chaundy1954]. A notation in use in 1644 for
the multiplication mentioned above was He [Cajori1928].
By encoding the underlying mathematical structure explicitly, without regard to how it is presented
aurally or visually, it is possible to interchange information more precisely between systems that se-
mantically process mathematical objects. In the trivial example above, such a system could substitute
values for the variables H and e and evaluate the result. Important application areas include computer
algebra systems, automatic reasoning system, industrial and scientific applications, multi-lingual trans-
lation systems, mathematical search, and interactive textbooks.
The organization of this chapter is as follows. In Section 4.2, a core collection of elements comprising
Strict Content Markup are described. Strict Content Markup is sufficient to encode general expression
trees in a semantically rigorous way. It is in one-to-one correspondence with OpenMath element set.
OpenMath is a standard for representing formal mathematical objects and semantics through the use
of extensible Content Dictionaries. Strict Content Markup defines a mechanism for associating precise
mathematical semantics with expression trees by referencing OpenMath Content Dictionaries. The next
127
128 Chapter 4. Content Markup
two sections introduce markup that is more convenient than Strict markup for some purposes, some-
what less formal and verbose. In Section 4.3, markup is introduced for representing a small number of
mathematical idioms, such as limits on integrals, sums and product. These constructs may all be rewrit-
ten as Strict Content Markup expressions, and rules for doing so are given. In Section 4.4, elements are
introduced for many common function, operators and constants. This section contains many examples,
including equivalent Strict Content expressions. In Section 4.5, elements from MathML 1 and 2 whose
use is now discouraged are listed. Finally, Section 4.6 summarizes the algorithm for translating arbi-
trary Content Markup into Strict Content Markup. It collects together in sequence all the rewrite rules
introduced throughout the rest of the chapter.
and bind for building up compound objects. The token elements such as ci and cn are also considered
part of Strict Content MathML, but with a more restricted set of attributes and with content restricted
to text.
Strict Content MathML is designed to be compatible with OpenMath (in fact it is an XML encoding of
OpenMath Objects in the sense of [OpenMath2004]). OpenMath is a standard for representing formal
mathematical objects and semantics through the use of extensible Content Dictionaries. The table below
gives an element-by-element correspondence between the OpenMath XML encoding of OpenMath
objects and Strict Content MathML.
Strict Content MathML OpenMath
cn OMI, OMF
csymbol OMS
ci OMV
cs OMSTR
apply OMA
bind OMBIND
bvar OMBVAR
share OMR
semantics OMATTR
annotation, annotation-xml OMATP, OMFOREIGN
cerror OME
cbytes OMB
In MathML 3, formal semantics Content MathML expressions are given by specifying equivalent Strict
Content MathML expressions. Since Strict Content MathML expressions all have carefully-defined
semantics given in terms of OpenMath Content Dictionaries, all Content MathML expressions inherit
well-defined semantics in this way. To make the correspondence exact, an algorithm is given in terms of
transformation rules that are applied to rewrite non-Strict MathML constructs into a strict equivalents.
The individual rules are introduced in context throughout the chapter. In Section 4.6, the algorithm as
a whole is described.
As most transformation rules relate to classes of MathML elements that have similar argument struc-
ture, they are introduced in Section 4.3.4 where these classes are defined. Some special case rules for
specific elements are given in Section Section 4.4. Transformations in Section 4.2 concern non-Strict
usages of the core Content MathML elements, those in Section 4.3 concern the rewriting of some
additional structures not directly supported in Strict Content MathML.
The full algorithm described inSection 4.6 is complete in the sense that it gives every Content MathML
expression a specific meaning in terms of a Strict Content MathML expression. This means it has to
give specific strict interpretations to some expressions whose meaning was insufficiently specified in
MathML2. The intention of this algorithm is to be faithful to mathematical intuitions. However edge
cases may remain where the normative interpretation of the algorithm may break earlier intuitions.
A conformant MathML processor need not implement this transformation. The existence of these trans-
formation rules does not imply that a system must treat equivalent expressions identically. In particular
systems may give different presentation renderings for expressions that the transformation rules imply
are mathematically equivalent.
symbols to expand the terrain of mathematical discourse. To do this, two things are required: a mech-
anism for representing symbols not already defined by Content MathML, and a means of associating
a specific mathematical meaning with them in an unambiguous way. In MathML 3, the csymbol ele-
ment provides the means to represent new symbols, while Content Dictionaries are the way in which
mathematical semantics are described. The association is accomplished via attributes of the csymbol
element that point at a definition in a CD. The syntax and usage of these attributes are described in
detail in Section 4.2.3.
Content Dictionaries are structured documents for the definition of mathematical concepts; see the
OpenMath standard, [OpenMath2004]. To maximize modularity and reuse, a Content Dictionary typ-
ically contains a relatively small collection of definitions for closely related concepts. The OpenMath
Society maintains a large set of public Content Dictionaries including the MathML CD group that in-
cluding contains definitions for all pre-defined symbols in MathML. There is a process for contributing
privately developed CDs to the OpenMath Society repository to facilitate discovery and reuse. MathML
3 does not require CDs be publicly available, though in most situations the goals of semantic markup
will be best served by referencing public CDs available to all user agents.
In the text below, descriptions of semantics for predefined MathML symbols refer to the Content Dic-
tionaries developed by the OpenMath Society in conjunction with the W3C Math Working Group. It
is important to note, however, that this information is informative, and not normative. In general, the
precise mathematical semantics of predefined symbols are not not fully specified by the MathML 3
Recommendation, and the only normative statements about symbol semantics are those present in the
text of this chapter. The semantic definitions provided by the OpenMath Content CDs are intended
to be sufficient for most applications, and are generally compatible with the semantics specified for
analogous constructs in the MathML 2.0 Recommendation. However, in contexts where highly precise
semantics are required (e.g. communication between computer algebra systems, within formal systems
such as theorem provers, etc.) it is the responsibility of the relevant community of practice to verify,
extend or replace definitions provided by OpenMath CDs as appropriate.
that they can be renamed consistently throughout the binding scope without changing the underlying
meaning of the expression. Variables that are not bound are termed free variables. Because the logical
distinction between bound and free variables is important for well-defined semantics, Content MathML
differentiates between the application of a function to a free variable, e.g. f (x) and the operation of
binding a variable within a scope. The bind element is used the delineate the binding scope, and group
the binding operator with its bound variables, which are indicated by the bvar element.
In Strict Content markup, the bind element is the only way of performing variable binding. In non-
Strict usage, however, markup is provided that more closely resembles well-known idiomatic notations,
such as the ‘limit’ notations for sums and integrals. These constructs often implicitly bind variables,
such as the variable of integration, or the index variable in a sum. MathML terms the elements used to
represent the auxiliary data such as limits required by these constructions qualifier elements.
Expressions involving qualifiers follow one of a small number of idiomatic patterns, each of which
applies to class of similar binding operators. For example, sums and products are in the same class
because they use index variables following the same pattern. The Content MathML operator classes are
described in detail in Section 4.3.4.
Each Content MathML element is described in a section below that begins with a table summarizing
the key information about the element. For elements that have different Strict and non-Strict usage,
these syntax tables are divided to clearly separate the two cases. The element’s content model is given
in the Content row, linked to the MathML Schema in Appendix A. The Attributes, and Attribute
Values rows similarly link to the schema. Where applicable, the Class row specifies the operator
class, which indicate how many arguments the operator represented by this element takes, and also in
many cases determines the mapping to Strict Content MathML, as described in Section 4.3.4. Finally,
the Qualifiers row clarifies whether the operator takes qualifiers and if so, which. Note Class and
Qualifiers specify how many siblings may follow the operator element in an apply, or the children
of the element for container elements; see Section 4.2.5 and Section 4.3.3 for details).
<cn type="hexdouble">7F800000</cn>
Sample Presentation
<mn>0x7F800000</mn>
0x7F800000
<cn base="16">7FE0</cn>
Sample Presentation
<msub><mn>7FE0</mn><mn>16</mn></msub>
7FE016
When base > 36, some integers cannot be represented using numbers and letters alone. For
example, while
<cn base="1000">10F</cn>
arguably represents the number written in base 10 as 1,000,015, the number written in base
10 as 1,000,037 cannot be represented using letters and numbers alone when base is 1000.
Consequently, support for additional characters (if any) that may be used for digits when
base > 36 is application specific.
real Real numbers can be represented with respect to a base different than 10. If a base attribute is
present, then the digits are interpreted as being digits computed relative to that base (in the
same way as described for type "integer").
e-notation A real number may be presented in scientific notation using this type. Such numbers have
two parts (a significand and an exponent) separated by a <sep/> element. The first part is
a real number, while the second part is an integer exponent indicating a power of the base.
For example, <cn type="e-notation">12.3<sep/>5</cn> represents 12.3 times 105 .
The default presentation of this example is 12.3e5. Note that this type is primarily useful
for backwards compatibility with MathML 2, and in most cases, it is preferable to use the
"double" type, if the number to be represented is in the range of IEEE doubles:
rational A rational number is given as two integers to be used as the numerator and denominator of a
quotient. The numerator and denominator are separated by <sep/>.
134 Chapter 4. Content Markup
<cn type="rational">22<sep/>7</cn>
Sample Presentation
<mrow><mn>22</mn><mo>/</mo><mn>7</mn></mrow>
22/7
complex-cartesian A complex cartesian number is given as two numbers specifying the real and imag-
inary parts. The real and imaginary parts are separated by the <sep/> element, and each part
has the format of a real number as described above.
Rewrite: cn sep
If there are sep children of the cn, then intervening text may be rewritten as cn elements. If the cn
element containing sep also has a base attribute, this is copied to each of the cn arguments of the
resulting symbol, as shown below.
<cn type="rational " base="b ">n <sep/>d </cn>
is rewritten to
<apply><csymbol cd="nums1 ">rational </csymbol>
<cn type="integer" base="b ">n </cn>
<cn type="integer" base="b ">d </cn>
</apply>
The symbol used in the result depends on the type attribute according to the following table:
type attribute OpenMath Symbol
e-notation bigfloat
rational rational
complex-cartesian complex_cartesian
complex-polar complex_polar
Note: In the case of bigfloat the symbol takes three arguments, <cn type="integer">10</cn>
should be inserted as the second argument, denoting the base of the exponent used.
If the type attribute has a different value, or if there is more than one <sep/> element, then the inter-
vening expressions are converted as above, but a system-dependent choice of symbol for the head of
the application must be used.
If a base attribute has been used then the resulting expression is not Strict Content MathML, and each
of the arguments needs to be recursively processed.
Rewrite: cn based_integer
A cn element with a base attribute other than 10 is rewritten as follows. (A base attribute with value 10
is simply removed) .
<cn type="integer " base="16 ">FF60 </cn>
<apply><csymbol cd="nums1">based_integer </csymbol>
<cn type="integer">16 </cn>
<cs>FF60 </cs>
</apply>
If the original element specified type "integer" or if there is no type attribute, but the content of
the element just consists of the characters [a-zA-Z0-9] and white space then the symbol used as the
head in the resulting application should be based_integer as shown. Otherwise it should be should be
based_float.
136 Chapter 4. Content Markup
Rewrite: cn constant
In Strict Content MathML, constants should be represented using csymbol elements. A number of
important constants are defined in the nums1 content dictionary. An expression of the form
<cn type="constant">c </cn>
has the Strict Content MathML equivalent
<csymbol cd="nums1">c2 </csymbol>
where c2 corresponds to c as specified in the following table.
Content Description OpenMath Symbol
U+03C0 (π) The usual π of trigonometry: approximately pi
3.141592653...
U+2147 ( The base for natural logarithms: approximately e
ⅇ 2.718281828...
or ⅇ)
U+2148 ( Square root of -1 i
ⅈ or
ⅈ)
U+03B3 ( Euler’s constant: approximately 0.5772156649... gamma
γ)
U+221E (∞ Infinity. Proper interpretation varies with context infinity
or &infty;)
4.2. Content MathML Elements Encoding Expression Structure 137
<ci type="integer">n</ci>
<semantics>
<ci>n</ci>
<annotation-xml cd="mathmltypes" name="type" encoding="MathML-Content">
<csymbol cd="mathmltypes">integer_type</csymbol>
</annotation-xml>
</semantics>
Note that "complex" should be considered an alias for "complex-cartesian" and rewritten to the
same complex_cartesian_type symbol. It is perhaps a more natural type name for use with ci as the
distinction between cartesian and polar form really only affects the interpretation of literals encoded
with cn.
4.2. Content MathML Elements Encoding Expression Structure 139
The ci element can contain mglyph elements to refer to characters not currently available in Unicode,
or a general presentation construct (see Section 3.1.9), which is used for rendering (see Section 4.1.2).
The following example encodes an atomic symbol that displays visually as C2 and that, for purposes of
content, is treated as a single symbol
<ci>
<msup><mi>C</mi><mn>2</mn></msup>
</ci>
The Strict Content MathML equivalent is
<semantics>
<ci>C2</ci>
<annotation-xml encoding="MathML-Presentation">
<msup><mi>C</mi><mn>2</mn></msup>
</annotation-xml>
</semantics>
Sample Presentation
<msup><mi>C</mi><mn>2</mn></msup>
C2
For this reason, several longstanding efforts have been organized to develop systematic, public reposi-
tories of mathematical definitions. Most notable of these, the OpenMath Society repository of Content
Dictionaries (CDs) is extensive, open and active. In MathML 3, OpenMath CDs are the preferred source
of external definitions. In particular, the definitions of pre-defined MathML 3 operators and functions
are given in terms of OpenMath CDs.
MathML 3 provides two mechanisms for referencing external definitions or content dictionaries. The
first, using the cd attribute, follows conventions established by OpenMath specifically for referencing
CDs. This is the form required in Strict Content MathML. The second, using the definitionURL
attribute, is backward compatible with MathML 2, and can be used to reference CDs or any other
source of definitions that can be identified by a URI. It is described in the following section
When referencing OpenMath CDs, the preferred method is to use the cd attribute as follows. Abstract-
ly, OpenMath symbol definitions are identified by a triple of values: a symbol name, a CD name, and a
CD base, which is a URI that disambiguates CDs of the same name. To associate such a triple with a
csymbol, the content of the csymbol specifies the symbol name, and the name of the Content Dictio-
nary is given using the cd attribute. The CD base is determined either from the document embedding the
math element which contains the csymbol by a mechanism given by the embedding document format,
or by system defaults, or by the cdgroup attribute , which is optionally specified on the enclosing math
element; see Section 2.2.1. In the absence of specific information http://www.openmath.org/cd is
assumed as the CD base for all csymbol elements annotation, and annotation-xml. This is the CD
base for the collection of standard CDs maintained by the OpenMath Society.
The cdgroup specifies a URL to an OpenMath CD Group file. For a detailed description of the format
of a CD Group file, see Section 4.4.2 (CDGroups) in [OpenMath2004]. Conceptually, a CD group file
is a list of pairs consisting of a CD name, and a corresponding CD base. When a csymbol references
a CD name using the cd attribute, the name is looked up in the CD Group file, and the associated CD
base value is used for that csymbol. When a CD Group file is specified, but a referenced CD name does
not appear in the group file, or there is an error in retrieving the group file, the referencing csymbol is
not defined. However, the handling of the resulting error is not defined, and is the responsibility of the
user agent.
While references to external definitions are URIs, it is strongly recommended that CD files be retriev-
able at the location obtained by interpreting the URI as a URL. In particular, other properties of the
symbol being defined may be available by inspecting the Content Dictionary specified. These include
not only the symbol definition, but also examples and other formal properties. Note, however, that there
are multiple encodings for OpenMath Content Dictionaries, and it is up to the user agent to correctly
determine the encoding when retrieving a CD.
The content of cs is text; no Presentation MathML constructs are allowed even when used in non-strict
markup. Specifically, cs may not contain mglyph elements, and the content does not undergo white
space normalization.
Content MathML
<set>
<cs>A</cs><cs>B</cs><cs> </cs>
</set>
Sample Presentation
<mrow>
<mo>{</mo>
<ms>A</ms>
<mo>,</mo>
<ms>B</ms>
<mo>,</mo>
<ms>  </ms>
<mo>}</mo>
</mrow>
{"A", "B", " "}
<apply><csymbol cd="arith1">plus</csymbol>
<ci>x</ci>
<ci>y</ci>
<ci>z</ci>
</apply>
Note that MathML also allows applications without operands, e.g. to represent functions like
random(), or current-date().
Mathematical expressions involving a mixture of operations result in nested occurrences of apply. For
example, a x + b would be encoded as
<apply><csymbol cd="arith1">plus</csymbol>
<apply><csymbol cd="arith1">times</csymbol>
<ci>a</ci>
<ci>x</ci>
</apply>
<ci>b</ci>
</apply>
There is no need to introduce parentheses or to resort to operator precedence in order to parse expres-
sions correctly. The apply tags provide the proper grouping for the re-use of the expressions within
other constructs. Any expression enclosed by an apply element is well-defined, coherent object whose
interpretation does not depend on the surrounding context. This is in sharp contrast to presentation
markup, where the same expression may have very different meanings in different contexts. For exam-
ple, an expression with a visual rendering such as (F+G)(x) might be a product, as in
<apply><csymbol cd="arith1">times</csymbol>
<apply><csymbol cd="arith1">plus</csymbol>
<ci>F</ci>
<ci>G</ci>
</apply>
<ci>x</ci>
</apply>
or it might indicate the application of the function F + G to the argument x. This is indicated by
constructing the sum
<apply><csymbol cd="arith1">plus</csymbol><ci>F</ci><ci>G</ci></apply>
and applying it to the argument x as in
<apply>
<apply><csymbol cd="arith1">plus</csymbol>
<ci>F</ci>
<ci>G</ci>
</apply>
<ci>x</ci>
</apply>
In both cases, the interpretation of the outer apply is explicit and unambiguous, and does not change
regardless of where the expression is used.
The preceding example also illustrates that in an apply construct, both the function and the arguments
may be simple identifiers or more complicated expressions.
The apply element is conceptually necessary in order to distinguish between a function or operator,
and an instance of its use. The expression constructed by applying a function to 0 or more arguments
4.2. Content MathML Elements Encoding Expression Structure 145
is always an element from the codomain of the function. Proper usage depends on the operator that
is being applied. For example, the plus operator may have zero or more arguments, while the minus
operator requires one or two arguments in order to be properly formed.
Content MathML
<apply> f
a1
a2
...
an
</apply>
Sample Presentation
<mrow>
F
<mo>⁡</mo>
<mrow>
<mo fence="true">(</mo>
A1
<mo separator="true">,</mo>
...
<mo separator="true">,</mo>
A2
<mo separator="true">,</mo>
An
<mo fence="true">)</mo>
</mrow>
</mrow>
Non-Strict MathML applications may also be used with qualifiers. In the absence of any more specific
rendering rules for well-known operators, rendering should follow the sample presentation below, mo-
tivated by the typical presentation for sum. Let Op denote the rendering of op , X the rendering
of x , and so on. Then:
146 Chapter 4. Content Markup
Content MathML
<apply> op
<bvar> x </bvar>
<domainofapplication> d </domainofapplication>
expression-in-x
</apply>
Sample Presentation
<mrow>
<munder>
Op
<mrow> X <mo>∈</mo><!-ELEMENT OF-> D </mrow>
</munder>
<mo>⁡</mo><!-FUNCTION APPLICATION->
<mrow>
<mo fence="true">(</mo>
Expression-in-X
<mo fence="true">)</mo>
</mrow>
</mrow>
4.2.6.1 Bindings
Schema Fragment (Strict) Schema Fragment (Full)
Class Bind Bind
Attributes CommonAtt CommonAtt, DefEncAtt
Content ContExp, BvarQ*, ContExp ContExp, BvarQ*, Qualifier*, ContExp+
Binding expressions are represented as MathML expression trees using the bind element. Its first
child is a MathML expression that represents a binding operator, for example integral operator. This is
followed by a non-empty list of bvar elements denoting the bound variables, and then the final child
which is a general Content MathML expression, known as the body of the binding.
The content of a bvar element is an annotated variable, i.e. either a content identifier represented by
a ci element or a semantics element whose first child is an annotated variable. The name of an
annotated variable of the second kind is the name of its first child. The name of a bound variable is that
of the annotated variable in the bvar element.
Bound variables are identified by comparing their names. Such identification can be made explicit by
placing an id on the ci element in the bvar element and referring to it using the xref attribute on all
other instances. An example of this approach is
<bind><csymbol cd="quant1">forall</csymbol>
<bvar><ci id="var-x">x</ci></bvar>
<apply><csymbol cd="relation1">lt</csymbol>
<ci xref="var-x">x</ci>
<cn>1</cn>
</apply>
</bind>
This id based approach is especially helpful when constructions involving bound variables are nested.
It is sometimes necessary to associate additional information with a bound variable. The information
might be something like a detailed mathematical type, an alternative presentation or encoding or a do-
main of application. Such associations are accomplished in the standard way by replacing a ci element
(even inside the bvar element) by a semantics element containing both the ci and the additional
information. Recognition of an instance of the bound variable is still based on the actual ci elements
and not the semantics elements or anything else they may contain. The id based-approach outlined
above may still be used.
The following example encodes forall x. x+y=y+x.
<bind><csymbol cd="quant1">forall</csymbol>
<bvar><ci>x</ci></bvar>
<apply><csymbol cd="relation1">eq</csymbol>
<apply><csymbol cd="arith1">plus</csymbol><ci>x</ci><ci>y</ci></apply>
<apply><csymbol cd="arith1">plus</csymbol><ci>y</ci><ci>x</ci></apply>
</apply>
</bind>
In non-Strict Content markup, the bvar element is used in a number of idiomatic constructs. These are
described in Section 4.3.3 and Section 4.4.
Content MathML
<bind> b
<bvar> x1 </bvar>
<bvar> ... </bvar>
<bvar> xn </bvar>
s
</bind>
Sample Presentation
<mrow>
B
<mrow>
x1
<mo separator="true">,</mo>
...
<mo separator="true">,</mo>
xn
</mrow>
<mo separator="true">.</mo>
S
</mrow>
<apply><ci>f</ci> <apply><ci>f</ci>
<apply><ci>f</ci> <apply id="t1"><ci>f</ci>
<apply><ci>f</ci> <apply id="t11"><ci>f</ci>
<ci>a</ci> <ci>a</ci>
<ci>a</ci> <ci>a</ci>
</apply> </apply>
<apply><ci>f</ci> <share href="#t11"/>
<ci>a</ci>
<ci>a</ci>
</apply>
</apply> </apply>
<apply><ci>f</ci> <share href="#t1"/>
<apply><ci>f</ci>
<ci>a</ci>
<ci>a</ci>
</apply>
<apply><ci>f</ci>
<ci>a</ci>
<ci>a</ci>
</apply>
</apply>
</apply> </apply>
<cn>1</cn> <cn>1</cn>
<share href="#baz"/> <share href="#bar"/>
</apply> </apply>
Here, the apply with id="bar" dominates its third child, the share with href="#baz". That element
dominates its target apply (with id="baz"), which in turn dominates its third child, the share with
href="#bar". Finally, the share with href="#bar" dominates its target, the original apply element
with id="bar". So this pair of representations ultimately violates the acyclicity constraint.
<cerror>
<csymbol cd="aritherror">DivisionByZero</csymbol>
<apply><csymbol cd="arith1">divide</csymbol><ci>x</ci><cn>0</cn></apply>
</cerror>
Sample Presentation
<merror>
<mtext>DivisionByZero: </mtext>
<mfrac><mi>x</mi><mn>0</mn></mfrac>
</merror>
x
DivisionByZero:
0
Note that when the context where an error occurs is so nonsensical that its default presentation would
not be useful, an application may provide an alternative representation of the error context. For example:
<cerror>
152 Chapter 4. Content Markup
Another example of container markup, where the list of arguments is given indirectly as an expression
with a bound variable. The container markup for the set of even integers is:
<set>
<bvar><ci>x</ci></bvar>
<domainofapplication><integers/></domainofapplication>
<apply><times/><cn>2</cn><ci>x</ci></apply>
</set>
This may be written as follows in Strict Content MathML:
<apply><csymbol cd="set1">map</csymbol>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>x</ci></bvar>
<apply><csymbol cd="arith1">times</csymbol>
<cn>2</cn>
<ci>x</ci>
</apply>
</bind>
<csymbol cd="setname1">Z</csymbol>
</apply>
This example shows the use of lambda container element and the equivalent use of bind in Strict
Content MathML
<lambda><bvar><ci>x</ci></bvar><ci>x</ci></lambda>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>x</ci></bvar><ci>x</ci>
</bind>
The logical quantifiers <forall/>, <exists/> and the container element lambda are the primary
examples of this type.
The second situation arises when the operator being applied allows the use of bound variables with
qualifiers. The most common examples are sums and integrals. In most of these cases, the variable
binding is to some extent implicit in the notation, and the equivalent Strict representation requires the
introduction of auxiliary constructs such as lambda expressions for formal correctness.
Because expressions using bound variables with qualifiers are idiomatic in nature, and do not always
involve true variable binding, one cannot expect systematic renaming (alpha-conversion) of variables
"bound" with apply to preserve meaning in all cases. An example for this is the diff element where
the bvar term is technically not bound at all.
The following example illustrates the use of apply with a binding operator. In these cases, the corre-
sponding Strict equivalent merely replaces the apply element with a bind element:
<apply><forall/>
<bvar><ci>x</ci></bvar>
<apply><geq/><ci>x</ci><ci>x</ci></apply>
</apply>
The equivalent Strict expression is:
<bind><csymbol cd="logic1">forall</csymbol>
<bvar><ci>x</ci></bvar>
<apply><csymbol cd="relation1">geq</csymbol><ci>x</ci><ci>x</ci></apply>
</bind>
156 Chapter 4. Content Markup
In this example, the sum operator is not itself a binding operator, but bound variables with qualifiers
are implicit in the standard notation, which is reflected in the non-Strict markup. In the equivalent
Strict representation, it is necessary to convert the summand into a lambda expression, and recast the
qualifiers as an argument expression:
<apply><sum/>
<bvar><ci>i</ci></bvar>
<lowlimit><cn>0</cn></lowlimit>
<uplimit><cn>100</cn></uplimit>
<apply><power/><ci>x</ci><ci>i</ci></apply>
</apply>
The equivalent Strict expression is:
<apply><csymbol cd="arith1">sum</csymbol>
<apply><csymbol cd="interval1">integer_interval</csymbol>
<cn>0</cn>
<cn>100</cn>
</apply>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>i</ci></bvar>
<apply><csymbol cd="arith1">power</csymbol>
<ci>x</ci>
<ci>i</ci>
</apply>
</bind>
</apply>
4.3.3 Qualifiers
Many common mathematical constructs involve an operator together with some additional data. The
additional data is either implicit in conventional notation, such as a bound variable, or thought of as part
of the operator, as is the case with the limits of a definite integral. MathML 3 uses qualifier elements to
represent the additional data in such cases.
Qualifier elements are always used in conjunction with operator or container elements. Their meaning
is idiomatic, and depends on the context in which they are used. When used with an operator, qualifiers
always follow the operator and precede any arguments that are present. In all cases, if more than one
qualifier is present, they appear in the order bvar, lowlimit, uplimit, interval, condition,
domainofapplication, degree, momentabout, logbase.
The precise function of qualifier elements depends on the operator or container that they modify. The
majority of use cases fall into one of several categories, discussed below, and usage notes for specific
operators and qualifiers are given in Section 4.4.
<condition>
<apply><and/>
<apply><leq/><cn>0</cn><ci>x</ci></apply>
<apply><leq/><ci>x</ci><cn>1</cn></apply>
</apply>
</condition>
<apply><power/><ci>x</ci><cn>2</cn></apply>
</apply>
Note the use of the explicit bound variable within the condition term. Note also that when a bound
variable is used, the integrand is an expression in the bound variable, not a function.
The general technique of using a condition element together with domainofapplication is quite
powerful. For example, to extend the previous example to a multivariate domain, one may use an extra
bound variable and a domain of application corresponding to a cartesian product:
<apply><int/>
<bvar><ci>x</ci></bvar>
<bvar><ci>y</ci></bvar>
<domainofapplication>
<set>
<bvar><ci>t</ci></bvar>
<bvar><ci>u</ci></bvar>
<condition>
<apply><and/>
<apply><leq/><cn>0</cn><ci>t</ci></apply>
<apply><leq/><ci>t</ci><cn>1</cn></apply>
<apply><leq/><cn>0</cn><ci>u</ci></apply>
<apply><leq/><ci>u</ci><cn>1</cn></apply>
</apply>
</condition>
<list><ci>t</ci><ci>u</ci></list>
</set>
</domainofapplication>
<apply><times/>
<apply><power/><ci>x</ci><cn>2</cn></apply>
<apply><power/><ci>y</ci><cn>3</cn></apply>
</apply>
</apply>
Note that the order of the inner and outer bound variables is significant.
Mappings to Strict Content MathML
When rewriting expressions to Strict Content MathML, qualifier elements are removed via a series of
rules described in this section. The general algorithm for rewriting a MathML expression involving
qualifiers proceeds in two steps. First, constructs using the interval, condition, uplimit and
lowlimit qualifiers are converted to constructs using only domainofapplication. Second,
domainofapplication expressions are then rewritten as Strict Content markup.
4.3. Content MathML for Specific Structures 159
Rewrite: condition
To rewrite an expression using the condition qualifier as one using domainofapplication,
<bvar> x1 </bvar>
<bvar> xn </bvar>
<condition> P </condition>
is rewritten to
<bvar> x1 </bvar>
<bvar> xn </bvar>
<domainofapplication>
<apply><csymbol cd="set1">suchthat</csymbol>
R
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar> x1 </bvar>
<bvar> xn </bvar>
P
</bind>
</apply>
</domainofapplication>
If the apply has a domainofapplication (perhaps originally expressed as interval or an uplimit/
lowlimit pair) then that is used for R . Otherwise R is a set determined by the type attribute of the
bound variable as specified in Section 4.2.2.2, if that is present. If the type is unspecified, the translation
introduces an unspecified domain via content identifier <ci>R</ci>.
By applying the rules above, expression using the interval, condition, uplimit and lowlimit can
be rewritten using only domainofapplication. Once a domainofapplication has been obtained,
the final mapping to Strict markup is accomplished using the following rules:
Rewrite: restriction
An application of a function that is qualified by the domainofapplication qualifier (expressed by an
apply element without bound variables) is converted to an application of a function term constructed
with the restriction symbol.
<apply> F
<domainofapplication>
C
</domainofapplication>
a1
an
</apply>
may be written as:
<apply>
<apply><csymbol cd="fns1">restriction</csymbol>
F
C
</apply>
a1
an
</apply>
4.3. Content MathML for Specific Structures 161
or implicitly. In the case of differentiation, the degree element is used in conjunction with a bvar, but
even in these cases, the variable may not be genuinely bound.
For the usage of degree with the root and moment operators, see the discussion of those operators be-
low. The usage of degree in differentiation is more complex. In general, the degree element indicates
the order of the derivative with respect to that variable. The degree element is allowed as the second
child of a bvar element identifying a variable with respect to which the derivative is being taken. Here
is an example of a second derivative using the degree qualifier:
<apply><diff/>
<bvar>
<ci>x</ci>
<degree><cn>2</cn></degree>
</bvar>
<apply><power/><ci>x</ci><cn>4</cn></apply>
</apply>
For details see Section 4.4.4.2 and Section 4.4.4.3.
Rewrite: element
For example,
<plus/>
is equivalent to the Strict form
<csymbol cd="arith1 ">plus </csymbol>
In MathML 2, the definitionURL attribute could be used to redefine or modify the meaning of an
operator element. When the definitionURL attribute is present, the value for the cd attribute on the
csymbol should be determined by the definitionURL value if possible. The correspondence between
cd and definitionURL values is described Section 4.2.3.2.
4.3. Content MathML for Specific Structures 163
Schema Patterns
The elements representing these n-ary operators are specified in the following schema patterns in Ap-
pendix A: nary-arith.class, nary-functional.class, nary-logical.class, nary-linalg.class, nary-set.class,
nary-constructor.class.
The above rule applies to all symbols in the listed classes. In the case of nary-set.class the choice
of Content Dictionary to use depends on the type attribute on the arguments, defaulting to set1, but
multiset1 should be used if type="multiset".
Note that the members of the nary-constructor.class, such as vector, use constructor syntax
where the arguments and qualifiers are given as children of the element rather than as children of a
containing apply. In this case, the above rules apply with the analogous syntactic modifications.
164 Chapter 4. Content Markup
Schema Patterns
The elements representing these n-ary operators are specified in the schema pattern nary-setlist-constructor.
class.
In the case of set, the choice of Content Dictionary and symbol depends on the value of the type
attribute of the arguments. By default the set symbol is used, but if one of the arguments has type
attribute with value "multiset", the multiset symbol is used. If there is a type attribute with value
other than "set" or "multiset" the set symbol should be used, and the arguments should be annotated
with their type by rewriting the type attribute using the rule Rewrite: attributes.
Schema Patterns
The elements representing these n-ary operators are specified in the following schema patterns in Ap-
pendix A: nary-reln.class, nary-set-reln.class.
The above rules apply to all symbols in classes nary-reln.class and nary-set-reln.class. In
the latter case the choice of Content Dictionary to use depends on the type attribute on the symbol,
defaulting to set1, but multiset1 should be used if type="multiset".
argument is supplied. If a single argument is supplied the function is applied to the elements represented
by the argument.
The underlying symbol used in Strict Content MathML for these elements is Unary and so if the
MathML is used with 0 or more than 1 arguments, the function is applied to the set constructed from
the explicitly supplied arguments according to the following rule.
Schema Patterns
The elements representing these n-ary operators are specified in the following schema patterns in Ap-
pendix A: nary-minmax.class, nary-stats.class.
Like all MathML n-ary operators, The list of arguments may be specified implicitly using qualifier
elements. This is expressed in Strict Content MathML using the following rule, which is similar to the
rule Rewrite: n-ary domainofapplication but differs in that the symbol can be directly applied to the
constructed set of arguments and it is not necessary to use apply_to_list.
4.3. Content MathML for Specific Structures 167
If the element is applied to a single argument the set symbol is not used and the symbol is applied
directly to the argument.
Note: Earlier versions of MathML were not explicit about the correct interpretation of elements in this
class, and left it undefined as to whether an expression such as max(X) was a trivial application of
max to a singleton, or whether it should be interpreted as meaning the maximum of values of the set
X. Applications finding that the rule Rewrite: n-ary unary single can not be applied as the supplied
argument is a scalar may wish to use the rule Rewrite: n-ary unary set as an error recovery. As a further
complication, in the case of the statistical functions the Content Dictionary to use in this case depends
on the desired interpretation of the argument as a set of explicit data or a random variable representing
a distribution.
Schema Patterns
The elements representing these binary operators are specified in the following schema patterns in
Appendix A: binary-arith.class, binary-logical.class, binary-reln.class, binary-linalg.class, binary-set.
class.
Schema Patterns
The elements representing these unary operators are specified in the following schema patterns in
Appendix A: unary-arith.class, unary-functional.class, unary-set.class, unary-elementary.class, unary-
veccalc.class.
Schema Patterns
The elements representing these constants are specified in the schema patterns constant-arith.class and
constant-set.class.
Schema Patterns
The elements representing quantifiers are specified in the schema pattern quantifier.class.
Rewrite: quantifier
An expression of following form where <exists/> denotes an element of class quantifier and
expression-in-x is an arbitrary expression involving the bound variable(s)
<apply><exists/>
<bvar> x </bvar>
<domainofapplication> D </domainofapplication>
expression-in-x
</apply>
is rewritten to an expression
<bind><csymbol cd="quant1 ">exists </csymbol>
<bvar> x </bvar>
<apply><csymbol cd="logic1 ">and </csymbol>
<apply><csymbol cd="set1">in</csymbol> x D </apply>
expression-in-x
</apply>
</bind>
where the symbols <csymbol cd="quant1 ">exists </csymbol> and
<csymbol cd="logic1 ">and </csymbol> are as specified in the syntax table of the element. (The
additional symbol being and in the case of exists and implies in the case of forall.) When no
domainofapplication is present, no logical conjunction is necessary, and the translation is direct.
4.3.4.9 Other Operators (classes lambda, interval, int, diff partialdiff, sum, product, limit)
Special purpose classes, described in the sections for the appropriate elements
Schema Patterns
The elements are specified in the following schema patterns in Appendix A: lambda.class, interval.
class, int.class, partialdiff.class, sum.class, product.class, limit.class.
Rewrite: attributes
For instance,
<ci class="foo " xmlns:other="http://example.com " other:att="bla ">x </ci>
is rewritten to
<semantics>
<ci>x </ci>
<annotation cd="mathmlattr"
name="class" encoding="text/plain">foo </annotation>
<annotation-xml cd="mathmlattr" name="foreign" encoding="MathML-Content">
<apply><csymbol cd="mathmlattr">foreign_attribute</csymbol>
<cs>http://example.com </cs>
<cs>other </cs>
<cs>att </cs>
<cs>bla </cs>
</apply>
</annotation-xml>
</semantics>
For MathML attributes not allowed in Strict Content MathML the content dictionary mathmlattr is
referenced, which provides symbols for all attributes allowed on content MathML elements.
Content MathML
<interval closure="open"><ci>x</ci><cn>1</cn></interval>
<interval closure="closed"><cn>0</cn><cn>1</cn></interval>
<interval closure="open-closed"><cn>0</cn><cn>1</cn></interval>
<interval closure="closed-open"><cn>0</cn><cn>1</cn></interval>
Sample Presentation
<mfenced><mi>x</mi><mn>1</mn></mfenced>
(x, 1)
<mfenced open="[" close="]"><mn>0</mn><mn>1</mn></mfenced>
[0, 1]
<mfenced open="(" close="]"><mn>0</mn><mn>1</mn></mfenced>
(0, 1]
<mfenced open="[" close=")"><mn>0</mn><mn>1</mn></mfenced>
[0, 1)
Content MathML
<apply><inverse/>
<ci> f </ci>
</apply>
Sample Presentation
<msup><mi>f</mi><mrow><mo>(</mo><mn>-1</mn><mo>)</mo></mrow></msup>
f (−1)
172 Chapter 4. Content Markup
Content MathML
<apply>
<apply><inverse/><ci type="matrix">A</ci></apply>
<ci>a</ci>
</apply>
Sample Presentation
<mrow>
<msup><mi>A</mi><mrow><mo>(</mo><mn>-1</mn><mo>)</mo></mrow></msup>
<mo>⁡</mo>
<mfenced><mi>a</mi></mfenced>
</mrow>
A (−1) (a)
Content MathML
<lambda>
<bvar><ci>x</ci></bvar>
<apply><sin/>
<apply><plus/><ci>x</ci><cn>1</cn></apply>
</apply>
</lambda>
Sample Presentation
<mrow>
<mi>λ</mi>
<mi>x</mi>
<mo>.</mo>
<mfenced>
<mrow>
<mi>sin</mi>
<mo>⁡</mo>
<mrow><mo>(</mo><mi>x</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow>
</mrow>
</mfenced>
</mrow>
λx.(sin (x + 1))
<mrow>
<mi>x</mi>
<mo>↦</mo>
<mrow>
<mi>sin</mi>
<mo>⁡</mo>
<mrow><mo>(</mo><mi>x</mi><mo>+</mo><mn>1</mn><mo>)</mo></mrow>
</mrow>
</mrow>
x 7→ sin (x + 1)
Rewrite: lambda
If the lambda element does not contain qualifiers, the lambda expression is directly translated into a
bind expression.
<lambda>
<bvar> x1 </bvar><bvar> xn </bvar>
expression-in-x1-xn
</lambda>
rewrites to the Strict Content MathML
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar> x1 </bvar><bvar> xn </bvar>
expression-in-x1-xn
</bind>
Content MathML
<apply><compose/><ci>f</ci><ci>g</ci><ci>h</ci></apply>
Sample Presentation
<mrow><mi>f</mi><mo>∘</mo><mi>g</mi><mo>∘</mo><mi>h</mi></mrow>
f ◦g◦h
Content MathML
<apply><eq/>
<apply>
<apply><compose/><ci>f</ci><ci>g</ci></apply>
<ci>x</ci>
</apply>
<apply><ci>f</ci><apply><ci>g</ci><ci>x</ci></apply></apply>
</apply>
Sample Presentation
<mrow>
<mrow>
<mrow><mo>(</mo><mi>f</mi><mo>∘</mo><mi>g</mi><mo>)</mo></mrow>
<mo>⁡</mo>
<mfenced><mi>x</mi></mfenced>
</mrow>
<mo>=</mo>
<mrow>
<mi>f</mi>
<mo>⁡</mo>
<mfenced>
<mrow>
<mi>g</mi>
<mo>⁡</mo>
<mfenced><mi>x</mi></mfenced>
</mrow>
</mfenced>
</mrow>
</mrow>
( f ◦ g)(x) = f (g (x))
Content MathML
<apply><eq/>
<apply><compose/>
<ci type="function">f</ci>
<apply><inverse/>
<ci type="function">f</ci>
</apply>
</apply>
<ident/>
</apply>
Sample Presentation
<mrow>
<mrow>
<mi>f</mi>
<mo>∘</mo>
<msup><mi>f</mi><mrow><mo>(</mo><mn>-1</mn><mo>)</mo></mrow></msup>
</mrow>
<mo>=</mo>
<mi>id</mi>
</mrow>
f ◦ f (−1) = id
Content MathML
<apply><eq/>
<apply><domain/><ci>f</ci></apply>
<reals/>
</apply>
Sample Presentation
<mrow>
<mrow><mi>domain</mi><mo>⁡</mo><mfenced><mi>f</mi></mfenced></mrow>
<mo>=</mo>
<mi mathvariant="double-struck">R</mi>
</mrow>
domain ( f ) = R
4.4. Content MathML for Specific Operators and Constants 177
Content MathML
<apply><eq/>
<apply><codomain/><ci>f</ci></apply>
<rationals/>
</apply>
Sample Presentation
<mrow>
<mrow><mi>codomain</mi><mo>⁡</mo><mfenced><mi>f</mi></mfenced></mrow>
<mo>=</mo>
<mi mathvariant="double-struck">Q</mi>
</mrow>
codomain ( f ) = Q
Content MathML
<apply><eq/>
<apply><image/><sin/></apply>
<interval><cn>-1</cn><cn> 1</cn></interval>
</apply>
Sample Presentation
<mrow>
<mrow><mi>image</mi><mo>⁡</mo><mfenced><mi>sin</mi></mfenced></mrow>
<mo>=</mo>
<mfenced open="[" close="]"><mn>-1</mn><mn>1</mn></mfenced>
</mrow>
image (sin) = [−1, 1]
178 Chapter 4. Content Markup
Content MathML
<piecewise>
<piece>
<apply><minus/><ci>x</ci></apply>
<apply><lt/><ci>x</ci><cn>0</cn></apply>
</piece>
<piece>
<cn>0</cn>
<apply><eq/><ci>x</ci><cn>0</cn></apply>
</piece>
<piece>
<ci>x</ci>
<apply><gt/><ci>x</ci><cn>0</cn></apply>
</piece>
</piecewise>
Sample Presentation
<mrow>
<mo>{</mo>
<mtable>
<mtr>
<mtd><mrow><mo>−</mo><mi>x</mi></mrow></mtd>
<mtd columnalign="left"><mtext>  if  </mtext></mtd>
<mtd><mrow><mi>x</mi><mo><</mo><mn>0</mn></mrow></mtd>
</mtr>
<mtr>
<mtd><mn>0</mn></mtd>
<mtd columnalign="left"><mtext>  if  </mtext></mtd>
<mtd><mrow><mi>x</mi><mo>=</mo><mn>0</mn></mrow></mtd>
</mtr>
<mtr>
<mtd><mi>x</mi></mtd>
<mtd columnalign="left"><mtext>  if  </mtext></mtd>
<mtd><mrow><mi>x</mi><mo>></mo><mn>0</mn></mrow></mtd>
</mtr>
</mtable>
</mrow>
−x if x<0
0 if x=0
x if x>0
Content MathML
<piecewise>
<piece>
<cn>0</cn>
<apply><lt/><ci>x</ci><cn>0</cn></apply>
</piece>
<piece>
<cn>1</cn>
<apply><gt/><ci>x</ci><cn>1</cn></apply>
</piece>
<otherwise>
<ci>x</ci>
</otherwise>
</piecewise>
Strict Content MathML equivalent
<apply><csymbol cd="piece1">piecewise</csymbol>
<apply><csymbol cd="piece1">piece</csymbol>
<cn>0</cn>
<apply><csymbol cd="relation1">lt</csymbol><ci>x</ci><cn>0</cn></apply>
</apply>
<apply><csymbol cd="piece1">piece</csymbol>
<cn>1</cn>
<apply><csymbol cd="relation1">gt</csymbol><ci>x</ci><cn>1</cn></apply>
</apply>
<apply><csymbol cd="piece1">otherwise</csymbol>
<ci>x</ci>
</apply>
</apply>
Content MathML
<apply><quotient/><ci>a</ci><ci>b</ci></apply>
Sample Presentation
<mrow><mo>⌊</mo><mi>a</mi><mo>/</mo><mi>b</mi><mo>⌋</mo></mrow>
ba/bc
4.4. Content MathML for Specific Operators and Constants 181
Content MathML
<apply><factorial/><ci>n</ci></apply>
Sample Presentation
<mrow><mi>n</mi><mo>!</mo></mrow>
n!
Content MathML
<apply><divide/>
<ci>a</ci>
<ci>b</ci>
</apply>
Sample Presentation
<mrow><mi>a</mi><mo>/</mo><mi>b</mi></mrow>
a/b
Content MathML
<apply><max/><cn>2</cn><cn>3</cn><cn>5</cn></apply>
Sample Presentation
<mrow>
<mi>max</mi>
<mrow>
<mo>{</mo><mn>2</mn><mo>,</mo><mn>3</mn><mo>,</mo><mn>5</mn><mo>}</mo>
</mrow>
</mrow>
max{2, 3, 5}
Content MathML
<apply><max/>
<bvar><ci>y</ci></bvar>
<condition>
<apply><in/>
<ci>y</ci>
<interval><cn>0</cn><cn>1</cn></interval>
</apply>
</condition>
<apply><power/><ci>y</ci><cn>3</cn></apply>
</apply>
Sample Presentation
<mrow>
<mi>max</mi>
<mrow>
<mo>{</mo><mi>y</mi><mo>|</mo>
<mrow>
<msup><mi>y</mi><mn>3</mn></msup>
<mo>∈</mo>
<mfenced open="[" close="]"><mn>0</mn><mn>1</mn></mfenced>
</mrow>
<mo>}</mo>
</mrow>
</mrow>
max y3 y ∈ [0, 1]
The min element denotes the minimum function, which returns the smallest of the arguments to which it
is applied. Its arguments may be explicitly specified in the enclosing apply element, or specified using
qualifier elements as described in Section 4.3.4.4. Note that when applied to infinite sets of arguments,
no minimal argument may exist.
Content MathML
<apply><min/><ci>a</ci><ci>b</ci></apply>
Sample Presentation
<mrow>
<mi>min</mi>
<mrow><mo>{</mo><mi>a</mi><mo>,</mo><mi>b</mi><mo>}</mo></mrow>
</mrow>
min{a, b}
Content MathML
<apply><min/>
<bvar><ci>x</ci></bvar>
<condition>
<apply><notin/><ci>x</ci><ci type="set">B</ci></apply>
</condition>
<apply><power/><ci>x</ci><cn>2</cn></apply>
</apply>
Sample Presentation
<mrow>
<mi>min</mi>
<mrow><mo>{</mo><msup><mi>x</mi><mn>2</mn></msup><mo>|</mo>
<mrow><mi>x</mi><mo>∉</mo><mi>B</mi></mrow>
<mo>}</mo>
</mrow>
</mrow>
min x2 x 6∈ B
Content MathML
<apply><minus/><cn>3</cn></apply>
Sample Presentation
<mrow><mo>−</mo><mn>3</mn></mrow>
−3
Content MathML
<apply><minus/><ci>x</ci><ci>y</ci></apply>
Sample Presentation
<mrow><mi>x</mi><mo>−</mo><mi>y</mi></mrow>
x−y
In both cases, the translation to Strict Content markup is direct, as described in Rewrite: element. It is
merely a matter of choosing the symbol that reflects the actual usage.
Content MathML
<apply><plus/><ci>x</ci><ci>y</ci><ci>z</ci></apply>
Sample Presentation
<mrow><mi>x</mi><mo>+</mo><mi>y</mi><mo>+</mo><mi>z</mi></mrow>
x+y+z
Content MathML
<apply><power/><ci>x</ci><cn>3</cn></apply>
Sample Presentation
<msup><mi>x</mi><mn>3</mn></msup>
x3
Content MathML
<apply><rem/><ci> a </ci><ci> b </ci></apply>
Sample Presentation
<mrow><mi>a</mi><mo>mod</mo><mi>b</mi></mrow>
a mod b
Content MathML
<apply><times/><ci>a</ci><ci>b</ci></apply>
Sample Presentation
<mrow><mi>a</mi><mo>⁢</mo><mi>b</mi></mrow>
ab
186 Chapter 4. Content Markup
Content MathML
<apply><root/>
<degree><ci type="integer">n</ci></degree>
<ci>a</ci>
</apply>
Sample Presentation
<mroot><mi>a</mi><mi>n</mi></mroot>
√
n
a
Content MathML
<apply><root/><ci>x</ci></apply>
Strict Content MathML equivalent
<apply><csymbol cd="arith1">root</csymbol>
<ci>x</ci>
<cn type="integer">2</cn>
</apply>
Content MathML
<apply><root/>
<degree><ci type="integer">n</ci></degree>
<ci>a</ci>
</apply>
Strict Content MathML equivalent
<apply><csymbol cd="arith1">root</csymbol>
<ci>a</ci>
<cn type="integer">n</cn>
</apply>
4.4. Content MathML for Specific Operators and Constants 187
Content MathML
<apply><gcd/><ci>a</ci><ci>b</ci><ci>c</ci></apply>
Sample Presentation
<mrow>
<mi>gcd</mi>
<mo>⁡</mo>
<mfenced><mi>a</mi><mi>b</mi><mi>c</mi></mfenced>
</mrow>
gcd (a, b, c)
This default rendering is English-language locale specific: other locales may have different default
renderings.
When the gcd element is applied to an explicit list of arguments, the translation to Strict Content
markup is direct, using the gcd symbol, as described in Rewrite: element. However, when qualifiers are
used, the equivalent Strict markup is computed via Rewrite: n-ary domainofapplication.
Content MathML
<apply><and/><ci>a</ci><ci>b</ci></apply>
Sample Presentation
<mrow><mi>a</mi><mo>∧</mo><mi>b</mi></mrow>
a∧b
188 Chapter 4. Content Markup
Content MathML
<apply><and/>
<bvar><ci>i</ci></bvar>
<lowlimit><cn>0</cn></lowlimit>
<uplimit><ci>n</ci></uplimit>
<apply><gt/><apply><selector/><ci>a</ci><ci>i</ci></apply><cn>0</cn></apply>
</apply>
Strict Content MathML
<apply><csymbol cd="fns2">apply_to_list</csymbol>
<csymbol cd="logic1">and</csymbol>
<apply><csymbol cd="list1">map</csymbol>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>i</ci></bvar>
<apply><csymbol cd="relation1">gt</csymbol>
<apply><csymbol cd="linalg1">vector_selector</csymbol>
<ci>i</ci>
<ci>a</ci>
</apply>
<cn>0</cn>
</apply>
</bind>
<apply><csymbol cd="interval1">integer_interval</csymbol>
<cn type="integer">0</cn>
<ci>n</ci>
</apply>
</apply>
</apply>
Sample Presentation
<mrow>
<munderover>
<mo>⋀</mo>
<mrow><mi>i</mi><mo>=</mo><mn>0</mn></mrow>
<mi>n</mi>
</munderover>
<mrow>
<mo>(</mo>
<msub><mi>a</mi><mi>i</mi></msub>
<mo>></mo>
<mn>0</mn>
<mo>)</mo>
</mrow>
</mrow>
n
^
(ai > 0)
i=0
4.4. Content MathML for Specific Operators and Constants 189
4.4.2.14 Or <or/>
Class nary-logical
Attributes CommonAtt, DefEncAtt
Content Empty
Qualifiers BvarQ,DomainQ
OM Symbols or
The or element represents the logical ‘or’ function. It is true if any of the arguments are true, and false
otherwise.
Content MathML
<apply><or/><ci>a</ci><ci>b</ci></apply>
Sample Presentation
<mrow><mi>a</mi><mo>∨</mo><mi>b</mi></mrow>
a∨b
Content MathML
<apply><xor/><ci>a</ci><ci>b</ci></apply>
Sample Presentation
<mrow><mi>a</mi><mo>xor</mo><mi>b</mi></mrow>
a xor b
Content MathML
<apply><not/><ci>a</ci></apply>
Sample Presentation
<mrow><mo>¬</mo><mi>a</mi></mrow>
¬a
Content MathML
<apply><implies/><ci>A</ci><ci>B</ci></apply>
Sample Presentation
<mrow><mi>A</mi><mo>⇒</mo><mi>B</mi></mrow>
A⇒B
Content MathML
<bind><forall/>
<bvar><ci>x</ci></bvar>
<apply><eq/>
<apply><minus/><ci>x</ci><ci>x</ci></apply>
<cn>0</cn>
</apply>
</bind>
Sample Presentation
<mrow>
<mo>∀</mo>
<mi>x</mi>
<mo>.</mo>
<mfenced>
<mrow>
<mrow><mi>x</mi><mo>−</mo><mi>x</mi></mrow>
<mo>=</mo>
<mn>0</mn>
</mrow>
</mfenced>
</mrow>
∀x.(x − x = 0)
<apply><csymbol cd="set1">in</csymbol>
<ci>p</ci>
<csymbol cd="setname1">Q</csymbol>
</apply>
<apply><csymbol cd="set1">in</csymbol>
<ci>q</ci>
<csymbol cd="setname1">Q</csymbol>
</apply>
<apply><csymbol cd="relation1">lt</csymbol><ci>p</ci><ci>q</ci></apply>
</apply>
<apply><csymbol cd="relation1">lt</csymbol>
<ci>p</ci>
<apply><csymbol cd="arith1">power</csymbol>
<ci>q</ci>
<cn>2</cn>
</apply>
</apply>
</apply>
</bind>
Sample Presentation
<mrow>
<mo>∀</mo>
<mrow>
<mrow><mi>p</mi><mo>∈</mo><mi mathvariant="double-struck">Q</mi></mrow>
<mo>∧</mo>
<mrow><mi>q</mi><mo>∈</mo><mi mathvariant="double-struck">Q</mi></mrow>
<mo>∧</mo>
<mrow><mo>(</mo><mi>p</mi><mo><</mo><mi>q</mi><mo>)</mo></mrow>
</mrow>
<mo>.</mo>
<mfenced>
<mrow><mi>p</mi><mo><</mo><msup><mi>q</mi><mn>2</mn></msup></mrow>
</mfenced>
</mrow>
∀p ∈ Q ∧ q ∈ Q ∧ (p < q). p < q2
<mrow>
<mo>∀</mo>
<mrow><mi>p</mi><mo>,</mo><mi>q</mi></mrow>
<mo>.</mo>
<mfenced>
<mrow>
<mrow>
<mo>(</mo>
<mrow>
<mi>p</mi><mo>∈</mo><mi mathvariant="double-struck">Q</mi>
</mrow>
<mo>∧</mo>
<mrow>
<mi>q</mi><mo>∈</mo><mi mathvariant="double-struck">Q</mi>
4.4. Content MathML for Specific Operators and Constants 193
</mrow>
<mo>∧</mo>
<mrow><mo>(</mo><mi>p</mi><mo><</mo><mi>q</mi><mo>)</mo></mrow>
<mo>)</mo>
</mrow>
<mo>⇒</mo>
<mrow>
<mo>(</mo>
<mi>p</mi>
<mo><</mo>
<msup><mi>q</mi><mn>2</mn></msup>
<mo>)</mo>
</mrow>
</mrow>
</mfenced>
</mrow>
∀p, q. (p ∈ Q ∧ q ∈ Q ∧ (p < q)) ⇒ p < q2
Content MathML
<bind><exists/>
<bvar><ci>x</ci></bvar>
<apply><eq/>
<apply><ci>f</ci><ci>x</ci></apply>
<cn>0</cn>
</apply>
</bind>
Sample Presentation
<mrow>
<mo>∃</mo>
<mi>x</mi>
<mo>.</mo>
<mfenced>
<mrow>
<mrow><mi>f</mi><mo>⁡</mo><mfenced><mi>x</mi></mfenced></mrow>
<mo>=</mo>
<mn>0</mn>
</mrow>
</mfenced>
</mrow>
∃x.( f (x) = 0)
4.4. Content MathML for Specific Operators and Constants 195
Content MathML
<apply><exists/>
<bvar><ci>x</ci></bvar>
<domainofapplication>
<integers/>
</domainofapplication>
<apply><eq/>
<apply><ci>f</ci><ci>x</ci></apply>
<cn>0</cn>
</apply>
</apply>
Strict MathML equivalent:
<bind><csymbol cd="quant1">exists</csymbol>
<bvar><ci>x</ci></bvar>
<apply><csymbol cd="logic1">and</csymbol>
<apply><csymbol cd="set1">in</csymbol>
<ci>x</ci>
<csymbol cd="setname1">Z</csymbol>
</apply>
<apply><csymbol cd="relation1">eq</csymbol>
<apply><ci>f</ci><ci>x</ci></apply>
<cn>0</cn>
</apply>
</apply>
</bind>
Sample Presentation
<mrow>
<mo>∃</mo>
<mi>x</mi>
<mo>.</mo>
<mfenced separators="">
<mrow><mi>x</mi><mo>∈</mo><mi mathvariant="double-struck">Z</mi></mrow>
<mo>∧</mo>
<mrow>
<mrow><mi>f</mi><mo>⁡</mo><mfenced><mi>x</mi></mfenced></mrow>
<mo>=</mo>
<mn>0</mn>
</mrow>
</mfenced>
</mrow>
∃x.(x ∈ Z ∧ f (x) = 0)
The abs element represents the absolute value function. The argument should be numerically valued.
When the argument is a complex number, the absolute value is often referred to as the modulus.
Content MathML
<apply><abs/><ci>x</ci></apply>
Sample Presentation
<mrow><mo>|</mo><mi>x</mi><mo>|</mo></mrow>
|x|
Content MathML
<apply><conjugate/>
<apply><plus/>
<ci>x</ci>
<apply><times/><cn>ⅈ</cn><ci>y</ci></apply>
</apply>
</apply>
Sample Presentation
<mover>
<mrow>
<mi>x</mi>
<mo>+</mo>
<mrow><mn>ⅈ</mn><mo>⁢</mo><mi>y</mi></mrow>
</mrow>
<mo>¯</mo>
</mover>
x + iy
Content MathML
<apply><arg/>
<apply><plus/>
<ci> x </ci>
<apply><times/><imaginaryi/><ci>y</ci></apply>
</apply>
</apply>
Sample Presentation
<mrow>
<mi>arg</mi>
<mo>⁡</mo>
<mfenced>
<mrow>
<mi>x</mi>
<mo>+</mo>
<mrow><mi>i</mi><mo>⁢</mo><mi>y</mi></mrow>
</mrow>
</mfenced>
</mrow>
arg (x + iy)
Content MathML
<apply><real/>
<apply><plus/>
<ci>x</ci>
<apply><times/><imaginaryi/><ci>y</ci></apply>
</apply>
</apply>
Sample Presentation
<mrow>
<mo>ℛ</mo>
<mo>⁡</mo>
<mfenced>
<mrow>
<mi>x</mi>
<mo>+</mo>
<mrow><mi>i</mi><mo>⁢</mo><mi>y</mi></mrow>
</mrow>
</mfenced>
</mrow>
R (x + iy)
Content MathML
<apply><imaginary/>
<apply><plus/>
<ci>x</ci>
<apply><times/><imaginaryi/><ci>y</ci></apply>
</apply>
</apply>
Sample Presentation
<mrow>
<mo>ℑ</mo>
<mo>⁡</mo>
<mfenced>
<mrow>
<mi>x</mi>
<mo>+</mo>
<mrow><mi>i</mi><mo>⁢</mo><mi>y</mi></mrow>
</mrow>
</mfenced>
</mrow>
I(x + iy)
Content MathML
<apply><lcm/><ci>a</ci><ci>b</ci><ci>c</ci></apply>
Sample Presentation
<mrow>
<mi>lcm</mi>
<mo>⁡</mo>
<mfenced><mi>a</mi><mi>b</mi><mi>c</mi></mfenced>
</mrow>
lcm (a, b, c)
This default rendering is English-language locale specific: other locales may have different default
renderings.
200 Chapter 4. Content Markup
Content MathML
<apply><floor/><ci>a</ci></apply>
Sample Presentation
<mrow><mo>⌊</mo><mi>a</mi><mo>⌋</mo></mrow>
bac
Content MathML
<apply><ceiling/><ci>a</ci></apply>
Sample Presentation
<mrow><mo>⌈</mo><mi>a</mi><mo>⌉</mo></mrow>
dae
4.4.3 Relations
4.4.3.1 Equals <eq/>
Class nary-reln
Attributes CommonAtt, DefEncAtt
Content Empty
Qualifiers BvarQ,DomainQ
OM Symbols eq
The eq elements represents the equality relation. While equality is a binary relation, eq may be used
with more than two arguments, denoting a chain of equalities, as described in Section 4.3.4.3.
4.4. Content MathML for Specific Operators and Constants 201
Content MathML
<apply><eq/>
<cn type="rational">2<sep/>4</cn>
<cn type="rational">1<sep/>2</cn>
</apply>
Sample Presentation
<mrow>
<mrow><mn>2</mn><mo>/</mo><mn>4</mn></mrow>
<mo>=</mo>
<mrow><mn>1</mn><mo>/</mo><mn>2</mn></mrow>
</mrow>
2/4 = 1/2
Content MathML
<apply><neq/><cn>3</cn><cn>4</cn></apply>
Sample Presentation
<mrow><mn>3</mn><mo>≠</mo><mn>4</mn></mrow>
3 6= 4
Content MathML
<apply><gt/><cn>3</cn><cn>2</cn></apply>
Sample Presentation
<mrow><mn>3</mn><mo>></mo><mn>2</mn></mrow>
3>2
Content MathML
<apply><lt/><cn>2</cn><cn>3</cn><cn>4</cn></apply>
Sample Presentation
<mrow><mn>2</mn><mo><</mo><mn>3</mn><mo><</mo><mn>4</mn></mrow>
2<3<4
Content MathML
<apply><geq/><cn>4</cn><cn>3</cn><cn>3</cn></apply>
Strict Content MathML
<apply><csymbol cd="fns2">predicate_on_list</csymbol>
<csymbol cd="reln1">geq</csymbol>
<apply><csymbol cd="list1">list</csymbol>
<cn>4</cn><cn>3</cn><cn>3</cn>
</apply>
</apply>
Sample Presentation
<mrow><mn>4</mn><mo>≥</mo><mn>3</mn><mo>≥</mo><mn>3</mn></mrow>
4≥3≥3
Content MathML
<apply><leq/><cn>3</cn><cn>3</cn><cn>4</cn></apply>
Sample Presentation
<mrow><mn>3</mn><mo>≤</mo><mn>3</mn><mo>≤</mo><mn>4</mn></mrow>
3≤3≤4
Content MathML
<apply><equivalent/>
<ci>a</ci>
<apply><not/><apply><not/><ci>a</ci></apply></apply>
</apply>
Sample Presentation
<mrow>
<mi>a</mi>
<mo>≡</mo>
<mrow><mo>¬</mo><mrow><mo>¬</mo><mi>a</mi></mrow></mrow>
</mrow>
a 𠪪a
Content MathML
<apply><approx/>
<pi/>
<cn type="rational">22<sep/>7</cn>
</apply>
Sample Presentation
<mrow>
<mi>π</mi>
<mo>≃</mo>
<mrow><mn>22</mn><mo>/</mo><mn>7</mn></mrow>
</mrow>
π ' 22/7
Content MathML
<apply><factorof/><ci>a</ci><ci>b</ci></apply>
Sample Presentation
<mrow><mi>a</mi><mo>|</mo><mi>b</mi></mrow>
a|b
Content MathML
<apply><eq/>
<apply><int/><sin/></apply>
<cos/>
</apply>
Sample Presentation
<mrow><mrow><mi>∫</mi><mi>sin</mi></mrow><mo>=</mo><mi>cos</mi></mrow>
Z
sin = cos
Content MathML
<apply><int/>
<interval><ci>a</ci><ci>b</ci></interval>
<cos/>
</apply>
Sample Presentation
<mrow>
<msubsup><mi>∫</mi><mi>a</mi><mi>b</mi></msubsup><mi>cos</mi>
</mrow>
Z b
cos
a
The int element can also be used with bound variables serving as the integration variables.
206 Chapter 4. Content Markup
Content MathML
Here, definite integrals are indicated by providing qualifier elements specifying a domain of integration
(here a lowlimit/uplimit pair). This is perhaps the most "standard" representation of this integral:
<apply><int/>
<bvar><ci>x</ci></bvar>
<lowlimit><cn>0</cn></lowlimit>
<uplimit><cn>1</cn></uplimit>
<apply><power/><ci>x</ci><cn>2</cn></apply>
</apply>
Sample Presentation
<mrow>
<msubsup><mi>∫</mi><mn>0</mn><mn>1</mn></msubsup>
<msup><mi>x</mi><mn>2</mn></msup>
<mi>d</mi>
<mi>x</mi>
</mrow>
Z 1
x2 dx
0
Rewrite: int
Translate an indefinite integral, where expression-in-x is an arbitrary expression involving the
bound variable(s) x
<apply><int/>
<bvar> x </bvar>
expression-in-x
</apply>
to the expression
<apply>
<apply><csymbol cd="calculus1">int</csymbol>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar> x </bvar>
expression-in-x
</bind>
</apply>
x
</apply>
Note that as x is not bound in the original indefinite integral, the integrated function is applied to the
variable x making it an explicit free variable in Strict Content Markup expression, even though it is
bound in the subterm used as an argument to int.
For a definite integral without bound variables, the translation is also straightforward.
208 Chapter 4. Content Markup
For instance, the integral of a differential form f over an arbitrary domain C represented as
<apply><int/>
<domainofapplication><ci>C</ci></domainofapplication>
<ci>f</ci>
</apply>
is equivalent to the Strict Content MathML:
<apply><csymbol cd="calculus1">defint</csymbol><ci>C</ci><ci>f</ci></apply>
Note, however, the additional remarks on the translations of other kinds of qualifiers that may be used
to specify a domain of integration in the rules for definite integrals following.
When bound variables are present, the situation is more complicated in general, and the following rules
are used.
Rewrite: defint
Translate a definite integral, where expression-in-x is an arbitrary expression involving the
bound variable(s) x
<apply><int/>
<bvar> x </bvar>
<domainofapplication> D </domainofapplication>
expression-in-x
</apply>
to the expression
<apply><csymbol cd="calculus1">defint</csymbol>
D
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar> x </bvar>
expression-in-x
</bind>
</apply>
But the definite integral with an lowlimit/uplimit pair carries the strong intuition that the range of
integration is oriented, and thus swapping lower and upper limits will change the sign of the result. To
accommodate this, use the following special translation rule:
4.4. Content MathML for Specific Operators and Constants 209
Note that use of the condition qualifier also requires special treatment. In particular, it extends to
multivariate domains by using extra bound variables and a domain corresponding to a cartesian product
as in:
<bind><int/>
<bvar><ci>x</ci></bvar>
<bvar><ci>y</ci></bvar>
<condition>
<apply><and/>
<apply><leq/><cn>0</cn><ci>x</ci></apply>
<apply><leq/><ci>x</ci><cn>1</cn></apply>
<apply><leq/><cn>0</cn><ci>y</ci></apply>
<apply><leq/><ci>y</ci><cn>1</cn></apply>
</apply>
</condition>
<apply><times/>
<apply><power/><ci>x</ci><cn>2</cn></apply>
<apply><power/><ci>y</ci><cn>3</cn></apply>
</apply>
</bind>
Strict Content MathML equivalent
<apply><csymbol cd="calculus1">defint</csymbol>
<apply><csymbol cd="set1">suchthat</csymbol>
<apply><csymbol cd="set1">cartesianproduct</csymbol>
<csymbol cd="setname1">R</csymbol>
<csymbol cd="setname1">R</csymbol>
</apply>
<apply><csymbol cd="logic1">and</csymbol>
<apply><csymbol cd="arith1">leq</csymbol><cn>0</cn><ci>x</ci></apply>
<apply><csymbol cd="arith1">leq</csymbol><ci>x</ci><cn>1</cn></apply>
<apply><csymbol cd="arith1">leq</csymbol><cn>0</cn><ci>y</ci></apply>
<apply><csymbol cd="arith1">leq</csymbol><ci>y</ci><cn>1</cn></apply>
</apply>
<bind><csymbol cd="fns11">lambda</csymbol>
<bvar><ci>x</ci></bvar>
<bvar><ci>y</ci></bvar>
<apply><csymbol cd="arith1">times</csymbol>
<apply><csymbol cd="arith1">power</csymbol><ci>x</ci><cn>2</cn></apply>
<apply><csymbol cd="arith1">power</csymbol><ci>y</ci><cn>3</cn></apply>
</apply>
</bind>
</apply>
</apply>
The diff element is the differentiation operator element for functions or expressions of a single vari-
able. It may be applied directly to an actual function thereby denoting a function which is the derivative
of the original function, or it can be applied to an expression involving a single variable.
Content MathML
<apply><diff/><ci>f</ci></apply>
Sample Presentation
<msup><mi>f</mi><mo>′</mo></msup>
0
f
Content MathML
<apply><eq/>
<apply><diff/>
<bvar><ci>x</ci></bvar>
<apply><sin/><ci>x</ci></apply>
</apply>
<apply><cos/><ci>x</ci></apply>
</apply>
Sample Presentation
<mrow>
<mfrac>
<mrow><mi>d</mi><mrow><mi>sin</mi><mo>⁡</mo><mi>x</mi></mrow></mrow>
<mrow><mi>d</mi><mi>x</mi></mrow>
</mfrac>
<mo>=</mo>
<mrow><mi>cos</mi><mo>⁡</mo><mi>x</mi></mrow>
</mrow>
dsin x
= cos x
dx
The bvar element may also contain a degree element, which specifies the order of the derivative to be
taken.
212 Chapter 4. Content Markup
Content MathML
<apply><diff/>
<bvar><ci>x</ci><degree><cn>2</cn></degree></bvar>
<apply><power/><ci>x</ci><cn>4</cn></apply>
</apply>
Sample Presentation
<mfrac>
<mrow>
<msup><mi>d</mi><mn>2</mn></msup>
<msup><mi>x</mi><mn>4</mn></msup>
</mrow>
<mrow><mi>d</mi><msup><mi>x</mi><mn>2</mn></msup></mrow>
</mfrac>
Rewrite: diff
Translate an expression
<apply><diff/>
<bvar> x </bvar>
expression-in-x
</apply>
where expression-in-x is an expression in the variable x to the expression
<apply>
<apply><csymbol cd="calculus1">diff</csymbol>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar> x </bvar>
E
</bind>
</apply>
x
</apply>
Note that the differentiated function is applied to the variable x making its status as a free variable
explicit in strict markup. Thus the strict equivalent of
<apply><diff/>
<bvar><ci>x</ci></bvar>
<apply><sin/><ci>x</ci></apply>
</apply>
is
<apply>
<apply><csymbol cd="calculus1">diff</csymbol>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>x</ci></bvar>
<apply><csymbol cd="transc1">sin</csymbol><ci>x</ci></apply>
</bind>
</apply>
<ci>x</ci>
</apply>
If the bvar element contains a degree element, use the nthdiff symbol.
214 Chapter 4. Content Markup
Rewrite: nthdiff
<apply><diff/>
<bvar> x <degree> n </degree></bvar>
expression-in-x
</apply>
where expression-in-x is an is an expression in the variable x is translated to to the expression:
<apply>
<apply><csymbol cd="calculus1">nthdiff</csymbol>
n
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar> x </bvar>
expression-in-x
</bind>
</apply>
x
</apply>
For example
<apply><diff/>
<bvar><degree><cn>2</cn></degree><ci>x</ci></bvar>
<apply><sin/><ci>x</ci></apply>
</apply>
Strict Content MathML equivalent
<apply>
<apply><csymbol cd="calculus1">nthdiff</csymbol>
<cn>2</cn>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>x</ci></bvar>
<apply><csymbol cd="transc1">sin</csymbol><ci>x</ci></apply>
</bind>
</apply>
<ci>x</ci>
</apply>
Content MathML
<apply><partialdiff/>
<list><cn>1</cn><cn>1</cn><cn>3</cn></list>
<ci type="function">f</ci>
</apply>
Sample Presentation
<mrow>
<msub>
<mi>D</mi>
<mrow><mn>1</mn><mo>,</mo><mn>1</mn><mo>,</mo><mn>3</mn></mrow>
</msub>
<mi>f</mi>
</mrow>
D1,1,3 f
Content MathML
<apply><partialdiff/>
<list><cn>1</cn><cn>1</cn><cn>3</cn></list>
<lambda>
<bvar><ci>x</ci></bvar>
<bvar><ci>y</ci></bvar>
<bvar><ci>z</ci></bvar>
<apply><ci>f</ci><ci>x</ci><ci>y</ci><ci>z</ci></apply>
</lambda>
</apply>
Sample Presentation
<mfrac>
<mrow>
<msup><mo>∂</mo><mn>3</mn></msup>
<mrow>
<mi>f</mi><mo>⁡</mo><mfenced><mi>x</mi><mi>y</mi><mi>z</mi></mfenced>
</mrow>
</mrow>
<mrow>
<mrow><mo>∂</mo><msup><mi>x</mi><mn>2</mn></msup></mrow>
<mrow><mo>∂</mo><mi>z</mi></mrow>
</mrow>
</mfrac>
∂3 f (x, y, z)
∂x2 ∂z
In the case of algebraic expressions, the bound variables are given by bvar elements, which are children
of the containing apply element. The bvar elements may also contain degree element, which specify
the order of the partial derivative to be taken in that variable.
216 Chapter 4. Content Markup
Content MathML
<apply><partialdiff/>
<bvar><ci>x</ci></bvar>
<bvar><ci>y</ci></bvar>
<apply><ci type="function">f</ci><ci>x</ci><ci>y</ci></apply>
</apply>
Sample Presentation
<mfrac>
<mrow>
<msup><mo>∂</mo><mn>2</mn></msup>
<mrow>
<mi>f</mi>
<mo>⁡</mo>
<mfenced><mi>x</mi><mi>y</mi></mfenced>
</mrow>
</mrow>
<mrow>
<mrow><mo>∂</mo><mi>x</mi></mrow>
<mrow><mo>∂</mo><mi>y</mi></mrow>
</mrow>
</mfrac>
∂2 f (x, y)
∂x∂y
Where a total degree of differentiation must be specified, this is indicated by use of a degree element
at the top level, i.e. without any associated bvar, as a child of the containing apply element.
4.4. Content MathML for Specific Operators and Constants 217
Content MathML
<apply><partialdiff/>
<bvar><ci>x</ci><degree><ci>m</ci></degree></bvar>
<bvar><ci>y</ci><degree><ci>n</ci></degree></bvar>
<degree><ci>k</ci></degree>
<apply><ci type="function">f</ci>
<ci>x</ci>
<ci>y</ci>
</apply>
</apply>
Sample Presentation
<mfrac>
<mrow>
<msup><mo>∂</mo><mi>k</mi></msup>
<mrow>
<mi>f</mi><mo>⁡</mo><mfenced><mi>x</mi><mi>y</mi></mfenced>
</mrow>
</mrow>
<mrow>
<mrow><mo>∂</mo><msup><mi>x</mi><mi>m</mi></msup></mrow>
<mrow><mo>∂</mo><msup><mi>y</mi><mi>n</mi></msup></mrow>
</mrow>
</mfrac>
∂k f (x, y)
∂ xm ∂ yn
Rewrite: partialdiffdegree
If partialdiff is used with an expression and bvar qualifiers it is rewritten to Strict Content MathML
using the partialdiffdegree symbol.
<apply><partialdiff/>
<bvar> x1 <degree> n1 </degree></bvar>
<bvar> xk <degree> nk </degree></bvar>
<degree> total-n1-nk </degree>
expression-in-x1-xk
</apply>
expression-in-x1-xk is an arbitrary expression involving the bound variables.
<apply>
<apply><csymbol cd="calculus1">partialdiffdegree</csymbol>
<apply><csymbol cd="list1">list</csymbol>
n1 nk
</apply>
total-n1-nk
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar> x1 </bvar>
<bvar> xk </bvar>
expression-in-x1-xk
</bind>
</apply>
x1
xk
</apply>
If any of the bound variables do not use a degree qualifier, <cn>1</cn> should be used in place of
the degree. If the original expression did not use the total degree qualifier then the second argument to
partialdiffdegree should be the sum of the degrees, for example
<apply><csymbol cd="arith1">plus</csymbol>
n1 nk
</apply>
4.4. Content MathML for Specific Operators and Constants 219
Content MathML
<apply><divergence/><ci>a</ci></apply>
Sample Presentation
<mrow><mi>div</mi><mo>⁡</mo><mfenced><mi>a</mi></mfenced></mrow>
div (a)
Content MathML
<apply><divergence/>
<ci type="vector">E</ci>
</apply>
Sample Presentation
<mrow><mi>div</mi><mo>⁡</mo><mfenced><mi>E</mi></mfenced></mrow>
div (E)
<mrow><mo>∇</mo><mo>⋅</mo><mi>E</mi></mrow>
∇·E
The functions defining the coordinates may be defined implicitly as expressions defined in terms of the
coordinate names, in which case the coordinate names must be provided as bound variables.
4.4. Content MathML for Specific Operators and Constants 221
Content MathML
<apply><divergence/>
<bvar><ci>x</ci></bvar>
<bvar><ci>y</ci></bvar>
<bvar><ci>z</ci></bvar>
<vector>
<apply><plus/><ci>x</ci><ci>y</ci></apply>
<apply><plus/><ci>x</ci><ci>z</ci></apply>
<apply><plus/><ci>z</ci><ci>y</ci></apply>
</vector>
</apply>
Sample Presentation
<mrow>
<mi>div</mi>
<mo>⁡</mo>
<mo>(</mo>
<mtable>
<mtr><mtd>
<mi>x</mi>
<mo>↦</mo>
<mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow>
</mtd></mtr>
<mtr><mtd>
<mi>y</mi>
<mo>↦</mo>
<mrow><mi>x</mi><mo>+</mo><mi>z</mi></mrow>
</mtd></mtr>
<mtr><mtd>
<mi>z</mi>
<mo>↦</mo>
<mrow><mi>z</mi><mo>+</mo><mi>y</mi></mrow>
</mtd></mtr>
</mtable>
<mo>)</mo>
</mrow>
x 7→ x + y
divy 7→ x + z
z 7→ z + y
Content MathML
<apply><grad/><ci type="function">f</ci></apply>
Sample Presentation
<mrow><mi>grad</mi><mo>⁡</mo><mfenced><mi>f</mi></mfenced></mrow>
grad ( f )
<mrow><mo>∇</mo><mo>⁡</mo><mfenced><mi>f</mi></mfenced></mrow>
∇( f )
The functions defining the coordinates may be defined implicitly as expressions defined in terms of the
coordinate names, in which case the coordinate names must be provided as bound variables.
Content MathML
<apply><grad/>
<bvar><ci>x</ci></bvar>
<bvar><ci>y</ci></bvar>
<bvar><ci>z</ci></bvar>
<apply><times/><ci>x</ci><ci>y</ci><ci>z</ci></apply>
</apply>
Sample Presentation
<mrow>
<mi>grad</mi>
<mo>⁡</mo>
<mrow>
<mo>(</mo>
<mfenced><mi>x</mi><mi>y</mi><mi>z</mi></mfenced>
<mo>↦</mo>
<mrow>
<mi>x</mi><mo>⁢</mo><mi>y</mi><mo>⁢</mo><mi>z</mi>
</mrow>
<mo>)</mo>
</mrow>
</mrow>
grad ((x, y, z) 7→ xyz)
Content MathML
<apply><curl/><ci>a</ci></apply>
Sample Presentation
<mrow><mi>curl</mi><mo>⁡</mo><mfenced><mi>a</mi></mfenced></mrow>
curl (a)
<mrow><mo>∇</mo><mo>×</mo><mi>a</mi></mrow>
∇×a
The functions defining the coordinates may be defined implicitly as expressions defined in terms of the
coordinate names, in which case the coordinate names must be provided as bound variables.
Content MathML
<apply><laplacian/><ci type="vector">E</ci></apply>
Sample Presentation
<mrow>
<msup><mo>∇</mo><mn>2</mn></msup>
<mo>⁡</mo>
<mfenced><mi>E</mi></mfenced>
</mrow>
2
∇ (E)
The functions defining the coordinates may be defined implicitly as expressions defined in terms of the
coordinate names, in which case the coordinate names must be provided as bound variables.
224 Chapter 4. Content Markup
Content MathML
<apply><laplacian/>
<bvar><ci>x</ci></bvar>
<bvar><ci>y</ci></bvar>
<bvar><ci>z</ci></bvar>
<apply><ci>f</ci><ci>x</ci><ci>y</ci></apply>
</apply>
Sample Presentation
<mrow>
<msup><mo>∇</mo><mn>2</mn></msup>
<mo>⁡</mo>
<mrow>
<mo>(</mo>
<mfenced><mi>x</mi><mi>y</mi><mi>z</mi></mfenced>
<mo>↦</mo>
<mrow>
<mi>f</mi>
<mo>⁡</mo>
<mfenced><mi>x</mi><mi>y</mi></mfenced>
</mrow>
<mo>)</mo>
</mrow>
</mrow>
2
∇ ((x, y, z) 7→ f (x, y))
Content MathML
<set>
<ci>a</ci><ci>b</ci><ci>c</ci>
</set>
Sample Presentation
<mrow>
<mo>{</mo><mi>a</mi><mo>,</mo><mi>b</mi><mo>,</mo><mi>c</mi><mo>}</mo>
</mrow>
{a, b, c}
In general, a set can be constructed by providing a function and a domain of application. The elements
of the set correspond to the values obtained by evaluating the function at the points of the domain.
Content MathML
<set>
<bvar><ci>x</ci></bvar>
<condition>
<apply><lt/><ci>x</ci><cn>5</cn></apply>
</condition>
<ci>x</ci>
</set>
Sample Presentation
<mrow>
<mo>{</mo>
<mi>x</mi>
<mo>|</mo>
<mrow><mi>x</mi><mo><</mo><mn>5</mn></mrow>
<mo>}</mo>
</mrow>
{x|x < 5}
226 Chapter 4. Content Markup
Content MathML
<set>
<bvar><ci type="set">S</ci></bvar>
<condition>
<apply><in/><ci>S</ci><ci type="list">T</ci></apply>
</condition>
<ci>S</ci>
</set>
Sample Presentation
<mrow>
<mo>{</mo>
<mi>S</mi>
<mo>|</mo>
<mrow><mi>S</mi><mo>∈</mo><mi>T</mi></mrow>
<mo>}</mo>
</mrow>
{S|S ∈ T }
Content MathML
<set>
<bvar><ci> x </ci></bvar>
<condition>
<apply><and/>
<apply><lt/><ci>x</ci><cn>5</cn></apply>
<apply><in/><ci>x</ci><naturalnumbers/></apply>
</apply>
</condition>
<ci>x</ci>
</set>
Sample Presentation
<mrow>
<mo>{</mo>
<mi>x</mi>
<mo>|</mo>
<mrow>
<mrow><mo>(</mo><mi>x</mi><mo><</mo><mn>5</mn><mo>)</mo></mrow>
<mo>∧</mo>
<mrow>
<mi>x</mi><mo>∈</mo><mi mathvariant="double-struck">N</mi>
</mrow>
</mrow>
<mo>}</mo>
</mrow>
{x|(x < 5) ∧ x ∈ N}
4.4. Content MathML for Specific Operators and Constants 227
Content MathML
<list>
<ci>a</ci><ci>b</ci><ci>c</ci>
</list>
Sample Presentation
<mrow>
<mo>(</mo><mi>a</mi><mo>,</mo><mi>b</mi><mo>,</mo><mi>c</mi><mo>)</mo>
</mrow>
(a, b, c)
In general a list can be constructed by providing a function and a domain of application. The elements
of the list correspond to the values obtained by evaluating the function at the points of the domain.
When this method is used, the ordering of the list elements may not be clear, so the kind of ordering
may be specified by the order attribute. Two orders are supported: lexicographic and numeric.
Content MathML
<list order="numeric">
<bvar><ci>x</ci></bvar>
<condition>
<apply><lt/><ci>x</ci><cn>5</cn></apply>
</condition>
</list>
Sample Presentation
<mrow>
<mo>(</mo>
<mi>x</mi>
<mo>|</mo>
<mrow><mi>x</mi><mo><</mo><mn>5</mn></mrow>
<mo>)</mo>
</mrow>
(x|x < 5)
228 Chapter 4. Content Markup
Content MathML
<apply><union/><ci>A</ci><ci>B</ci></apply>
Sample Presentation
<mrow><mi>A</mi><mo>∪</mo><mi>B</mi></mrow>
A∪B
Arguments may also be specified using qualifier elements as described in Section 4.3.4.1. operator
element can be used as a binding operator to construct the union over a collection of sets.
Content MathML
<apply><union/>
<bvar><ci type="set">S</ci></bvar>
<domainofapplication>
<ci type="list">L</ci>
</domainofapplication>
<ci type="set"> S</ci>
</apply>
Sample Presentation
<mrow><munder><mo>⋃</mo><mi>L</mi></munder><mi>S</mi></mrow>
[
S
L
Content MathML
<apply><intersect/>
<ci type="set"> A </ci>
<ci type="set"> B </ci>
</apply>
Sample Presentation
<mrow><mi>A</mi><mo>∩</mo><mi>B</mi></mrow>
A∩B
Content MathML
<apply><intersect/>
<bvar><ci type="set">S</ci></bvar>
<domainofapplication><ci type="list">L</ci></domainofapplication>
<ci type="set"> S </ci>
</apply>
Sample Presentation
<mrow><munder><mo>⋂</mo><mi>L</mi></munder><mi>S</mi></mrow>
\
S
L
Content MathML
<apply><in/><ci>a</ci><ci type="set">A</ci></apply>
Sample Presentation
<mrow><mi>a</mi><mo>∈</mo><mi>A</mi></mrow>
a∈A
When translating to Strict Content Markup, if the type has value "multiset", then the in symbol
from multiset1 should be used instead.
The notin represents the negated set inclusion relation. It has two arguments, an element and a set. It
is used to denote that the element is not in the given set.
Content MathML
<apply><notin/><ci>a</ci><ci type="set">A</ci></apply>
Sample Presentation
<mrow><mi>a</mi><mo>∉</mo><mi>A</mi></mrow>
a 6∈ A
When translating to Strict Content Markup, if the type has value "multiset", then the in symbol
from multiset1 should be used instead.
Content MathML
<apply><subset/>
<ci type="set">A</ci>
<ci type="set">B</ci>
</apply>
Sample Presentation
<mrow><mi>A</mi><mo>⊆</mo><mi>B</mi></mrow>
A⊆B
Content MathML
<apply><prsubset/>
<ci type="set">A</ci>
<ci type="set">B</ci>
</apply>
Sample Presentation
<mrow><mi>A</mi><mo>⊂</mo><mi>B</mi></mrow>
A⊂B
Content MathML
<apply><notsubset/>
<ci type="set">A</ci>
<ci type="set">B</ci>
</apply>
Sample Presentation
<mrow><mi>A</mi><mo>⊈</mo><mi>B</mi></mrow>
A 6⊆ B
When translating to Strict Content Markup, if the type has value "multiset", then the in symbol
from multiset1 should be used instead.
Content MathML
<apply><notprsubset/>
<ci type="set">A</ci>
<ci type="set">B</ci>
</apply>
Sample Presentation
<mrow><mi>A</mi><mo>⊄</mo><mi>B</mi></mrow>
A 6⊂ B
When translating to Strict Content Markup, if the type has value "multiset", then the in symbol
from multiset1 should be used instead.
Content MathML
<apply><setdiff/>
<ci type="set">A</ci>
<ci type="set">B</ci>
</apply>
Sample Presentation
<mrow><mi>A</mi><mo>∖</mo><mi>B</mi></mrow>
A\B
When translating to Strict Content Markup, if the type has value "multiset", then the in symbol
from multiset1 should be used instead.
Content MathML
<apply><eq/>
<apply><card/><ci>A</ci></apply>
<cn>5</cn>
</apply>
Sample Presentation
<mrow>
<mrow><mo>|</mo><mi>A</mi><mo>|</mo></mrow>
<mo>=</mo>
<mn>5</mn>
</mrow>
|A| = 5
When translating to Strict Content Markup, if the type has value "multiset", then the size symbol
from multiset1 should be used instead.
Content MathML
<apply><cartesianproduct/><ci>A</ci><ci>B</ci></apply>
Sample Presentation
<mrow><mi>A</mi><mo>×</mo><mi>B</mi></mrow>
A×B
The sum operator may be used either with or without explicit bound variables. When a bound variable
is used, the sum element is followed by one or more bvar elements giving the index variables, followed
by qualifiers giving the domain for the index variables. The final child in the enclosing apply is then an
expression in the bound variables, and the terms of the sum are obtained by evaluating this expression at
each point of the domain of the index variables. Depending on the structure of the domain, the domain
of summation is often given by using uplimit and lowlimit to specify upper and lower limits for the
sum.
When no bound variables are explicitly given, the final child of the enclosing apply element must be a
function, and the terms of the sum are obtained by evaluating the function at each point of the domain
specified by qualifiers.
Content MathML
<apply><sum/>
<bvar><ci>x</ci></bvar>
<lowlimit><ci>a</ci></lowlimit>
<uplimit><ci>b</ci></uplimit>
<apply><ci>f</ci><ci>x</ci></apply>
</apply>
Sample Presentation
<mrow>
<munderover>
<mo>∑</mo>
<mrow><mi>x</mi><mo>=</mo><mi>a</mi></mrow>
<mi>b</mi>
</munderover>
<mrow><mi>f</mi><mo>⁡</mo><mfenced><mi>x</mi></mfenced></mrow>
</mrow>
b
∑ f (x)
x=a
4.4. Content MathML for Specific Operators and Constants 235
Content MathML
<apply><sum/>
<bvar><ci>x</ci></bvar>
<condition>
<apply><in/><ci>x</ci><ci type="set">B</ci></apply>
</condition>
<apply><ci type="function">f</ci><ci>x</ci></apply>
</apply>
Sample Presentation
<mrow>
<munder>
<mo>∑</mo>
<mrow><mi>x</mi><mo>∈</mo><mi>B</mi></mrow>
</munder>
<mrow><mi>f</mi><mo>⁡</mo><mfenced><mi>x</mi></mfenced></mrow>
</mrow>
∑ f (x)
x∈B
Content MathML
<apply><sum/>
<domainofapplication>
<ci type="set">B</ci>
</domainofapplication>
<ci type="function">f</ci>
</apply>
Sample Presentation
<mrow><munder><mo>∑</mo><mi>B</mi></munder><mi>f</mi></mrow>
∑f
B
Content MathML
<apply><sum/>
<bvar><ci>i</ci></bvar>
<lowlimit><cn>0</cn></lowlimit>
<uplimit><cn>100</cn></uplimit>
<apply><power/><ci>x</ci><ci>i</ci></apply>
</apply>
Strict Content MathML equivalent
<apply><csymbol cd="arith1">sum</csymbol>
<apply><csymbol cd="interval1">integer_interval</csymbol>
<cn>0</cn>
<cn>100</cn>
</apply>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>i</ci></bvar>
<apply><csymbol cd="arith1">power</csymbol><ci>x</ci><ci>i</ci></apply>
</bind>
</apply>
Content MathML
<apply><product/>
<bvar><ci>x</ci></bvar>
<lowlimit><ci>a</ci></lowlimit>
<uplimit><ci>b</ci></uplimit>
<apply><ci type="function">f</ci>
<ci>x</ci>
</apply>
</apply>
Sample Presentation
<mrow>
<munderover>
<mo>∏</mo>
<mrow><mi>x</mi><mo>=</mo><mi>a</mi></mrow>
<mi>b</mi>
</munderover>
<mrow><mi>f</mi><mo>⁡</mo><mfenced><mi>x</mi></mfenced></mrow>
</mrow>
b
∏ f (x)
x=a
Content MathML
<apply><product/>
<bvar><ci>x</ci></bvar>
<condition>
<apply><in/>
<ci>x</ci>
<ci type="set">B</ci>
</apply>
</condition>
<apply><ci>f</ci><ci>x</ci></apply>
</apply>
Sample Presentation
<mrow>
<munder>
<mo>∏</mo>
<mrow><mi>x</mi><mo>∈</mo><mi>B</mi></mrow>
</munder>
<mrow><mi>f</mi><mo>⁡</mo><mfenced><mi>x</mi></mfenced></mrow>
</mrow>
∏ f (x)
x∈B
variables are used, it is necessary to introduce a lambda construction to rewrite the expression in the
bound variables as a function.
Content MathML
<apply><product/>
<bvar><ci>i</ci></bvar>
<lowlimit><cn>0</cn></lowlimit>
<uplimit><cn>100</cn></uplimit>
<apply><power/><ci>x</ci><ci>i</ci></apply>
</apply>
Strict Content MathML equivalent
<apply><csymbol cd="arith1">product</csymbol>
<apply><csymbol cd="interval1">integer_interval</csymbol>
<cn>0</cn>
<cn>100</cn>
</apply>
<bind><csymbol cd="fns1">lambda</csymbol>
<bvar><ci>i</ci></bvar>
<apply><csymbol cd="arith1">power</csymbol><ci>x</ci><ci>i</ci></apply>
</bind>
</apply>
Content MathML
<apply><limit/>
<bvar><ci>x</ci></bvar>
<lowlimit><cn>0</cn></lowlimit>
<apply><sin/><ci>x</ci></apply>
</apply>
Sample Presentation
<mrow>
<munder>
<mi>lim</mi>
<mrow><mi>x</mi><mo>→</mo><mn>0</mn></mrow>
</munder>
<mrow><mi>sin</mi><mo>⁡</mo><mi>x</mi></mrow>
</mrow>
lim sin x
x→0
Content MathML
<apply><limit/>
<bvar><ci>x</ci></bvar>
<condition>
<apply><tendsto/><ci>x</ci><cn>0</cn></apply>
</condition>
<apply><sin/><ci>x</ci></apply>
</apply>
Sample Presentation
<mrow>
<munder>
<mi>lim</mi>
<mrow><mi>x</mi><mo>→</mo><mn>0</mn></mrow>
</munder>
<mrow><mi>sin</mi><mo>⁡</mo><mi>x</mi></mrow>
</mrow>
lim sin x
x→0
240 Chapter 4. Content Markup
Content MathML
<apply><limit/>
<bvar><ci>x</ci></bvar>
<condition>
<apply><tendsto type="above"/><ci>x</ci><ci>a</ci></apply>
</condition>
<apply><sin/><ci>x</ci></apply>
</apply>
Sample Presentation
<mrow>
<munder>
<mi>lim</mi>
<mrow><mi>x</mi><mo>→</mo><msup><mi>a</mi><mo>+</mo></msup></mrow>
</munder>
<mrow><mi>sin</mi><mo>⁡</mo><mi>x</mi></mrow>
</mrow>
lim sin x
x→a+
The direction from which a limiting value is approached is given as an argument limit in Strict Content
MathML, which supplies the direction specifier symbols both_sides, above, and below for this purpose.
The first correspond to the values "all", "above", and "below" of the type attribute of the tendsto
element below. The null symbol corresponds to the case where no type attribute is present. We translate
Content MathML
<apply><tendsto type="above"/>
<apply><power/><ci>x</ci><cn>2</cn></apply>
<apply><power/><ci>a</ci><cn>2</cn></apply>
</apply>
Sample Presentation
<mrow>
<msup><mi>x</mi><mn>2</mn></msup>
<mo>→</mo>
<msup><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo></msup>
</mrow>
+
x 2 → a2
242 Chapter 4. Content Markup
Content MathML
<apply><tendsto/>
<vector><ci>x</ci><ci>y</ci></vector>
<vector>
<apply><ci type="function">f</ci><ci>x</ci><ci>y</ci></apply>
<apply><ci type="function">g</ci><ci>x</ci><ci>y</ci></apply>
</vector>
</apply>
Sample Presentation
<mfenced><mtable>
<mtr><mtd><mi>x</mi></mtd></mtr>
<mtr><mtd><mi>y</mi></mtd></mtr>
</mtable></mfenced>
<mo>→</mo>
<mfenced><mtable>
<mtr><mtd>
<mi>f</mi><mo>⁡</mo><mfenced><mi>x</mi><mi>y</mi></mfenced>
</mtd></mtr>
<mtr><mtd>
<mi>g</mi><mo>⁡</mo><mfenced><mi>x</mi><mi>y</mi></mfenced>
</mtd></mtr>
</mtable></mfenced>
x f (x, y)
→ g
y (x, y)
Rewrite: tendsto
<tendsto/>
Strict Content MathML equivalent:
<semantics>
<ci>tendsto</ci>
<annotation-xml encoding="MathML-Content">
<tendsto/>
</annotation-xml>
</semantics>
4.4. Content MathML for Specific Operators and Constants 243
Content MathML
<apply><sin/><ci>x</ci></apply>
Sample Presentation
<mrow><mi>sin</mi><mo>⁡</mo><mi>x</mi></mrow>
sin x
Content MathML
<apply><sin/>
<apply><plus/>
<apply><cos/><ci>x</ci></apply>
<apply><power/><ci>x</ci><cn>3</cn></apply>
</apply>
</apply>
Sample Presentation
<mrow>
<mi>sin</mi>
<mo>⁡</mo>
<mrow>
<mo>(</mo>
<mrow><mi>cos</mi><mo>⁡</mo><mi>x</mi></mrow>
<mo>+</mo>
<msup><mi>x</mi><mn>3</mn></msup>
<mo>)</mo>
</mrow>
</mrow>
sin cos x + x3
These operator elements denote the inverses of standard trigonometric functions. Differing definitions
are in use so for maximum interoperability applications evaluating such expressions should follow the
definitions in [Abramowitz1977].
Content MathML
<apply><arcsin/><ci>x</ci></apply>
Sample Presentations
<mrow>
<mi>arcsin</mi>
<mo>⁡</mo>
<mi>x</mi>
</mrow>
arcsin x
<mrow>
<msup><mi>sin</mi><mrow><mo>-</mo><mn>1</mn></mrow></msup>
<mo>⁡</mo>
<mi>x</mi>
</mrow>
sin−1 x
Content MathML
<apply><sinh/><ci>x</ci></apply>
Sample Presentation
<mrow><mi>sinh</mi><mo>⁡</mo><mi>x</mi></mrow>
Content MathML
<apply><arcsinh/><ci>x</ci></apply>
Sample Presentations
<mrow>
<mi>arcsinh</mi>
<mo>⁡</mo>
<mi>x</mi>
</mrow>
<mrow>
<msup><mi>sinh</mi><mrow><mo>-</mo><mn>1</mn></mrow></msup>
<mo>⁡</mo>
<mi>x</mi>
</mrow>
Content MathML
<apply><exp/><ci>x</ci></apply>
Sample Presentation
<msup><mi>e</mi><mi>x</mi></msup>
ex
Content MathML
<apply><ln/><ci>a</ci></apply>
Sample Presentation
<mrow><mi>ln</mi><mo>⁡</mo><mi>a</mi></mrow>
ln a
246 Chapter 4. Content Markup
Content MathML
<apply><log/>
<logbase><cn>3</cn></logbase>
<ci>x</ci>
</apply>
Sample Presentation
<mrow><msub><mi>log</mi><mn>3</mn></msub><mo>⁡</mo><mi>x</mi></mrow>
log3 x
Content MathML
<apply><log/><ci>x</ci></apply>
Sample Presentation
<mrow><mi>log</mi><mo>⁡</mo><mi>x</mi></mrow>
log x
<apply><plus/>
<apply>
<log/>
<logbase><cn>2</cn></logbase>
<ci>x</ci>
</apply>
<apply>
<log/>
<ci>y</ci>
</apply>
</apply>
Strict Content MathML equivalent:
<apply>
<csymbol cd="arith1">plus</csymbol>
<apply>
<csymbol cd="transc1">log</csymbol>
<cn>2</cn>
<ci>x</ci>
</apply>
<apply>
<csymbol cd="transc1">log</csymbol>
<cn>10</cn>
<ci>y</ci>
</apply>
</apply>
4.4.8 Statistics
4.4.8.1 Mean <mean/>
Class nary-stats
Attributes CommonAtt, DefEncAtt
Content Empty
Qualifiers BvarQ,DomainQ
OM Symbols mean, mean
The mean element represents the function returning arithmetic mean or average of a data set or random
variable.
248 Chapter 4. Content Markup
Content MathML
<apply><mean/>
<cn>3</cn><cn>4</cn><cn>3</cn><cn>7</cn><cn>4</cn>
</apply>
Sample Presentation
<mrow>
<mo>⟨</mo>
<mn>3</mn><mo>,</mo><mn>4</mn><mo>,</mo><mn>3</mn>
<mo>,</mo><mn>7</mn><mo>,</mo><mn>4</mn>
<mo>⟩</mo>
</mrow>
h3, 4, 3, 7, 4i
Content MathML
<apply><mean/><ci>X</ci></apply>
Sample Presentation
<mrow><mo>⟨</mo><mi>X</mi><mo>⟩</mo></mrow>
hXi
<mover><mi>X</mi><mo>¯</mo></mover>
X
Mapping to Strict Markup
When the mean element is applied to an explicit list of arguments, the translation to Strict Content
markup is direct, using the mean symbol from the s_data1 content dictionary, as described in Rewrite:
element. When it is applied to a distribution, then the mean symbol from the s_dist1 content dictionary
should be used. In the case with qualifiers use Rewrite: n-ary domainofapplication with the same caveat.
Content MathML
<apply><sdev/>
<cn>3</cn><cn>4</cn><cn>2</cn><cn>2</cn>
</apply>
Sample Presentation
<mrow>
<mo>σ</mo>
<mo>⁡</mo>
<mfenced><mn>3</mn><mn>4</mn><mn>2</mn><mn>2</mn></mfenced>
</mrow>
σ(3, 4, 2, 2)
Content MathML
<apply><sdev/>
<ci type="discrete_random_variable">X</ci>
</apply>
Sample Presentation
<mrow><mo>σ</mo><mo>⁡</mo><mfenced><mi>X</mi></mfenced></mrow>
σ(X)
Content MathML
<apply><variance/>
<cn>3</cn><cn>4</cn><cn>2</cn><cn>2</cn>
</apply>
Sample Presentation
<mrow>
<msup>
<mo>σ</mo>
<mn>2</mn>
</msup>
<mo>⁡</mo>
<mfenced><mn>3</mn><mn>4</mn><mn>2</mn><mn>2</mn></mfenced>
</mrow>
σ2 (3, 4, 2, 2)
Content MathML
<apply><variance/>
<ci type="discrete_random_variable"> X</ci>
</apply>
Sample Presentation
<mrow>
<msup><mo>σ</mo><mn>2</mn></msup>
<mo>⁡</mo>
<mfenced><mi>X</mi></mfenced>
</mrow>
σ2 (X)
Content MathML
<apply><median/>
<cn>3</cn><cn>4</cn><cn>2</cn><cn>2</cn>
</apply>
Sample Presentation
<mrow>
<mi>median</mi>
<mo>⁡</mo>
<mfenced><mn>3</mn><mn>4</mn><mn>2</mn><mn>2</mn></mfenced>
</mrow>
median (3, 4, 2, 2)
Content MathML
<apply><mode/>
<cn>3</cn><cn>4</cn><cn>2</cn><cn>2</cn>
</apply>
Sample Presentation
<mrow>
<mi>mode</mi>
<mo>⁡</mo>
<mfenced><mn>3</mn><mn>4</mn><mn>2</mn><mn>2</mn></mfenced>
</mrow>
mode (3, 4, 2, 2)
Content MathML
<apply><moment/>
<degree><cn>3</cn></degree>
<momentabout><mean/></momentabout>
<cn>6</cn><cn>4</cn><cn>2</cn><cn>2</cn><cn>5</cn>
</apply>
Sample Presentation
<msub>
<mrow>
<mo>⟨</mo>
<msup>
<mfenced><mn>6</mn><mn>4</mn><mn>2</mn><mn>2</mn><mn>5</mn></mfenced>
<mn>3</mn>
</msup>
<mo>⟩</mo>
</mrow>
<mi>mean</mi>
</msub>
h(6, 4, 2, 2, 5)3 imean
4.4. Content MathML for Specific Operators and Constants 253
Content MathML
<apply><moment/>
<degree><cn>3</cn></degree>
<momentabout><ci>p</ci></momentabout>
<ci>X</ci>
</apply>
Sample Presentation
<msub>
<mrow>
<mo>⟨</mo><msup><mi>X</mi><mn>3</mn></msup><mo>⟩</mo>
</mrow>
<mi>p</mi>
</msub>
hX 3 i p
When rewriting to Strict Markup, the moment symbol from the s_data1 content dictionary is used when
the moment element is applied to an explicit list of arguments. When it is applied to a distribution, then
the moment symbol from the s_dist1 content dictionary should be used. Both operators take the degree
as the first argument, the point as the second, followed by the data set or random variable respectively.
<apply><moment/>
<degree><cn>3</cn></degree>
<momentabout><ci>p</ci></momentabout>
<ci>X</ci>
</apply>
Strict Content MathML equivalent
<apply><csymbol cd="s_dist1">moment</csymbol>
<cn>3</cn>
<ci>p</ci>
<ci>X</ci>
</apply>
The components of a vector may be given explicitly as child elements, or specified by rule as described
in Section 4.3.1.1.
Content MathML
<vector>
<apply><plus/><ci>x</ci><ci>y</ci></apply>
<cn>3</cn>
<cn>7</cn>
</vector>
Sample Presentation
<mrow>
<mo>(</mo>
<mtable>
<mtr><mtd><mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow></mtd></mtr>
<mtr><mtd><mn>3</mn></mtd></mtr>
<mtr><mtd><mn>7</mn></mtd></mtr>
</mtable>
<mo>)</mo>
</mrow>
x+y
3
7
<mfenced>
<mrow><mi>x</mi><mo>+</mo><mi>y</mi></mrow>
<mn>3</mn>
<mn>7</mn>
</mfenced>
(x + y, 3, 7)
Content MathML
<matrix>
<bvar><ci type="integer">i</ci></bvar>
<bvar><ci type="integer">j</ci></bvar>
<condition>
<apply><and/>
<apply><in/>
<ci>i</ci>
<interval><ci>1</ci><ci>5</ci></interval>
</apply>
<apply><in/>
<ci>j</ci>
<interval><ci>5</ci><ci>9</ci></interval>
</apply>
</apply>
</condition>
<apply><power/><ci>i</ci><ci>j</ci></apply>
</matrix>
Sample Presentation
<mrow>
<mo>[</mo>
<msub><mi>m</mi><mrow><mi>i</mi><mo>,</mo><mi>j</mi></mrow></msub>
<mo>|</mo>
<mrow>
<msub><mi>m</mi><mrow><mi>i</mi><mo>,</mo><mi>j</mi></mrow></msub>
<mo>=</mo>
<msup><mi>i</mi><mi>j</mi></msup>
</mrow>
<mo>;</mo>
<mrow>
<mrow>
<mi>i</mi>
<mo>∈</mo>
<mfenced open="[" close="]"><mi>1</mi><mi>5</mi></mfenced>
</mrow>
<mo>∧</mo>
<mrow>
<mi>j</mi>
<mo>∈</mo>
<mfenced open="[" close="]"><mi>5</mi><mi>9</mi></mfenced>
</mrow>
</mrow>
<mo>]</mo>
</mrow>
[mi, j mi, j = i j ; i ∈ [1, 5] ∧ j ∈ [5, 9]]
256 Chapter 4. Content Markup
Content MathML
<apply><determinant/>
<ci type="matrix">A</ci>
</apply>
Sample Presentation
<mrow><mi>det</mi><mo>⁡</mo><mi>A</mi></mrow>
det A
Content MathML
<apply><transpose/>
<ci type="matrix">A</ci>
</apply>
Sample Presentation
<msup><mi>A</mi><mi>T</mi></msup>
AT
4.4. Content MathML for Specific Operators and Constants 257
Content MathML
<apply><selector/><ci type="vector">V</ci><cn>1</cn></apply>
Sample Presentation
<msub><mi>V</mi><mn>1</mn></msub>
V1
258 Chapter 4. Content Markup
Content MathML
<apply><eq/>
<apply><selector/>
<matrix>
<matrixrow><cn>1</cn><cn>2</cn></matrixrow>
<matrixrow><cn>3</cn><cn>4</cn></matrixrow>
</matrix>
<cn>1</cn>
</apply>
<matrix>
<matrixrow><cn>1</cn><cn>2</cn></matrixrow>
</matrix>
</apply>
Sample Presentation
<mrow>
<msub>
<mrow>
<mo>(</mo>
<mtable>
<mtr><mtd><mn>1</mn></mtd><mtd><mn>2</mn></mtd></mtr>
<mtr><mtd><mn>3</mn></mtd><mtd><mn>4</mn></mtd></mtr>
</mtable>
<mo>)</mo>
</mrow>
<mn>1</mn>
</msub>
<mo>=</mo>
<mrow>
<mo>(</mo>
<mtable><mtr><mtd><mn>1</mn></mtd><mtd><mn>2</mn></mtd></mtr></mtable>
<mo>)</mo>
</mrow>
</mrow>
1 2
= 1 2
3 4 1
Content MathML
<apply><eq/>
<apply><vectorproduct/>
<ci type="vector"> A </ci>
<ci type="vector"> B </ci>
</apply>
<apply><times/>
<ci>a</ci>
<ci>b</ci>
<apply><sin/><ci>θ</ci></apply>
<ci type="vector"> N </ci>
</apply>
</apply>
Sample Presentation
<mrow>
<mrow><mi>A</mi><mo>×</mo><mi>B</mi></mrow>
<mo>=</mo>
<mrow>
<mi>a</mi>
<mo>⁢</mo>
<mi>b</mi>
<mo>⁢</mo>
<mrow><mi>sin</mi><mo>⁡</mo><mi>θ</mi></mrow>
<mo>⁢</mo>
<mi>N</mi>
</mrow>
</mrow>
A × B = absin θN
Content MathML
<apply><eq/>
<apply><scalarproduct/>
<ci type="vector">A</ci>
<ci type="vector">B</ci>
</apply>
<apply><times/>
<ci>a</ci>
<ci>b</ci>
<apply><cos/><ci>θ</ci></apply>
</apply>
</apply>
Sample Presentation
<mrow>
<mrow><mi>A</mi><mo>.</mo><mi>B</mi></mrow>
<mo>=</mo>
<mrow>
<mi>a</mi>
<mo>⁢</mo>
<mi>b</mi>
<mo>⁢</mo>
<mrow><mi>cos</mi><mo>⁡</mo><mi>θ</mi></mrow>
</mrow>
</mrow>
A.B = abcos θ
Content MathML
<apply><outerproduct/>
<ci type="vector">A</ci>
<ci type="vector">B</ci>
</apply>
Sample Presentation
<mrow><mi>A</mi><mo>⊗</mo><mi>B</mi></mrow>
A⊗B
Content MathML
<apply><in/>
<cn type="integer"> 42 </cn>
<integers/>
</apply>
Sample Presentation
<mrow><mn>42</mn><mo>∈</mo><mi mathvariant="double-struck">Z</mi></mrow>
42 ∈ Z
Content MathML
<apply><in/>
<cn type="real"> 44.997</cn>
<reals/>
</apply>
Sample Presentation
<mrow>
<mn>44.997</mn><mo>∈</mo><mi mathvariant="double-struck">R</mi>
</mrow>
44.997 ∈ R
Content MathML
<apply><in/>
<cn type="rational"> 22 <sep/>7</cn>
<rationals/>
</apply>
Sample Presentation
<mrow>
<mrow><mn>22</mn><mo>/</mo><mn>7</mn></mrow>
<mo>∈</mo>
<mi mathvariant="double-struck">Q</mi>
</mrow>
22/7 ∈ Q
Content MathML
<apply><in/>
<cn type="integer">1729</cn>
<naturalnumbers/>
</apply>
Sample Presentation
<mrow>
<mn>1729</mn><mo>∈</mo><mi mathvariant="double-struck">N</mi>
</mrow>
1729 ∈ N
Content MathML
<apply><in/>
<cn type="complex-cartesian">17<sep/>29</cn>
<complexes/>
</apply>
Sample Presentation
<mrow>
<mrow><mn>17</mn><mo>+</mo><mn>29</mn><mo>⁢</mo><mi>i</mi></mrow>
<mo>∈</mo>
<mi mathvariant="double-struck">C</mi>
</mrow>
17 + 29i ∈ C
Content MathML
<apply><in/>
<cn type="integer">17</cn>
<primes/>
</apply>
Sample Presentation
<mrow><mn>17</mn><mo>∈</mo><mi mathvariant="double-struck">P</mi></mrow>
17 ∈ P
Content MathML
<apply><eq/>
<apply><ln/><exponentiale/></apply>
<cn>1</cn>
</apply>
Sample Presentation
<mrow>
<mrow><mi>ln</mi><mo>⁡</mo><mi>e</mi></mrow>
<mo>=</mo>
<mn>1</mn>
</mrow>
ln e = 1
Content MathML
<apply><eq/>
<apply><power/><imaginaryi/><cn>2</cn></apply>
<cn>-1</cn>
</apply>
Sample Presentation
<mrow><msup><mi>i</mi><mn>2</mn></msup><mo>=</mo><mn>-1</mn></mrow>
i2 = −1
Content MathML
<apply><eq/>
<apply><divide/><cn>0</cn><cn>0</cn></apply>
<notanumber/>
</apply>
Sample Presentation
<mrow>
<mrow><mn>0</mn><mo>/</mo><mn>0</mn></mrow>
<mo>=</mo>
<mi>NaN</mi>
</mrow>
0/0 = NaN
Content MathML
<apply><eq/>
<apply><or/>
<true/>
<ci type="boolean">P</ci>
</apply>
<true/>
</apply>
Sample Presentation
<mrow>
<mrow><mi>true</mi><mo>∨</mo><mi>P</mi></mrow>
<mo>=</mo>
<mi>true</mi>
</mrow>
true ∨ P = true
Content MathML
<apply><eq/>
<apply><and/>
<false/>
<ci type="boolean">P</ci>
</apply>
<false/>
</apply>
Sample Presentation
<mrow>
<mrow><mi>false</mi><mo>∧</mo><mi>P</mi></mrow>
<mo>=</mo>
<mi>false</mi>
</mrow>
false ∧ P = false
Content MathML
<apply><neq/>
<integers/>
<emptyset/>
</apply>
Sample Presentation
<mrow>
<mi mathvariant="double-struck">Z</mi><mo>≠</mo><mi>∅</mi>
</mrow>
Z 6= ∅
4.4.10.13 pi <pi/>
Class constant-arith
Attributes CommonAtt, DefEncAtt
Content Empty
OM Symbols pi
This element represents pi, approximately 3.142, which is the ratio of the circumference of a circle to
its diameter.
Content MathML
<apply><approx/>
<pi/>
<cn type="rational">22<sep/>7</cn>
</apply>
Sample Presentation
<mrow>
<mi>π</mi>
<mo>≃</mo>
<mrow><mn>22</mn><mo>/</mo><mn>7</mn></mrow>
</mrow>
π ' 22/7
Content MathML
<apply><approx/>
<eulergamma/>
<cn>0.5772156649</cn>
</apply>
Sample Presentation
<mrow><mi>γ</mi><mo>≃</mo><mn>0.5772156649</mn></mrow>
γ ' 0.5772156649
Content MathML
<infinity/>
Sample Presentation
<mi>∞</mi>
∞
The mapping of arbitrary content MathML into Strict content MathML is defined algorithmically. The
algorithm is described below as a collection of rewrite rules applying to specific non-Strict construc-
tions. The individual rewrite transformations have been described in detail in context above. The goal
of this section is to outline the complete algorithm in one place.
The algorithm is a sequence of nine steps. Each step is applied repeatedly to rewrite the input until no
further application is possible. Note that in many programming languages, such as XSLT, the natural
implementation is as a recursive algorithm, rather than the multi-pass implementation suggested by
the description below. The translation to XSL is straightforward and produces the same eventual Strict
Content MathML. However, because the overall structure of the multi-pass algorithm is clearer, that is
the formulation given here.
To transform an arbitrary content MathML expression into Strict Content MathML, apply each of the
following rules in turn to the input expression until all instances of the target constructs have been
eliminated:
1. Rewrite non-strict bind and elminate deprecated elements: Change the outer bind tags in
binding expressions to apply if they have qualifiers or multiple children. This simplifies the
algorithm by allowing the subsequent rules to be applied to non-strict binding expressions
without case distinction. Note that the later rules will change the apply elements introduced
in this step back to bind elements. Also in this step, deprecated reln elements are rewritten
to apply, and fn elements are replaced by the child expressions they enclose.
2. Apply special case rules for idiomatic uses of qualifiers:
(a) Rewrite derivatives with rules Rewrite: diff, Rewrite: nthdiff, and Rewrite: partiald-
iffdegree to explicate the binding status of the variables involved.
(b) Rewrite integrals with the rules Rewrite: int, Rewrite: defint and Rewrite: defint limits
to disambiguate the status of bound and free variables and of the orientation of the
range of integration if it is given as a lowlimit/uplimit pair.
(c) Rewrite limits as described in Rewrite: tendsto and Rewrite: limits condition.
(d) Rewrite sums and products as described in Section 4.4.6.1 and Section 4.4.6.2.
(e) Rewrite roots as described in Section 4.4.2.11.
(f) Rewrite logarithms as described in Section 4.4.7.7.
(g) Rewrite moments as described in Section 4.4.8.6.
3. Rewrite Qualifiers to domainofapplication : These rules rewrite all apply constructions
using bvar and qualifiers to those using only the general domainofapplication qualifier.
(a) Intervals: Rewrite qualifiers given as interval and lowlimit/uplimit to intervals
of integers via Rewrite: interval qualifier.
(b) Multiple conditions: Rewrite multiple condition qualifiers to a single one by taking
their conjunction. The resulting compound condition is then rewritten to
domainofapplication according to rule Rewrite: condition.
(c) Multiple domainofapplications: Rewrite multiple domainofapplication quali-
fiers to a single one by taking the intersection of the specified domains.
4. Normalize Container Markup:
(a) Rewrite sets and lists by the rule Rewrite: n-ary setlist domainofapplication.
(b) Rewrite interval, vectors, matrices, and matrix rows as described in Section 4.4.1.1,
Section 4.4.9.1, Section 4.4.9.2 and Section 4.4.9.3. Note any qualifiers will have been
rewritten to domainofapplication and will be further rewritten in Step 6.
(c) Rewrite lambda expressions by the rules Rewrite: lambda and Rewrite: lambda do-
mainofapplication
(d) Rewrite piecewise functions as described in Section 4.4.1.9.
270 Chapter 4. Content Markup
5. Apply Special Case Rules for Operators using domainofapplication Qualifiers: This step
deals with the special cases for the operators introduced in Section 4.4. There are different
classes of special cases to be taken into account:
(a) Rewrite min, max, mean and similar n-ary/unary operators by the rules Rewrite: n-ary
unary set, Rewrite: n-ary unary domainofapplication and Rewrite: n-ary unary single.
(b) Rewrite the quantifiers forall and exists used with domainofapplication to ex-
pressions using implication and conjunction by the rule Rewrite: quantifier.
(c) Rewrite integrals used with a domainofapplication element (with or without a
bvar) according to the rules Rewrite: int and Rewrite: defint.
(d) Rewrite sums and products used with a domainofapplication element (with or with-
out a bvar) as described in Section 4.4.6.1 and Section 4.4.6.2.
6. Eliminate domainofapplication : At this stage, any apply has at most one
domainofapplication child and special cases have been addressed. As
domainofapplication is not Strict Content MathML, it is rewritten
(a) into an application of a restricted function via the rule Rewrite: restriction if the apply
does not contain a bvar child.
(b) into an application of the predicate_on_list symbol via the rules Rewrite: n-ary relations
and Rewrite: n-ary relations bvar if used with a relation.
(c) into a construction with the apply_to_list symbol via the general rule Rewrite: n-ary
domainofapplication for general n-ary operators.
(d) into a construction using the suchthat symbol from the set1 content dictionary in an
apply with bound variables via the Rewrite: apply bvar domainofapplication rule.
7. Rewrite non-strict token elements:
(a) Rewrite numbers represented as cn elements where the type attribute is one of
"e-notation", "rational", "complex-cartesian", "complex-polar",
"constant" as strict cn via rules Rewrite: cn sep, Rewrite: cn based_integer and
Rewrite: cn constant.
(b) Rewrite any ci, csymbol or cn containing presentation MathML to semantics ele-
ments with rules Rewrite: cn presentation mathml and Rewrite: ci presentation mathml
and the analogous rule for csymbol.
8. Rewrite operators: Rewrite any remaining operator defined in Section 4.4 to a csymbol
referencing the symbol identified in the syntax table by the rule Rewrite: element. As noted
in the descriptions of each operator element, some require special case rules to determine the
proper choice of symbol. Some cases of particular note are:
(a) The order of the arguments for the selector operator must be rewritten, and the sym-
bol depends on the type of the arguments.
(b) The choice of symbol for the minus operator depends on the number of the arguments.
(c) The choice of symbol for some set operators depends on the values of the type of the
arguments.
(d) The choice of symbol for some statistical operators depends on the values of the types
of the arguments.
9. Rewrite non-strict attributes:
(a) Rewrite the type attribute: At this point, all elements that accept the type, other than
ci and csymbol, should have been rewritten into Strict Content Markup equivalents
without type attributes, where type information is reflected in the choice of operator
symbol. Now rewrite remaining ci and csymbol elements with a type attribute to a
strict expression with semantics according to rules Rewrite: ci type annotation and
Rewrite: csymbol type annotation.
(b) Rewrite definitionURL and encoding attributes: If the definitionURL and
encoding attributes on a csymbol element can be interpreted as a reference to a con-
4.6. The Strict Content MathML Transformation 271
tent dictionary (see Section 4.2.3.2 for details), then rewrite to reference the content
dictionary by the cd attribute instead.
(c) Rewrite attributes: Rewrite any element with attributes that are not allowed in strict
markup to a semantics construction with the element without these attributes as the
first child and the attributes in annotation elements by rule Rewrite: attributes.
Chapter 5
MathML markup can be combined with other markup languages, and these mixing constructions are
realized by the semantic annotation elements. The semantic annotation elements provide an important
tool for making associations between alternate representations of an expression, and for associating se-
mantic properties and other attributions with a MathML expression. These elements allow presentation
markup and content markup to be combined in several different ways. One method, known as mixed
markup, is to intersperse content and presentation elements in what is essentially a single tree. Another
method, known as parallel markup, is to provide both explicit presentation markup and content markup
in a pair of markup expressions, combined by a single semantics element.
272
5.1. Annotation Framework 273
\sin x + 5
</annotation>
<annotation-xml encoding="application/openmath+xml">
<OMA xmlns="http://www.openmath.org/OpenMath">
<OMS cd="arith1" name="plus"/>
<OMA><OMS cd="transc1" name="sin"/><OMV name="x"/></OMA>
<OMI>5</OMI>
</OMA>
</annotation-xml>
</semantics>
Note that this example makes use of the namespace extensibility that is only available in the XML
syntax of MathML. If this example is included in an HTML document then it would be considered
invalid and the OpenMath elements would be parsed as elements in the MathML namespace. See
Section 5.2.3.3 for details.
The semantics element is considered to be both a presentation element and a content element, and
may be used in either context. All MathML processors should process the semantics element, even if
they only process one of these two subsets of MathML.
The default annotation key is alternate-representation when no annotation key is explicitly specified on
an annotation or annotation-xml element.
Typically, annotation keys specify only the logical nature of the relationship between an expression and
an annotation. The data format for an annotation is indicated with the encoding attribute. In MathML
2, the encoding attribute was the primary information that a processor could use to determine whether
or not it could understand an annotation. For backward compatibility, processors are encouraged to
examine both the annotation key and encoding attribute. In particular, MathML 2 specified the prede-
fined encoding values MathML, MathML-Content, and MathML-Presentation. The MathML encoding
value is used to indicate an annotation-xml element contains a MathML expression. The use of the
other values is more specific, as discussed in following sections.
While the predefined alternate-representation and contentequiv keys cover many common use cases,
user communities are encouraged to define and standardize additional content dictionaries as neces-
sary. Annotation keys in user-defined, public Content Dictionaries are preferred over private encod-
ing attribute value conventions, since content dictionaries are more expressive, more open and more
maintainable than private encoding values. However, for backward compatibility with MathML 2, the
encoding attribute may also be used.
<mn>5</mn>
</mrow>
</annotation-xml>
<annotation encoding="application/x-maple">
sin(x) + 5
</annotation>
<annotation encoding="application/vnd.wolfram.mathematica">
Sin[x] + 5
</annotation>
<annotation encoding="application/x-tex">
\sin x + 5
</annotation>
<annotation-xml encoding="application/openmath+xml">
<OMA xmlns="http://www.openmath.org/OpenMath">
<OMA>
<OMS cd="arith1" name="plus"/>
<OMA><OMS cd="transc1" name="sin"/><OMV name="x"/></OMA>
<OMI>5</OMI>
</OMA>
</OMA>
</annotation-xml>
</semantics>
Note that this example makes use of the namespace extensibility that is only available in the XML
syntax of MathML. If this example is included in an HTML document then it would be considered
invalid and the OpenMath elements would be parsed as elements un the MathML namespace. See
Section 5.2.3.3 for details.
</mfenced>
</mrow>
</mrow>
<annotation-xml cd="mathmlkeys" name="contentequiv"
encoding="MathML-Content">
<apply>
<ci>a</ci>
<apply><plus/><ci>x</ci><cn>5</cn></apply>
</apply>
</annotation-xml>
</semantics>
expression may appear as the first child of the semantics element. Subsequent annotation and
annotation-xml children enclose the annotations. An annotation represented in XML is enclosed in
an annotation-xml element. An annotation represented in character data is enclosed in an
annotation element.
As noted above, the semantics element is considered to be both a presentation element and a content
element, since it can act as either, depending on its content. Consequently, all MathML processors
should process the semantics element, even if they process only presentation markup or only content
markup.
The default rendering of a semantics element is the default rendering of its first child. A renderer may
use the information contained in the annotations to customize its rendering of the annotated element.
<semantics>
<mrow>
<mrow>
<mi>sin</mi>
<mo>⁡</mo>
<mfenced><mi>x</mi></mfenced>
</mrow>
<mo>+</mo>
<mn>5</mn>
</mrow>
<annotation-xml cd="mathmlkeys" name="contentequiv" encoding="MathML-Content">
<apply>
<plus/>
<apply><sin/><ci>x</ci></apply>
<cn>5</cn>
</apply>
</annotation-xml>
<annotation encoding="application/x-tex">
\sin x + 5
</annotation>
</semantics>
5.2.1.2 Attributes
Name values default
definitionURL URI none
The location of an external source for semantic information
encoding string none
The encoding of the external semantic information
The semantics element takes the definitionURL and encoding attributes, which reference an ex-
ternal source for some or all of the semantic information for the annotated element, as modified by the
annotation. The use of these attributes on the semantics element is deprecated in MathML3.
data for the annotation, and should not contain XML markup elements. If the annotation contains one
of the XML reserved characters &, < then these characters must be encoded using an entity reference or
(in the XML syntax) an XML CDATA section.
5.2.2.2 Attributes
Name values default
definitionURL URI none
The location of the annotation key symbol
encoding string none
The encoding of the semantic information in the annotation
cd string mathmlkeys
The content dictionary that contains the annotation key symbol
name string alternate-representation
The name of the annotation key symbol
src URI none
The location of an external source for semantic information
Taken together, the cd and name attributes specify the annotation key symbol, which identifies the
relationship between the annotated element and the annotation, as described in Section 5.1.1. The
definitionURL attribute provides an alternate way to reference the annotation key symbol as a single
attribute. If none of these attributes are present, the annotation key symbol is the symbol alternate-
representation from the mathmlkeys content dictionary.
The encoding attribute describes the content type of the annotation. The value of the encoding at-
tribute may contain a media type that identifies the data format for the encoding data. For data formats
that do not have an associated media type, implementors may choose a self-describing character string
to identify their content type.
The src attribute provides a mechanism to attach external entities as annotations on MathML expres-
sions.
<annotation encoding="image/png" src="333/formula56.png"/>
The annotation element is a semantic mapping element that may only be used as a child of the
semantics element. While there is no default rendering for the annotation element, a renderer may
use the information contained in an annotation to customize its rendering of the annotated element.
5.2.3.2 Attributes
Name values default
definitionURL URI none
The location of the annotation key symbol
encoding string none
The encoding of the semantic information in the annotation
cd string mathmlkeys
The content dictionary that contains the annotation key symbol
name string alternate-representation
The name of the annotation key symbol
src URI none
The location of an external source for semantic information
Taken together, the cd and name attributes specify the annotation key symbol, which identifies the
relationship between the annotated element and the annotation, as described in Section 5.1.1. The
definitionURL attribute provides an alternate way to reference the annotation key symbol as a single
attribute. If none of these attributes are present, the annotation key symbol is the symbol alternate-
representation from the mathmlkeys content dictionary.
The encoding attribute describes the content type of the annotation. The value of the encoding at-
tribute may contain a media type that identifies the data format for the encoding data. For data formats
that do not have an associated media type, implementors may choose a self-describing character string
to identify their content type. In particular, as described above and in Section 6.2.4, MathML specifies
MathML, MathML-Presentation, and MathML-Content as predefined values for the encoding at-
tribute. Finally, The src attribute provides a mechanism to attach external XML entities as annotations
on MathML expressions.
<annotation-xml cd="mathmlkeys" name="contentequiv" encoding="MathML-Content">
<apply>
<plus/>
<apply><sin/><ci>x</ci></apply>
<cn>5</cn>
</apply>
</annotation-xml>
<annotation-xml encoding="application/openmath+xml">
<OMA xmlns="http://www.openmath.org/OpenMath">
<OMS cd="arith1" name="plus"/>
<OMA><OMS cd="transc1" name="sin"/><OMV name="x"/></OMA>
<OMI>5</OMI>
</OMA>
</annotation-xml>
When the MathML is being parsed as XML and the annotation value is represented in an XML dialect
other than MathML, the namespace for the XML markup for the annotation should be identified by
means of namespace attributes and/or namespace prefixes on the annotation value. For instance:
<annotation-xml encoding="application/xhtml+xml">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>E</title></head>
<body>
<p>The base of the natural logarithms, approximately 2.71828.</p>
</body>
280 Chapter 5. Mixing Markup Languages for Mathematical Expressions
</html>
</annotation-xml>
The annotation-xml element is a semantic mapping element that may only be used as a child of the
semantics element. While there is no default rendering for the annotation-xml element, a renderer
may use the information contained in an annotation to customize its rendering of the annotated element.
<mo>+</mo>
<mi>b</mi>
</math>
If the above is parsed by an HTML parser it produces a result equivalent to the following invalid input,
where the span element has caused all MathML elements to be prematurely closed. The remaining
MathML elements following the span are no longer contained within <math> so will be parsed as
unknown HTML elements and render incorrectly.
<math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
<mi>a</mi>
<annotation-xml>
</annotation-xml>
</semantics>
</math>
<span xmlns="http://www.w3.org/1999/xhtml">xxx</span>
<mo xmlns="http://www.w3.org/1999/xhtml">+</mo>
<mi xmlns="http://www.w3.org/1999/xhtml">b</mi>
Note here that the HTML span element has caused all open MathML elements to be prematurely
closed, resulting in the following MathML elements being treated as unknown HTML elements as they
are no longer descendents of math. See Section 6.4.3 for more details of the parsing of MathML in
HTML.
Any use of elements in other vocabularies (such as the OpenMath examples above) is considered in-
valid in HTML. If validity is not a strict requirement it is possible to use such elements but they will
be parsed as elements on the MathML namespace. Documents SHOULD NOT use namespace pre-
fixes and element names containing colon (:) as the element nodes produced by the HTML parser
with have local names containing a colon, which can not be constructed by a namespace aware XML
parser. Rather than use such foreign annotations, when using an HTML parser it is better to encode
the annotation using the existing vocabulary. For example as shown in Chapter 4 OpenMath may be
encoded faithfuly as Strict Content MathML. Similarly RDF annotations could be encoded using RDFa
in text/html annotation or (say) N3 notation in annotation rather than using RDF/XML encoding
in an annotation-xml element.
Any other presentation markup occurring within content markup is a MathML error. More detailed
discussion of these three cases follows:
Presentation markup within token elements. The token elements ci and cn are permitted to contain
any sequence of MathML characters (defined in Chapter 7) and/or presentation elements.
Contiguous blocks of MathML characters in ci or cn elements are treated as if wrapped in
mi or mn elements, as appropriate, and the resulting collection of presentation elements is
rendered as if wrapped in an implicit mrow element.
Presentation markup within the csymbol element. The csymbol element may contain either MathML
characters interspersed with presentation markup, or content markup. It is a MathML er-
ror for a csymbol element to contain both presentation and content elements. When the
csymbol element contains character data and presentation markup, the same rendering rules
that apply to the token elements ci and cn should be used.
Presentation markup within the semantics element. One of the main purposes of the semantics
element is to provide a mechanism for incorporating arbitrary MathML expressions into con-
tent markup in a semantically meaningful way. In particular, any valid presentation expres-
sion can be embedded in a content expression by placing it as the first child of a semantics
element. The meaning of this wrapped expression should be indicated by one or more anno-
tation elements also contained in the semantics element.
The following example encodes the Boolean arithmetic expression (a+b)(c+d) in this way.
<semantics>
<mrow>
<mrow><mo>(</mo><mi>a</mi> <mo>+</mo> <mi>b</mi><mo>)</mo></mrow>
<mo>⁢</mo>
<mrow><mo>(</mo><mi>c</mi> <mo>+</mo> <mi>d</mi><mo>)</mo></mrow>
</mrow>
<annotation-xml encoding="MathML-Content">
<apply><and/>
<apply><xor/><ci>a</ci> <ci>b</ci></apply>
<apply><xor/><ci>c</ci> <ci>d</ci></apply>
</apply>
</annotation-xml>
</semantics>
Note that the above markup annotates the presentation markup as the first child element, with the
content markup as part of the annotation-xml element. An equivalent form could be given that an-
notates the content markup as the first child element, with the presentation markup as part of the
annotation-xml element.
<annotation-xml encoding="MathML-Content">
<apply xref="E">
284 Chapter 5. Mixing Markup Languages for Mathematical Expressions
<and xref="E.2"/>
<apply xref="E.1">
<xor xref="E.1.3"/><ci xref="E.1.2">a</ci><ci xref="E.1.4">b</ci>
</apply>
<apply xref="E.3">
<xor xref="E.3.3"/><ci xref="E.3.2">c</ci><ci xref="E.3.4">d</ci>
</apply>
</apply>
</annotation-xml>
</semantics>
An id attribute and associated xref attributes that appear within the same semantics element estab-
lish the cross-references between corresponding sub-expressions.
For parallel markup, all of the id attributes referenced by any xref attribute should be in the same
branch of an enclosing semantics element. This constraint guarantees that the cross-references do
not create unintentional cycles. This restriction does not exclude the use of id attributes within other
branches of the enclosing semantics element. It does, however, exclude references to these other id
attributes originating from the same semantics element.
There is no restriction on which branch of the semantics element may contain the destination id
attributes. It is up to the application to determine which branch to use.
In general, there will not be a one-to-one correspondence between nodes in parallel branches. For
example, a presentation tree may contain elements, such as parentheses, that have no correspondents
in the content tree. It is therefore often useful to put the id attributes on the branch with the finest-
grained node structure. Then all of the other branches will have xref attributes to some subset of the
id attributes.
In absence of other criteria, the first branch of the semantics element is a sensible choice to contain
the id attributes. Applications that add or remove annotations will then not have to re-assign these
attributes as the annotations change.
In general, the use of id and xref attributes allows a full correspondence between sub-expressions to
be given in text that is at most a constant factor larger than the original. The direction of the references
should not be taken to imply that sub-expression selection is intended to be permitted only on one child
of the semantics element. It is equally feasible to select a subtree in any branch and to recover the
corresponding subtrees of the other branches.
Parallel markup with cross-references may be used in any XML-encoded branch of the semantic an-
notations, as shown by the following example where the Boolean expression of the previous section is
annotated with OpenMath markup that includes cross-references:
<semantics>
<mrow id="EE">
<mrow id="EE.1">
<mo id="EE.1.1">(</mo>
<mi id="EE.1.2">a</mi>
<mo id="EE.1.3">+</mo>
<mi id="EE.1.4">b</mi>
<mo id="EE.1.5">)</mo>
</mrow>
<mo id="EE.2">⁢</mo>
<mrow id="EE.3">
5.4. Parallel Markup 285
<mo id="EE.3.1">(</mo>
<mi id="EE.3.2">c</mi>
<mo id="EE.3.3">+</mo>
<mi id="EE.3.4">d</mi>
<mo id="EE.3.5">)</mo>
</mrow>
</mrow>
<annotation-xml encoding="MathML-Content">
<apply xref="EE">
<and xref="EE.2"/>
<apply xref="EE.1">
<xor xref="EE.1.3"/><ci xref="EE.1.2">a</ci><ci xref="EE.1.4">b</ci>
</apply>
<apply xref="EE.3">
<xor xref="EE.3.3"/><ci xref="EE.3.2">c</ci><ci xref="EE.3.4">d</ci>
</apply>
</apply>
</annotation-xml>
<annotation-xml encoding="application/openmath+xml">
<om:OMA xmlns:om="http://www.openmath.org/OpenMath" href="EE">
<om:OMS name="and" cd="logic1" href="EE.2"/>
<om:OMA href="EE.1">
<om:OMS name="xor" cd="logic1" href="EE.1.3"/>
<om:OMV name="a" href="EE.1.2"/>
<om:OMV name="b" href="EE.1.4"/>
</om:OMA>
<om:OMA href="EE.3">
<om:OMS name="xor" cd="logic1" href="EE.3.3"/>
<om:OMV name="c" href="EE.3.2"/>
<om:OMV name="d" href="EE.3.4"/>
</om:OMA>
</om:OMA>
</annotation-xml>
</semantics>
Here OMA, OMS and OMV are elements defined in the OpenMath standard for representing application,
symbol, and variable, respectively. The references from the OpenMath annotation are given by the
href attributes. As noted above, the use of namespaces other than MathML, SVG or HTML within
annotation-xml is not considered valid in the HTML syntax. Use of colons and namespace-prefixed
element names should be avoided as the HTML parser will generate nodes with local name om:OMA
(for example), and such nodes can not be constructed by a namespace-aware XML parser.
Chapter 6
6.1 Introduction
To be effective, MathML must work well with a wide variety of renderers, processors, translators and
editors. This chapter raises some of the interface issues involved in generating and rendering MathML.
Since MathML exists primarily to encode mathematics in Web documents, perhaps the most important
interface issues relate to embedding MathML in [HTML5], and [XHTML], and in any newer HTML
when it appears.
There are three kinds of interface issues that arise in embedding MathML in other XML documents.
First, MathML markup must be recognized as valid embedded XML content, and not as an error. This
issue could be seen primarily as a question of managing namespaces in XML [Namespaces].
Second, in the case of HTML/XHTML, MathML rendering must be integrated with browser software.
Some browsers already implement MathML rendering natively, and one can expect more browsers
will do so in the future. At the same time, other browsers have developed infrastructure to facilitate
the rendering of MathML and other embedded XML content by third-party software or other built-
in technology. Examples of this built-in technology are the sophisticated CSS rendering engines now
available, and the powerful implementations of JavaScript/ECMAScript that are becoming common.
Using these browser-specific mechanisms generally requires additional interface markup of some sort
to activate them. In the case of CSS, there is a special restricted form of MathML3 [MathMLforCSS]
that is tailored for use with CSS rendering engines that support CSS 2.1 [CSS21]. This restricted profile
of MathML3 does not offer the full expressiveness of MathML3, but it provides a portable simpler form
that can be rendered acceptably on the screen by modern CSS engines.
Third, other tools for generating and processing MathML must be able to communicate. A number
of MathML tools have been or are being developed, including editors, translators, computer algebra
systems, and other scientific software. However, since MathML expressions tend to be lengthy, and
prone to error when entered by hand, special emphasis must be made to ensure that MathML can easily
be generated by user-friendly conversion and authoring tools, and that these tools work together in a
dependable, platform-independent, and vendor-independent way.
This chapter applies to both content and presentation markup, and describes a particular processing
model for the semantics, annotation and annotation-xml elements described in Section 5.1.
286
6.2. Invoking MathML Processors 287
The MathML namespace URI is the recommended method to embed MathML within [XHTML] doc-
uments. However, some user-agents may require supplementary information to be available to allow
them to invoke specific extensions to process the MathML markup.
Markup-language specifications that wish to embed MathML may require special conditions to recog-
nize MathML markup that are independent of this recommendation. The conditions should be similar
to those expressed in this recommendation, and the local names of the MathML elements should remain
the same as those defined in this recommendation.
See Appendix B for more details about each of these encoding names.
MathML 2 specified the predefined encoding values MathML, MathML-Content, and
MathML-Presentation for the encoding attribute on the annotation-xml element. These values
may be used as an alternative to the media type for backward compatibility. See Section 5.1.3 and
Section 5.1.4 for details. Moreover, MathML 1.0 suggested the media-type text/mathml, which has
been superseded by [RFC3023].
4. The instance MAY use a schemaLocation attribute on the math element to indicate the
location of the MathML schema that describes the MathML document type to which the
instance conforms. The presence of the schemaLocation attribute does not require a con-
sumer of the MathML instance to obtain or use the referenced schema.
5. The instance SHOULD use numeric character references (e.g. α) rather than char-
acter entity names (e.g. α) for greater interoperability.
6. The instance MUST specify the character encoding, if it uses an encoding other than UTF-8,
either in the XML declaration, or by the use of a byte-order mark (BOM) for UTF-16-
encoded data.
6.3.3 Discussion
To determine whether a MathML instance is pure content markup or pure presentation markup, the
math, semantics, annotation and annotation-xml elements should be regarded as belonging to
both the presentation and content markup vocabularies. The math element is treated in this way be-
cause it is required as the root element in any MathML transfer. The semantics element and its child
annotation elements comprise an arbitrary annotation mechanism within MathML, and are not tied to
290 Chapter 6. Interactions with the Host Environment
either presentation or content markup. Consequently, an application that consumes MathML should
always process these four elements, even if it only implements one of the two vocabularies.
It is worth noting that the above recommendations allow agents that produce MathML to provide binary
data for the clipboard, for example in an image or other application-specific format. The sole method
to do so is to reference the binary data using the src attribute of an annotation, since XML character
data does not allow for the transfer of arbitrary byte-stream data.
While the above recommendations are intended to improve interoperability between MathML-aware
applications that use these transfer paradigms, it should be noted that they do not guarantee interoper-
ability. For example, references to external resources (e.g. stylesheets, etc.) in MathML data can cause
interoperability problems if the consumer of the data is unable to locate them, as can happen when
cutting and pasting HTML or other data types. An application that makes use of references to external
resources is encouraged to make users aware of potential problems and provide alternate ways to obtain
the referenced resources. In general, consumers of MathML data that contains references they cannot
resolve or do not understand should ignore the external references.
6.3.4 Examples
6.3.4.1 Example 1
An e-Learning application has a database of quiz questions, some of which contain MathML. The
MathML comes from multiple sources, and the e-Learning application merely passes the data on for
display, but does not have sophisticated MathML analysis capabilities. Consequently, the application
is not aware whether a given MathML instance is pure presentation or pure content markup, nor does
it know whether the instance is valid with respect to a particular version of the MathML schema. It
therefore places the following data formats on the clipboard:
Flavor Name Flavor Content
MathML <math xmlns="http://www.w3.org/1998/Math/MathML">...</math>
Unicode Text <math xmlns="http://www.w3.org/1998/Math/MathML">...</math>
6.3.4.2 Example 2
An equation editor on the Windows platform is able to generate pure presentation markup, valid with
respect to MathML 3. Consequently, it exports the following flavors:
Flavor Name Flavor Content
MathML Presentation <math xmlns="http://www.w3.org/1998/Math/MathML">...</math>
Tiff (a rendering sample)
Unicode Text <math xmlns="http://www.w3.org/1998/Math/MathML">...</math>
6.3.4.3 Example 3
A schema-based content management system on the Mac OS X platform contains multiple MathML
representations of a collection of mathematical expressions, including mixed markup from authors,
pure content markup for interfacing to symbolic computation engines, and pure presentation markup
for print publication. Due to the system’s use of schemata, markup is stored with a namespace prefix.
The system therefore can transfer the following data:
6.3. Transferring MathML 291
6.3.4.4 Example 4
A similar content management system is web-based and delivers MathML representations of mathe-
matical expressions. The system is able to produce MathML-Presentation, MathML-Content, TeX and
pictures in TIFF format. In web-pages being browsed, it could produce a MathML fragment such as
the following:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<semantics>
<mrow>...</mrow>
<annotation-xml encoding="MathML-Content">...</annotation-xml>
<annotation encoding="TeX">{1 \over x}</annotation>
<annotation encoding="image/tiff" src="formula3848.tiff"/>
</semantics>
</math>
A web-browser on the Windows platform that receives such a fragment and tries to export it as part of
a drag-and-drop action, can offer the following flavors:
292 Chapter 6. Interactions with the Host Environment
In the standard schema, elements from other namespaces are not allowed, but attributes from other
namespaces are permitted. MathML processors that encounter unknown XML markup should behave
as follows:
1. An attribute from a non-MathML namespace should be silently ignored.
2. An element from a non-MathML namespace should be treated as an error, except in an
annotation-xml element. If the element is a child of a presentation element, it should be
handled as described in Section 3.3.5. If the element is a child of a content element, it should
be handled as described in Section 4.2.9.
For example, if the second child of an mfrac element is an unknown element, the fraction should be
rendered with a denominator that indicates the error.
When designing a compound document format in which MathML is included in a larger document type,
the designer may extend the content model of MathML to allow additional elements. For example, a
common extension is to extend the MathML schema such that elements from non-MathML namespaces
are allowed in token elements, but not in other elements. MathML processors that encounter unknown
markup should behave as follows:
1. An unrecognized XML attribute should be silently ignored.
2. An unrecognized element in a MathML token element should be silently ignored.
3. An element from a non-MathML namespace should be treated as an error, except in an
annotation-xml element. If the element is a child of a presentation element, it should be
handled as described in Section 3.3.5. If the element is a child of a content element, it should
be handled as described in Section 4.2.9.
Extending the schema in this way is easily achieved using the Relax NG schema described in Ap-
pendix A, it may be as simple as including the MathML schema whilst overriding the content model of
mtext:
default namespace m = "http://www.w3.org/1998/Math/MathML"
include "mathml3.rnc" {
mtext = element mtext {mtext.attributes, (token.content|anyElement)*}
}
The definition given here would allow any well formed XML that is not in the MathML namespace
as a child of mtext. In practice this may be too lax. For example, an XHTML+MathML Schema may
just want to allow inline XHTML elements as additional children of mtext. This may be achieved
by replacing anyElement by a suitable production from the schema for the host document type, see
Section 6.4.1.
Considerations about mixing markup vocabularies in compound documents arise when a compound
document type is first designed. But once the document type is fixed, it is not generally practical for
specific software tools to further modify the content model to suit their needs. However, it is still
frequently the case that such tools may need to store additional information within a MathML instance.
Since MathML is most often generated by authoring tools, a particularly common and important case
is where an authoring tool needs to store information about its internal state along with a MathML
expression, so an author can resume editing from a previous state. For example, placeholders may be
used to indicate incomplete parts of an expression, or a insertion point within an expression may need
to be stored.
An application that needs to persist private data within a MathML expression should generally attempt
to do so without altering the underlying content model, even in situations where it is feasible to do so.
To support this requirement, regardless of what may be allowed by the content model of a particular
compound document format, MathML permits the storage of private data via the following strategies:
294 Chapter 6. Interactions with the Host Environment
1. In a format that permits the use of XML Namespaces, for small amounts of data, attributes
from other namespaces are allowed on all MathML elements.
2. For larger amounts of data, applications may use the semantics element, as described in
Section 5.1.
3. For authoring tools and other applications that need to associate particular actions with pre-
sentation MathML subtrees, e.g. to mark an incomplete expression to be filled in by an
author, the maction element may be used, as described in Section 3.7.1.
The main differences that affect MathML usage may be summarized as:
• Attribute values in most cases do not need to be quoted: <mfenced open=( close=)>
would parse correctly.
• End tags may in many cases be omitted.
• HTML does not support namespaces other than the three built in ones for HTML, MathML
and SVG, and does not support namespace prefixes. Thus you can not use a prefix form like
<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"> and while you may
use <math xmlns="http://www.w3.org/1998/Math/MathML">, the namespace decla-
ration is essentially ignored and the input is treated as <math>. In either case the math
element and its descendants are placed in the MathML namespace. As noted in Chapter 5
the lack of namespace support limits some of the possibilities for annotating MathML with
markup from other vocabularies when used in HTML.
• Unlike the XML parser, the HTML parser is defined to accept any input string and produce
a defined result (which may be classified as non-conforming. The extreme example
<math></<><z =5> for example would be flagged as a parse error by validators but would
return a tree corresponding to a math element containing a comment < and an element z with
an attribute that could not be expressed in XML with name =5 and value "".
• Unless inside the token elements <mtext>, <mo>, <mn>, <mi>, <ms>, or inside an
<annotation-xml> with encoding attribute "text/html" or
"annotation/xhtml+xml", the presence of an HTML element will terminate the math
expression by closing all open MathML elements, so that the HTML element is interpreted
as being in the outer HTML context. Any following MathML elements are then not con-
tained in <math> so will be parsed as invalid HTML elements and not rendered as MathML.
See for example the example given in Section 5.2.3.3.
In the interests of compatibility with existing MathML applications authors and editing systems should
use MathML fragments that are well formed XML, even when embedded in an HTML document. Also
as noted above, although applications accepting MathML in HTML documents must accept MathML
making use of these HTML parser features, they should offer a way to export MathML in a portable
XML syntax.
6.4.4 Linking
In MathML 3, an element is designated as a link by the presence of the href attribute. MathML has no
element that corresponds to the HTML/XHTML anchor element a.
MathML allows the href attribute on all elements. However, most user agents have no way to imple-
ment nested links or links on elements with no visible rendering; such links may have no effect.
The list of presentation markup elements that do not ordinarily have a visual rendering, and thus should
not be used as linking elements, is given in the table below.
MathML elements that should not be linking elements
mprescripts none
malignmark maligngroup
For compound document formats that support linking mechanisms, the id attribute should be used to
specify the location for a link into a MathML expression. The id attribute is allowed on all MathML
elements, and its value must be unique within a document, making it ideal for this purpose.
Note that MathML 2 has no direct support for linking; it refers to the W3C Recommendation "XML
Linking Language" [XLink] in defining links in compound document contexts by using an
xlink:href attribute. As mentioned above, MathML 3 adds an href attribute for linking so that
296 Chapter 6. Interactions with the Host Environment
xlink:href is no longer needed. However, xlink:href is still allowed because MathML permits
the use of attributes from non-MathML namespaces. It is recommended that new compound document
formats use the MathML 3 href attribute for linking. When user agents encounter MathML elements
with both href and xlink:href attributes, the href attribute should take precedence. To support
backward compatibility, user agents that implement XML Linking in compound documents containing
MathML 2 should continue to support the use of the xlink:href attribute in addition to supporting
the href attribute.
Note that the semantics representation of this example is given in MathML-Content markup, as the
first child of the semantics element. In this regard, it is the representation most analogous to the alt
attribute of the img element in XHTML, and would likely be the best choice for non-visual rendering.
7.1 Introduction
Notation and symbols have proved very important for mathematics. Mathematics has grown in part
because its notation continually changes toward being succinct and suggestive. Many new signs have
been developed for use in mathematical notation, and many have been adopted that were originally
introduced elsewhere.The result is that mathematics makes use of a very large collection of symbols.
It is difficult to write mathematics fluently if these characters are not available for use. It is difficult to
read mathematics if corresponding glyphs are not available for presentation on specific display devices.
The W3C Math Working Group therefore took on the job of specifying part of the mechanism need-
ed to proceed from notation to final presentation, and has collaborated with the Unicode Technical
Committee (UTC) and the STIX Fonts Project in undertaking specification of the rest.
This chapter contains discussion of characters for use within MathML, recommendations for their use,
and warnings concerning the correct form of the corresponding code points given in the Universal
Multiple-Octet Coded Character Set (UCS) [ISO10646] as codified in Unicode [Unicode]. For sim-
plicity we refer to this character set by the short name Unicode. Unless otherwise stated, the mappings
discussed in this chapter and elsewhere in the MathML 3.0 recommendation are based on Unicode 5.2.
Conformant MathML processors (see Section 2.3) are free to use characters defined in Unicode 5.2 or
later.
While a long process of review and adoption by UTC and ISO/IEC of the characters of special interest
to mathematics and MathML is now complete, more characters may be added in the future. For the
latest character tables and font information, see the [Entities] and the Unicode Home Page, notably
Unicode Work in Progress and Unicode Technical Report #25 “Unicode Support for Mathematics”.
A MathML token element (see Section 3.2, Section 4.2.1, Section 4.2.2, Section 4.2.3) takes as content
a sequence of MathML characters or mglyph elements. The latter are used to represent characters that
do not have a Unicode encoding, as described in Section 3.2.1.2. The need for mglyph should be rare
because Unicode 3.1 provided approximately one thousand alphabetic characters for mathematics, and
Unicode 3.2 added over 900 more special mathematical symbols.
299
300 Chapter 7. Characters, Entities and Fonts
pairs, and the two characters guaranteed not to be Unicode characters at all. U+FFFE is excluded to
allow determination of byte order in certain encodings.
There are essentially three different ways of encoding character data in an XML document.
• Using characters directly: For example, the ’é’ (character U+00E9 [LATIN SMALL LET-
TER E WITH ACUTE]) may have been inserted. This option is only useful if the character
encoding specified for the XML document includes the character intended. Note that if the
document is, for example, encoded in Latin-1 (ISO-8859-1) then only the characters in that
encoding are available directly; for instance character U+00E9 (eacute) is, but character
U+03B1 (alpha) is not.
• Using numeric XML character references: For example, ’é’ may be represented as é
(decimal) or é (hex), or é (decimal) or é. Note that the numbers in the
character references always refer to the Unicode encoding (and not to the character encoding
used in the XML file). By using character references it is always possible to access the entire
Unicode range.
• Using entity references: The MathML DTD defines internal entities that expand to character
data. Thus for example the entity reference é may be used rather than the character
reference é. An XML fragment that uses an entity reference which is not defined in a
DTD is not well-formed; therefore it will be rejected by an XML parser. For this reason ev-
ery fragment using entity references must use a DOCTYPE declaration which specifies the
MathML DTD, or a DTD that at least declares any entity reference used in the MathML in-
stance. The need to use a DOCTYPE complicates inclusion of MathML in some documents.
However, entity references can be useful for small illustrative examples.
not letters that may be used to make up words with recognized meanings, but individual carriers of
semantics themselves. Writing a string of such symbols is usually interpreted in terms of some com-
position law, for instance, multiplication. Many letter-like symbols may be quickly interpreted as of a
certain mathematical type by specialists in a given area: for instance, bold symbols, whether based on
Latin or Greek letters, as vectors in physics or engineering, or Fraktur symbols as Lie algebras in part
of pure mathematics.
The additional Mathematical Alphanumeric Symbols provided in Unicode 3.1 have code points in the
range U+1D400 to U+1D7FF in Plane 1, that is, in the first plane with Unicode values higher than 216 .
This plane of characters is also known as the Secondary Multilingual Plane (SMP), in contrast to the
Basic Multilingual Plane (BMP) which was originally the entire extent of Unicode. Support for Plane 1
characters in currently deployed software is not always reliable, but it should be possible in multilingual
operating systems, since Plane 2 has many Chinese characters that must be displayable in East Asian
locales.
As discussed in Section 3.2.2, MathML offers an alternative mechanism to specify mathematical al-
phanumeric characters. This alternative mechanism spans the gap between the specification of the
mathematical alphanumeric symbols as Unicode code points, and the deployment of software and fonts
that support them. Namely, one uses the mathvariant attribute on a token element such as mi to
indicate that the character data in the token element selects a mathematical alphanumeric symbol.
In principle, any mathvariant value may be used with any character data to define a specific symbolic
token. In practice, only certain combinations of character data and mathvariant values will be visual-
ly distinguished by a given renderer. In this section we explain the correspondence between certain
characters in Plane 0 that, when modified by the mathvariant attribute, are considered equivalent to
mathematical alphanumeric symbol characters.
The mathematical alphanumeric symbol characters in Plane 1 include alphabets for Latin upper-case
and lower-case letters, including dotless i and j, Greek upper-case and lower-case letters, Greek sym-
bols (also known as variants), including upper-case and lower-case digamma, and Latin digits. These
alphabets provide Plane 1 Unicode code points that differ from corresponding Plane 0 characters only
by a variation in font that carries mathematical semantics when used in a formula.
The mathvariant attribute uses exactly this correspondence to provide an alternate markup encoding
that selects these Plane 1 characters. For example, the Mathematical Italic alphabet runs from U+1D434
("A") to U+1D467 ("z"). Thus, a typical example of an identifier for a variable, marked up as
<mi>a</mi>
and rendered in a mathematical italic font (as described in Section 3.2.3) could equivalently be marked
up as
<mi>𝑎<!--MATHEMATICAL ITALIC SMALL A--></mi>
which invokes the Mathematical Italic lower-case a explicitly.
An important use of the mathematical alphanumeric symbols in Plane 1 is for identifiers normally
printed in special mathematical fonts, such as Fraktur, Greek, Boldface, or Script. As another example,
the Mathematical Fraktur alphabet runs from U+1D504 ("A") to U+1D537 ("z"). Thus, an identifier for
a variable that uses Fraktur characters could be marked up as
<mi>𝔄<!--BLACK-LETTER CAPITAL A--></mi>
An alternative, equivalent markup for this example is to use the common upper-case A, modified by
using the mathvariant attribute:
<mi mathvariant="fraktur">A</mi>
302 Chapter 7. Characters, Entities and Fonts
A MathML processor must treat a mathematical alphanumeric character (when it appears) as identi-
cal to the corresponding combination of the unstyled character and mathvariant attribute value. It is
important to note that the mathvariant attribute specifies a semantic class of characters, each of which
has a specific appearance that should be protected from document-wide style changes, so the intended
meaning of the character may be preserved. The use of a mathematical alphanumeric character is also
intended to preserve this specific appearance, and so these characters are also not to be affected by
surrounding style changes.
Not all combinations of character data and mathvariant values have assigned Unicode code points. For
example, sans-serif Greek alphabets are omitted, while bold sans-serif Greek alphabets are included,
and bold digits are included, while bold-italic digits are excluded. A renderer should visually distin-
guish those combinations of character data and mathvariant attribute values that it can subject to the
availability of font characters. It is intended that renderers distinghish at least those combinations that
have equivalent Unicode code points, and renderers are free to ignore those combinations that have no
assigned Unicode code point or for which adequate font support is unavailable.
The exact correspondence between a mathematical alphabetic character and an unstyled character is
complicated by the fact that certain characters that were already present in Unicode in Plane 0 are not
in the ’expected’ sequence in Plane 1. The table below shows the Plane 0 mathematical alphanumeric
symbols, listing for each character its Unicode code point, its Unicode character name, its correspond-
ing unstyled alphabetic character, and the code point in Plane 1 where one might naturally have sought
this character.
Unicode code point Unicode name BMP code Plane-1 code
U+210E PLANCK CONSTANT U+0068 U+1D455
U+212C SCRIPT CAPITAL B U+0042 U+1D49D
U+2130 SCRIPT CAPITAL E U+0045 U+1D4A0
U+2131 SCRIPT CAPITAL F U+0046 U+1D4A1
U+210B SCRIPT CAPITAL H U+0048 U+1D4A3
U+2110 SCRIPT CAPITAL I U+0049 U+1D4A4
U+2112 SCRIPT CAPITAL L U+004C U+1D4A7
U+2133 SCRIPT CAPITAL M U+004D U+1D4A8
U+211B SCRIPT CAPITAL R U+0052 U+1D4AD
U+212F SCRIPT SMALL E U+0065 U+1D4BA
U+210A SCRIPT SMALL G U+0067 U+1D4BC
U+2134 SCRIPT SMALL O U+006F U+1D4C4
U+212D BLACK-LETTER CAPITAL C U+0043 U+1D506
U+210C BLACK-LETTER CAPITAL H U+0048 U+1D50B
U+2111 BLACK-LETTER CAPITAL I U+0049 U+1D50C
U+211C BLACK-LETTER CAPITAL R U+0052 U+1D515
U+2128 BLACK-LETTER CAPITAL Z U+005A U+1D51D
U+2102 DOUBLE-STRUCK CAPITAL C U+0043 U+1D53A
U+210D DOUBLE-STRUCK CAPITAL H U+0048 U+1D53F
U+2115 DOUBLE-STRUCK CAPITAL N U+004E U+1D545
U+2119 DOUBLE-STRUCK CAPITAL P U+0050 U+1D547
U+211A DOUBLE-STRUCK CAPITAL Q U+0051 U+1D548
U+211D DOUBLE-STRUCK CAPITAL R U+0052 U+1D549
U+2124 DOUBLE-STRUCK CAPITAL Z U+005A U+1D551
Mathematical Alphanumeric Symbol characters should not be used for styled prose. For example,
Mathematical Fraktur A must not be used to just select a blackletter font for an uppercase A as it would
create problems for searching, restyling (e.g. for accessibility), and many other kinds of processing.
7.6. Non-Marking Characters 303
7.7.1.1 Minus
The most common ordinary text character which enjoys a special mathematical use is U+002D [HYPHEN-
MINUS]. As its Unicode name suggests, it is used as a hyphen in prose contexts, and as a minus or
negative sign in formulas. For text use, there is a specific code point U+2010 [HYPHEN] which is
intended for prose contexts, and which should render as a hyphen or short dash. For mathematical
use, there is another code point U+2212 [MINUS SIGN] which is intended for mathematical formulas,
and which should render as a longer minus or negative sign. MathML renderers should treat U+002D
[HYPHEN-MINUS] as equivalent to U+2212 [MINUS SIGN] in formula contexts such as mo, and as
equivalent to U+2010 [HYPHEN] in text contexts such as mtext.
304 Chapter 7. Characters, Entities and Fonts
7.7.2 Pseudo-scripts
There are a number of characters in the UCS that traditionally have been taken to have a natural ‘script’
aspect. The visual presentation of these characters is similar to a script, that is, raised from the baseline,
and smaller than the base font size. The degree symbol and prime characters are examples. For use in
text, such characters occur in sequence with the identifier they follow, and are typically rendered using
the same font. These characters are called pseudo-scripts here.
In almost all mathematical contexts, pseudo-script characters should be associated with a base expres-
sion using explicit script markup in MathML. For example, the preferred encoding of ‘x prime’ is
<msup><mi>x</mi><mo>′<!--PRIME--></mo></msup>
and not
<mi>x’</mi>
or any other variants not using an explicit script construct. Note, however, that within text contexts such
as mtext, pseudo-scripts may be used in sequence with other character data.
There are two reasons why explicit markup is preferable in mathematical contexts. First, a problem
arises with typesetting, when pseudo-scripts are used with subscripted identifiers. Traditionally, sub-
scripting of x’ would be rendered stacked under the prime. This is easily accomplished with script
markup, for example:
7.7. Anomalous Mathematical Characters 305
<mrow><msubsup><mi>x</mi><mn>0</mn><mo>′<!--PRIME--></mo></msubsup></mrow>
By contrast,
<mrow><msub><mi>x’</mi><mn>0</mn></msub></mrow>
will render with staggered scripts.
Note this means that a renderer of MathML will have to treat pseudo-scripts differently from most other
character codes it finds in a superscript position; in most fonts, the glyphs for pseudo-scripts are already
shrunk and raised from the baseline.
The second reason that explicit script markup is preferrable to juxtaposition of characters is that it
generally better reflects the intended mathematical structure. For example,
<msup>
<mrow><mo>(</mo><mrow><mi>f</mi><mo>+</mo><mi>g</mi></mrow><mo>)</mo></mrow>
<mo>′<!-PRIME-></mo>
</msup>
accurately reflects that the prime here is operating on an entire expression, and does not suggest that
the prime is acting on the final right parenthesis.
However, the data model for all MathML token elements is Unicode text, so one cannot rule out the
possibility of valid MathML markup containing constructions such as
<mrow><mi>x’</mi></mrow>
and
<mrow><mi>x</mi><mo>’</mo></mrow>
While the first form may, in some rare situations, legitmately be used to distinguish a multi-character
identifer named x’ from the derivative of a function x, such forms should generally be avoided. Author-
ing and validation tools are encouraged to generate the recommended script markup:
<mrow><msup><mi>x</mi><mo>′<!--PRIME--></mo></msup></mrow>
The U+2032 [PRIME] character is perhaps the most common pseudo-script, but there are many others,
as listed below:
306 Chapter 7. Characters, Entities and Fonts
Pseudo-script Characters
U+0022 QUOTATION MARK
U+0027 APOSTROPHE
U+002A ASTERISK
U+0060 GRAVE ACCENT
U+00AA FEMININE ORDINAL INDICATOR
U+00B0 DEGREE SIGN
U+00B2 SUPERSCRIPT TWO
U+00B3 SUPERSCRIPT THREE
U+00B4 ACUTE ACCENT
U+00B9 SUPERSCRIPT ONE
U+00BA MASCULINE ORDINAL INDICATOR
U+2018 LEFT SINGLE QUOTATION MARK
U+2019 RIGHT SINGLE QUOTATION MARK
U+201A SINGLE LOW-9 QUOTATION MARK
U+201B SINGLE HIGH-REVERSED-9 QUOTATION MARK
U+201C LEFT DOUBLE QUOTATION MARK
U+201D RIGHT DOUBLE QUOTATION MARK
U+201E DOUBLE LOW-9 QUOTATION MARK
U+201F DOUBLE HIGH-REVERSED-9 QUOTATION MARK
U+2032 PRIME
U+2033 DOUBLE PRIME
U+2034 TRIPLE PRIME
U+2035 REVERSED PRIME
U+2036 REVERSED DOUBLE PRIME
U+2037 REVERSED TRIPLE PRIME
U+2057 QUADRUPLE PRIME
In addition, the characters in the Unicode Superscript and Subscript block (beginning at U+2070)
should be treated as pseudo-scripts when they appear in mathematical formulas.
Note that several of these characters are common on keyboards, including U+002A [ASTERISK],
U+00B0 [DEGREE SIGN], U+2033 [DOUBLE PRIME], and U+2035 [REVERSED PRIME] also
known as a back prime.
In a similar way there are mathematical characters which have negations given by a vertical bar overlay
U+20D2 [COMBINING LONG VERTICAL LINE OVERLAY]. Some are available in pre-composed
forms, and some named character entities are given explicitly as combinations. In addition there are ex-
amples using U+0333 [COMBINING DOUBLE LOW LINE] and U+20E5 [COMBINING REVERSE
SOLIDUS OVERLAY], and variants specified by use of the U+FE00 [VARIATION SELECTOR-1].
For fuller listing of these cases see the listings in [Entities].
The general rule is that a base character followed by a string of combining characters should be treated
just as though it were the pre-composed character that results from the combination, if such a character
exists.
Appendix A
Parsing MathML
308
A.2. Using the RelaxNG Schema for MathML3 309
## Content MathML
include "mathml3-content.rnc"
## Presentation MathML
include "mathml3-presentation.rnc"
start = math
math.attributes = CommonAtt,
attribute {display} {"block" | "inline"}?,
attribute {maxwidth} {length}?,
attribute {overflow} {"linebreak" | "scroll" | "elide" |
"truncate" | "scale"}?,
attribute {altimg} {xsd:anyURI}?,
attribute {altimg}-width {length}?,
attribute {altimg}-height {length}?,
attribute {altimg}-valign {length | "top" | "middle" |
"bottom"}?,
attribute {alttext} {text}?,
attribute {cdgroup} {xsd:anyURI}?,
math.deprecatedattributes
annotation-xml.model = (MathExpression|anyElement)*
A.2. Using the RelaxNG Schema for MathML3 311
length = xsd:string {
pattern = ’\s*((-?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(e[mx]|in|cm|mm|p[xtc]|%)?)|
(negative)?((very){0,2}thi(n|ck)|medium)mathspace)\s*’
}
MathExpression |= PresentationExpression
ImpliedMrow = MathExpression*
TableRowExpression = mtr|mlabeledtr
312 Appendix A. Parsing MathML
TableCellExpression = mtd
MstackExpression = MathExpression|mscarries|msline|msrow|msgroup
MsrowExpression = MathExpression|none
MultiScriptExpression = (MathExpression|none),(MathExpression|none)
mpadded-length = xsd:string {
pattern = ’\s*([\+\-]?[0-9]*([0-9]\.?|\.[0-9])[0-9]*\s*((%?\s*(height|depth|
width)?)|e[mx]|in|cm|mm|p[xtc]|((negative)?((very){0,2}thi(n|ck)|
medium)mathspace))?)\s*’ }
verticalalign =
"top" |
"bottom" |
"center" |
"baseline" |
"axis"
notationstyle =
"longdiv" |
"actuarial" |
"radical" |
"box" |
"roundedbox" |
"circle" |
"left" |
"right" |
"top" |
"bottom" |
"updiagonalstrike" |
"downdiagonalstrike" |
"verticalstrike" |
"horizontalstrike" |
"madruwb"
idref = text
unsigned-integer = xsd:unsignedLong
integer = xsd:integer
number = xsd:decimal
character = xsd:string {
pattern = ’\s*\S\s*’}
color = xsd:string {
A.2. Using the RelaxNG Schema for MathML3 313
pattern = ’\s*((#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?)|[aA][qQ][uU][aA]|
[bB][lL][aA][cC][kK]|[bB][lL][uU][eE]|[fF][uU][cC][hH][sS][iI][aA]|
[gG][rR][aA][yY]|[gG][rR][eE][eE][nN]|[lL][iI][mM][eE]|
[mM][aA][rR][oO][oO][nN]|[nN][aA][vV][yY]|[oO][lL][iI][vV][eE]|
[pP][uU][rR][pP][lL][eE]|[rR][eE][dD]|[sS][iI][lL][vV][eE][rR]|
[tT][eE][aA][lL]|[wW][hH][iI][tT][eE]|[yY][eE][lL][lL][oO][wW])\s*’}
TokenExpression = mi|mn|mo|mtext|mspace|ms
token.content = mglyph|malignmark|text
TokenAtt,
attribute {lquote} {text}?,
attribute {rquote} {text}?
CommonPresAtt =
attribute {mathcolor} {color}?,
attribute {mathbackground} {color | "transparent"}?
TokenAtt =
attribute {mathvariant} {"normal" | "bold" | "italic" | "bold-italic" |
316 Appendix A. Parsing MathML
DeprecatedTokenAtt =
attribute {fontfamily} {text}?,
attribute {fontweight} {"normal" | "bold"}?,
attribute {fontstyle} {"normal" | "italic"}?,
attribute {fontsize} {length}?,
attribute {color} {color}?,
attribute {background} {color | "transparent"}?
MalignExpression = maligngroup|malignmark
PresentationExpression = TokenExpression|MalignExpression|
mrow|mfrac|msqrt|mroot|mstyle|merror|mpadded|
mphantom|
mfenced|menclose|msub|msup|msubsup|munder|mover|
munderover|
mmultiscripts|mtable|mstack|mlongdiv|maction
mstyle.specificattributes =
attribute {scriptlevel} {integer}?,
attribute {displaystyle} {"true" | "false"}?,
attribute {scriptsizemultiplier} {number}?,
attribute {scriptminsize} {length}?,
attribute {infixlinebreakstyle} {"before" | "after" | "duplicate"}?,
attribute {decimalpoint} {character}?
mstyle.generalattributes =
attribute {accent} {"true" | "false"}?,
attribute {accentunder} {"true" | "false"}?,
attribute {align} {"left" | "right" | "center"}?,
attribute {alignmentscope} {list {("true" | "false") +}}?,
attribute {bevelled} {"true" | "false"}?,
attribute {charalign} {"left" | "center" | "right"}?,
attribute {charspacing} {length | "loose" | "medium" | "tight"}?,
attribute {close} {text}?,
attribute {columnalign} {list {columnalignstyle+} }?,
attribute {columnlines} {list {linestyle +}}?,
attribute {columnspacing} {list {(length) +}}?,
attribute {columnspan} {positive-integer}?,
attribute {columnwidth} {list {("auto" | length | "fit") +}}?,
attribute {crossout} {list {("none" | "updiagonalstrike" |
"downdiagonalstrike" | "verticalstrike" | "horizontalstrike")*}}?,
attribute {denomalign} {"left" | "center" | "right"}?,
attribute {depth} {length}?,
attribute {dir} {"ltr" | "rtl"}?,
attribute {edge} {"left" | "right"}?,
attribute {equalcolumns} {"true" | "false"}?,
318 Appendix A. Parsing MathML
mstyle.deprecatedattributes =
DeprecatedTokenAtt,
attribute {veryverythinmathspace} {length}?,
attribute {verythinmathspace} {length}?,
attribute {thinmathspace} {length}?,
attribute {mediummathspace} {length}?,
attribute {thickmathspace} {length}?,
attribute {verythickmathspace} {length}?,
attribute {veryverythickmathspace} {length}?
mtr.attributes =
CommonAtt, CommonPresAtt,
attribute {rowalign} {"top" | "bottom" | "center" | "baseline" | "axis"}?,
attribute {columnalign} {list {columnalignstyle+} }?,
attribute {groupalign} {group-alignment-list-list}?
SymbolName = xsd:NCName
csymbol.attributes = CommonAtt, cd
csymbol.content = SymbolName
BvarQ = bvar*
bvar = element {bvar} {CommonAtt, (ci | semantics-ci)}
MathExpression |= ContExp
A.2. Using the RelaxNG Schema for MathML3 325
include "mathml3-strict-content.rnc"{
cn.content = (text | mglyph | sep | PresentationExpression)*
cn.attributes = CommonAtt, DefEncAtt, attribute {type} {text}?, base?
bind.content = apply.content
}
DomainQ = (domainofapplication|condition|interval|(lowlimit,uplimit?))*
domainofapplication = element {domainofapplication} {ContExp}
condition = element {condition} {ContExp}
uplimit = element {uplimit} {ContExp}
lowlimit = element {lowlimit} {ContExp}
326 Appendix A. Parsing MathML
Qualifier = DomainQ|degree|momentabout|logbase
degree = element {degree} {ContExp}
momentabout = element {momentabout} {ContExp}
logbase = element {logbase} {ContExp}
ContExp |= piecewise
interval.class = interval
ContExp |= interval.class
lambda.class = lambda
ContExp |= lambda.class
nary-functional.class = compose
ContExp |= nary-functional.class
unary-logical.class = not
ContExp |= unary-logical.class
int.class = int
ContExp |= int.class
Differential-Operator.class = diff
ContExp |= Differential-Operator.class
partialdiff.class = partialdiff
ContExp |= partialdiff.class
ContExp |= binary-set.class
unary-set.class = card
ContExp |= unary-set.class
sum.class = sum
ContExp |= sum.class
product.class = product
ContExp |= product.class
limit.class = limit
ContExp |= limit.class
nary-linalg.class = selector
ContExp |= nary-linalg.class
332 Appendix A. Parsing MathML
Inline.class |= math
Block.class |= math
assuming that we have access to a modular RelaxNG schema for XHTML that uses Inline.class
and Block.class to collect the the content models for inline and block-level elements.
Customizing the MathML3 schema so that we can restrict the content of annotation-xml elements
is similarly simple, for example:
# A RelaxNG Schema for MathML with OpenMath3 annotations
omobj = external "openmath3.rnc"
include "mathml3.rnc" {anotation-xml.model = omobj}
The MathML3 schema is organized so that subsetting to one of the sublanguages specified here is easy.
To include strict content MathML3 in a schema just include
include "mathml3-common.rnc"
include "mathml3-strict-content.rnc"
instead of include mathml3.rnc.
For details about RelaxNG grammars and modularization see [RELAX-NG] or [RelaxNGBook].
This normative appendix registers three media types for MathML, "application/mathml+xml", "applica-
tion/mathml-presentation+xml" and "application/mathml-content+xml", in conformance with [RFC4288]
and W3CRegMedia. The media-types have been approved by IESG for registration with IANA as an-
nounced by IETF and are visible on the list of application media-types.
335
336 Appendix B. Media Types Registrations
will commonly be appropriate to use as a default type, and all MathML processors are encouraged to
accept it as a fallback to the more specific formats.
The media types described here may be applied to instances of all versions of MathML up to and
including MathML 3. MathML instances do not contain version numbers, so processors and producers
must follow the normative backward compatibility behavior described in this specification.
Published specification This media type registration is extracted from Appendix B of the
Mathematical Markup Language (MathML) Version 3. specification.
Applications that use this media type Web browsers, rendering engines, formula editors,
typesetting software, search robots, computing systems.
Additional information Magic number(s): see [RFC3023]
File extension(s): .mml
Windows Clipboard Name: MathML
Macintosh file type code(s) MML
Macintosh Universal Type Identifier code public.mathml conforming to public.xml
Person & email address to contact for further information Paul Libbrecht (member-
math@w3.org). See the W3C Math Working Group home page for more information.
Intended usage COMMON
Restrictions on usage None
Author and Change controller The MathML specification is the product of the World Wide Web
Consortium’s Math Working Group. The W3C has change control over this specification.
considerations in the Media Type registrations for those formats shall apply. Similarly,
MathML annotation elements may contain content intended for execution or processing. In
the case where the processor recognizes and processes the additional content, or where
further processing of that content is dispatched to other processors, additional security
issues potentially arise. Since the normative semantics of this specification do not require
processing of annotation elements, such issues fall outside the domain of this registration
document.MathML may be used to describe mathematical expressions intended for
evaluation in computing systems. Because of the nature of mathematics, a seemingly
innocuous expression may lead to a computation which does not terminate or is
impractically large. This introduces the risk that computational processors in constrained
environments may fail.In addition, because of the extensibility features for MathML and of
XML in general, it is possible that "application/mathml-content+xml" may describe content
that has security implications beyond those described here. However, if the processor
follows only the normative semantics of this specification, this content will be outside the
MathML namespace and shall be ignored.
Interoperability considerations This specification describes processing semantics that dictate
behavior that must be followed when dealing with, among other things, unrecognized
elements and attributes, both in the MathML namespace and in other namespaces.Because
MathML is extensible, conformant "application/mathml-content+xml" processors must
expect that content received is well-formed XML, but it cannot be guaranteed that the
content is valid to a particular DTD or Schema or that the processor will recognize all of the
elements and attributes in the document.MathML instances do not contain version numbers,
so processors and producers must follow the normative backward compatibility behavior
described in this specification.In computational contexts, the result of evaluating a MathML
expression is system-specific, and is not guaranteed to be interoperable between
systems.This specification does not record a file extension for the media type "application/
mathml-content+xml" because we expect tools processing files with MathML inside to
have sufficient information with the generic media-type (application/mathml+xml) while
other content negotiation forms will take advantage of specific media-types.
Published specification This media type registration is extracted from Appendix B of the
Mathematical Markup Language (MathML) Version 3. specification.
Applications that use this media type Formula editors, search robots, computing systems.
Additional information Magic number(s): see [RFC3023]
File extension(s): None
Windows Clipboard Name: MathML Content
Macintosh file type code(s) MMLc
Macintosh Universal Type Identifier code public.mathml.content conforming to
public.mathml (described above) conforming to public.xml
Person & email address to contact for further information Paul Libbrecht (member-
math@w3.org). See the W3C Math Working Group home page for more information.
Intended usage COMMON
Restrictions on usage None
Author and Change controller The MathML specification is the product of the World Wide Web
Consortium’s Math Working Group. The W3C has change control over this specification.
Appendix C
The following table gives the suggested dictionary of rendering properties for operators, fences, sep-
arators, and accents in MathML, all of which are represented by mo elements. For brevity, all such
elements will be called simply ‘operators’ in this Appendix.
340
C.3. Notes on lspace and rspace attributes 341
∵ infix 70 5 5
because
-> infix 90 5 5
multiple character operator: ->
.. postfix 100 0 0
multiple character operator: ..
: infix 100 1 2
colon
!= infix 260 4 4
multiple character operator: !=
*= infix 260 4 4
multiple character operator: *=
+= infix 260 4 4
multiple character operator: +=
-= infix 260 4 4
multiple character operator: -=
346 Appendix C. Operator Dictionary (Non-Normative)
:= infix 260 4 4
multiple character operator: :=
= infix 260 5 5
equals sign
== infix 260 4 4
multiple character operator: ==
+ infix 275 4 4
plus sign
+ prefix 275 0 1
plus sign
- infix 275 4 4
hyphen-minus
- prefix 275 0 1
hyphen-minus
* infix 390 3 3
asterisk
. infix 390 3 3
full stop
% infix 640 3 3
percent sign
\ infix 650 0 0
reverse solidus
/ infix 660 1 1
solidus
** infix 780 1 1
multiple character operator: **
^ infix 780 1 1
circumflex accent
! postfix 810 1 0
exclamation mark
!! postfix 810 1 0
multiple character operator: !!
// infix 820 1 1
multiple character operator: //
@ infix 825 1 1
commercial at
? infix 835 1 1
question mark
++ postfix 880 0 0
multiple character operator: ++
– postfix 880 0 0
multiple character operator: –
_ infix 900 1 1
low line
Appendix D
Glossary (Non-Normative)
Several of the following definitions of terms have been borrowed or modified from similar definitions
in documents originating from W3C or standards organizations. See the individual definitions for more
information.
Argument A child of a presentation layout schema. That is, ‘A is an argument of B’ means ‘A is a
child of B and B is a presentation layout schema’. Thus, token elements have no arguments,
even if they have children (which can only be malignmark).
Attribute A parameter used to specify some property of an SGML or XML element type. It is defined
in terms of an attribute name, attribute type, and a default value. A value may be specified
for it on a start-tag for that element type.
Axis The axis is an imaginary alignment line upon which a fraction line is centered. Often, operators
as well as characters that can stretch, such as parentheses, brackets, braces, summation signs
etc., are centered on the axis, and are symmetric with respect to it.
Baseline The baseline is an imaginary alignment line upon which a glyph without a descender rests.
The baseline is an intrinsic property of the glyph (namely a horizontal line). Often baselines
are aligned (joined) during typesetting.
Black box The bounding box of the actual size taken up by the viewable portion (ink) of a glyph or
expression.
Bounding box The rectangular box of smallest size, taking into account the constraints on boxes al-
lowed in a particular context, which contains some specific part of a rendered display.
Box A rectangular plane area considered to contain a character or further sub-boxes, used in discus-
sions of rendering for display. It is usually considered to have a baseline, height, depth and
width.
Cascading Style Sheets (CSS) A language that allows authors and readers to attach style (e.g. fonts,
colors and spacing) to HTML and XML documents.
Character A member of a set of identifiers used for the organization, control or representation of text.
ISO/IEC Standard 10646-1:1993 uses the word ‘data’ here instead of ‘text’.
Character data (CDATA) A data type in SGML and XML for raw data that does not include markup
or entity references. Attributes of type CDATA may contain entity references. These are ex-
panded by an XML processor before the attribute value is processed as CDATA.
Character or expression depth Distance between the baseline and bottom edge of the character glyph
or expression. Also known as the descent.
Character or expression height Distance between the baseline and top edge of the character glyph or
expression. Also known as the ascent.
Character or expression width Horizontal distance taken by the character glyph as indicated in the
font metrics, or the total width of an expression.
Condition A MathML content element used to place a mathematical condition on one or more vari-
ables.
379
380 Appendix D. Glossary (Non-Normative)
Instance of MathML A single instance of the top level element of MathML, and/or a single instance
of embedded MathML in some other data format.
Inverse function A mathematical function that, when composed with the original function acts like an
identity function.
Lambda expression A mathematical expression used to define a function in terms of variables and an
expression in those variables.
Layout schema (plural: schemata) A presentation element defined in chapter 3, other than the token
elements and empty elements defined there (i.e. not the elements defined in Section 3.2 and
Section 3.5.5, or the empty elements none and mprescripts defined in Section 3.4.7). The
layout schemata are never empty elements (though their content may contain nothing in some
cases), are always expressions, and all allow any MathML expressions as arguments (except
for requirements on argument count, and the requirement for a certain empty element in
mmultiscripts).
Mathematical Markup Language (MathML) The markup language specified in this document for
describing the structure of mathematical expressions, together with a mathematical context.
MathML element An XML element that forms part of the logical structure of a MathML document.
MathML expression (within some valid MathML data) A single instance of a presentation element,
except for the empty elements none or mprescripts, or an instance of malignmark within
a token element (defined below); or a single instance of certain of the content elements (see
Chapter 4 for a precise definition of which ones).
Multi-purpose Internet Mail Extensions (MIME) A set of specifications that offers a way to inter-
change text in languages with different character sets, and multimedia content among many
different computer systems that use Internet mail standards.
Operator, content element A mathematical object that is applied to arguments using the apply ele-
ment.
Operator, an mo element Used to represent ordinary operators, fences, separators in MathML presen-
tation. (The token element mo is defined in Section 3.2.5).
OpenMath A general representation language for communicating mathematical objects between ap-
plication programs.
Parsed character data (PCDATA) An SGML/XML data type for raw data occurring in a context where
text is parsed and markup (for instance entity references and element start/end tags) is rec-
ognized.
Point Point is often abbreviated ‘pt’. The value of 1 pt is approximately 1/72 inch. Points are typically
used to specify absolute sizes for font-related objects.
Presentation elements MathML tags and entities intended to express the syntactic structure of math-
ematical notation (defined in Chapter 3).
Presentation layout schema A presentation element that can have other MathML elements as content.
Presentation token element A presentation element that can contain only parsed character data or the
malignmark element.
Qualifier A MathML content element that is used to specify the value of a specific named parameter
in the application of selected pre-defined functions.
Relation A MathML content element used to construct expressions such as a < b.
Render Faithfully translate into application-specific form allowing native application operations to be
performed.
Schema Schema (plural: schemata or schemata). See ‘presentation layout schema’.
Scope of a declaration The portion of a MathML document in which a particular definition is active.
Selected sub-expression (of an maction element) The argument of an maction element (a layout
schema defined in Section 3.7) that is (at any given time) ‘selected’ within the viewing
state of a MathML renderer, or by the selection attribute when the element exists only in
MathML data. Defined precisely in the aforementioned section.
382 Appendix D. Glossary (Non-Normative)
Space-like (MathML expression) A MathML expression that is ignored by the suggested rendering
rules for MathML presentation elements when they determine operator forms and effective
operator rendering attributes based on operator positions in mrow elements. Defined precisely
in Section 3.2.7.
Standard Generalized Markup Language (SGML) An ISO standard (ISO 8879:1986) that provides
a formal mechanism for the definition of document structure via DTDs (Document Type
Definitions), and a notation for the markup of document instances conforming to a DTD.
Sub-expression (of a MathML expression ‘E’) A MathML expression contained (directly or indi-
rectly) in the content of E.
Suggested rendering rules for MathML presentation elements Defined throughout Chapter 3; the
ones that use other terms defined here occur mainly in Section 3.2.5 and in Section 3.7.
TEX A software system developed by Professor Donald Knuth for typesetting documents.
Token element Presentation token element or a Content token element. (See above.)
Top-level element (of MathML) math (defined in Section 2.2).
Typeface A typeface is a specific design of a set of letters, numbers and symbols, such as ‘Times
Roman’ or ‘Chicago’.
Valid MathML data MathML data that (1) conforms to the MathML DTD, (2) obeys the additional
rules defined in the MathML standard for the legal contents and attribute values of each
MathML element, and (3) satisfies the EBNF grammar for content elements.
Width (of a box) The distance from the left edge of the box to the right edge of the box.
Extensible Style Language (XSL) A style language for XML developed by W3C. See XSL FO and
XSLT.
XSL Formatting Objects (XSL FO) An XML vocabulary to express formatting, which is a part of
XSL.
XSL Transformation (XSLT) A language to express the transformation of XML documents into oth-
er XML documents.
Appendix E
383
384 Appendix E. Working Group Membership and Acknowledgments (Non-Normative)
E.2 Acknowledgments
The Working Group benefited from the help of many other people in developing the specification for
MathML 1.0. We would like to particularly name Barbara Beeton, Chris Hamlin, John Jenkins, Ira
Polans, Arthur Smith, Robby Villegas and Joe Yurvati for help and information in assembling the char-
acter tables in Chapter 7, as well as Peter Flynn, Russell S.S. O’Connor, Andreas Strotmann, and other
contributors to the www-math mailing list for their careful proofreading and constructive criticisms.
As the Math Working Group went on to MathML 2.0, it again was helped by many from the W3C
family of Working Groups with whom we necessarily had a great deal of interaction. Outside the W3C,
a particularly active relevant front was the interface with the Unicode Technical Committee (UTC)
and the NTSC WG2 dealing with ISO 10646. There the STIX project put together a proposal for the
addition of characters for mathematical notation to Unicode, and this work was again spearheaded by
Barbara Beeton of the AMS. The whole problem ended split into three proposals, two of which were
advanced by Murray Sargent of Microsoft, a Math WG member and member of the UTC. But the
mathematical community should be grateful for essential help and guidance over a couple of years
of refinement of the proposals to help mathematics provided by Kenneth Whistler of Sybase, and a
UTC and WG2 member, and by Asmus Freytag, also involved in the UTC and WG2 deliberations, and
always a stalwart and knowledgeable supporter of the needs of scientific notation.
Appendix F
Changes (Non-Normative)
F.1 Changes between MathML 3.0 Second Edition and Third Edition
• Changes to Chapter 3
– Separate the the examples in Section 3.2.3.3 and Section 3.2.4.3 to improve their ap-
pearance when rendered.
– Clarify that negative numbers should be marked up with an explicit mo operator in
Section 3.2.4.4.
– Correct the long division notation names in Section 3.6.2.2.
– Clarify that the horizontal alignment of scripts in Section 3.4.7 is towards the base, and
add a new example.
• Changes to Chapter 5
– Fix grammatical and spelling typos in note and Section 5.1.2.
F.2 Changes between MathML 3.0 First Edition and Second Edition
• Changes to the Frontmatter
– Changes to to acknowlege the death of Robert Miner.
– Changes to to highlight MathML may be used in HTML as well as XML.
– Update the Status.
• Changes to the Chapter 1
– Changes to Section 1.3 to highlight MathML may be used in HTML as well as XML.
• Changes to the Chapter 2
– Changes to Section 2.1.1 to highlight MathML may be used in HTML as well as XML.
– Add element markup to heading in Section 2.2.
– Changes to Section 2.1.2 the xmlns syntax for namespaces only applies to the XML
serialisation.
– Changes to Section 2.1.5.2 to clarify that values specified with a % or no unit are multi-
ples of a reference value, which may differ from the default value used when the value
is not specified.
– Changes to namedspace in Section 2.1.5.2 some attribute values such as
"thinmathspace" were marked up as attribute names. (This affected formatting and
also the index Section I.2).
– Additional paragraph describing global document property defaults in Section 2.1.5.4
• Changes to the Chapter 3
– Refer to ‘characters’ rather than ‘MathML Characters’ in Section 3.1.
– Delete the note about bidi in HTML in Section 3.1.5.2 (As there are proposals to change
the HTML behavior).
387
388 Appendix F. Changes (Non-Normative)
– Changes to markup of syntax tables in Section 4.2.5 and Section 4.2.7.1 to avoid re-
dundant colspans, which make the html5 version invalid.
– Clarify the behavior of qualifiers in Step 4b of the rewrite to Strict Content MathML.
(AM)
– Clarify that the types of the arguments are used to distinguish between set and multiset
use of the set constructor in Section 4.3.4.1 and Section 4.3.4.2. (AM)
– Fix spelling in Section 4.4.2.16.
– Fix spelling in Section 4.4.3.1.
– Split Section 4.4.7.1 into separate sections Section 4.4.7.1, Section 4.4.7.1,Section 4.4.7.2,
Section 4.4.7.3, Section 4.4.7.4, add new presentation images for arcsin.
– Add element markup to heading in Section 4.4.7.7.
– Minor rearrangement of heading in Section 4.4.8.6
– Add syntax table for deprecated elements in Section 4.5.1, Section 4.5.3 and Sec-
tion 4.5.2.
• Changes to Chapter 5.
– Changes to Section 5.1.1 to highlight MathML may be used in HTML as well as XML.
– Add additional note warning namespace extensibility example not applicable to HTML.
– Add additional note warning namespace extensibility example not applicable to HTML.
– Add additional note warning namespace extensibility example not applicable to HTML.
– Additional section Section 5.2.3.3 detailing the use of annotation-xmlin HTML doc-
uments
– Show tag markup around element names in section headings in semantics, annotation
and annotation-xml.
• Changes to Chapter 6.
– Editorial wording changes in Section 6.4.
– Editorial wording changes in Section 6.5.
– Changes to wording on namespace use in Section 6.1.
– Additional section Section 6.2.2.
– Remove XML Declaration and mml namespace prefix from the examples in Section 6.3.4.
– Delete recommendation to use prefixed element names in XHTML in Section 6.4.1.
– Split HTML into a separate section from other non-XML use Section 6.4.3 and Sec-
tion 6.4.2
– Remove the reference to [MathMLforCSS] in Chapter 6.
• Changes to Chapter 7.
– Change the DTD description in Section 7.3 to reference the Combined HTML MathML
entity set rather than the legacy ISO entity sets. This does not change any existing defi-
nition, but adds the following 38 entity definitions: " (U+0022), & (U+0026),
< (U+003C), > (U+003E), © (U+00A9), ® (U+00AE), Α
(U+0391), Β (U+0392), Ε (U+0395), Ζ (U+0396), Η (U+0397),
Ι (U+0399), Κ (U+039A), Μ (U+039C), Ν (U+039D),
Ο (U+039F), Ρ (U+03A1), Τ (U+03A4), Χ (U+03A7),
ε (U+03B5), ο (U+03BF), ς (U+03C2), ϑ
(U+03D1), ϒ (U+03D2), ‌ (U+200C), ‍ (U+200D), ‎ (U+200E),
‏ (U+200F), ‚ (U+201A), „ (U+201E), ‹ (U+2039),
› (U+203A), ‾ (U+203E), ⁄ (U+2044), € (U+20AC),
™ (U+2122), ℵ (U+2135), ↵ (U+21B5).
• Changes to Appendix A.
– Modify the schema regular expression to allow the deprecated unitless length attributes.
– The schema now enforces a mandatory space and optional minus sign before rownum-
ber in the align attribute of mtable and mstack.
390 Appendix F. Changes (Non-Normative)
– Modify the schema (including DTD and XSD versions) to include the attributes listed
in Section 3.2.5.2 on mspace to match the text description in Section 3.2.7.
– Modify the schema to include the Common Attributes such as id on bvar and cn to
match the attribute tables in the text
– Modify the regular expressions used for mpadded-length and length so that there
must be at most one . and at least one digit. (FW)
– New sections: Section A.5 and Section A.6.
• Changes to Appendix C.
– Add entries for the characters listed in Section 7.7.2.
• Changes to Appendix E.
– Changes to Section E.1 to note the death of Robert Miner.
• Changes to Appendix G.
– Make [HTML5] normative.
– Update the references to current versions, [Bidi], [Entities], [ISO10646], [Normal],
[RELAX-NG], [Unicode].
• Changes to Appendix H.
– Update the references to current versions, [AAP-math], [Abramowitz1977], [CSS21],
[ISO-12083], [XLink].
• Changes to Appendix I.
– Changes to Section I.2.
F.3 Changes between MathML 2.0 Second Edition and MathML 3.0
• Changes to Chapter 2.
– The attribute href added to the common MathML attributes, Section 2.1.6 to allow
hypertext links.
– Additional attributes added to the math element, see Section 2.2.1.
• Changes to Chapter 3.
– Introduced mechanisms for controlling the Directionality of layout, as described in
Section 3.1.5.
– Introduced mechanisms for controlling linebreaking Section 3.1.7.
– Extended mglyph to support general image inclusion, Section 3.2.1.2.
– The facilities for adjusting spacing with mpadded have been extended and rationalised,
Section 3.3.6.
– Introduced new presentation elements for elementary math layouts, Section 3.6:
mstack, mlongdiv, msgroup, msrow, mscarries, mscarry, and msline.
• Changes to Chapter 4.
– Introduced new content elements bind, share, cerror, cs and cbytes.
– Removed deprecated content elements reln and fn.
– Removed content element declare.
– The concept of Strict Content MathML and the use of OpenMath Content Dictionaries
has been introduced, and the whole chapter restructured.
• Changes to Chapter 5.
• New Chapter: Chapter 6.
• Changes to Chapter 7.This chapter is much reduced from the corresponding chapter in pre-
vious releases of MathML. All the tables and much of the other content of this chapter is
now maintained as a separate document [Entities]
• Changes to Appendix A.
F.3. Changes between MathML 2.0 Second Edition and MathML 3.0 391
– The Normative version of the grammar is now expressed in Relax NG, with DTD and
XSD versions being derived.
– Three MathML 1 attrbutes on math that were deprecated and undocumented in MathML2
but retained in the MathML2 DTD have been removed. name (use id instead),
baseline and type (These are not used by any known implementation, so can be
removed.) See Chapter 7 of [MathML1].
• New Appendix: Appendix B.
• Changes to Appendix C.The Operator Dictionary table has been updated and rationalised
and presented in a new format.
• MathML DOMThe chapter and appendices relating to the MathML DOM have been re-
moved from this specification, with the intention of updating them and publishing them as a
separate document at a later time.
Appendix G
Normative References
[Bidi] Mark Davis; Unicode Bidirectional Algorithm, Unicode Standard Annex #9, Unicode 6.3.0
2013-09-24. (http://www.unicode.org/reports/tr9/)
[Entities] David Carlisle and Patrick Ion (editors); XML Entity Definitions for Characters (2nd Edi-
tion), W3C Recommendation 10 April 2014. (http://www.w3.org/TR/xml-entity-names/)
[HTML4] Dave Raggett, Arnaud Le Hors, and Ian Jacobs (editors); HTML 4.01 Specification, W3C
Recommendation, 24 December 1999. (http://www.w3.org/TR/html401/)
[HTML5] Robin Berjon, Steve Faulkner, Travis Leithead, Erika Doyle Navara, Edward O’Connor,
Silvia Pfeiffer, Ian Hickson; HTML 5, A vocabulary and associated APIs for HTML and XHTML
W3C Candidate Recommendation 04 February 2014 (http://www.w3.org/TR/html5/)
[IRI] M. Duerst and M. Suignard; Internationalized Resource Identifiers (IRIs), January 2005 (http:
//www.ietf.org/rfc/rfc3987.txt). See also the proposed update http://tools.ietf.
org/html/draft-duerst-iri-bis-07.
[ISO10646] Joint Technical Committee ISO/IEC JTC 1, Subcommittee SC 2. ISO/IEC 10646:2012,
Information technology – Universal Coded Character Set (UCS). International Standards Organi-
zation, Geneva, Switzerland, 2012.
[Namespaces] Tim Bray, Dave Hollander, Andrew Layman, Richard Tobin, and Henry S. Thompson
(editors); Namespaces in XML, W3C Recommendation, 8 December 2009. (http://www.w3.
org/TR/REC-xml-names/)
[Normal] Mark Davis, Ken Whistler, and Martin Dürst; Unicode Normalization Forms, Unicode Stan-
dard Annex #15, Unicode 6.3.0 2013-09-20. (http://www.unicode.org/reports/tr15/)
[OpenMath2004] S. Buswell, O. Caprotti, D. P. Carlisle, M. C. Dewar, M. Gaëtano and M. Kohlhase
(editors); The OpenMath Standard Version 2.0, The OpenMath Society, 30 June 2004. (http:
//www.openmath.org/standard/om20-2004-06-30/)
[RELAX-NG] ISO/IEC JTC 1/SC 34; Document Schema Definition Language (DSDL) – Part 2:
Regular-grammar-based validation – RELAX NG 2008, International Organization for Standard-
ization, 15 December 2008. (http://relaxng.org/spec-20011203.html)
[RFC2045] N. Freed and N. Borenstein; Multipurpose Internet Mail Extensions (MIME) Part One:
Format of Internet Message Bodies, RFC 2045, November 1996. (http://www.ietf.org/rfc/
rfc2045.txt)
[RFC2046] N. Freed and N. Borenstein; Multipurpose Internet Mail Extensions (MIME) Part Two:
Media Types, RFC 2045, November 1996. (http://www.ietf.org/rfc/rfc2046.txt)
[RFC3023] M. Murata, S. St.Laurent and D. Kohn; XML Media Types, RFC 3023, January 2001.
(http://www.ietf.org/rfc/rfc3023.txt)
[RFC3986] T. Berners-Lee, R. Fielding and L. Masinter; Uniform Resource Identifier (URI): Generic
Syntax, RFC 3986, January 2005. (http://tools.ietf.org/html/rfc3986)
392
393
[RFC4288] N. Freed and J. Klensin; Media Type Specifications and Registration Procedures, RFC
4288, December 2005. (http://www.ietf.org/rfc/rfc4288.txt)
[Unicode] The Unicode Consortium. The Unicode Standard, Version 6.3.0, The Unicode Consortium,
2012. ISBN 978-1-936213-07-8. (http://www.unicode.org/versions/Unicode6.3.0/)
[XHTML] Steven Pemberton, et al.; XHTMLTM 1.0 The Extensible HyperText Markup Language
(Second Edition): A Reformulation of HTML 4 in XML 1.0, W3C Recommendation, 26 January
2000, revised 1 August 2002. (http://www.w3.org/TR/xhtml1/)
[XML] Tim Bray, Jean Paoli, C. M. Sperberg-McQueen, Eve Maler, and François Yergeau (editors);
Extensible Markup Language (XML) 1.0 (Fifth Edition), W3C Recommendation, 26 November
2008. (http://www.w3.org/TR/xml/)
Appendix H
References (Non-Normative)
[AAP-math] ANSI/NISO Z39.59-1998; AAP Math DTD, Standard for Electronic Manuscript Prepa-
ration and MarkUp. (Association of American Publishers, Inc., Washington, DC) Bethesda, MD,
1988.
[Abramowitz1977] Abramowitz, Milton, Irene A. Stegun (editors); Mathematical Functions: With For-
mulas, Graphs, and Mathematical Tables. Dover Publications Inc., December 1977, ISBN: 0-
4866-1272-4.
[CSS21] Bert Bos, Tantek Çelik, Ian Hickson, and Håkon Wium Lie (editors); Cascading Style Sheets
Level 2 Revision 1 (CSS 2.1) Specification, W3C Recommendation 07 June 2011. (http://www.
w3.org/TR/CSS21/)
[Cajori1928] Cajori, Florian; A History of Mathematical Notations, vol. I & II. Open Court Publish-
ing Co., La Salle Illinois, 1928 & 1929 republished Dover Publications Inc., New York, 1993,
xxviii+820 pp. ISBN 0-486-67766-4 (paperback).
[Chaundy1954] Chaundy, T.W., P.R. Barrett, and C. Batey; The Printing of Mathematics. Aids for
authors and editors and rules for compositors and readers at the University Press, Oxford. Oxford
University Press, London, 1954, ix+105 pp.
[HTTP11] Fielding, R., J. Gettys, J. Mogul, H. Frystyk, L. Masinter, P. Leach, and T. Berners-Lee;
Hypertext Transfer Protocol – HTTP/1.1, June 1999.
[IEEE754] IEEE IEEE Standard for Floating-Point Arithmetic (http://ieeexplore.ieee.org/
xpl/freeabs_all.jsp?arnumber=4610935)
[ISO-12083] ISO 12083:1994; ISO 12083 DTD Information and Documentation - Electronic
Manuscript Preparation and Markup. International Standards Organization, Geneva, Switzerland,
1994.
[Knuth1986] Knuth, Donald E.; The TEXbook. American Mathematical Society, Providence, RI and
Addison-Wesley Publ. Co., Reading, MA, 1986, ix+483 pp. ISBN: 0-201-13448-9.
[MathML1] Patrick Ion, Robert Miner, Mathematical Markup Language (MathML) 1.01 Specification
W3C Recommendation, revision of 7 July 1999 (http://www.w3.org/TR/REC-MathML/)
[MathML2] David Carlisle, Patrick Ion, Robert Miner, Nico Poppelier, Mathematical Markup Lan-
guage (MathML) Version 2.0 (Second Edition) W3C Recommendation 21 October 2003 (http://
www.w3.org/TR/MathML2)
[MathMLTypes] Stan Devitt, Michael Kohlhase, Max Froumentin (editors); Structured Types in
MathML 2.0, (http://www.w3.org/TR/mathml-types/) W3C Working Group Note 10 November
2003.
[MathMLforCSS] Bert Bos, David Carlisle, George Chavchanidze, Patrick D. F. Ion, Bruce R.
Miller A MathML for CSS profile W3C Recommendation 07 June 2011 (http://www.w3.org/
TR/mathml-for-css)
394
395
Index (Non-Normative)
396
I.1. MathML Elements 397
complexes 4.4.10.5
compose 4.4.1.4
condition 4.3.3, 4.3.3.1, 4.4.2.18, 4.4.2.19, 4.4.4.1, 4.4.6.3, 4.6, 5.3.2
conjugate 4.4.2.21
cos 4.4.7.1
cosh 4.4.7.3
cot 4.4.7.1
coth 4.4.7.3
cs 2.1.7, 4.1.3, 4.2.4, F.3
csc 4.4.7.1
csch 4.4.7.3
csymbol 2.1.7, 2.2.1, 4.1.3, 4.1.4, 4.1.5, 4.2.1.3, 4.2.3, 4.2.3.1, 4.2.3.2, 4.2.3.3, 4.2.9, 4.3.4, 4.4, 4.5.3,
4.6, 5.3.1
curl 4.4.4.6
declare 4.3.1, 4.5.1, F.3
degree 4.3.3, 4.3.3.2, 4.4.4.2, 4.4.4.3, 4.4.8.6, 5.3.2
determinant 4.4.9.4
diff 4.3.2, 4.4.4.2
divergence 4.4.4.4
divide 4.4.2.3
domain 4.4.1.6
domainofapplication 4.3.3, 4.3.3.1, 4.3.4.1, 4.3.4.4, 4.3.4.8, 4.4.1.3, 4.6
emptyset 4.4.10.12
eq 4.4.3.1
equivalent 4.4.3.7
eulergamma 4.4.10.14
exists 4.3.2, 4.3.4.8, 4.4.2.19, 4.6
exp 4.4.7.5
exponentiale 4.4.10.7
factorial 4.4.2.2
factorof 4.4.3.9
false 4.4.10.11
floor 4.4.2.26
fn 4.3.1, 4.5.3, 4.6, F.3
forall 4.3.2, 4.3.4.8, 4.4.2.18, 4.6
gcd 4.4.2.12
geq 4.4.3.5
grad 4.4.4.5
gt 4.4.3.3
ident 4.4.1.5
image 4.4.1.8
imaginary 4.4.2.24
imaginaryi 4.4.10.8
implies 4.4.2.17
in 4.4.5.5
infinity 4.4.10.15
int 4.3.3.1, 4.4.4.1
integers 4.4.10.1
intersect 4.4.5.4
interval 4.1.3, 4.3.3, 4.3.3.1, 4.3.4.5, 4.3.5, 4.4.1.1, 4.4.4.1, 4.6
398 Appendix I. Index (Non-Normative)
inverse 4.4.1.2
lambda 4.3.1.2, 4.3.2, 4.4.1.3, 4.4.6.1, 4.4.6.2
laplacian 4.4.4.7
lcm 4.4.2.25
leq 4.4.3.6
limit 4.4.6.3
list 4.2.2.1, 4.3.4.2, 4.4.5.2
ln 4.4.7.6
log 4.1.3, 4.3.3.3, 4.4.7.7
logbase 4.3.3, 4.3.3.3, 4.4.7.7, 5.3.2
lowlimit 4.3.3, 4.3.3.1, 4.4.4.1, 4.4.6.1, 4.4.6.2, 4.4.6.3, 4.6, 5.3.2
lt 4.4.3.4
maction 2.3.1.3, 2.3.3, 3.1.3.2, 3.1.9.6, 3.2.5.7, 3.2.7.4, 3.3.4.1, 3.5.5.2, 3.5.5.4, 3.5.5.6, 3.7.1, 3.7.1.1,
6.4
maligngroup 3.1.9.4, 3.2.7.1, 3.2.7.4, 3.3.4.1, 3.5.1.2, 3.5.2.2, 3.5.4.2, 3.5.5, 3.5.5.2, 3.5.5.3, 3.5.5.4,
3.5.5.6, 3.5.5.7, 3.5.5.9, 3.5.5.10, 6.4.4
malignmark 3.1.5.2, 3.1.9.4, 3.2.1, 3.2.7.4, 3.2.8.1, 3.5.1.2, 3.5.2.2, 3.5.4.2, 3.5.5, 3.5.5.2, 3.5.5.4,
3.5.5.5, 3.5.5.6, 3.5.5.9, 3.5.5.10, 6.4.4
math 2.2, 2.2.1, 2.2.2, 3.1.3.1, 3.1.3.2, 3.1.5.1, 3.1.6, 3.1.7.1, 3.2.2, 3.2.5.2, 3.7.1, 4.2.3.1, 5.2.3.3,
6.2.1, 6.2.2, 6.3.1, 6.3.2, 6.3.3, 6.4.3, 6.5, B.1, F.2, F.3
matrix 3.5.5.9, 4.2.2.1, 4.4.9.2
matrixrow 4.4.9.2, 4.4.9.3
max 4.3.4.4, 4.4.2.4, 4.6
mean 4.3.4.4, 4.4.8.1, 4.6
median 4.4.8.4
menclose 3.1.3.1, 3.1.3.2, 3.1.7.1, 3.1.9.2, 3.3.9, 3.3.9.1, 3.3.9.2, 3.3.9.3, 3.5.5.6, 3.6.8.1
merror 2.3.2, 3.1.3.1, 3.1.3.2, 3.1.9.2, 3.3.5, 3.3.5.1, 3.3.5.2, 4.2.9
mfenced 3.1.3.2, 3.1.7.1, 3.1.9.2, 3.2.5.4, 3.3.1.1, 3.3.8, 3.3.8.1, 3.3.8.2, 3.3.8.3, 3.5.5.2, 3.5.5.4, 3.5.5.6
mfrac 2.1.5.2, 2.1.5.3, 3.1.3.2, 3.1.6, 3.1.7.1, 3.1.9.2, 3.2.5.7, 3.3.2, 3.3.2.1, 3.3.2.2, 3.3.4.1, 3.3.5.3,
3.5.5.2, 6.4, 6.4.2
mglyph 2.3.1.3, 3.1.5.2, 3.1.8.2, 3.1.9.1, 3.2, 3.2.1, 3.2.1.2, 3.2.8.1, 3.3.4.1, 4.2.1.3, 4.2.2.2, 4.2.3.2,
4.2.4, 7.1, 7.4, F.3
mi 2.1.7, 3.1.5.2, 3.1.7.1, 3.1.8.2, 3.1.9.1, 3.2, 3.2.1.2, 3.2.2, 3.2.2.1, 3.2.3, 3.2.3.1, 3.2.3.2, 3.2.3.3,
3.2.6.1, 3.2.6.4, 3.2.8.1, 3.5.5.4, 4.2.2.3, 4.2.3.3, 5.3.1, 6.4.3, 7.5
mi" 6.4.2
min 4.3.4.4, 4.4.2.5, 4.6
minus 4.2.5.1, 4.4.2.6, 4.6
mlabeledtr 3.1.3.2, 3.1.9.4, 3.3.4.1, 3.5, 3.5.1.1, 3.5.1.2, 3.5.3, 3.5.3.1, 3.5.3.2, 3.5.3.3, 3.5.4.1, 3.5.4.2,
3.5.5.7
mlongdiv 3.1.3.2, 3.1.9.5, 3.3.9.2, 3.5, 3.6, 3.6.2, 3.6.2.1, 3.6.2.2, 3.6.3.1, 3.6.3.2, 3.6.4.2, 3.6.5.1,
3.6.5.2, 3.6.7.2, F.3
mmultiscripts 3.1.3.2, 3.1.9.3, 3.2.5.7, 3.4.7, 3.4.7.1, 3.4.7.2, 3.4.7.3, 3.5.5.6
mn 2.1.7, 3.1.5.2, 3.1.7.1, 3.1.9.1, 3.2, 3.2.1.2, 3.2.4, 3.2.4.1, 3.2.4.2, 3.2.4.4, 3.5.5.4, 3.5.5.6, 3.6.4.1,
4.2.1.1, 5.3.1, 6.4.3
mo 2.1.7, 3.1.4, 3.1.5.2, 3.1.6, 3.1.7.1, 3.1.7.3, 3.1.8.2, 3.1.9.1, 3.2, 3.2.1.2, 3.2.4.1, 3.2.5, 3.2.5.1,
3.2.5.2, 3.2.5.4, 3.2.5.5, 3.2.5.6, 3.2.5.7, 3.2.5.8, 3.2.6.1, 3.2.6.4, 3.2.7.2, 3.2.7.4, 3.2.8.1,
3.3.1.1, 3.3.1.3, 3.3.2.2, 3.3.4.1, 3.3.7.3, 3.3.8.1, 3.3.8.2, 3.4.4.1, 3.4.4.2, 3.4.5.1, 3.4.5.2,
3.4.6.1, 6.4.3, 7.6, 7.7.1.1, C.1, C.2, F.1, F.2
mode 4.4.8.5
moment 4.3.3.2, 4.3.3.3, 4.4.8.6
I.1. MathML Elements 399
mode 2.2.2
movablelimits 2.1.5.4, 3.1.6, 3.2.5.2, 3.4.4.1, 3.4.5.1, 3.4.6.1
msgroup 3.6.8.3
mslinethickness 3.6.7.2
name 5.1.2, 5.2.2.2, 5.2.3.2, F.3
nargs 4.5.1
newline 3.2.7.2
notation 3.3.9.1, 3.3.9.2
numalign 3.3.2.2
number 2.1.5.1
occurrence 4.5.1
open 3.3.8.2
order 4.4.5.2
other 2.1.6, 2.3.3
overflow 2.2.1, 3.1.7.1
position 3.6.1.1, 3.6.1.2, 3.6.3.2, 3.6.4.2, 3.6.5.2, 3.6.7.2, 3.6.8.2, 3.6.8.3
rightoverhang 3.6.7.2
role 5.1.2
rowalign 3.2.5.8, 3.3.4.1, 3.5.1.2, 3.5.2.2, 3.5.4.2
rowlines 3.5.1.2
rowspacing 3.5.1.2
rowspan 3.2.5.8, 3.5.1.1, 3.5.4.2, 3.5.5.9
rquote 3.2.8.2
rspace 3.2.5.2, 3.2.5.7, C.3
schemaLocation 6.3.1, A.4.1
scope 4.5.1
scriptlevel 2.1.5.2, 2.2.1, 3.1.6, 3.3.2.1, 3.3.3.1, 3.3.4.1, 3.3.4.2, 3.4, 3.4.1.1, 3.4.2.1, 3.4.3.1, 3.4.4.1,
3.4.4.2, 3.4.5.1, 3.4.5.2, 3.4.6.1, 3.4.6.2, 3.4.7.2, 3.5.1.2, 3.6.5.1, C.3
scriptminsize 3.1.6, 3.3.4.2
scriptsize 3.6.5.2
scriptsizemultiplier 3.1.6, 3.3.4.2, 3.6.5.1, 3.6.5.2
selection 3.7.1.1
separator 3.2.5.1, 3.2.5.2, 3.2.5.4
separators 3.3.8.2
shift 3.6.1.1, 3.6.1.2, 3.6.3.2, 3.6.4.2, 3.6.5.2, 3.6.7.2, 3.6.8.2
side 3.5.1.2, 3.5.3.1, 3.5.3.3
src 3.2.1.2, 3.3.4.1, 4.2.7.1, 5.1.5, 5.2.2.2, 5.2.3.2, 6.3.2, 6.3.3, F.2
stackalign 3.6.1.1, 3.6.1.2, 3.6.3.2, 3.6.4.2, 3.6.5.2, 3.6.7.2
stretchy 3.2.5.2, 3.2.5.8, 3.3.4.1, C.2
style 2.1.6
subscriptshift 3.4.1.2, 3.4.3.2
superscriptshift 3.4.2.2, 3.4.3.2
symmetric 3.2.5.2, 3.2.5.8, F.2
thickmathspace 3.3.4.2
thinmathspace 3.3.4.2
type 4.2.1, 4.2.1.2, 4.2.1.3, 4.2.2, 4.2.2.1, 4.2.2.2, 4.2.2.3, 4.2.3.2, 4.3.3.1, 4.3.4.1, 4.3.4.2, 4.3.4.3, 4.4,
4.4.5.1, 4.4.5.5, 4.4.5.6, 4.4.5.9, 4.4.5.10, 4.4.5.11, 4.4.5.12, 4.4.6.3, 4.4.6.4, 4.5.1, 4.6, F.3
valign 3.2.1.2
verythickmathspace 3.3.4.2
verythinmathspace 3.3.4.2
404 Appendix I. Index (Non-Normative)
veryverythickmathspace 3.3.4.2
veryverythinmathspace 3.3.4.2
voffset 3.3.4.1, 3.3.6.2, 3.3.6.3
width 3.2.1.2, 3.2.7.2, 3.3.4.1, 3.3.6.1, 3.3.6.2, 3.3.6.3, 3.5.1.1, 3.5.1.2, F.2
xlink:href 2.1.6, 6.4.4
xml:lang 2.1.6
xml:space 2.1.7
xmlns 2.1.2, F.2
xref 2.1.6, 4.2.6.2, 5.4.2
xsi:schemaLocation A.4.1