<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="http://www.w3.org/1998/Math/MathML" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<define name="MathExpression" combine="choice">
<ref name="PresentationExpression"/>
</define>
<define name="ImpliedMrow">
<zeroOrMore>
<ref name="MathExpression"/>
</zeroOrMore>
</define>
<define name="TableRowExpression">
<choice>
<ref name="mtr"/>
<ref name="mlabeledtr"/>
</choice>
</define>
<define name="TableCellExpression">
<ref name="mtd"/>
</define>
<define name="MstackExpression">
<choice>
<ref name="MathExpression"/>
<ref name="mscarries"/>
<ref name="msline"/>
<ref name="msrow"/>
<ref name="msgroup"/>
</choice>
</define>
<define name="MsrowExpression">
<choice>
<ref name="MathExpression"/>
<ref name="none"/>
</choice>
</define>
<define name="MultiScriptExpression">
<choice>
<ref name="MathExpression"/>
<ref name="none"/>
</choice>
<choice>
<ref name="MathExpression"/>
<ref name="none"/>
</choice>
</define>
<define name="mpadded-length">
<data type="string">
<param name="pattern">\s*([\+\-]?[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*</param>
</data>
</define>
<define name="linestyle">
<choice>
<value>none</value>
<value>solid</value>
<value>dashed</value>
</choice>
</define>
<define name="verticalalign">
<choice>
<value>top</value>
<value>bottom</value>
<value>center</value>
<value>baseline</value>
<value>axis</value>
</choice>
</define>
<define name="columnalignstyle">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
</choice>
</define>
<define name="notationstyle">
<choice>
<value>longdiv</value>
<value>actuarial</value>
<value>radical</value>
<value>box</value>
<value>roundedbox</value>
<value>circle</value>
<value>left</value>
<value>right</value>
<value>top</value>
<value>bottom</value>
<value>updiagonalstrike</value>
<value>downdiagonalstrike</value>
<value>verticalstrike</value>
<value>horizontalstrike</value>
<value>madruwb</value>
</choice>
</define>
<define name="idref">
<text/>
</define>
<define name="unsigned-integer">
<data type="unsignedLong"/>
</define>
<define name="integer">
<data type="integer"/>
</define>
<define name="number">
<data type="decimal"/>
</define>
<define name="character">
<data type="string">
<param name="pattern">\s*\S\s*</param>
</data>
</define>
<define name="color">
<data type="string">
<param name="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*</param>
</data>
</define>
<define name="group-alignment">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>decimalpoint</value>
</choice>
</define>
<define name="group-alignment-list">
<list>
<oneOrMore>
<ref name="group-alignment"/>
</oneOrMore>
</list>
</define>
<define name="group-alignment-list-list">
<data type="string">
<param name="pattern">(\s*\{\s*(left|center|right|decimalpoint)(\s+(left|center|right|decimalpoint))*\})*\s*</param>
</data>
</define>
<define name="positive-integer">
<data type="positiveInteger"/>
</define>
<define name="TokenExpression">
<choice>
<ref name="mi"/>
<ref name="mn"/>
<ref name="mo"/>
<ref name="mtext"/>
<ref name="mspace"/>
<ref name="ms"/>
</choice>
</define>
<define name="token.content">
<choice>
<ref name="mglyph"/>
<ref name="malignmark"/>
<text/>
</choice>
</define>
<define name="mi">
<element name="mi">
<ref name="mi.attributes"/>
<zeroOrMore>
<ref name="token.content"/>
</zeroOrMore>
</element>
</define>
<define name="mi.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<ref name="TokenAtt"/>
</define>
<define name="mn">
<element name="mn">
<ref name="mn.attributes"/>
<zeroOrMore>
<ref name="token.content"/>
</zeroOrMore>
</element>
</define>
<define name="mn.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<ref name="TokenAtt"/>
</define>
<define name="mo">
<element name="mo">
<ref name="mo.attributes"/>
<zeroOrMore>
<ref name="token.content"/>
</zeroOrMore>
</element>
</define>
<define name="mo.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<ref name="TokenAtt"/>
<optional>
<attribute name="form">
<choice>
<value>prefix</value>
<value>infix</value>
<value>postfix</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="fence">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="separator">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="lspace">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="rspace">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="stretchy">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="symmetric">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="maxsize">
<choice>
<ref name="length"/>
<value>infinity</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="minsize">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="largeop">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="movablelimits">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="accent">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="linebreak">
<choice>
<value>auto</value>
<value>newline</value>
<value>nobreak</value>
<value>goodbreak</value>
<value>badbreak</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="lineleading">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="linebreakstyle">
<choice>
<value>before</value>
<value>after</value>
<value>duplicate</value>
<value>infixlinebreakstyle</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="linebreakmultchar"/>
</optional>
<optional>
<attribute name="indentalign">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>auto</value>
<value>id</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentshift">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="indenttarget">
<ref name="idref"/>
</attribute>
</optional>
<optional>
<attribute name="indentalignfirst">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>auto</value>
<value>id</value>
<value>indentalign</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentshiftfirst">
<choice>
<ref name="length"/>
<value>indentshift</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentalignlast">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>auto</value>
<value>id</value>
<value>indentalign</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentshiftlast">
<choice>
<ref name="length"/>
<value>indentshift</value>
</choice>
</attribute>
</optional>
</define>
<define name="mtext">
<element name="mtext">
<ref name="mtext.attributes"/>
<zeroOrMore>
<ref name="token.content"/>
</zeroOrMore>
</element>
</define>
<define name="mtext.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<ref name="TokenAtt"/>
</define>
<define name="mspace">
<element name="mspace">
<ref name="mspace.attributes"/>
<empty/>
</element>
</define>
<define name="mspace.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<ref name="TokenAtt"/>
<optional>
<attribute name="width">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="height">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="depth">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="linebreak">
<choice>
<value>auto</value>
<value>newline</value>
<value>nobreak</value>
<value>goodbreak</value>
<value>badbreak</value>
<value>indentingnewline</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentalign">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>auto</value>
<value>id</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentshift">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="indenttarget">
<ref name="idref"/>
</attribute>
</optional>
<optional>
<attribute name="indentalignfirst">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>auto</value>
<value>id</value>
<value>indentalign</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentshiftfirst">
<choice>
<ref name="length"/>
<value>indentshift</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentalignlast">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>auto</value>
<value>id</value>
<value>indentalign</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentshiftlast">
<choice>
<ref name="length"/>
<value>indentshift</value>
</choice>
</attribute>
</optional>
</define>
<define name="ms">
<element name="ms">
<ref name="ms.attributes"/>
<zeroOrMore>
<ref name="token.content"/>
</zeroOrMore>
</element>
</define>
<define name="ms.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<ref name="TokenAtt"/>
<optional>
<attribute name="lquote"/>
</optional>
<optional>
<attribute name="rquote"/>
</optional>
</define>
<define name="mglyph">
<element name="mglyph">
<ref name="mglyph.attributes"/>
<ref name="mglyph.deprecatedattributes"/>
<empty/>
</element>
</define>
<define name="mglyph.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="src">
<data type="anyURI"/>
</attribute>
</optional>
<optional>
<attribute name="width">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="height">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="valign">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="alt"/>
</optional>
</define>
<define name="mglyph.deprecatedattributes">
<optional>
<attribute name="index">
<ref name="integer"/>
</attribute>
</optional>
<optional>
<attribute name="mathvariant">
<choice>
<value>normal</value>
<value>bold</value>
<value>italic</value>
<value>bold-italic</value>
<value>double-struck</value>
<value>bold-fraktur</value>
<value>script</value>
<value>bold-script</value>
<value>fraktur</value>
<value>sans-serif</value>
<value>bold-sans-serif</value>
<value>sans-serif-italic</value>
<value>sans-serif-bold-italic</value>
<value>monospace</value>
<value>initial</value>
<value>tailed</value>
<value>looped</value>
<value>stretched</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="mathsize">
<choice>
<value>small</value>
<value>normal</value>
<value>big</value>
<ref name="length"/>
</choice>
</attribute>
</optional>
<ref name="DeprecatedTokenAtt"/>
</define>
<define name="msline">
<element name="msline">
<ref name="msline.attributes"/>
<empty/>
</element>
</define>
<define name="msline.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="position">
<ref name="integer"/>
</attribute>
</optional>
<optional>
<attribute name="length">
<ref name="unsigned-integer"/>
</attribute>
</optional>
<optional>
<attribute name="leftoverhang">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="rightoverhang">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="mslinethickness">
<choice>
<ref name="length"/>
<value>thin</value>
<value>medium</value>
<value>thick</value>
</choice>
</attribute>
</optional>
</define>
<define name="none">
<element name="none">
<ref name="none.attributes"/>
<empty/>
</element>
</define>
<define name="none.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
</define>
<define name="mprescripts">
<element name="mprescripts">
<ref name="mprescripts.attributes"/>
<empty/>
</element>
</define>
<define name="mprescripts.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
</define>
<define name="CommonPresAtt">
<optional>
<attribute name="mathcolor">
<ref name="color"/>
</attribute>
</optional>
<optional>
<attribute name="mathbackground">
<choice>
<ref name="color"/>
<value>transparent</value>
</choice>
</attribute>
</optional>
</define>
<define name="TokenAtt">
<optional>
<attribute name="mathvariant">
<choice>
<value>normal</value>
<value>bold</value>
<value>italic</value>
<value>bold-italic</value>
<value>double-struck</value>
<value>bold-fraktur</value>
<value>script</value>
<value>bold-script</value>
<value>fraktur</value>
<value>sans-serif</value>
<value>bold-sans-serif</value>
<value>sans-serif-italic</value>
<value>sans-serif-bold-italic</value>
<value>monospace</value>
<value>initial</value>
<value>tailed</value>
<value>looped</value>
<value>stretched</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="mathsize">
<choice>
<value>small</value>
<value>normal</value>
<value>big</value>
<ref name="length"/>
</choice>
</attribute>
</optional>
<optional>
<attribute name="dir">
<choice>
<value>ltr</value>
<value>rtl</value>
</choice>
</attribute>
</optional>
<ref name="DeprecatedTokenAtt"/>
</define>
<define name="DeprecatedTokenAtt">
<optional>
<attribute name="fontfamily"/>
</optional>
<optional>
<attribute name="fontweight">
<choice>
<value>normal</value>
<value>bold</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="fontstyle">
<choice>
<value>normal</value>
<value>italic</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="fontsize">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="color">
<ref name="color"/>
</attribute>
</optional>
<optional>
<attribute name="background">
<choice>
<ref name="color"/>
<value>transparent</value>
</choice>
</attribute>
</optional>
</define>
<define name="MalignExpression">
<choice>
<ref name="maligngroup"/>
<ref name="malignmark"/>
</choice>
</define>
<define name="malignmark">
<element name="malignmark">
<ref name="malignmark.attributes"/>
<empty/>
</element>
</define>
<define name="malignmark.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="edge">
<choice>
<value>left</value>
<value>right</value>
</choice>
</attribute>
</optional>
</define>
<define name="maligngroup">
<element name="maligngroup">
<ref name="maligngroup.attributes"/>
<empty/>
</element>
</define>
<define name="maligngroup.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="groupalign">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>decimalpoint</value>
</choice>
</attribute>
</optional>
</define>
<define name="PresentationExpression">
<choice>
<ref name="TokenExpression"/>
<ref name="MalignExpression"/>
<ref name="mrow"/>
<ref name="mfrac"/>
<ref name="msqrt"/>
<ref name="mroot"/>
<ref name="mstyle"/>
<ref name="merror"/>
<ref name="mpadded"/>
<ref name="mphantom"/>
<ref name="mfenced"/>
<ref name="menclose"/>
<ref name="msub"/>
<ref name="msup"/>
<ref name="msubsup"/>
<ref name="munder"/>
<ref name="mover"/>
<ref name="munderover"/>
<ref name="mmultiscripts"/>
<ref name="mtable"/>
<ref name="mstack"/>
<ref name="mlongdiv"/>
<ref name="maction"/>
</choice>
</define>
<define name="mrow">
<element name="mrow">
<ref name="mrow.attributes"/>
<zeroOrMore>
<ref name="MathExpression"/>
</zeroOrMore>
</element>
</define>
<define name="mrow.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="dir">
<choice>
<value>ltr</value>
<value>rtl</value>
</choice>
</attribute>
</optional>
</define>
<define name="mfrac">
<element name="mfrac">
<ref name="mfrac.attributes"/>
<ref name="MathExpression"/>
<ref name="MathExpression"/>
</element>
</define>
<define name="mfrac.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="linethickness">
<choice>
<ref name="length"/>
<value>thin</value>
<value>medium</value>
<value>thick</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="numalign">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="denomalign">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="bevelled">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
</define>
<define name="msqrt">
<element name="msqrt">
<ref name="msqrt.attributes"/>
<ref name="ImpliedMrow"/>
</element>
</define>
<define name="msqrt.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
</define>
<define name="mroot">
<element name="mroot">
<ref name="mroot.attributes"/>
<ref name="MathExpression"/>
<ref name="MathExpression"/>
</element>
</define>
<define name="mroot.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
</define>
<define name="mstyle">
<element name="mstyle">
<ref name="mstyle.attributes"/>
<ref name="ImpliedMrow"/>
</element>
</define>
<define name="mstyle.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<ref name="mstyle.specificattributes"/>
<ref name="mstyle.generalattributes"/>
<ref name="mstyle.deprecatedattributes"/>
</define>
<define name="mstyle.specificattributes">
<optional>
<attribute name="scriptlevel">
<ref name="integer"/>
</attribute>
</optional>
<optional>
<attribute name="displaystyle">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="scriptsizemultiplier">
<ref name="number"/>
</attribute>
</optional>
<optional>
<attribute name="scriptminsize">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="infixlinebreakstyle">
<choice>
<value>before</value>
<value>after</value>
<value>duplicate</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="decimalpoint">
<ref name="character"/>
</attribute>
</optional>
</define>
<define name="mstyle.generalattributes">
<optional>
<attribute name="accent">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="accentunder">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="align">
<choice>
<value>left</value>
<value>right</value>
<value>center</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="alignmentscope">
<list>
<oneOrMore>
<choice>
<value>true</value>
<value>false</value>
</choice>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="bevelled">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="charalign">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="charspacing">
<choice>
<ref name="length"/>
<value>loose</value>
<value>medium</value>
<value>tight</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="close"/>
</optional>
<optional>
<attribute name="columnalign">
<list>
<oneOrMore>
<ref name="columnalignstyle"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="columnlines">
<list>
<oneOrMore>
<ref name="linestyle"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="columnspacing">
<list>
<oneOrMore>
<ref name="length"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="columnspan">
<ref name="positive-integer"/>
</attribute>
</optional>
<optional>
<attribute name="columnwidth">
<list>
<oneOrMore>
<choice>
<value>auto</value>
<ref name="length"/>
<value>fit</value>
</choice>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="crossout">
<list>
<zeroOrMore>
<choice>
<value>none</value>
<value>updiagonalstrike</value>
<value>downdiagonalstrike</value>
<value>verticalstrike</value>
<value>horizontalstrike</value>
</choice>
</zeroOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="denomalign">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="depth">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="dir">
<choice>
<value>ltr</value>
<value>rtl</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="edge">
<choice>
<value>left</value>
<value>right</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="equalcolumns">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="equalrows">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="fence">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="form">
<choice>
<value>prefix</value>
<value>infix</value>
<value>postfix</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="frame">
<ref name="linestyle"/>
</attribute>
</optional>
<optional>
<attribute name="framespacing">
<list>
<ref name="length"/>
<ref name="length"/>
</list>
</attribute>
</optional>
<optional>
<attribute name="groupalign">
<ref name="group-alignment-list-list"/>
</attribute>
</optional>
<optional>
<attribute name="height">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="indentalign">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>auto</value>
<value>id</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentalignfirst">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>auto</value>
<value>id</value>
<value>indentalign</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentalignlast">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>auto</value>
<value>id</value>
<value>indentalign</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentshift">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="indentshiftfirst">
<choice>
<ref name="length"/>
<value>indentshift</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indentshiftlast">
<choice>
<ref name="length"/>
<value>indentshift</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="indenttarget">
<ref name="idref"/>
</attribute>
</optional>
<optional>
<attribute name="largeop">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="leftoverhang">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="length">
<ref name="unsigned-integer"/>
</attribute>
</optional>
<optional>
<attribute name="linebreak">
<choice>
<value>auto</value>
<value>newline</value>
<value>nobreak</value>
<value>goodbreak</value>
<value>badbreak</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="linebreakmultchar"/>
</optional>
<optional>
<attribute name="linebreakstyle">
<choice>
<value>before</value>
<value>after</value>
<value>duplicate</value>
<value>infixlinebreakstyle</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="lineleading">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="linethickness">
<choice>
<ref name="length"/>
<value>thin</value>
<value>medium</value>
<value>thick</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="location">
<choice>
<value>w</value>
<value>nw</value>
<value>n</value>
<value>ne</value>
<value>e</value>
<value>se</value>
<value>s</value>
<value>sw</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="longdivstyle">
<choice>
<value>lefttop</value>
<value>stackedrightright</value>
<value>mediumstackedrightright</value>
<value>shortstackedrightright</value>
<value>righttop</value>
<value>left/\right</value>
<value>left)(right</value>
<value>:right=right</value>
<value>stackedleftleft</value>
<value>stackedleftlinetop</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="lquote"/>
</optional>
<optional>
<attribute name="lspace">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="mathsize">
<choice>
<value>small</value>
<value>normal</value>
<value>big</value>
<ref name="length"/>
</choice>
</attribute>
</optional>
<optional>
<attribute name="mathvariant">
<choice>
<value>normal</value>
<value>bold</value>
<value>italic</value>
<value>bold-italic</value>
<value>double-struck</value>
<value>bold-fraktur</value>
<value>script</value>
<value>bold-script</value>
<value>fraktur</value>
<value>sans-serif</value>
<value>bold-sans-serif</value>
<value>sans-serif-italic</value>
<value>sans-serif-bold-italic</value>
<value>monospace</value>
<value>initial</value>
<value>tailed</value>
<value>looped</value>
<value>stretched</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="maxsize">
<choice>
<ref name="length"/>
<value>infinity</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="minlabelspacing">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="minsize">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="movablelimits">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="mslinethickness">
<choice>
<ref name="length"/>
<value>thin</value>
<value>medium</value>
<value>thick</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="notation"/>
</optional>
<optional>
<attribute name="numalign">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="open"/>
</optional>
<optional>
<attribute name="position">
<ref name="integer"/>
</attribute>
</optional>
<optional>
<attribute name="rightoverhang">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="rowalign">
<list>
<oneOrMore>
<ref name="verticalalign"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="rowlines">
<list>
<oneOrMore>
<ref name="linestyle"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="rowspacing">
<list>
<oneOrMore>
<ref name="length"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="rowspan">
<ref name="positive-integer"/>
</attribute>
</optional>
<optional>
<attribute name="rquote"/>
</optional>
<optional>
<attribute name="rspace">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="selection">
<ref name="positive-integer"/>
</attribute>
</optional>
<optional>
<attribute name="separator">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="separators"/>
</optional>
<optional>
<attribute name="shift">
<ref name="integer"/>
</attribute>
</optional>
<optional>
<attribute name="side">
<choice>
<value>left</value>
<value>right</value>
<value>leftoverlap</value>
<value>rightoverlap</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="stackalign">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>decimalpoint</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="stretchy">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="subscriptshift">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="superscriptshift">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="symmetric">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="valign">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="width">
<ref name="length"/>
</attribute>
</optional>
</define>
<define name="mstyle.deprecatedattributes">
<ref name="DeprecatedTokenAtt"/>
<optional>
<attribute name="veryverythinmathspace">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="verythinmathspace">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="thinmathspace">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="mediummathspace">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="thickmathspace">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="verythickmathspace">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="veryverythickmathspace">
<ref name="length"/>
</attribute>
</optional>
</define>
<define name="math.attributes" combine="interleave">
<ref name="CommonPresAtt"/>
</define>
<define name="math.attributes" combine="interleave">
<ref name="mstyle.specificattributes"/>
</define>
<define name="math.attributes" combine="interleave">
<ref name="mstyle.generalattributes"/>
</define>
<define name="merror">
<element name="merror">
<ref name="merror.attributes"/>
<ref name="ImpliedMrow"/>
</element>
</define>
<define name="merror.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
</define>
<define name="mpadded">
<element name="mpadded">
<ref name="mpadded.attributes"/>
<ref name="ImpliedMrow"/>
</element>
</define>
<define name="mpadded.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="height">
<ref name="mpadded-length"/>
</attribute>
</optional>
<optional>
<attribute name="depth">
<ref name="mpadded-length"/>
</attribute>
</optional>
<optional>
<attribute name="width">
<ref name="mpadded-length"/>
</attribute>
</optional>
<optional>
<attribute name="lspace">
<ref name="mpadded-length"/>
</attribute>
</optional>
<optional>
<attribute name="voffset">
<ref name="mpadded-length"/>
</attribute>
</optional>
</define>
<define name="mphantom">
<element name="mphantom">
<ref name="mphantom.attributes"/>
<ref name="ImpliedMrow"/>
</element>
</define>
<define name="mphantom.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
</define>
<define name="mfenced">
<element name="mfenced">
<ref name="mfenced.attributes"/>
<zeroOrMore>
<ref name="MathExpression"/>
</zeroOrMore>
</element>
</define>
<define name="mfenced.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="open"/>
</optional>
<optional>
<attribute name="close"/>
</optional>
<optional>
<attribute name="separators"/>
</optional>
</define>
<define name="menclose">
<element name="menclose">
<ref name="menclose.attributes"/>
<ref name="ImpliedMrow"/>
</element>
</define>
<define name="menclose.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="notation"/>
</optional>
</define>
<define name="msub">
<element name="msub">
<ref name="msub.attributes"/>
<ref name="MathExpression"/>
<ref name="MathExpression"/>
</element>
</define>
<define name="msub.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="subscriptshift">
<ref name="length"/>
</attribute>
</optional>
</define>
<define name="msup">
<element name="msup">
<ref name="msup.attributes"/>
<ref name="MathExpression"/>
<ref name="MathExpression"/>
</element>
</define>
<define name="msup.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="superscriptshift">
<ref name="length"/>
</attribute>
</optional>
</define>
<define name="msubsup">
<element name="msubsup">
<ref name="msubsup.attributes"/>
<ref name="MathExpression"/>
<ref name="MathExpression"/>
<ref name="MathExpression"/>
</element>
</define>
<define name="msubsup.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="subscriptshift">
<ref name="length"/>
</attribute>
</optional>
<optional>
<attribute name="superscriptshift">
<ref name="length"/>
</attribute>
</optional>
</define>
<define name="munder">
<element name="munder">
<ref name="munder.attributes"/>
<ref name="MathExpression"/>
<ref name="MathExpression"/>
</element>
</define>
<define name="munder.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="accentunder">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="align">
<choice>
<value>left</value>
<value>right</value>
<value>center</value>
</choice>
</attribute>
</optional>
</define>
<define name="mover">
<element name="mover">
<ref name="mover.attributes"/>
<ref name="MathExpression"/>
<ref name="MathExpression"/>
</element>
</define>
<define name="mover.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="accent">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="align">
<choice>
<value>left</value>
<value>right</value>
<value>center</value>
</choice>
</attribute>
</optional>
</define>
<define name="munderover">
<element name="munderover">
<ref name="munderover.attributes"/>
<ref name="MathExpression"/>
<ref name="MathExpression"/>
<ref name="MathExpression"/>
</element>
</define>
<define name="munderover.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="accent">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="accentunder">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="align">
<choice>
<value>left</value>
<value>right</value>
<value>center</value>
</choice>
</attribute>
</optional>
</define>
<define name="mmultiscripts">
<element name="mmultiscripts">
<ref name="mmultiscripts.attributes"/>
<ref name="MathExpression"/>
<zeroOrMore>
<ref name="MultiScriptExpression"/>
</zeroOrMore>
<optional>
<ref name="mprescripts"/>
<zeroOrMore>
<ref name="MultiScriptExpression"/>
</zeroOrMore>
</optional>
</element>
</define>
<define name="mmultiscripts.attributes">
<ref name="msubsup.attributes"/>
</define>
<define name="mtable">
<element name="mtable">
<ref name="mtable.attributes"/>
<zeroOrMore>
<ref name="TableRowExpression"/>
</zeroOrMore>
</element>
</define>
<define name="mtable.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="align">
<data type="string">
<param name="pattern">\s*(top|bottom|center|baseline|axis)(\s+-?[0-9]+)?\s*</param>
</data>
</attribute>
</optional>
<optional>
<attribute name="rowalign">
<list>
<oneOrMore>
<ref name="verticalalign"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="columnalign">
<list>
<oneOrMore>
<ref name="columnalignstyle"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="groupalign">
<ref name="group-alignment-list-list"/>
</attribute>
</optional>
<optional>
<attribute name="alignmentscope">
<list>
<oneOrMore>
<choice>
<value>true</value>
<value>false</value>
</choice>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="columnwidth">
<list>
<oneOrMore>
<choice>
<value>auto</value>
<ref name="length"/>
<value>fit</value>
</choice>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="width">
<choice>
<value>auto</value>
<ref name="length"/>
</choice>
</attribute>
</optional>
<optional>
<attribute name="rowspacing">
<list>
<oneOrMore>
<ref name="length"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="columnspacing">
<list>
<oneOrMore>
<ref name="length"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="rowlines">
<list>
<oneOrMore>
<ref name="linestyle"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="columnlines">
<list>
<oneOrMore>
<ref name="linestyle"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="frame">
<ref name="linestyle"/>
</attribute>
</optional>
<optional>
<attribute name="framespacing">
<list>
<ref name="length"/>
<ref name="length"/>
</list>
</attribute>
</optional>
<optional>
<attribute name="equalrows">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="equalcolumns">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="displaystyle">
<choice>
<value>true</value>
<value>false</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="side">
<choice>
<value>left</value>
<value>right</value>
<value>leftoverlap</value>
<value>rightoverlap</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="minlabelspacing">
<ref name="length"/>
</attribute>
</optional>
</define>
<define name="mlabeledtr">
<element name="mlabeledtr">
<ref name="mlabeledtr.attributes"/>
<oneOrMore>
<ref name="TableCellExpression"/>
</oneOrMore>
</element>
</define>
<define name="mlabeledtr.attributes">
<ref name="mtr.attributes"/>
</define>
<define name="mtr">
<element name="mtr">
<ref name="mtr.attributes"/>
<zeroOrMore>
<ref name="TableCellExpression"/>
</zeroOrMore>
</element>
</define>
<define name="mtr.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="rowalign">
<choice>
<value>top</value>
<value>bottom</value>
<value>center</value>
<value>baseline</value>
<value>axis</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="columnalign">
<list>
<oneOrMore>
<ref name="columnalignstyle"/>
</oneOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="groupalign">
<ref name="group-alignment-list-list"/>
</attribute>
</optional>
</define>
<define name="mtd">
<element name="mtd">
<ref name="mtd.attributes"/>
<ref name="ImpliedMrow"/>
</element>
</define>
<define name="mtd.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="rowspan">
<ref name="positive-integer"/>
</attribute>
</optional>
<optional>
<attribute name="columnspan">
<ref name="positive-integer"/>
</attribute>
</optional>
<optional>
<attribute name="rowalign">
<choice>
<value>top</value>
<value>bottom</value>
<value>center</value>
<value>baseline</value>
<value>axis</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="columnalign">
<ref name="columnalignstyle"/>
</attribute>
</optional>
<optional>
<attribute name="groupalign">
<ref name="group-alignment-list"/>
</attribute>
</optional>
</define>
<define name="mstack">
<element name="mstack">
<ref name="mstack.attributes"/>
<zeroOrMore>
<ref name="MstackExpression"/>
</zeroOrMore>
</element>
</define>
<define name="mstack.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="align">
<data type="string">
<param name="pattern">\s*(top|bottom|center|baseline|axis)(\s+-?[0-9]+)?\s*</param>
</data>
</attribute>
</optional>
<optional>
<attribute name="stackalign">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
<value>decimalpoint</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="charalign">
<choice>
<value>left</value>
<value>center</value>
<value>right</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="charspacing">
<choice>
<ref name="length"/>
<value>loose</value>
<value>medium</value>
<value>tight</value>
</choice>
</attribute>
</optional>
</define>
<define name="mlongdiv">
<element name="mlongdiv">
<ref name="mlongdiv.attributes"/>
<ref name="MstackExpression"/>
<ref name="MstackExpression"/>
<oneOrMore>
<ref name="MstackExpression"/>
</oneOrMore>
</element>
</define>
<define name="mlongdiv.attributes">
<ref name="msgroup.attributes"/>
<optional>
<attribute name="longdivstyle">
<choice>
<value>lefttop</value>
<value>stackedrightright</value>
<value>mediumstackedrightright</value>
<value>shortstackedrightright</value>
<value>righttop</value>
<value>left/\right</value>
<value>left)(right</value>
<value>:right=right</value>
<value>stackedleftleft</value>
<value>stackedleftlinetop</value>
</choice>
</attribute>
</optional>
</define>
<define name="msgroup">
<element name="msgroup">
<ref name="msgroup.attributes"/>
<zeroOrMore>
<ref name="MstackExpression"/>
</zeroOrMore>
</element>
</define>
<define name="msgroup.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="position">
<ref name="integer"/>
</attribute>
</optional>
<optional>
<attribute name="shift">
<ref name="integer"/>
</attribute>
</optional>
</define>
<define name="msrow">
<element name="msrow">
<ref name="msrow.attributes"/>
<zeroOrMore>
<ref name="MsrowExpression"/>
</zeroOrMore>
</element>
</define>
<define name="msrow.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="position">
<ref name="integer"/>
</attribute>
</optional>
</define>
<define name="mscarries">
<element name="mscarries">
<ref name="mscarries.attributes"/>
<zeroOrMore>
<choice>
<ref name="MsrowExpression"/>
<ref name="mscarry"/>
</choice>
</zeroOrMore>
</element>
</define>
<define name="mscarries.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="position">
<ref name="integer"/>
</attribute>
</optional>
<optional>
<attribute name="location">
<choice>
<value>w</value>
<value>nw</value>
<value>n</value>
<value>ne</value>
<value>e</value>
<value>se</value>
<value>s</value>
<value>sw</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="crossout">
<list>
<zeroOrMore>
<choice>
<value>none</value>
<value>updiagonalstrike</value>
<value>downdiagonalstrike</value>
<value>verticalstrike</value>
<value>horizontalstrike</value>
</choice>
</zeroOrMore>
</list>
</attribute>
</optional>
<optional>
<attribute name="scriptsizemultiplier">
<ref name="number"/>
</attribute>
</optional>
</define>
<define name="mscarry">
<element name="mscarry">
<ref name="mscarry.attributes"/>
<zeroOrMore>
<ref name="MsrowExpression"/>
</zeroOrMore>
</element>
</define>
<define name="mscarry.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<optional>
<attribute name="location">
<choice>
<value>w</value>
<value>nw</value>
<value>n</value>
<value>ne</value>
<value>e</value>
<value>se</value>
<value>s</value>
<value>sw</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="crossout">
<list>
<zeroOrMore>
<choice>
<value>none</value>
<value>updiagonalstrike</value>
<value>downdiagonalstrike</value>
<value>verticalstrike</value>
<value>horizontalstrike</value>
</choice>
</zeroOrMore>
</list>
</attribute>
</optional>
</define>
<define name="maction">
<element name="maction">
<ref name="maction.attributes"/>
<oneOrMore>
<ref name="MathExpression"/>
</oneOrMore>
</element>
</define>
<define name="maction.attributes">
<ref name="CommonAtt"/>
<ref name="CommonPresAtt"/>
<attribute name="actiontype"/>
<optional>
<attribute name="selection">
<ref name="positive-integer"/>
</attribute>
</optional>
</define>
</grammar>