﻿<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="math.css"?>
<?xml-stylesheet type="text/css" href="minx.css"?>
<!DOCTYPE article PUBLIC "-//RMI//DTD XML MAIDEN 2.1//EN" "http://xml-maiden.com/21/article.dtd" [<!ATTLIST a xmlns CDATA "http://www.w3.org/1999/xhtml">]>
<article xmlns="http://xml-maiden.com">
<title>Mathematics in XML MAIDEN 2.1</title>
<author>George Chavchanidze</author>
<affiliation>Department of Theoretical Physics, A. Razmadze Institute of Mathematics, 	1 Aleksidze Street, Ge 0193 Tbilisi, Georgia</affiliation>
<abstract>
XML MAIDEN is science oriented, XML based markup language, 
designed to simplify authoring, interchange and delivery of 
short mathematical manuscripts (articles, letters, notes). 
XML MAIDEN aims to capture general structure of scientific 
articles (front matter, headers, sections, statements, paragraphs, 
references etc) and basic structure of mathematical formulae in the way 
suitable for further formatting with Cascading Style Sheets (2.1 or later).
The present document describes mathematical part of XML MAIDEN 2.1
markup. It briefly explains role of basic elements used to encode 
mathematical formulae in XML MAIDEN 2.1
</abstract>
<keywords>Mathematical Markup Language, XML, CSS</keywords>
<date>22 June 2006 (revised on 31 August 2006)</date>

<header xml:id="introduction">Introduction</header>

<paragraph>
First SGML based mathematical markup languages emerged in 1988-1994 years and were mainly used by scientific publishers. 
Due to complexity of SGML and lack of good SGML/DSSSL tools these markup languages were not really popular among
individual authors.  Later SGML and DSSSL were replaced with more simple and much more widespread 
<a href="http://www.w3.org/TR/REC-xml/" title="eXtensible Markup Language">XML</a> and 
<a href="http://www.w3.org/TR/CSS21/" title="Cascading Style Sheets">CSS</a>,
that were implemented in many browsers, CSS formatters and authoring tools. However transition from SGML/DSSSL to
XML/CSS appeared to be lethal for existing mathematical DTDs. 
One problem came from style language. DSSSL with special set of properties  intended to format 
mathematical formulae was replaced with more simple Cascading Style Sheets that had no math oriented extensions at all. 
Another problem came from meta markup. SGML that allowed users to omit redundant tags and to cut down verbosity 
of markup languages in this way, was replaced with more simple and strict eXtensible Markup Language that did not admit optional elements 
and optional end tags. To address issue W3C decided to develop new XML based mathematical markup language 
and to add special math module to CSS3. Unfortunately from the very beginning working group responsible for development 
of mathematical markup ignored technical restrictions coming from XML/CSS and produced markup which turned out to be completely 
unsuitable for usage in XML/CSS publishing framework. Later CSS unfriendly design of mathematical markup played crucial role in failure of 
CSS3 math module, work on which was nearly abandoned as working group failed to merge existing markup into XML/CSS model.
</paragraph>
<paragraph>
As a result need in new markup language, that would fit well in the scope of CSS2.1 visual formatting model and thus 
would be suitable for rendering of mathematical formulae in wide range of web browsers and CSS formatters, emerged and was 
partly addressed by designing XML MAIDEN markup (XML Manuscript Authoring, Interchange and Delivery Environment). 
Scope of XML MAIDEN is roughly aligned with the scopes of ISO 12083 and AAP mathematical DTDs, but unlike these DTDs
it admits universal CSS style sheet that makes markup suitable for rendering in browsers and formatters that support CSS2.1 or later.
Universal CSS2.1 style sheets can handle arbitrary complex math formulae obtained by combining and nesting of subscripts, 
superscripts, prescripts, under and over scripts, fractions, operators, matrices, vectors, determinants, cases, fences, radicals and 
other mathematical expressions. Apart of XML/CSS framework which XML MAIDEN markup was designed to be used in,
one can use XML MAIDEN in less widespread XML/XSL and XML/DSSSL publishing models.
</paragraph>

<header xml:id="entities">Content Model</header>

<paragraph>
In XML MAIDEN most of the mathematical elements with mixed content model may carry 
<key xml:id="inline-math">inline mathematical content</key> that may be sequence of character data and one of the following 
elements: <a href="#apply" role="keyword">apply</a>, <a href="#bold" role="keyword">bold</a>, 
<a href="#cases" role="keyword">cases</a>, <a href="#det" role="keyword">det</a>, <a href="#fence" role="keyword">fence</a>, <a href="#fenced" role="keyword">fenced</a>, <a href="#float" role="keyword">float</a>, 
<a href="#fraction" role="keyword">fraction</a>, <a href="#group" role="keyword">group</a>, <a href="#inf" role="keyword">inf</a>, <a href="#italic" role="keyword">italic</a>, <a href="#matrix" role="keyword">matrix</a>, 
<a href="#ope" role="keyword">ope</a>, <a href="#opgroup" role="keyword">opgroup</a>, <a href="#over" role="keyword">over</a>, <a href="#overline" role="keyword">overline</a>, <a href="#radical" role="keyword">radical</a>, 
<a href="#sqrt" role="keyword">sqrt</a>, <a href="#strike" role="keyword">strike</a>, <a href="#sub" role="keyword">sub</a>, <a href="#sup" role="keyword">sup</a>, <a href="#sur" role="keyword">sur</a>, <a href="#under" role="keyword">under</a>, 
<a href="#underline" role="keyword">underline</a>, <a href="#vector" role="keyword">vector</a>. In addition to inline mathematical content <a href="#formula" role="keyword">formula</a>
element may contain line breaks (elements <a href="#line" role="keyword">line</a> and <a href="#wrap" role="keyword">wrap</a>) and <a href="#subformula" role="keyword">subformula</a> elements.
Content model of each element is specified below. The following entities are used in DTD:
<code language="xml"><![CDATA[<!ENTITY % innermath "(#PCDATA | apply | bold | cases | det | fence | fenced | float | 
fraction | group | inf | italic | matrix | ope | opgroup | over | overline | 
radical | sqrt | strike | sub | sup | sur | under | underline | vector)*">
<!ENTITY % blockmath "(#PCDATA | apply | bold | cases | det | fence | fenced | float | 
fraction | group | inf | italic | line | matrix | ope | opgroup | over | overline | 
radical | sqrt | strike | sub | subformula | sup | sur | under | underline | vector | wrap)*">
]]></code>

</paragraph>

<header xml:id="containers">Mathematical Formulae</header>

<paragraph>
XML MAIDEN 2.1 reserves four elements used to mark inline-equations, displayed 
equations, equation arrays and subformulae. These are <a href="#math" role="keyword">math</a>, <a href="#formula" role="keyword">formula</a>,
<a href="#formulae" role="keyword">formulae</a> and <a href="#subformula" role="keyword">subformula</a> elements. In addition there is general purpose inline container
used to group mathematical expressions.
</paragraph>
<definition keywords="math element" xml:id="math"><key>math</key> element is primary container that encloses inline mathematical 
expressions (those formulae that are part of normal text flow).
Aural equivalent of mathematical expression may be specified via <key>pronounce</key> attribute.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ATTLIST math pronounce CDATA #IMPLIED>
<!ELEMENT math %innermath;>]]></code>
</definition>
<example of="math">
<code language="xml-maiden"><![CDATA[Dirac's construction provides an explicit local expression for the traverse Poisson 
structure of a Poisson manifold <math>(M, W)</math> at any of its points.]]></code>
<subparagraph role="formatted example">
Dirac's construction provides an explicit local expression for the traverse Poisson 
structure of a Poisson manifold <math>(M, W)</math> at any of its points
</subparagraph>
</example>

<definition keywords="formula element" xml:id="formula"><key>formula</key> element is basic block level container 
that marks displayed equations (block level formulae). 
Large formulae may be broken into several block level parts using <a href="#subformula" role="keyword">subformula</a> element. 
Multiple related formulae may be grouped using <a href="#formulae" role="keyword">formulae</a> element. 
Aural equivalent of mathematical expression may be specified via <key>pronounce</key> attribute.
In addition to <a href="#inline-math" role="keyword">inline mathematical content</a> element may contain
may contain line breaks (elements <a href="#line" role="keyword">line</a> and <a href="#wrap" role="keyword">wrap</a>) and <a href="#subformula" role="keyword">subformula</a> elements.
<code language="xml"><![CDATA[<!ATTLIST formula pronounce CDATA #IMPLIED>
<!ELEMENT formula %blockmath;>]]></code>
</definition>
<example of="formula">
<code language="xml-maiden"><![CDATA[Any function <math>F</math> commuting with Hamiltonian
<formula>{F, H} = 0</formula> is first integral of Hamiltonian system.]]></code>
<subparagraph role="formatted example">
Any function <math>F</math> commuting with Hamiltonian <formula>{F, H} = 0</formula> is first integral 
of Hamiltonian system.</subparagraph>
</example>

<definition keywords="formulae element" xml:id="formulae"><key>formulae</key> element 
is used to group several related formulae (for example equations in system of equations).
Element may contain two or more <a href="#formula" role="keyword">formula</a> elements.
<code language="xml"><![CDATA[<!ELEMENT formulae (formula, formula+)>]]></code>
</definition>
<example of="formulae">
<code language="xml-maiden"><![CDATA[Being linear operation, 
Poisson bracket satisfied properties
<formulae>
<formula>{F, G + H} = {F, G} + {F, H}</formula>
<formula>{F, GH} = {F, G}H + {F, H}G</formula>
</formulae>]]></code>
<subparagraph role="formatted example">
Being linear operation, 
Poisson bracket satisfied properties
<formulae>
<formula>{F, G + H} = {F, G} + {F, H}</formula>
<formula>{F, GH} = {F, G}H + {F, H}G</formula>
</formulae></subparagraph>
</example>

<definition keywords="subformula element" xml:id="subformula"><key>subformula</key> element 
may be used to break large formulae  into several block level parts.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT subformula %innermath;>]]></code>
</definition>
<example of="subformula">
<code language="xml-maiden"><![CDATA[<formula>
<subformula>{F, (G + H)S} = {F, GS} + {F, HS}</subformula>
<subformula>= {F, G}S + {F, H}S + (G + H){F, S}</subformula>
</formula>
]]></code>
<subparagraph role="formatted example">
<formula>
<subformula>{F, (G + H)S} = {F, GS} + {F, HS}</subformula>
<subformula>= {F, G}S + {F, H}S + (G + H){F, S}</subformula>
</formula>
</subparagraph>
</example>

<definition keywords="group element" xml:id="group"><key>group</key> element is general purpose inline container 
that may be used to group expressions. Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT group %innermath;>]]></code>
</definition>

<header xml:id="indices">Subscripts and superscripts</header>

<paragraph>
In XML MAIDEN 2.1 the elements <a href="#sup" role="keyword">sup</a> and <a href="#sub" role="keyword">sub</a> are used to mark
subscripts and superscripts respectively. They may be nested and
combined to produce complex indices. Note that indices produced via
<a href="#sub" role="keyword">sub</a> and <a href="#sup" role="keyword">sup</a> elements are applied to preceding Unicode character (if any).
Otherwise base is undefined, in particular note that <a href="#sup" role="keyword">sup</a> and <a href="#sub" role="keyword">sub</a>
elements do not apply to fences (element <a href="#fence" role="keyword">fence</a>), matrices
(elements <a href="#matrix" role="keyword">matrix</a>, <a href="#determinant" role="keyword">determinant</a> and <a href="#vector" role="keyword">vector</a>) and operators (element <a href="#ope" role="keyword">ope</a>). 
In XML MAIDEN 2.1 matrix, fence indices (markers) and operator limits are considered to be 
intrinsic part of matrix, fence and operator constructions, extra elements are
reserved for this purpose (operator, fence, matrix and vector markers).
</paragraph>
<paragraph>
When positioning indices (elements <a href="#sup" role="keyword">sup</a>, <a href="#sub" role="keyword">sub</a>), XML MAIDEN 2.1 implementations may 
base vertical-alignment offsets on font-size value, 
like it is done in case of XHTML subscripts, superscripts (elements <a href="#sup" role="keyword">sup</a>, <a href="#sub" role="keyword">sub</a>) 
and CSS vertical-align:super, sub property values, while markers (elements <a href="#marker" role="keyword">marker</a>, <a href="#submarker" role="keyword">submarker</a>) 
should be positioned with respect to base that they are applied to.
</paragraph>
<example of="sub sup">
<code language="xml-maiden"><![CDATA[<formula>ax<sup>2</sup> + bx + c = 0</formula>
<formula>u<sub>t</sub> = u<sub>xxx</sub> + uu<sub>x</sub></formula>]]></code>
<subparagraph role="formatted example">
<formula>ax<sup>2</sup> + bx + c = 0</formula>
<formula>u<sub>t</sub> = u<sub>xxx</sub> + uu<sub>x</sub></formula>
</subparagraph>
</example>
<paragraph>
Indices may be nested, combined and may carry complex mathematical expressions
like fractions, operators etc. When subscript and superscript are combined
they may be formatted in three different ways.
<list>
<item>Subscript may precede superscript</item>
<item>Subscript may succeed superscript</item>
<item>Subscript and superscript may be stacked (floated to common base)</item>
</list>
The difference between these three cases is not purely presentational
and in certain cases position of indices may change meaning
of mathematical expression therefore XML MAIDEN 2.1 distinguishes
these cases as follows:
<list>
<item><shell role="xml-maiden code"><![CDATA[A<sub>X</sub><sup>Y</sup>]]></shell> is treated as:
<formula>
A<sub>X</sub><sup>Y</sup>
</formula>
</item>
<item><shell role="xml-maiden code"><![CDATA[A<sup>Y</sup><sub>X</sub>]]></shell> is handled as:
<formula>
A<sup>Y</sup><sub>X</sub>
</formula>
</item>
<item><shell role="xml-maiden code"><![CDATA[A<float><sup>Y</sup><sub>X</sub></float>]]></shell> is formatted like:
<formula>
A<float><sup>Y</sup><sub>X</sub></float>
</formula>
</item>
</list>
Note that <a href="#float" role="keyword">float</a> element is used to stack indices.
</paragraph>
<definition keywords="sub element" xml:id="sub"><key>sub</key> element is used to mark subscripts in XML MAIDEN.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT sub %innermath;>]]></code>
</definition>
<definition keywords="sup element" xml:id="sup"><key>sup</key> element is used to mark superscripts in XML MAIDEN.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT sup %innermath;>]]></code>
</definition>
<definition keywords="float element" xml:id="float"><key>float</key> element is used to group stacked indices.
Element may have one of the following content models:
<list>
<item><a href="#sup" role="keyword">sup</a> element followed by <a href="#sub" role="keyword">sub</a> element</item>
<item><a href="#sur" role="keyword">sur</a> element followed by <a href="#inf" role="keyword">inf</a> element</item>
</list>
<code language="xml"><![CDATA[<!ELEMENT float ((sup,sub)|(sur,inf))>]]></code>
</definition>

<definition keywords="submarker element" xml:id="submarker"><key>submarker</key> element is used to mark subscripts that
are associated with operators (lower limits), fences (fence markers), matrices (matrix markers) or vectors (vector markers).
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT submarker %innermath;>]]></code>
</definition>
<definition keywords="marker element" xml:id="marker"><key>marker</key> element is used to mark superscripts that
are associated with operators (upper limits), fences (fence markers), matrices (matrix markers) or vectors (vector markers).
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT marker %innermath;>]]></code>
</definition>
<definition keywords="markers element" xml:id="markers"><key>markers</key> element is used to group markers.
Element may contain <a href="#marker" role="keyword">marker</a> element followed by <a href="#submarker" role="keyword">submarker</a> element
<code language="xml"><![CDATA[<!ELEMENT markers (marker, submarker)>]]></code>
</definition>

<header xml:id="prescripts">Prescripts</header>

<paragraph>
The elements <a href="#inf" role="keyword">inf</a> (inferior) and <a href="#sur" role="keyword">sur</a> (superior) are similar 
to <a href="#sub" role="keyword">sub</a> and <a href="#sup" role="keyword">sup</a> but are used to mark prescripts (sub and 
superscripts that precede their base). They may be nested and
combined to produce complex prescripts. Note that prescripts 
produced via <a href="#inf" role="keyword">inf</a> and <a href="#sur" role="keyword">sur</a> elements are applied to succeeding 
Unicode character (if any). Otherwise base is undefined.
</paragraph>
<example of="sur inf">
<code language="xml-maiden"><![CDATA[<formula>
<inf>13</inf>Al<sup>27</sup> + <inf>2</inf>He<sup>4</sup> 
= <inf>15</inf>P<sup>30</sup> + n
</formula>]]></code>
<subparagraph role="formatted example">
<formula>
<inf>13</inf>Al<sup>27</sup> + <inf>2</inf>He<sup>4</sup> 
= <inf>15</inf>P<sup>30</sup> + n
</formula>
</subparagraph>
</example>

<paragraph>
When inferior and superior are combined
they may be formatted in three different ways. 
XML MAIDEN 2.1 treats combined prescripts as follows:
<list>
<item><shell role="xml-maiden code"><![CDATA[<sur>Y</sur><inf>X</inf>A]]></shell> is treated as:
<formula>
<sur>Y</sur><inf>X</inf>A
</formula>
</item>
<item><shell role="xml-maiden code"><![CDATA[<inf>X</inf><sur>Y</sur>A]]></shell> is handled as:
<formula>
<inf>X</inf><sur>Y</sur>A
</formula>
</item>
<item><shell role="xml-maiden code"><![CDATA[<float><sur>Y</sur><inf>X</inf></float>A]]></shell> is formatted like:
<formula>
<float><sur>Y</sur><inf>X</inf></float>A
</formula>
</item>
</list>
<a href="#float" role="keyword">float</a> element is used to stack indices.
</paragraph>
<definition keywords="inf element" xml:id="inf"><key>inf</key> element is used to mark subscripts that precede their base.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT inf %innermath;>]]></code>
</definition>
<definition keywords="sur element" xml:id="sur"><key>sur</key> element is used to mark superscripts that precede their base.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT sur %innermath;>]]></code>
</definition>

<header xml:id="fractions">Fractions</header>

<paragraph>
Markup for fractions resembles that used in ISO 12083.
</paragraph>

<example of="fraction num den">
<code language="xml-maiden"><![CDATA[<formula>
<fraction>
<num>tanh(x) + tanh(y)</num>
<den>1 + tanh(x)tanh(y)</den>
</fraction>
</formula>]]></code>
<subparagraph role="formatted example">
<formula>
<fraction>
<num>tanh(x) + tanh(y)</num>
<den>1 + tanh(x)tanh(y)</den>
</fraction>
</formula>
</subparagraph>
</example>

<definition keywords="fraction element" xml:id="fraction"><key>fraction</key> element is used to mark fractions.
Element must contain <a href="#num" role="keyword">num</a> element followed by <a href="#den" role="keyword">den</a> element.
<code language="xml"><![CDATA[<!ELEMENT fraction (num, den)>]]></code>
</definition>
<definition keywords="num element" xml:id="num"><key>num</key> element is used to mark numerator of fraction.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT num %innermath;>]]></code>
</definition>
<definition keywords="num element" xml:id="den"><key>den</key> element is used to mark denominator of fraction.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT den %innermath;>]]></code>
</definition>

<header xml:id="sattelites">Under scripts and over scripts</header>

<paragraph>
XML MAIDEN 2.1 uses element <a href="#ker" role="keyword">ker</a> to mark base (kernel) of over
or under scripted expression. Element <a href="#sat" role="keyword">sat</a> is used for under and 
over scripts (satellites), while <a href="#over" role="keyword">over</a> and <a href="#under" role="keyword">under</a> elements are used to compose over
or under scripted expressions by combining arbitrary number of over script or
under scripts with base. Note that <a href="#over" role="keyword">over</a> expression
is not expected to produce diacritical marks/accents. See 
<a href="#accents">accents</a> section below.
</paragraph>

<example of="under over ker sat">
<code language="xml-maiden"><![CDATA[<formula>
<over>
<sat>over script</sat>
<ker>BASE</ker>
</over>

<under>
<over>
<sat>over script</sat>
<ker>BASE</ker>
</over>
<sat>under script</sat>
</under>

<under>
<ker>BASE</ker>
<sat>under script</sat>
</under>

<under>
<over>
<sat>over script</sat>
<ker>BASE</ker>
</over>
<sat>under script-1</sat>
<sat>under script-2</sat>
</under>
</formula>]]></code>
<subparagraph role="formatted example">
<formula>
<over>
<sat>over script</sat>
<ker>BASE</ker>
</over>

<under>
<over>
<sat>over script</sat>
<ker>BASE</ker>
</over>
<sat>under script</sat>
</under>

<under>
<ker>BASE</ker>
<sat>under script</sat>
</under>

<under>
<over>
<sat>over script</sat>
<ker>BASE</ker>
</over>
<sat>under script-1</sat>
<sat>under script-2</sat>
</under>
</formula>
</subparagraph>
</example>

<definition keywords="over element" xml:id="over"><key>over</key> element is used to mark expression with over scripts and/or over braces.
Element may have one of the following content models:
<list>
<item>one or more <a href="#sat" role="keyword">sat</a> elements followed by optional <a href="#overbrace" role="keyword">overbrace</a> 
element and followed by one of the elements from the following list: <a href="#ker" role="keyword">ker</a>, <a href="#ope" role="keyword">ope</a>, <a href="#under" role="keyword">under</a></item>
<item><a href="#overbrace" role="keyword">overbrace</a>  element followed by zero or more <a href="#sat" role="keyword">sat</a> elements and followed by one of the elements from the following list: 
<a href="#ker" role="keyword">ker</a>, <a href="#ope" role="keyword">ope</a>, <a href="#under" role="keyword">under</a></item>
</list>

<code language="xml"><![CDATA[<!ELEMENT over (((overbrace, sat*)|(sat+, overbrace?)),(ker|ope|under))>]]></code>
</definition>

<definition keywords="under element" xml:id="under"><key>under</key> elements are used to mark expression with under scripts and/or under braces.
Element may have one of the following content models:
<list>
<item>One of the elements from the following list: <a href="#ker" role="keyword">ker</a>, <a href="#ope" role="keyword">ope</a>, 
<a href="#over" role="keyword">over</a>, followed by <a href="#underbrace" role="keyword">underbrace</a>
and followed by zero or more <a href="#sat" role="keyword">sat</a> elements</item>
<item>One of the elements from the following list: <a href="#ker" role="keyword">ker</a>, <a href="#ope" role="keyword">ope</a>, 
<a href="#over" role="keyword">over</a>, followed by one or more <a href="#sat" role="keyword">sat</a> elements
and followed by optional <a href="#underbrace" role="keyword">underbrace</a> element</item>
</list>
<code language="xml"><![CDATA[<!ELEMENT under ((ker|ope|over),((underbrace, sat*)|(sat+, underbrace?)))>]]></code>
</definition>

<definition keywords="ker element" xml:id="ker"><key>ker</key> element is used to mark base of under and/or over scripted expression.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT ker %innermath;>]]></code>
</definition>
<definition keywords="sat element" xml:id="sat"><key>sat</key> element is used to mark under and over scripts.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT sat %innermath;>]]></code>
</definition>

<paragraph>
Under and over scripted expressions may involve under and 
over braces that outline expression which scripts apply to.
Such expressions are produced using empty elements <a href="#underbrace" role="keyword">underbrace</a> and <a href="#overbrace" role="keyword">overbrace</a>
</paragraph>

<definition keywords="overbrace element" xml:id="overbrace"><key>overbrace</key> element represents over braces.
Element is empty.
<code language="xml"><![CDATA[<!ELEMENT overbrace EMPTY>]]></code>
</definition>

<definition keywords="underbrace element" xml:id="underbrace"><key>underbrace</key> element represents under braces.
Element is empty.
<code language="xml"><![CDATA[<!ELEMENT underbrace EMPTY>]]></code>
</definition>

<example of="overbrace underbrace">
<code language="xml-maiden"><![CDATA[<formula>
<over>
<sat>k times</sat>
<overbrace/>
<ker>(m, m, ... , m)</ker>
</over>

<under>
<ker>(m, m, ... , m)</ker>
<underbrace/>
<sat>k times</sat>
</under>
</formula>]]></code>
<subparagraph role="formatted example">
<formula>
<over>
<sat>k times</sat>
<overbrace/>
<ker>(m, m, ... , m)</ker>
</over>

<under>
<ker>(m, m, ... , m)</ker>
<underbrace/>
<sat>k times</sat>
</under></formula>
</subparagraph>
</example>

<header xml:id="operators">Operators</header>

<paragraph>
Element <a href="#ope" role="keyword">ope</a> marks mathematical operators such as sum, product,
unification, intersection, integral etc. 	In case if operator is accompanied by over script and/or under scripts one may
use <a href="#over" role="keyword">over</a> and <a href="#under" role="keyword">under</a> elements to associate over/under scripts with operator
</paragraph>

<example of="ope under over">
<code language="xml-maiden"><![CDATA[<formula>
A =
<under>
<over>
<sat>n</sat>
<ope>U</ope>
</over>
<sat>s = 1</sat>
</under>
A<sup>(s)</sup>
</formula>

<formula>
A =
<under>
<ope>U</ope>
<sat>s</sat>
</under>
A<sup>(s)</sup>
</formula>]]></code>
<subparagraph role="formatted example">
<formula>
A =
<under>
<over>
<sat>n</sat>
<ope>U</ope>
</over>
<sat>s = 1</sat>
</under>
A<sup>(s)</sup>
</formula>

<formula>
A =
<under>
<ope>U</ope>
<sat>s</sat>
</under>
A<sup>(s)</sup>
</formula></subparagraph>
</example>

<paragraph>
Instead of under and over scripts one may associate markers that are
positioned near top and bottom edges of operator's core. 
Element 'opgroup' is reserved for this purpose</paragraph>

<example of="ope opgroup">
<code language="xml-maiden"><![CDATA[<formula>
A =
<opgroup>
<ope>U</ope>
<markers>
<marker>n</marker>
<submarker>s = 1</submarker>
</markers>
</opgroup>
A<sup>(s)</sup>
</formula>

<formula>
A =
<opgroup>
<ope>U</ope>
<submarker>s</submarker>
</opgroup>
A<sup>(s)</sup>
</formula>]]></code>
<subparagraph role="formatted example">
<formula>
A =
<opgroup>
<ope>U</ope>
<markers>
<marker>n</marker>
<submarker>s = 1</submarker>
</markers>
</opgroup>
A<sup>(s)</sup>
</formula>

<formula>
A =
<opgroup>
<ope>U</ope>
<submarker>s</submarker>
</opgroup>
A<sup>(s)</sup>
</formula>
</subparagraph>
</example>

<definition keywords="opgroup element" xml:id="opgroup"><key>opgroup</key> element is used to associate markers (limits) with operators.
Element may have one of the following content models:
<list>
<item><a href="#ope" role="keyword">ope</a> element followed by <a href="#marker" role="keyword">marker</a> element</item>
<item><a href="#ope" role="keyword">ope</a> element followed by <a href="#submarker" role="keyword">submarker</a> element</item>
<item><a href="#ope" role="keyword">ope</a> element followed by <a href="#markers" role="keyword">markers</a> element</item>
</list>
<code language="xml"><![CDATA[<!ELEMENT opgroup (ope, (marker | markers | submarker))>]]></code>
</definition>

<definition keywords="ope element" xml:id="ope"><key>ope</key> element is used to mark resizable operators like  integrals and 
N-ary mathematical operators. Element may contain one or more characters representing mathematical operator.
<code language="xml"><![CDATA[<!ELEMENT ope (#PCDATA)>]]></code>
</definition>

<header xml:id="matrices">Matrices, vectors and determinants</header>

<paragraph>
To represent matrices, vectors and determinants, XML MAIDEN 2.1 uses elements
<a href="#matrix" role="keyword">matrix</a>, <a href="#vector" role="keyword">vector</a>, <a href="#det" role="keyword">det</a> (determinant), 
<a href="#row" role="keyword">row</a>, <a href="#cell" role="keyword">cell</a>  and <a href="#entry" role="keyword">entry</a>.
Matrices and determinants are structured row by row, they should
contain at least two rows and should be at least two column wide
</paragraph>

<example of="matrix row cell">
<code language="xml-maiden"><![CDATA[<formula>
M =
<matrix>
<row><cell>A</cell><cell>B</cell></row>
<row><cell>C</cell><cell>D</cell></row>
</matrix>
</formula>]]></code>
<subparagraph role="formatted example">
<formula>
M =
<matrix>
<row><cell>A</cell><cell>B</cell></row>
<row><cell>C</cell><cell>D</cell></row>
</matrix>
</formula></subparagraph>
</example>

<paragraph>
In determinants number of row must be equal to number of columns.
</paragraph>

<example of="det row cell">
<code language="xml-maiden"><![CDATA[<formula>
det(M) =
<det>
<row><cell>A</cell><cell>B</cell></row>
<row><cell>C</cell><cell>D</cell></row>
</det>
= AD - BC
</formula>
]]></code>
<subparagraph role="formatted example"><formula>
det(M) =
<det>
<row><cell>A</cell><cell>B</cell></row>
<row><cell>C</cell><cell>D</cell></row>
</det>
= AD - BC
</formula></subparagraph>
</example>

<paragraph>
Vectors should contain at least two entries.
</paragraph>

<example of="vector entry">
<code language="xml-maiden"><![CDATA[<formula>
V =
<vector>
<entry>X</entry>
<entry>Y</entry>
</vector>
</formula>
]]></code>
<subparagraph role="formatted example"><formula>
V =
<vector>
<entry>X</entry>
<entry>Y</entry>
</vector>
</formula></subparagraph>
</example>

<paragraph>
Element <a href="#apply" role="keyword">apply</a> may be used to associate either marker or submarker with matrix or vector. 
Matrix (or vector) marker (submarker) is placed near top (bottom) of right fence that encloses matrix (vector). 
</paragraph>

<example of="matrix marker apply">
<code language="xml-maiden"><![CDATA[<formula>
M<sup>T</sup> =
<apply>
<matrix>
<row><cell>A</cell><cell>B</cell></row>
<row><cell>C</cell><cell>D</cell></row>
</matrix>
<marker>T</marker>
</apply>
</formula>
]]></code>
<subparagraph role="formatted example"><formula>
M<sup>T</sup> =
<apply>
<matrix>
<row><cell>A</cell><cell>B</cell></row>
<row><cell>C</cell><cell>D</cell></row>
</matrix>
<marker>T</marker>
</apply>
</formula></subparagraph>
</example>

<definition keywords="matrix element" xml:id="matrix"><key>matrix</key> element represents matrices. 
 Element should contain two or more <a href="#row" role="keyword">row</a> elements.
<code language="xml"><![CDATA[<!ELEMENT matrix (row, row+)>]]></code>
</definition>
<definition keywords="det element" xml:id="det"><key>det</key> element represents determinants. 
 Element should contain two or more <a href="#row" role="keyword">row</a> elements.
<code language="xml"><![CDATA[<!ELEMENT det (row, row+)>]]></code>
</definition>
<definition keywords="vector element" xml:id="vector"><key>vectors</key> element represents vectors. 
 Element should contain two or more <a href="#entry" role="keyword">entry</a> elements.
<code language="xml"><![CDATA[<!ELEMENT vector (entry, entry+)>]]></code>
</definition>
<definition keywords="row element" xml:id="row"><key>row</key> element marks row in matrices 
and determinants. Element should contain two or more <a href="#cell" role="keyword">cell</a> elements.
<code language="xml"><![CDATA[<!ELEMENT row (cell, cell+)>]]></code>
</definition>

<definition keywords="cell element" xml:id="cell"><key>cell</key> element marks individual cells (entries)
in matrices and determinants.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT cell %innermath;>]]></code>
</definition>

<definition keywords="entry element" xml:id="entry"><key>entry</key> element marks individual entries (components) in vectors.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT entry %innermath;>]]></code>
</definition>

<definition keywords="apply element" xml:id="apply"><key>apply</key> element is used to associate markers with matrices and vectors.
Element may have one of the following content models:
<list>
<item><a href="#matrix" role="keyword">matrix</a> element followed by <a href="#marker" role="keyword">marker</a> element</item>
<item><a href="#matrix" role="keyword">matrix</a> element followed by <a href="#submarker" role="keyword">submarker</a> element</item>
<item><a href="#vector" role="keyword">vector</a> element followed by <a href="#marker" role="keyword">marker</a> element</item>
<item><a href="#vector" role="keyword">vector</a> element followed by <a href="#submarker" role="keyword">submarker</a> element</item>
</list>
<code language="xml"><![CDATA[<!ELEMENT apply ((matrix | vector),(marker | submarker))>]]></code>
</definition>

<header xml:id="piecewise">Cases</header>

<paragraph>
In case when expression has different values under different conditions, 
one may use <a href="#cases" role="keyword">cases</a> construction. For each case <a href="#value" role="keyword">value</a> element specifies value of
expression, while element <a href="#scope" role="keyword">scope</a> specifies condition under which the value is valid.
</paragraph>

<example of="cases case scope value">
<code language="xml-maiden"><![CDATA[<formula>
F(x) =
<cases>
<case><value>x<sup>3</sup></value><scope>if x > 0</scope></case>
<case><value>x<sup>2</sup></value><scope>otherwise</scope></case>
</cases>
</formula>]]></code>
<subparagraph role="formatted example"><formula>
F(x) =
<cases>
<case><value>x<sup>3</sup></value><scope>if x > 0</scope></case>
<case><value>x<sup>2</sup></value><scope>otherwise</scope></case>
</cases>
</formula>
</subparagraph>
</example>

<definition keywords="cases element" xml:id="cases"><key>cases</key> element marks set of possible 
values of certain expression. Element should contain two or more <a href="#case" role="keyword">case</a> elements.
<code language="xml"><![CDATA[<!ELEMENT cases (case, case+)>]]></code>
</definition>
<definition keywords="case element" xml:id="case"><key>case</key> element marks individual values
from the set of possible values of expression. Element should contain <a href="#value" role="keyword">value</a> element followed by
<a href="#scope" role="keyword">scope</a> element.
<code language="xml"><![CDATA[<!ELEMENT case (value, scope)>]]></code>
</definition>

<definition keywords="value element" xml:id="value"><key>value</key> element marks one of the values of 
expression, value is valid in domain specified by following sibling <a href="#scope" role="keyword">scope</a> element.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT value %innermath;>]]></code>
</definition>

<definition keywords="scope element" xml:id="scope"><key>scope</key> element marks domain in which, 
value specified by preceding sibling <a href="#value" role="keyword">value</a> element is valid.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT scope %innermath;>]]></code>
</definition>

<header xml:id="fences">Fences</header>

<paragraph>
Element <a href="#fence" role="keyword">fence</a> is used to produce large brackets and fences.
Type of fence is specified via attributes <key>left</key> and <key>right</key>.
Fence markers are produced via <a href="#marker" role="keyword">marker</a>, <a href="#markers" role="keyword">markers</a> and <a href="#submarker" role="keyword">submarker</a> elements.
In XML MAIDEN fence marker is expression aligned near the top (or bottom) of right
fence. To attach markers to base fence <a href="#fenced" role="keyword">fenced</a> element is used. 
The <a href="#marker" role="keyword">marker</a> element carries top-right marker. 
</paragraph>

<example of="fence fenced marker">
<code language="xml-maiden"><![CDATA[<formula>
<fenced>
<fence>
EXPRESSION IN SQUARE BRACKETS
</fence>
<marker>TOP MARKER</marker>
</fenced>
</formula>]]></code>
<subparagraph role="formatted example"><formula>
<fenced>
<fence>
EXPRESSION IN SQUARE BRACKETS
</fence>
<marker>TOP MARKER</marker>
</fenced>
</formula>
</subparagraph>
</example>
<paragraph>
The <a href="#submarker" role="keyword">submarker</a> produces bottom-right marker. 
</paragraph>
<example of="fence fenced submarker">
<code language="xml-maiden"><![CDATA[<formula>
<fenced>
<fence left="double" right="double">
EXPRESSION IN DOUBLE BARS
</fence>
<submarker>BOTTOM MARKER</submarker>
</fenced>
</formula>
]]></code>
<subparagraph role="formatted example"><formula>
<fenced>
<fence left="double" right="double">
EXPRESSION IN DOUBLE BARS
</fence>
<submarker>BOTTOM MARKER</submarker>
</fenced>
</formula>
</subparagraph>
</example>
<paragraph>
The <a href="#markers" role="keyword">markers</a> element produces right markers. 
</paragraph>
<example of="fence fenced marker submarker">
<code language="xml-maiden"><![CDATA[    
<formula>
<fenced>
<fence left="none" right="solid">
EXPRESSION WITH RIGHT RULER
</fence>
<markers>
<marker>TOP MARKER</marker>
<submarker>BOTTOM MARKER</submarker>
</markers>
</fenced>
</formula>]]></code>
<subparagraph role="formatted example">
<formula>
<fenced>
<fence left="none" right="solid">
EXPRESSION WITH RIGHT RULER
</fence>
<markers>
<marker>TOP MARKER</marker>
<submarker>BOTTOM MARKER</submarker>
</markers>
</fenced>
</formula>
</subparagraph>
</example>
<definition keywords="fence element" xml:id="fence"><key>fence</key> element encloses its content in large brackets or fences.
Element has attributes <key>left</key> and <key>right</key>.
Attribute <key>left</key> may have values <key>none</key>, <key>curly</key>,  <key>dashed</key>, <key>double</key>
<key>round</key>, <key>solid</key> and <key>square</key> with <key>square</key> being default value.
Attribute <key>right</key> may have values <key>curly</key>,  <key>dashed</key>, <key>double</key>
<key>round</key>, <key>solid</key> and <key>square</key> where <key>square</key> is default value.
Value <key>none</key> indicates that fence should be omitted, 
<key>curly</key> produces large brace {curly bracket}, <key>round</key> marks large 
parenthesis (round bracket), <key>square</key> is used for large bracket [square bracket],
<key>dashed</key> produces large dashed bar, <key>solid</key> is used for large single bar fence
like |absolute value| and <key>double</key> for large double bar fence like ||norm||
Current list of fence types is not comprehensive and may be extended 
in future versions of XML MAIDEN. 
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ATTLIST fence left (none | curly | dashed | double | round | solid | square) "square" 
right (curly | dashed | double | round | solid | square) "square">
<!ELEMENT fence %innermath;>]]></code>
</definition>

<definition keywords="fenced element" xml:id="fenced"><key>fenced</key> element is used to associate markers with fences.
Element may have one of the following content models:
<list>
<item><a href="#fence" role="keyword">fence</a> element followed by <a href="#marker" role="keyword">marker</a> element</item>
<item><a href="#fence" role="keyword">fence</a> element followed by <a href="#submarker" role="keyword">submarker</a> element</item>
<item><a href="#fence" role="keyword">fence</a> element followed by <a href="#markers" role="keyword">markers</a> element</item>
</list>
<code language="xml"><![CDATA[<!ELEMENT fenced (fence, (marker | markers | submarker))>]]></code>
</definition>

<header xml:id="radicals">Radicals</header>

<paragraph>
Markup for radicals resembles that used in ISO 12083.
</paragraph>

<example of="radical radix radicand">
<code language="xml-maiden"><![CDATA[<formula>
<radical><radix>3</radix><radicand>x<sup>3</sup> + y<sup>3</sup> + z<sup>3</sup></radicand></radical>
</formula>]]></code>
<subparagraph role="formatted example">
<formula>
<radical><radix>3</radix><radicand>x<sup>3</sup> + y<sup>3</sup> + z<sup>3</sup></radicand></radical>
</formula>
</subparagraph>
</example>
<paragraph>
For square roots there is separate element.
</paragraph>
<example of="sqrt">
<code language="xml-maiden"><![CDATA[<formula>
<sqrt>b<sup>2</sup> - 4ac</sqrt>
</formula>]]></code>
<subparagraph role="formatted example">
<formula>
<sqrt>b<sup>2</sup> - 4ac</sqrt>
</formula>
</subparagraph>
</example>

<definition keywords="radical element" xml:id="radical"><key>radical</key> element marks radicals.
Element must contain <a href="#radix" role="keyword">radix</a> element followed by <a href="#radicand" role="keyword">radicand</a> element.
<code language="xml"><![CDATA[<!ELEMENT radical (radix, radicand)>]]></code>
</definition>
<definition keywords="radix element" xml:id="radix"><key>radix</key> element is used to mark radical index and is placed before the radical sign.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT radix %innermath;>]]></code>
</definition>
<definition keywords="radicand element" xml:id="radicand"><key>radicand</key> element is used to mark radical content and is placed under the radical sign.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT radicand %innermath;>]]></code>
</definition>
<definition keywords="sqrt element" xml:id="sqrt"><key>sqrt</key> element is used to mark square roots.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT sqrt %innermath;>]]></code>
</definition>

<header xml:id="bolditalic">Bold and Italic</header>

<paragraph>
Elements <a href="#bold" role="keyword">bold</a> and <a href="#italic" role="keyword">italic</a> are used to produce bold and italic expressions. 
In mathematical formulae bold and italic are sometimes applied 
to individual glyphs that may denote some variables, vectors etc.
Note however that in such cases Unicode consortium 
recommends to use bold, bold italic and italic math alphanumeric symbols
located in Unicode Plane 1:
<list>
<item>Latin bold math characters (&amp;#x1D400;-&amp;#x1D433;)</item>
<item>Latin bold italic math characters (&amp;#x1D468;-&amp;#x1D49B;)</item>
<item>Latin italic math characters (&amp;#x1D434;-&amp;#x1D467;)</item>
<item>Greek bold math characters (&amp;#x1D6A8;-&amp;#x1D6E1;)</item>
<item>Greek bold italic math characters (&amp;#x1D71C;-&amp;#x1D755;)</item>
<item>Greek italic math characters (&amp;#x1D6E2;-&amp;#x1D71B;)</item>
<item>Bold face numbers (&amp;#x1D7CE;-&amp;#x1D7D7;)</item>
</list>
Set of math alphanumeric symbols located in Unicode Plane 1
is specially shaped and kerned for usage in mathematical formulae, as
letters that represent mathematical variables are slightly slanted 
and look smoother then ordinary Latin/Greek glyphs, while kerning of characters 
used in mathematical expressions differs from kerning in Latin/Greek text.
</paragraph>
<definition keywords="bold element" xml:id="bold"><key>bold</key> element produces bold text.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT bold %innermath;>]]></code>
</definition>
<definition keywords="italic element" xml:id="italic"><key>italic</key> element produces italic text.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT italic %innermath;>]]></code>
</definition>

<header xml:id="underoverlines">Under, over lines and strike</header>

<paragraph>
Elements <a href="#overline" role="keyword">overline</a> and <a href="#underline" role="keyword">underline</a> are reserved for over and underlined 
expressions. In case if one needs to apply under or over bars to individual glyphs it is better to use precomposed 
Unicode characters or combining diacritical marks.
</paragraph>
<definition keywords="underline element" xml:id="underline"><key>underline</key> element produces underlined math expression.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT underline %innermath;>]]></code>
</definition>
<definition keywords="overline element" xml:id="overline"><key>overline</key> element produces overlined math expression.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT overline %innermath;>]]></code>
</definition>
<paragraph>
Element 'strike' generates line through. In the same time it may 
be used to mark cancelled or deleted terms. 
Note that element does not produce new glyphs like h-bar 
(appropriate Unicode characters should be used instead).
</paragraph>
<definition keywords="strike element" xml:id="strike"><key>strike</key> element produces math expression with line through.
Element carries <a href="#inline-math" role="keyword">inline mathematical content</a>.
<code language="xml"><![CDATA[<!ELEMENT strike %innermath;>]]></code>
</definition>

<header xml:id="breaks">Line breaks</header>

<paragraph>
Automated line breaks inside mathematical expressions are usually
prohibited. However line breaks can be specified manually using 
empty element <a href="#line" role="keyword">line</a> that generates line break, or <a href="#wrap" role="keyword">wrap</a> element that marks
place (wrap point) where line breaks may be generated by browser 
(depending on page width browser may decide whether to use this opportunity).
</paragraph>
<example of="wrap">
<code language="xml-maiden"><![CDATA[<formula>
{F, (G + H)S} = {F, GS} + {F, HS}<wrap/> 
= {F, G}S + {F, H}S + (G + H){F, S}
</formula>]]></code>
<subparagraph role="formatted example">
Depending on available width example may be formatted as
<formula>
{F, (G + H)S} = {F, GS} + {F, HS} 
= {F, G}S + {F, H}S + (G + H){F, S}
</formula>
or
<formula>
{F, (G + H)S} = {F, GS} + {F, HS}<line/> 
= {F, G}S + {F, H}S + (G + H){F, S}
</formula>
</subparagraph>
</example>

<definition keywords="line element" xml:id="line"><key>line</key> element produces line feed. Element is empty.
<code language="xml"><![CDATA[<!ELEMENT line EMPTY>]]></code>
</definition>
<definition keywords="wrap element" xml:id="wrap"><key>wrap</key> element marks places (wrap points) where line breaks are allowed. Element is empty.
<code language="xml"><![CDATA[<!ELEMENT wrap EMPTY>]]></code>
</definition>


<header xml:id="attributes">Core attributes</header>

<paragraph>
Core attributes are shared by most of XML MAIDEN 2.1 elements. 
There are three core attributes: <key>xml:id</key>, <key>token</key> and <key>role</key>.
</paragraph>

<definition keywords="xml:id attribute" xml:id="id"><key>xml:id</key>  is ID type attribute used to assign unique identifier to element. 
In XML MAIDEN 2.1 <key>xml:id</key> attribute may be applied to any element 
excluding empty elements <a href="#line" role="keyword">line</a> and <a href="#wrap" role="keyword">wrap</a>.
</definition>
<definition keywords="token attribute" xml:id="token"><key>token</key>  is general purpose attribute, it can be used to enrich document 
structure by grouping/dividing elements into classes. 	Its value is of NMTOKEN type. Attribute may be applied to any XML MAIDEN element.
</definition>
<definition keywords="role attribute" xml:id="role"><key>role</key>  attribute is used to enrich document structure with semantics,
and may specify semantical role of the given element.
In XML MAIDEN 2.1 <key>role</key> attribute may be applied to any element 	excluding empty elements <a href="#line" role="keyword">line</a> and <a href="#wrap" role="keyword">wrap</a>.
</definition>

<header xml:id="accents">Accents</header>

<paragraph>
XML MAIDEN 2.1 provides no markup for diacritical marks (accents like over dots, 
hats, tildes, caps) as rendering of diacritical marks is governed by Unicode standard 
(via combining diacritical marks and precomposed glyphs). Unicode based solution is 
preferable as it is more universal (may be used in many XML based markup languages 
and even plain Unicode text), does not put extra burden on style sheets, admits more 
accurate positioning of accents based on font metrics and allows multiple diacritical marks
per character. In the same time, note that Unicode standard in its current form does not provide
mechanism for stretching diacritical marks to enclose several characters (there are 
some for pairs, however). See also document <a href="http://www.unicode.org/reports/tr25/">Unicode Support for Mathematics</a>
issued by Unicode consortium</paragraph>


<header xml:id="dtd">XML MAIDEN 2.1 Math DTD</header>

<paragraph>
XML MAIDEN 2.1 Math DTD specifies allowed nesting of XML MAIDEN 2.1 math oriented elements, 
allowed attributes and attribute value types.
DTD may be used for validation or error tracking purposes. It is not required to attach DTD to each XML MAIDEN document
explicitly. In absence of DTD,  XML MAIDEN 2.1 markup may be identified by namespace.

<code language="xml"><![CDATA[
<!ENTITY % attr "role CDATA #IMPLIED token NMTOKEN #IMPLIED xml:id ID #IMPLIED">

<!ATTLIST apply %attr;>
<!ATTLIST bold %attr;>
<!ATTLIST case %attr;>
<!ATTLIST cases %attr;>
<!ATTLIST cell %attr;>
<!ATTLIST den %attr;>
<!ATTLIST det %attr;>
<!ATTLIST entry %attr;>
<!ATTLIST fence %attr; left (none | curly | dashed | double | round | solid | square) "square" 
right (curly | dashed | double | round | solid | square) "square">
<!ATTLIST fenced %attr;>
<!ATTLIST float %attr;>
<!ATTLIST formula %attr; pronounce CDATA #IMPLIED>
<!ATTLIST formulae %attr;>
<!ATTLIST fraction %attr;>
<!ATTLIST group %attr;>
<!ATTLIST inf %attr;>
<!ATTLIST italic %attr;>
<!ATTLIST ker %attr;>
<!ATTLIST line token NMTOKEN #IMPLIED>
<!ATTLIST marker %attr;>
<!ATTLIST markers %attr;>
<!ATTLIST math %attr; pronounce CDATA #IMPLIED>
<!ATTLIST matrix %attr;>
<!ATTLIST num %attr;>
<!ATTLIST ope %attr;>
<!ATTLIST opgroup %attr;>
<!ATTLIST over %attr;>
<!ATTLIST overbrace %attr;>
<!ATTLIST overline %attr;>
<!ATTLIST row %attr;>
<!ATTLIST radical %attr;>
<!ATTLIST radicand %attr;>
<!ATTLIST radix %attr;>
<!ATTLIST sat %attr;>
<!ATTLIST scope %attr;>
<!ATTLIST sqrt %attr;>
<!ATTLIST strike %attr;>
<!ATTLIST sub %attr;>
<!ATTLIST subformula %attr;>
<!ATTLIST submarker %attr;>
<!ATTLIST sup %attr;>
<!ATTLIST sur %attr;>
<!ATTLIST under %attr;>
<!ATTLIST underbrace %attr;>
<!ATTLIST underline %attr;>
<!ATTLIST value %attr;>
<!ATTLIST vector %attr;>
<!ATTLIST wrap token NMTOKEN #IMPLIED>

<!ENTITY % innermath "(#PCDATA | apply | bold | cases | det | fence | fenced | float | 
fraction | group | inf | italic | matrix | ope | opgroup | over | overline | 
radical | sqrt | strike | sub | sup | sur | under | underline | vector)*">
<!ENTITY % blockmath "(#PCDATA | apply | bold | cases | det | fence | fenced | float | 
fraction | group | inf | italic | line | matrix | ope | opgroup | over | overline | 
radical | sqrt | strike | sub | subformula | sup | sur | under | underline | vector | wrap)*">

<!ELEMENT apply ((matrix | vector),(marker | submarker))>
<!ELEMENT bold %innermath;>
<!ELEMENT case (value, scope)>
<!ELEMENT cases (case, case+)>
<!ELEMENT cell %innermath;>
<!ELEMENT den %innermath;>
<!ELEMENT det (row, row+)>
<!ELEMENT entry %innermath;>
<!ELEMENT fence %innermath;>
<!ELEMENT fenced (fence, (marker | markers | submarker))>
<!ELEMENT float ((sup, sub) | (sur, inf))>
<!ELEMENT formula %blockmath;>
<!ELEMENT formulae (formula, formula+)>
<!ELEMENT fraction (num, den)>
<!ELEMENT group %innermath;>
<!ELEMENT inf %innermath;>
<!ELEMENT italic %innermath;>
<!ELEMENT ker %innermath;>
<!ELEMENT line EMPTY>
<!ELEMENT marker %innermath;>
<!ELEMENT markers (marker, submarker)>
<!ELEMENT math %innermath;>
<!ELEMENT matrix (row, row+)>
<!ELEMENT num %innermath;>
<!ELEMENT ope (#PCDATA)>
<!ELEMENT opgroup (ope, (marker | markers | submarker))>
<!ELEMENT over (((overbrace, sat*)|(sat+, overbrace?)),(ker|ope|under))>
<!ELEMENT overbrace EMPTY>
<!ELEMENT overline %innermath;>
<!ELEMENT row (cell, cell+)>
<!ELEMENT radical (radix, radicand)>
<!ELEMENT radicand %innermath;>
<!ELEMENT radix %innermath;>
<!ELEMENT sat %innermath;>
<!ELEMENT scope %innermath;>
<!ELEMENT sqrt %innermath;>
<!ELEMENT strike %innermath;>
<!ELEMENT sub %innermath;>
<!ELEMENT subformula %innermath;>
<!ELEMENT submarker %innermath;>
<!ELEMENT sup %innermath;>
<!ELEMENT sur %innermath;>
<!ELEMENT under ((ker|ope|over),((underbrace, sat*)|(sat+, underbrace?)))>
<!ELEMENT underbrace EMPTY>
<!ELEMENT underline %innermath;>
<!ELEMENT value %innermath;>
<!ELEMENT vector (entry, entry+)>
<!ELEMENT wrap EMPTY>
]]></code>
</paragraph>

<header xml:id="namespace">XML MAIDEN namespace</header>

<paragraph>
XML MAIDEN 2.0 and 2.1 math elements belong to <name>http://xml-maiden.com</name> namespace. 
Most of XML MAIDEN math attributes are not bound 
to <a href="http://www.w3.org/TR/REC-xml-names/" title="Namespaces in XML">namespaces</a>, exception is 
<a href="http://www.w3.org/TR/xml-id/" role="keyword">xml:id</a>
attribute which is bound to <name>http://www.w3.org/XML/1998/</name>
</paragraph>

<header xml:id="uaconformance">User Agent Conformance</header>

<paragraph>
XML MAIDEN does not impose any specific UA conformance requirements
apart of those defined by host environment (like XML/CSS, XML/XSL, XML/DSSSL).
</paragraph>

<header xml:id="docconformance">Document Conformance</header>

<paragraph>
For basic conformance of math formulae to XML MAIDEN 2.1 Math DTD, 
XML MAIDEN elements should be bound to <name>http://xml-maiden.com</name> namespace,
while each of normalized XML subtrees, obtained from subtrees spanned by XML MAIDEN <a href="#math" role="keyword">math</a>, <a href="#formula" role="keyword">formula</a> or
<a href="#formulae" role="keyword">formulae</a> elements, by stripping element namespace prefixes and corresponding namespace declarations (if any), should
validate against XML MAIDEN 2.1 Math DTD. <a href="http://xml-maiden.com/#doctypes">Attaching DTD</a> to the XML document explicitly is not required.
Note that formatting of XML MAIDEN documents is governed by style sheets, therefore 
<a href="http://www.w3.org/TR/xml-stylesheet/" title="Associating Style Sheets with XML documents">associating appropriate
style sheet(s)</a> with XML document is crucial for proper rendering of math formulae.
</paragraph>

<references xml:id="refs">
<cite xml:id="unicode"><who>B. Beeton et al.</who><what><a href="http://www.unicode.org/reports/tr25/">Unicode support for mathematics</a></what><when>2003</when></cite>
<cite xml:id="css"><who>B. Bos et al.</who><what><a href="http://www.w3.org/TR/CSS21/">Cascading Style Sheets, level 2 revision 1</a></what><when>2006</when></cite>
<cite xml:id="rec-xml"><who>T. Bray et al.</who><what><a href="http://www.w3.org/TR/REC-xml/">Extensible Markup Language (XML) 1.0</a></what><when>2004</when></cite>
<cite xml:id="rec-xmlns"><who>T. Bray et al.</who><what><a href="http://www.w3.org/TR/REC-xml-names/">Namespaces in XML</a></what><when>1999</when></cite>
<cite xml:id="rec-xml-stylesheet"><who>J. Clark</who><what><a href="http://www.w3.org/TR/xml-stylesheet/">Associating Style Sheets with XML documents</a></what><when>1999</when></cite>
<cite xml:id="rec-xml-id"><who>J. Marsh et al.</who><what><a href="http://www.w3.org/TR/xml-id/">xml:id Version 1.0</a></what><when>2005</when></cite>
</references>
</article>