<?xml version="1.0" encoding="ISO-8859-1"?>
<article version="5.0" xmlns="http://docbook.org/ns/docbook">
  <info>
    <title>MathML Presentation Markup for the Impatient</title>

    <author>
      <personname><firstname>Hussein</firstname><surname>Shafie</surname></personname>

      <affiliation>
        <orgname>XMLmind Software</orgname>
      </affiliation>
    </author>

    <pubdate>October 18, 2025</pubdate>

    <legalnotice>
      <para>This article is published under the <link
      xlink:href="http://creativecommons.org/licenses/by-sa/3.0/"
      xmlns:xlink="http://www.w3.org/1999/xlink">Creative Commons
      "Attribution-Share Alike"</link> license.</para>
    </legalnotice>
  </info>

  <para><link xlink:href="http://www.w3.org/TR/MathML2/"
  xmlns:xlink="http://www.w3.org/1999/xlink">MathML</link> comprises two sets
  of elements: <firstterm>Presentation Markup</firstterm>, the XML equivalent
  of <link xlink:href="http://www.tug.org/"
  xmlns:xlink="http://www.w3.org/1999/xlink">TeX</link> math, and
  <firstterm>Content Markup</firstterm>, which may be used to encode the
  mathematical structure of an expression, regardless of the way this
  expression is rendered visually. This short tutorial is exclusively about
  Presentation Markup. After reading it, you should be able to add equations
  to your DocBook, DITA or XHTML documents.</para>

  <section>
    <title>Basic elements</title>

    <para>MathML most basic elements are <tag class="element">mrow</tag>, <tag
    class="element">mi</tag>, <tag class="element">mo</tag> and <tag
    class="element">mn</tag>. Example: <inlineequation>
        <m:math display="inline" xmlns:m="http://www.w3.org/1998/Math/MathML">
          <m:mrow>
            <m:mrow>
              <m:mi>x</m:mi>

              <m:mo>+</m:mo>

              <m:mi>y</m:mi>
            </m:mrow>

            <m:mo>=</m:mo>

            <m:mn>2</m:mn>
          </m:mrow>
        </m:math>
      </inlineequation> is encoded in MathML as:</para>

    <programlisting language="xml">&lt;mrow&gt;
  &lt;mrow&gt;
    &lt;mi&gt;x&lt;/mi&gt;
    &lt;mo&gt;+&lt;/mo&gt;
    &lt;mi&gt;y&lt;/mi&gt;
  &lt;/mrow&gt;
  &lt;mo&gt;=&lt;/mo&gt;
  &lt;mn&gt;2&lt;/mn&gt;
&lt;/mrow&gt;</programlisting>

    <variablelist>
      <varlistentry>
        <term><tag class="element">mrow</tag></term>

        <listitem>
          <para>Use this element to group any number of subexpressions
          horizontally.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">mi</tag></term>

        <listitem>
          <para>Use this element to specify an identifier, that is, the name
          of a variable, a constant, a function, etc.</para>

          <para>If this name is just one character long, the identifier is
          automatically rendered using an italic font, otherwise the name is
          rendered using a normal, upright, font.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">mo</tag></term>

        <listitem>
          <para>Use this element to specify an operator (e.g.
          '<literal>+</literal>'), a fence (e.g. '<literal>{</literal>') or a
          separator (e.g. '<literal>,</literal>').</para>

          <para>The appropriate amount of space is added on the left and on
          the right of an <tag class="element">mo</tag> depending on the
          textual contents of this element. Example: if in the above
          expression you replace <literal>&lt;mo&gt;+&lt;/mo&gt;</literal> by
          <literal>&lt;mo&gt;,&lt;/mo&gt;</literal>, this will suppress the
          space at the left of the <tag class="element">mo</tag>
          element.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">mn</tag></term>

        <listitem>
          <para>Use this element to specify a numeric
          <emphasis>literal</emphasis>.</para>

          <para>For example, PI should be specified as
          <literal>&lt;mi&gt;PI&lt;/mi&gt;</literal> and not as
          <literal>&lt;mn&gt;PI&lt;/mn&gt;</literal> while 3.14 should be
          specified as <literal>&lt;mn&gt;3.14&lt;/mn&gt;</literal> and not as
          <literal>&lt;mi&gt;3.14&lt;/mi&gt;</literal>.</para>
        </listitem>
      </varlistentry>
    </variablelist>

    <important>
      <para>It is really important to use <tag class="element">mi</tag>, <tag
      class="element">mo</tag> and <tag class="element">mn</tag> appropriately
      because otherwise the MathML rendering engine will not be able to apply
      its built-in typographic rules.</para>
    </important>
  </section>

  <section>
    <title>More basic elements</title>

    <section>
      <title>The <tag class="element">math</tag> top-level element</title>

      <para>The above MathML expression cannot be inserted as is in a DocBook,
      DITA or XHTML document because the <tag class="element">mrow</tag>
      element should be enclosed in a <tag class="element">math</tag> element.
      The <tag class="element">math</tag> element is the root of all MathML
      expressions.</para>

      <programlisting language="xml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML"<co
          linkends="ns2" xml:id="ns"/>
      display="inline"&gt;<co linkends="display2" xml:id="display"/>
  &lt;mrow&gt;
    &lt;mrow&gt;
      &lt;mi&gt;x&lt;/mi&gt;
      &lt;mo&gt;+&lt;/mo&gt;
      &lt;mi&gt;y&lt;/mi&gt;
    &lt;/mrow&gt;
    &lt;mo&gt;=&lt;/mo&gt;xml
    &lt;mn&gt;2&lt;/mn&gt;
  &lt;/mrow&gt;
&lt;/math&gt;</programlisting>

      <calloutlist>
        <callout arearefs="ns" xml:id="ns2">
          <para>The namespace of all MathML elements is
          "<literal>http://www.w3.org/1998/Math/MathML</literal>". Specifying
          such namespace is mandatory but it will be omitted in this tutorial
          for brevity.</para>
        </callout>

        <callout arearefs="display" xml:id="display2">
          <para>Note the <literal>display="inline"</literal> attribute which
          specifies that the <tag class="element">math</tag> element is to be
          displayed inline (``like a word in a paragraph''). The other value
          is <literal>display="block"</literal> which specifies that the <tag
          class="element">math</tag> element is to be displayed as a block
          (``like a paragraph''). This attribute has an influence on the
          typographic rules applied by the MathML rendering engine.</para>
        </callout>
      </calloutlist>
    </section>

    <section>
      <title>Plain text</title>

      <para>We have already recommended to be very precise in the use of <tag
      class="element">mi</tag>, <tag class="element">mo</tag> and <tag
      class="element">mn</tag> when tagging some text. But what if you just
      want to type plain text? Here enters the <tag
      class="element">mtext</tag> element, which with <tag
      class="element">mi</tag>, <tag class="element">mo</tag>, <tag
      class="element">mn</tag> and <link linkend="ms"><tag
      class="element">ms</tag></link> are the only MathML elements which may
      contain text. All the other MathML elements (<tag
      class="element">math</tag>, <tag class="element">mrow</tag>, <tag
      class="element">mfrac</tag>, <tag class="element">msqrt</tag>, etc) may
      only contain child elements.</para>

      <para>Example:</para>

      <informalequation>
        <m:math display="block" xmlns:m="http://www.w3.org/1998/Math/MathML">
          <m:mrow>
            <m:mtext>if</m:mtext>

            <m:mspace depth="0.5ex" height="0.5ex" width="1ex"/>

            <m:mrow>
              <m:mi>x</m:mi>

              <m:mo>=</m:mo>

              <m:mi>y</m:mi>
            </m:mrow>

            <m:mspace depth="0.5ex" height="0.5ex" width="1ex"/>

            <m:mtext>then</m:mtext>

            <m:mspace depth="0.5ex" height="0.5ex" width="1ex"/>

            <m:mrow>
              <m:mrow>
                <m:mi>a</m:mi>

                <m:mi>x</m:mi>
              </m:mrow>

              <m:mo>=</m:mo>

              <m:mrow>
                <m:mi>a</m:mi>

                <m:mi>y</m:mi>
              </m:mrow>
            </m:mrow>
          </m:mrow>
        </m:math>
      </informalequation>

      <para>is encoded in MathML as:</para>

      <programlisting language="xml">&lt;mrow&gt;
  <emphasis role="bold">&lt;mtext&gt;if&lt;/mtext&gt;</emphasis>
  &lt;mspace depth="0.5ex" height="0.5ex" width="1ex"/&gt;
  &lt;mrow&gt;
    &lt;mi&gt;x&lt;/mi&gt;
    &lt;mo&gt;=&lt;/mo&gt;
    &lt;mi&gt;y&lt;/mi&gt;
  &lt;/mrow&gt;
  &lt;mspace depth="0.5ex" height="0.5ex" width="1ex"/&gt;
  <emphasis role="bold">&lt;mtext&gt;then&lt;/mtext&gt;</emphasis>
  &lt;mspace depth="0.5ex" height="0.5ex" width="1ex"/&gt;
  &lt;mrow&gt;
    &lt;mrow&gt;
      &lt;mi&gt;a&lt;/mi&gt;
      &lt;mi&gt;x&lt;/mi&gt;
    &lt;/mrow&gt;
    &lt;mo&gt;=&lt;/mo&gt;
    &lt;mrow&gt;
      &lt;mi&gt;a&lt;/mi&gt;
      &lt;mi&gt;y&lt;/mi&gt;
    &lt;/mrow&gt;
  &lt;/mrow&gt;
&lt;/mrow&gt;</programlisting>
    </section>

    <section>
      <title>Explicit space between elements</title>

      <para>If in the above example, you want to add some space after word
      "<literal>if</literal>", do not attempt to insert one or more whitespace
      characters in the corresponding <tag class="element">mtext</tag> element
      (e.g. <literal>&lt;mtext&gt;if    &lt;/mtext&gt;</literal>). Doing so is
      useless because, leading and trailing whitespace characters are
      automatically removed from <tag class="element">mi</tag>, <tag
      class="element">mo</tag>, <tag class="element">mn</tag>, and <tag
      class="element">mtext</tag> by the MathML processor. Instead, you need
      to insert an <tag class="element">mspace</tag> element in your MathML
      expression. Note that due to the built-in typographic rules, doing so is
      just occasionally needed.</para>

      <variablelist>
        <varlistentry>
          <term><tag class="attribute">width</tag></term>

          <listitem>
            <para>This optional attribute specifies the overall width of the
            <tag class="element">mspace</tag> element.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term><tag class="attribute">height</tag></term>

          <listitem>
            <para>This optional attribute specifies the overall height above
            the baseline.</para>
          </listitem>
        </varlistentry>

        <varlistentry>
          <term><tag class="attribute">depth</tag></term>

          <listitem>
            <para>This optional attribute specifies the overall height below
            the baseline.</para>
          </listitem>
        </varlistentry>
      </variablelist>

      <para>The value of these attributes is a number followed by one of the
      following units: <literal>em</literal>, <literal>ex</literal>,
      <literal>px</literal>, <literal>in</literal>, <literal>cm</literal>,
      <literal>mm</literal>, <literal>pt</literal>,
      <literal>pc</literal>.</para>
    </section>
  </section>

  <section>
    <title>Fractions</title>

    <para>Fractions are specified using the <tag class="element">mfrac</tag>
    element. Example: <inlineequation>
        <m:math display="inline" xmlns:m="http://www.w3.org/1998/Math/MathML">
          <m:mfrac>
            <m:mrow>
              <m:mi>x</m:mi>

              <m:mo>-</m:mo>

              <m:mn>1</m:mn>
            </m:mrow>

            <m:mn>100</m:mn>
          </m:mfrac>
        </m:math>
      </inlineequation></para>

    <programlisting language="xml">&lt;mfrac&gt;
  &lt;mrow&gt;
    &lt;mi&gt;x&lt;/mi&gt;
    &lt;mo&gt;-&lt;/mo&gt;
    &lt;mn&gt;1&lt;/mn&gt;
  &lt;/mrow&gt;
  &lt;mn&gt;100&lt;/mn&gt;
&lt;/mfrac&gt;</programlisting>

    <para>First child element is the numerator of the fraction. Second child
    element is its denominator.</para>

    <para>Attribute <literal>bevelled="true"</literal> may be used to change
    the style of the fraction. Example: <inlineequation>
        <m:math display="inline" xmlns:m="http://www.w3.org/1998/Math/MathML">
          <m:mfrac bevelled="true">
            <m:mrow>
              <m:mi>x</m:mi>

              <m:mo>-</m:mo>

              <m:mn>1</m:mn>
            </m:mrow>

            <m:mn>100</m:mn>
          </m:mfrac>
        </m:math>
      </inlineequation>.</para>
  </section>

  <section>
    <title>Radicals</title>

    <para>MathML has two elements allowing to specify radicals:</para>

    <variablelist>
      <varlistentry>
        <term><tag class="element">msqrt</tag></term>

        <listitem>
          <para>Use this element to specify a square root. Example:
          <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:msqrt>
                  <m:mi>x</m:mi>

                  <m:mo>+</m:mo>

                  <m:mi>y</m:mi>
                </m:msqrt>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;msqrt&gt;
  &lt;mi&gt;x&lt;/mi&gt;
  &lt;mo&gt;+&lt;/mo&gt;
  &lt;mi&gt;y&lt;/mi&gt;
&lt;/msqrt&gt;</programlisting>

          <para>Note that, like a number of other MathML elements (<tag
          class="element">mstyle</tag>, <tag class="element">merror</tag>,
          <tag class="element">menclose</tag>, <tag
          class="element">mpadded</tag>, <tag class="element">mphantom</tag>,
          <tag class="element">mtd</tag> and <tag class="element">math</tag>),
          <tag class="element">msqrt</tag> may have one or more child
          elements. Below the radical sign, <tag class="element">msqrt</tag>
          behaves as if it had an implicit <tag class="element">mrow</tag>
          element grouping all its child elements.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">mroot</tag></term>

        <listitem>
          <para>Use this element to specify a radical with an arbitrary index.
          Example: <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:mroot>
                  <m:mi>x</m:mi>

                  <m:mn>3</m:mn>
                </m:mroot>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;mroot&gt;
  &lt;mi&gt;x&lt;/mi&gt;
  &lt;mn&gt;3&lt;/mn&gt;
&lt;/mroot&gt;</programlisting>

          <para>Unlike <tag class="element">msqrt</tag>, <tag
          class="element">mroot</tag> may only have two child elements. First
          child element is the base of the root. Second child element is its
          index. If you need more that one element below the radical sign,
          then use an explicit <tag class="element">mrow</tag> element.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </section>

  <section>
    <title>Subscripts and superscripts</title>

    <para>Subscripts and superscripts elements are:</para>

    <variablelist>
      <varlistentry>
        <term><tag class="element">msub</tag></term>

        <listitem>
          <para>Use this element to attach a subscript to a base. Example:
          <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:msub>
                  <m:mi>x</m:mi>

                  <m:mi>i</m:mi>
                </m:msub>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;msub&gt;
  &lt;mi&gt;x&lt;/mi&gt;
  &lt;mi&gt;i&lt;/mi&gt;
&lt;/msub&gt;</programlisting>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">msup</tag></term>

        <listitem>
          <para>Use this element to attach a superscript to a base. Example:
          <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:msup>
                  <m:mi>x</m:mi>

                  <m:mi>j</m:mi>
                </m:msup>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;msup&gt;
  &lt;mi&gt;x&lt;/mi&gt;
  &lt;mi&gt;j&lt;/mi&gt;
&lt;/msup&gt;</programlisting>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">msubsup</tag></term>

        <listitem>
          <para>Use this element to attach both a subscript and a superscript
          to a base. Example: <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:msubsup>
                  <m:mi>x</m:mi>

                  <m:mi>i</m:mi>

                  <m:mi>j</m:mi>
                </m:msubsup>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;msubsup&gt;
  &lt;mi&gt;x&lt;/mi&gt;
  &lt;mi&gt;i&lt;/mi&gt;
  &lt;mi&gt;j&lt;/mi&gt;
&lt;/msubsup&gt;</programlisting>
        </listitem>
      </varlistentry>
    </variablelist>

    <para>Note that for all the above elements, the base is the
    <emphasis>first</emphasis> child element.</para>
  </section>

  <section>
    <title>Underscripts and overscripts</title>

    <para>Underscripts and overscripts are similar to subscripts and
    superscripts, except that script elements are centered above and/or below
    the base element.</para>

    <variablelist>
      <varlistentry>
        <term><tag class="element">munder</tag></term>

        <listitem>
          <para>Use this element to attach a underscript to a base. Example:
          <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:munder>
                  <m:mi>x</m:mi>

                  <m:mo>&#9472;</m:mo>
                </m:munder>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;munder&gt;
  &lt;mi&gt;x&lt;/mi&gt;
  &lt;mo&gt;&amp;#9472;&lt;/mo&gt;
&lt;/munder&gt;</programlisting>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">mover</tag></term>

        <listitem>
          <para>Use this element to attach a overscript to a base. Example:
          <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:mover>
                  <m:mi>v</m:mi>

                  <m:mo>&#8594;</m:mo>
                </m:mover>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;mover&gt;
  &lt;mi&gt;v&lt;/mi&gt;
  &lt;mo&gt;&amp;#8594;&lt;/mo&gt;
&lt;/mover&gt;</programlisting>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">munderover</tag></term>

        <listitem>
          <para>Use this element to attach both a underscript and a overscript
          to a base. Example: <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:munderover>
                  <m:mi>x</m:mi>

                  <m:mi>a</m:mi>

                  <m:mi>b</m:mi>
                </m:munderover>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;munderover&gt;
  &lt;mi&gt;x&lt;/mi&gt;
  &lt;mi&gt;a&lt;/mi&gt;
  &lt;mi&gt;b&lt;/mi&gt;
&lt;/munderover&gt;</programlisting>
        </listitem>
      </varlistentry>
    </variablelist>
  </section>

  <section>
    <title>The ubiquitous <tag class="element">mo</tag> element</title>

    <para>Even after all these explanations, it is probably still not obvious
    to figure out how to encode in MathML many common constructs such as
    integrals, limits, etc. The answer is simple: use an <tag
    class="element">mo</tag> element containing the right character. This
    character typically belongs to the "Mathematical Operators" U+2200-U+22FF
    Unicode range or to the "Arrows" U+2190-U+21FF Unicode range.</para>

    <para>Example 1:</para>

    <informalequation>
      <m:math display="block" xmlns:m="http://www.w3.org/1998/Math/MathML">
        <m:mrow>
          <m:munderover>
            <m:mo>&#8747;</m:mo>

            <m:mn>-1</m:mn>

            <m:mn>+1</m:mn>
          </m:munderover>

          <m:mfrac>
            <m:mrow>
              <m:mi>d</m:mi>

              <m:mi>x</m:mi>
            </m:mrow>

            <m:mi>x</m:mi>
          </m:mfrac>
        </m:mrow>
      </m:math>
    </informalequation>

    <programlisting language="xml">&lt;mrow&gt;
  &lt;munderover&gt;
    <emphasis role="bold">&lt;mo&gt;&amp;#8747;&lt;/mo&gt;</emphasis>
    &lt;mn&gt;-1&lt;/mn&gt;
    &lt;mn&gt;+1&lt;/mn&gt;
  &lt;/munderover&gt;
  &lt;mfrac&gt;
    &lt;mrow&gt;
      &lt;mi&gt;d&lt;/mi&gt;
      &lt;mi&gt;x&lt;/mi&gt;
    &lt;/mrow&gt;
    &lt;mi&gt;x&lt;/mi&gt;
  &lt;/mfrac&gt;
&lt;/mrow&gt;</programlisting>

    <para>Example 2:</para>

    <informalequation>
      <m:math display="block" xmlns:m="http://www.w3.org/1998/Math/MathML">
        <m:mrow>
          <m:mi>x</m:mi>

          <m:munder>
            <m:mo>&#8594;</m:mo>

            <m:mtext>maps to</m:mtext>
          </m:munder>

          <m:mi>y</m:mi>
        </m:mrow>
      </m:math>
    </informalequation>

    <programlisting language="xml">&lt;mrow&gt;
  &lt;mi&gt;x&lt;/mi&gt;
  &lt;munder&gt;
    <emphasis role="bold">&lt;mo&gt;&amp;#8594;&lt;/mo&gt;</emphasis>
    &lt;mtext&gt;maps to&lt;/mtext&gt;
  &lt;/munder&gt;
  &lt;mi&gt;y&lt;/mi&gt;
&lt;/mrow&gt;</programlisting>

    <para>Note how the <tag class="element">mo</tag> element stretches
    vertically or horizontally when needed to. The amount of stretching is
    normally automatically determined by the MathML renderer, but it is
    possible to influence it by specifying the <tag
    class="attribute">minsize</tag> and/or <tag
    class="attribute">maxsize</tag> attributes. Example:
    <literal>&lt;mo minsize="10"&gt;&amp;#8594;&lt;/mo&gt;</literal> means:
    make the arrow at least 10 times its normal size.</para>
  </section>

  <section>
    <title>Matrices</title>

    <para>Matrices are specified using the <tag class="element">mtable</tag>
    element which is similar to the simple &#8212; no <tag
    class="element">tbody</tag> &#8212; XHTML table. An <tag
    class="element">mtable</tag> table element contains <tag
    class="element">mtr</tag> row elements and an <tag
    class="element">mtr</tag> element contains <tag class="element">mtd</tag>
    cell elements.</para>

    <para>Example:</para>

    <informalequation>
      <m:math display="block" xmlns:m="http://www.w3.org/1998/Math/MathML">
        <m:mrow>
          <m:mo>[</m:mo>

          <m:mtable>
            <m:mtr>
              <m:mtd>
                <m:mn>1</m:mn>
              </m:mtd>

              <m:mtd>
                <m:mn>0</m:mn>
              </m:mtd>

              <m:mtd>
                <m:mn>0</m:mn>
              </m:mtd>
            </m:mtr>

            <m:mtr>
              <m:mtd>
                <m:mn>0</m:mn>
              </m:mtd>

              <m:mtd>
                <m:mn>1</m:mn>
              </m:mtd>

              <m:mtd>
                <m:mn>0</m:mn>
              </m:mtd>
            </m:mtr>

            <m:mtr>
              <m:mtd>
                <m:mn>0</m:mn>
              </m:mtd>

              <m:mtd>
                <m:mn>0</m:mn>
              </m:mtd>

              <m:mtd>
                <m:mn>1</m:mn>
              </m:mtd>
            </m:mtr>
          </m:mtable>

          <m:mo>]</m:mo>
        </m:mrow>
      </m:math>
    </informalequation>

    <programlisting language="xml">&lt;mrow&gt;
  &lt;mo&gt;[&lt;/mo&gt;
  &lt;mtable&gt;
    &lt;mtr&gt;
      &lt;mtd&gt;
        &lt;mn&gt;1&lt;/mn&gt;
      &lt;/mtd&gt;
      &lt;mtd&gt;
        &lt;mn&gt;0&lt;/mn&gt;
      &lt;/mtd&gt;
      &lt;mtd&gt;
        &lt;mn&gt;0&lt;/mn&gt;
      &lt;/mtd&gt;
    &lt;/mtr&gt;
    &lt;mtr&gt;
      &lt;mtd&gt;
        &lt;mn&gt;0&lt;/mn&gt;
      &lt;/mtd&gt;
      &lt;mtd&gt;
        &lt;mn&gt;1&lt;/mn&gt;
      &lt;/mtd&gt;
      &lt;mtd&gt;
        &lt;mn&gt;0&lt;/mn&gt;
      &lt;/mtd&gt;
    &lt;/mtr&gt;
    &lt;mtr&gt;
      &lt;mtd&gt;
        &lt;mn&gt;0&lt;/mn&gt;
      &lt;/mtd&gt;
      &lt;mtd&gt;
        &lt;mn&gt;0&lt;/mn&gt;
      &lt;/mtd&gt;
      &lt;mtd&gt;
        &lt;mn&gt;1&lt;/mn&gt;
      &lt;/mtd&gt;
    &lt;/mtr&gt;
  &lt;/mtable&gt;
  &lt;mo&gt;]&lt;/mo&gt;
&lt;/mrow&gt;</programlisting>

    <para>Note that by default, an <tag class="element">mtable</tag> element
    has no borders at all. This is why you'll generally need to add an <tag
    class="element">mo</tag> containing a fence character (e.g.
    '<literal>[</literal>', '<literal>]</literal>', '<literal>(</literal>',
    '<literal>)</literal>', '<literal>|</literal>') before and after the <tag
    class="element">mtable</tag> when you specify a matrix or the determinant
    of a matrix.</para>
  </section>

  <section>
    <title>Equations</title>

    <para>The MathML <tag class="element">mtable</tag> element is fairly
    generic. Use it whenever you need to layout elements in a rectangular
    grid. This feature is of course useful to specify matrices. It is also
    useful to specify a set of equations.</para>

    <para>Example (how to properly align this set of equations is explained
    <link linkend="maligngroup">below</link>):</para>

    <informalequation xml:id="set_linear_equations">
      <m:math display="block" xmlns:m="http://www.w3.org/1998/Math/MathML">
        <m:mrow>
          <m:mo>{</m:mo>

          <m:mtable>
            <m:mtr>
              <m:mtd>
                <m:mrow>
                  <m:mrow>
                    <m:mrow>
                      <m:mn>2</m:mn>

                      <m:mo>&#8290;</m:mo>

                      <m:mi>x</m:mi>
                    </m:mrow>

                    <m:mo>+</m:mo>

                    <m:mi>y</m:mi>
                  </m:mrow>

                  <m:mo>=</m:mo>

                  <m:mn>8</m:mn>
                </m:mrow>
              </m:mtd>
            </m:mtr>

            <m:mtr>
              <m:mtd>
                <m:mrow>
                  <m:mrow>
                    <m:mi>x</m:mi>

                    <m:mo>+</m:mo>

                    <m:mi>y</m:mi>
                  </m:mrow>

                  <m:mo>=</m:mo>

                  <m:mn>6</m:mn>
                </m:mrow>
              </m:mtd>
            </m:mtr>
          </m:mtable>
        </m:mrow>
      </m:math>
    </informalequation>

    <programlisting language="xml">&lt;mrow&gt;
  &lt;mo&gt;{&lt;/mo&gt;
  &lt;mtable&gt;
    &lt;mtr&gt;
      &lt;mtd&gt;
        &lt;mrow&gt;
          &lt;mrow&gt;
            &lt;mrow&gt;
              &lt;mn&gt;2&lt;/mn&gt;
              &lt;mo&gt;&amp;#8290;&lt;/mo&gt;
              &lt;mi&gt;x&lt;/mi&gt;
            &lt;/mrow&gt;
            &lt;mo&gt;+&lt;/mo&gt;
            &lt;mi&gt;y&lt;/mi&gt;
          &lt;/mrow&gt;
          &lt;mo&gt;=&lt;/mo&gt;
          &lt;mn&gt;8&lt;/mn&gt;
        &lt;/mrow&gt;
      &lt;/mtd&gt;
    &lt;/mtr&gt;
    &lt;mtr&gt;
      &lt;mtd&gt;
        &lt;mrow&gt;
          &lt;mrow&gt;
            &lt;mi&gt;x&lt;/mi&gt;
            &lt;mo&gt;+&lt;/mo&gt;
            &lt;mi&gt;y&lt;/mi&gt;
          &lt;/mrow&gt;
          &lt;mo&gt;=&lt;/mo&gt;
          &lt;mn&gt;6&lt;/mn&gt;
        &lt;/mrow&gt;
      &lt;/mtd&gt;
    &lt;/mtr&gt;
  &lt;/mtable&gt;
&lt;/mrow&gt;</programlisting>

    <para>Replacing an <tag class="element">mtr</tag> row element by an <tag
    class="element">mlabeledtr</tag> labeled row element allows to use the
    first <tag class="element">mtd</tag> cell element of this row as the
    caption of the equation. Example:</para>

    <informalequation>
      <m:math display="block" xmlns:m="http://www.w3.org/1998/Math/MathML">
        <m:mtable side="left">
          <m:mlabeledtr>
            <m:mtd>
              <m:mtext>Gauss' law</m:mtext>
            </m:mtd>

            <m:mtd>
              <m:mrow>
                <m:mrow>
                  <m:mo>&#8711;</m:mo>

                  <m:mo>&#8729;</m:mo>

                  <m:mi mathvariant="normal">E</m:mi>
                </m:mrow>

                <m:mo>=</m:mo>

                <m:mfrac>
                  <m:mi>&#961;</m:mi>

                  <m:msub>
                    <m:mi>&#949;</m:mi>

                    <m:mn>0</m:mn>
                  </m:msub>
                </m:mfrac>
              </m:mrow>
            </m:mtd>
          </m:mlabeledtr>

          <m:mlabeledtr>
            <m:mtd>
              <m:mtext>Gauss's law for magnetism</m:mtext>
            </m:mtd>

            <m:mtd>
              <m:mrow>
                <m:mrow>
                  <m:mo>&#8711;</m:mo>

                  <m:mo>&#8729;</m:mo>

                  <m:mi mathvariant="normal">B</m:mi>
                </m:mrow>

                <m:mo>=</m:mo>

                <m:mn>0</m:mn>
              </m:mrow>
            </m:mtd>
          </m:mlabeledtr>
        </m:mtable>
      </m:math>
    </informalequation>

    <programlisting language="xml">&lt;mtable <emphasis role="bold">side="left"</emphasis>&gt;
<emphasis role="bold">  &lt;mlabeledtr&gt;
    &lt;mtd&gt;
      &lt;mtext&gt;Gauss' law&lt;/mtext&gt;
    &lt;/mtd&gt;
</emphasis>    &lt;mtd&gt;
      &lt;mrow&gt;
        &lt;mrow&gt;
          &lt;mo&gt;&amp;#8711;&lt;/mo&gt;
          &lt;mo&gt;&amp;#8729;&lt;/mo&gt;
          &lt;mi mathvariant="normal"&gt;E&lt;/mi&gt;
        &lt;/mrow&gt;
        &lt;mo&gt;=&lt;/mo&gt;
        &lt;mfrac&gt;
          &lt;mi&gt;&amp;#961;&lt;/mi&gt;
          &lt;msub&gt;
            &lt;mi&gt;&amp;#949;&lt;/mi&gt;
            &lt;mn&gt;0&lt;/mn&gt;
          &lt;/msub&gt;
        &lt;/mfrac&gt;
      &lt;/mrow&gt;
    &lt;/mtd&gt;
  &lt;/mlabeledtr&gt;
<emphasis role="bold">  &lt;mlabeledtr&gt;
    &lt;mtd&gt;
      &lt;mtext&gt;Gauss's law for magnetism&lt;/mtext&gt;
    &lt;/mtd&gt;
</emphasis>    &lt;mtd&gt;
      &lt;mrow&gt;
        &lt;mrow&gt;
          &lt;mo&gt;&amp;#8711;&lt;/mo&gt;
          &lt;mo&gt;&amp;#8729;&lt;/mo&gt;
          &lt;mi mathvariant="normal"&gt;B&lt;/mi&gt;
        &lt;/mrow&gt;
        &lt;mo&gt;=&lt;/mo&gt;
        &lt;mn&gt;0&lt;/mn&gt;
      &lt;/mrow&gt;
    &lt;/mtd&gt;
  &lt;/mlabeledtr&gt;
&lt;/mtable&gt;</programlisting>

    <para>Note that without the <literal>side="left"</literal> attribute,
    captions are displayed at the right of equations and this, despite the
    fact that the caption is always specified by the contents of the first
    <tag class="element">mtd</tag> child of a <tag
    class="element">mlabeledtr</tag> element.</para>
  </section>

  <section>
    <title>Other, less useful, elements</title>

    <para>We'll not describe in this tutorial the following, rarely needed,
    elements: <tag class="element">mglyph</tag>, <tag
    class="element">mmultiscripts</tag>, <tag
    class="element">malignmark</tag>, <tag class="element">merror</tag>, <tag
    class="element">maction</tag>. This being said, you may also skip this
    section if you are really impatient.</para>

    <variablelist>
      <varlistentry xml:id="ms">
        <term><tag class="element">ms</tag></term>

        <listitem>
          <para>Use this element to specify a quoted string literal. Example:
          <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:ms>Hello word!</m:ms>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;ms&gt;Hello word!&lt;/ms&gt;</programlisting>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">mfenced</tag></term>

        <listitem>
          <para>The <tag class="element">mfenced</tag> element is a shorthand
          notation for common forms of <tag class="element">mrow</tag>.
          Example: <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:mfenced>
                  <m:mi>x</m:mi>

                  <m:mi>y</m:mi>

                  <m:mi>z</m:mi>
                </m:mfenced>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;mfenced&gt;
  &lt;mi&gt;x&lt;/mi&gt;
  &lt;mi&gt;y&lt;/mi&gt;
  &lt;mi&gt;z&lt;/mi&gt;
&lt;/mfenced&gt;</programlisting>

          <para>is equivalent to: <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:mrow>
                  <m:mo>(</m:mo>

                  <m:mi>x</m:mi>

                  <m:mo>,</m:mo>

                  <m:mi>y</m:mi>

                  <m:mo>,</m:mo>

                  <m:mi>z</m:mi>

                  <m:mo>)</m:mo>
                </m:mrow>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;mrow&gt;
  &lt;mo&gt;(&lt;/mo&gt;
  &lt;mi&gt;x&lt;/mi&gt;
  &lt;mo&gt;,&lt;/mo&gt;
  &lt;mi&gt;y&lt;/mi&gt;
  &lt;mo&gt;,&lt;/mo&gt;
  &lt;mi&gt;z&lt;/mi&gt;
  &lt;mo&gt;)&lt;/mo&gt;
&lt;/mrow&gt;</programlisting>

          <para>The <tag class="attribute">open</tag>, <tag
          class="attribute">separators</tag> and <tag
          class="attribute">close</tag> attributes of an <tag
          class="element">mfenced</tag> element specify the opening fence
          added before its first child element, the separators added between
          child elements and the closing fence added after its last child
          element. By default, the values of these attributes are
          "<literal>(</literal>", "<literal>,</literal>" and
          "<literal>)</literal>".</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">menclose</tag></term>

        <listitem>
          <para>The <tag class="element">menclose</tag> element allows to draw
          lines, typically a box, around its child elements. Example:
          <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:menclose notation="box">
                  <m:mi>n</m:mi>

                  <m:mo>!</m:mo>
                </m:menclose>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;menclose notation="box"&gt;
  &lt;mi&gt;n&lt;/mi&gt;
  &lt;mo&gt;!&lt;/mo&gt;
&lt;/menclose&gt;</programlisting>

          <para>The <tag class="attribute">notation</tag> attribute of an <tag
          class="element">menclose</tag> element specify which kind of lines
          are drawn around the child elements. The allowed values for this
          attribute are: <tag class="attvalue">longdiv</tag> (default value),
          <tag class="attvalue">actuarial</tag>, <tag
          class="attvalue">radical</tag>, <tag class="attvalue">box</tag>,
          <tag class="attvalue">roundedbox</tag>, <tag
          class="attvalue">circle</tag>, <tag class="attvalue">left</tag>,
          <tag class="attvalue">right</tag>, <tag class="attvalue">top</tag>,
          <tag class="attvalue">bottom</tag>, <tag
          class="attvalue">updiagonalstrike</tag>, <tag
          class="attvalue">downdiagonalstrike</tag>, <tag
          class="attvalue">verticalstrike</tag>, <tag
          class="attvalue">horizontalstrike</tag>.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">mpadded</tag></term>

        <listitem>
          <para>The <tag class="element">mpadded</tag> element allows to add
          padding, that is extra space, around its child elements. It's an
          alternative to using <tag class="element">mspace</tag>.
          Example:</para>

          <informalequation>
            <m:math display="block"
                    xmlns:m="http://www.w3.org/1998/Math/MathML">
              <m:mrow>
                <m:mpadded width="+1ex">
                  <m:mtext>if</m:mtext>
                </m:mpadded>

                <m:mrow>
                  <m:mi>x</m:mi>

                  <m:mo>=</m:mo>

                  <m:mi>y</m:mi>
                </m:mrow>

                <m:mpadded lspace="1ex" width="+2ex">
                  <m:mtext>then</m:mtext>
                </m:mpadded>

                <m:mrow>
                  <m:mrow>
                    <m:mi>a</m:mi>

                    <m:mi>x</m:mi>
                  </m:mrow>

                  <m:mo>=</m:mo>

                  <m:mrow>
                    <m:mi>a</m:mi>

                    <m:mi>y</m:mi>
                  </m:mrow>
                </m:mrow>
              </m:mrow>
            </m:math>
          </informalequation>

          <programlisting language="xml">&lt;mrow&gt;
<emphasis role="bold">  &lt;mpadded width="+1ex"&gt;
    &lt;mtext&gt;if&lt;/mtext&gt;
  &lt;/mpadded&gt;
</emphasis>  &lt;mrow&gt;
    &lt;mi&gt;x&lt;/mi&gt;
    &lt;mo&gt;=&lt;/mo&gt;
    &lt;mi&gt;y&lt;/mi&gt;
  &lt;/mrow&gt;
<emphasis role="bold">  &lt;mpadded lspace="1ex" width="+2ex"&gt;
    &lt;mtext&gt;then&lt;/mtext&gt;
  &lt;/mpadded&gt;
</emphasis>  &lt;mrow&gt;
    &lt;mrow&gt;
      &lt;mi&gt;a&lt;/mi&gt;
      &lt;mi&gt;x&lt;/mi&gt;
    &lt;/mrow&gt;
    &lt;mo&gt;=&lt;/mo&gt;
    &lt;mrow&gt;
      &lt;mi&gt;a&lt;/mi&gt;
      &lt;mi&gt;y&lt;/mi&gt;
    &lt;/mrow&gt;
  &lt;/mrow&gt;
&lt;/mrow&gt;</programlisting>

          <para>The attributes allowing to specify the padding are:</para>

          <variablelist>
            <varlistentry>
              <term><tag class="attribute">width</tag></term>

              <listitem>
                <para>This optional attribute specifies the overall width of
                the <tag class="element">mpadded</tag> element.</para>

                <para>The value of this attribute, as well as the values of
                the <tag class="attribute">height</tag> and <tag
                class="attribute">depth</tag> attributes (but not the <tag
                class="attribute">lspace</tag> attribute) described below, may
                start with a "+" sign which means: add specified amount to the
                intrinsic size.</para>
              </listitem>
            </varlistentry>

            <varlistentry>
              <term><tag class="attribute">lspace</tag></term>

              <listitem>
                <para>This optional attribute specifies the amount of space
                added before the first child of the <tag
                class="element">mpadded</tag> element.</para>

                <para>There is no <tag class="attribute">rspace</tag>
                attribute. The amount of space added after the last child of
                the <tag class="element">mpadded</tag> element is: value of
                the above <tag class="attribute">width</tag> attribute -
                intrinsic width of all the child elements - value of this <tag
                class="attribute">lspace</tag> attribute.</para>
              </listitem>
            </varlistentry>

            <varlistentry>
              <term><tag class="attribute">height</tag></term>

              <listitem>
                <para>This optional attribute specifies the overall height
                above the baseline.</para>
              </listitem>
            </varlistentry>

            <varlistentry>
              <term><tag class="attribute">depth</tag></term>

              <listitem>
                <para>This optional attribute specifies the overall height
                below the baseline.</para>
              </listitem>
            </varlistentry>
          </variablelist>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">mphantom</tag></term>

        <listitem>
          <para>The <tag class="element">mphantom</tag> element transforms its
          descendant elements into &#8216;&#8216;phantoms'': they are there,
          they occupy some space, but you cannot see them. The <tag
          class="element">mphantom</tag> element is often the only way to
          properly align some elements. Example:</para>

          <informalequation>
            <m:math display="block"
                    xmlns:m="http://www.w3.org/1998/Math/MathML">
              <m:mrow>
                <m:mfrac>
                  <m:mn>1</m:mn>

                  <m:msup>
                    <m:mi>x</m:mi>

                    <m:mphantom>
                      <m:msup>
                        <m:mi>y</m:mi>

                        <m:mi>z</m:mi>
                      </m:msup>
                    </m:mphantom>
                  </m:msup>
                </m:mfrac>

                <m:mo>+</m:mo>

                <m:mfrac>
                  <m:mn>1</m:mn>

                  <m:msup>
                    <m:mi>x</m:mi>

                    <m:msup>
                      <m:mi>y</m:mi>

                      <m:mi>z</m:mi>
                    </m:msup>
                  </m:msup>
                </m:mfrac>
              </m:mrow>
            </m:math>
          </informalequation>

          <programlisting language="xml">&lt;mrow&gt;
  &lt;mfrac&gt;
    &lt;mn&gt;1&lt;/mn&gt;
    &lt;msup&gt;
      &lt;mi&gt;x&lt;/mi&gt;
<emphasis role="bold">      &lt;mphantom&gt;
        &lt;msup&gt;
          &lt;mi&gt;y&lt;/mi&gt;
          &lt;mi&gt;z&lt;/mi&gt;
        &lt;/msup&gt;
      &lt;/mphantom&gt;
</emphasis>    &lt;/msup&gt;
  &lt;/mfrac&gt;
  &lt;mo&gt;+&lt;/mo&gt;
  &lt;mfrac&gt;
    &lt;mn&gt;1&lt;/mn&gt;
    &lt;msup&gt;
      &lt;mi&gt;x&lt;/mi&gt;
      &lt;msup&gt;
        &lt;mi&gt;y&lt;/mi&gt;
        &lt;mi&gt;z&lt;/mi&gt;
      &lt;/msup&gt;
    &lt;/msup&gt;
  &lt;/mfrac&gt;
&lt;/mrow&gt;</programlisting>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term><tag class="element">mstyle</tag></term>

        <listitem>
          <para>The <tag class="element">mstyle</tag> element allows to
          specify attributes which are intended to be inherited by all its
          descendant elements. As such, the <tag class="element">mstyle</tag>
          element supports <emphasis>all</emphasis> the attributes of
          <emphasis>all</emphasis> the other MathML elements.</para>

          <para>The most commonly used attributes are those used to style the
          <tag class="element">mi</tag>, <tag class="element">mo</tag>, <tag
          class="element">mn</tag> and <tag class="element">mtext</tag> text
          container elements:</para>

          <informaltable>
            <tgroup cols="3">
              <colspec colnum="2" colwidth="3*"/>

              <thead>
                <row>
                  <entry align="center">Attribute Name</entry>

                  <entry align="center">Attribute Value</entry>

                  <entry align="center">Default Value</entry>
                </row>
              </thead>

              <tbody>
                <row>
                  <entry><tag class="attribute">mathvariant</tag></entry>

                  <entry><tag class="attvalue">normal</tag> | <tag
                  class="attvalue">bold</tag> | <tag
                  class="attvalue">italic</tag> | <tag
                  class="attvalue">bold-italic</tag> | <tag
                  class="attvalue">double-struck</tag> | <tag
                  class="attvalue">bold-fraktur</tag> | <tag
                  class="attvalue">script</tag> | <tag
                  class="attvalue">bold-script</tag> | <tag
                  class="attvalue">fraktur</tag> | <tag
                  class="attvalue">sans-serif</tag> | <tag
                  class="attvalue">bold-sans-serif</tag> | <tag
                  class="attvalue">sans-serif-italic</tag> | <tag
                  class="attvalue">sans-serif-bold-italic</tag> | <tag
                  class="attvalue">monospace</tag></entry>

                  <entry><tag class="attvalue">normal</tag> (except on <tag
                  class="element">mi</tag>)</entry>
                </row>

                <row>
                  <entry><tag class="attribute">mathsize</tag></entry>

                  <entry><tag class="attvalue">small</tag> | <tag
                  class="attvalue">normal</tag> | <tag
                  class="attvalue">big</tag> |
                  <replaceable>number</replaceable>
                  <replaceable>v-unit</replaceable></entry>

                  <entry>inherited</entry>
                </row>

                <row>
                  <entry><tag class="attribute">mathcolor</tag></entry>

                  <entry>#<replaceable>rgb</replaceable> |
                  #<replaceable>rrggbb</replaceable> |
                  <replaceable>html-color-name</replaceable></entry>

                  <entry>inherited</entry>
                </row>

                <row>
                  <entry><tag class="attribute">mathbackground</tag></entry>

                  <entry>#<replaceable>rgb</replaceable> |
                  #<replaceable>rrggbb</replaceable> |
                  <replaceable>html-color-name</replaceable></entry>

                  <entry>inherited</entry>
                </row>
              </tbody>
            </tgroup>
          </informaltable>

          <para>Example: <inlineequation>
              <m:math display="inline"
                      xmlns:m="http://www.w3.org/1998/Math/MathML">
                <m:mstyle mathbackground="yellow" mathcolor="navy"
                          mathsize="16pt" mathvariant="bold">
                  <m:mrow>
                    <m:mi>x</m:mi>

                    <m:mo>+</m:mo>

                    <m:mi>y</m:mi>
                  </m:mrow>

                  <m:mo>=</m:mo>

                  <m:mn mathcolor="red">2</m:mn>
                </m:mstyle>
              </m:math>
            </inlineequation></para>

          <programlisting language="xml">&lt;mstyle mathbackground="yellow" mathcolor="navy" mathsize="16pt"
        mathvariant="bold"&gt;
  &lt;mrow&gt;
    &lt;mi&gt;x&lt;/mi&gt;
    &lt;mo&gt;+&lt;/mo&gt;
    &lt;mi&gt;y&lt;/mi&gt;
  &lt;/mrow&gt;
  &lt;mo&gt;=&lt;/mo&gt;
  &lt;mn mathcolor="red"&gt;2&lt;/mn&gt;
&lt;/mstyle&gt;</programlisting>
        </listitem>
      </varlistentry>

      <varlistentry xml:id="maligngroup">
        <term><tag class="element">maligngroup</tag></term>

        <listitem>
          <para>Use this element to properly align a set of equations. Each
          inserted <tag class="element">maligngroup</tag> specifies a
          ``sub-column'' within the column of an <tag
          class="element">mtable</tag>. The <tag
          class="attribute">groupalign</tag> attribute of the <tag
          class="element">mtable</tag> element specifies the horizontal
          alignment within each ``sub-column''. Example:</para>

          <informalequation>
            <m:math display="block"
                    xmlns:m="http://www.w3.org/1998/Math/MathML">
              <m:mrow>
                <m:mo>{</m:mo>

                <m:mtable groupalign="{right center right center right}">
                  <m:mtr>
                    <m:mtd>
                      <m:mrow>
                        <m:mrow>
                          <m:mrow>
                            <m:maligngroup/>

                            <m:mn>2</m:mn>

                            <m:mo>&#8290;</m:mo>

                            <m:mi>x</m:mi>
                          </m:mrow>

                          <m:maligngroup/>

                          <m:mo>+</m:mo>

                          <m:maligngroup/>

                          <m:mi>y</m:mi>
                        </m:mrow>

                        <m:maligngroup/>

                        <m:mo>=</m:mo>

                        <m:maligngroup/>

                        <m:mn>8</m:mn>
                      </m:mrow>
                    </m:mtd>
                  </m:mtr>

                  <m:mtr>
                    <m:mtd>
                      <m:mrow>
                        <m:mrow>
                          <m:maligngroup/>

                          <m:mi>x</m:mi>

                          <m:maligngroup/>

                          <m:mo>+</m:mo>

                          <m:maligngroup/>

                          <m:mi>y</m:mi>
                        </m:mrow>

                        <m:maligngroup/>

                        <m:mo>=</m:mo>

                        <m:maligngroup/>

                        <m:mn>6</m:mn>
                      </m:mrow>
                    </m:mtd>
                  </m:mtr>
                </m:mtable>
              </m:mrow>
            </m:math>
          </informalequation>

          <programlisting language="xml">&lt;mrow&gt;
  &lt;mo&gt;{&lt;/mo&gt;
  &lt;mtable <emphasis role="bold">groupalign="{right center right center right}"</emphasis>&gt;
    &lt;mtr&gt;
      &lt;mtd&gt;
        &lt;mrow&gt;
          &lt;mrow&gt;
            &lt;mrow&gt;
              <emphasis role="bold">&lt;maligngroup/&gt;</emphasis>
              &lt;mn&gt;2&lt;/mn&gt;
              &lt;mo&gt;&amp;#8290;&lt;/mo&gt;
              &lt;mi&gt;x&lt;/mi&gt;
            &lt;/mrow&gt;
            <emphasis role="bold">&lt;maligngroup/&gt;</emphasis>
            &lt;mo&gt;+&lt;/mo&gt;
            <emphasis role="bold">&lt;maligngroup/&gt;</emphasis>
            &lt;mi&gt;y&lt;/mi&gt;
          &lt;/mrow&gt;
          <emphasis role="bold">&lt;maligngroup/&gt;</emphasis>
          &lt;mo&gt;=&lt;/mo&gt;
          <emphasis role="bold">&lt;maligngroup/&gt;</emphasis>
          &lt;mn&gt;8&lt;/mn&gt;
        &lt;/mrow&gt;
      &lt;/mtd&gt;
    &lt;/mtr&gt;
    &lt;mtr&gt;
      &lt;mtd&gt;
        &lt;mrow&gt;
          &lt;mrow&gt;
            <emphasis role="bold">&lt;maligngroup/&gt;</emphasis>
            &lt;mi&gt;x&lt;/mi&gt;
            <emphasis role="bold">&lt;maligngroup/&gt;</emphasis>
            &lt;mo&gt;+&lt;/mo&gt;
            <emphasis role="bold">&lt;maligngroup/&gt;</emphasis>
            &lt;mi&gt;y&lt;/mi&gt;
          &lt;/mrow&gt;
          <emphasis role="bold">&lt;maligngroup/&gt;</emphasis>
          &lt;mo&gt;=&lt;/mo&gt;
          <emphasis role="bold">&lt;maligngroup/&gt;</emphasis>
          &lt;mn&gt;6&lt;/mn&gt;
        &lt;/mrow&gt;
      &lt;/mtd&gt;
    &lt;/mtr&gt;
  &lt;/mtable&gt;
&lt;/mrow&gt;</programlisting>

          <para>The value of the <tag class="attribute">groupalign</tag>
          attribute has the following syntax: one
          "<literal>{<replaceable>...</replaceable>}</literal>" group per
          column. A "<literal>{<replaceable>...</replaceable>}</literal>"
          group contains one alignment specification per sub-column (that is,
          per <tag class="element">maligngroup</tag>). Alignment
          specifications are: <tag class="attvalue">left</tag>, <tag
          class="attvalue">center</tag> or <tag
          class="attvalue">right</tag>.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </section>
</article>
