<?xml version="1.0" encoding="us-ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN"
      "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>MathML Test : Token elements</title>
  <meta http-equiv="content-type" content="text/html; charset=us-ascii" />
  <meta name="generator" content="Amaya, see http://www.w3.org/Amaya/" />
  <meta name="author" content="Frederic WANG" />
</head>

<body>
<p><a href="index.xml#presentation_elements">Back to home</a></p>

<h1>MathML Test : Token elements</h1>

<h2>Identifier (mi)</h2>

<p>This element must be rendered <code>"normal"</code> if there are several
characters and <code>"italic"</code> if there is only one. There should be no
space arround it. MathML editors can use an empty <code>mi</code> to
represent a placeholder.</p>
<ul>
  <li>one character : <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>a</mi>
    </math></li>
  <li>several characters : <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>sin</mi>
    </math></li>
  <li>spaces : <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mtext>sometext</mtext>
      <mi>MI</mi>
      <mtext>sometext</mtext>
    </math></li>
  <li>empty : <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi></mi>
    </math> </li>
</ul>

<h2>Number (mn)</h2>

<p>The element should be diplayed with an unslanted font and without space
arround.</p>
<ul>
  <li>an integer : <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mn>57</mn>
    </math></li>
  <li>spaces : <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mtext>sometext</mtext>
      <mn>9.9</mn>
      <mtext>sometext</mtext>
    </math></li>
</ul>

<h2>Operator, Fence, Separator or Accent (mo)</h2>

<p>See the page <a href="mo_element.xml">Operator, Fence, Separator or
Accent</a> for more details.</p>
<ul>
  <li>operator : <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>a</mi>
      <mo>+</mo>
      <mi>b</mi>
    </math></li>
  <li>fence : <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mo>(</mo>
      <mi>x</mi>
      <mo>)</mo>
    </math></li>
  <li>separator : <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mo>;</mo>
    </math></li>
</ul>

<h2>Text (mtext)</h2>

<p>This element allows to include commentary text in mathematical formulae.
There is no space arround but it can be used to include special characters
representing space.</p>
<ul>
  <li>mtext between <code>mi</code> elements : <math
    xmlns="http://www.w3.org/1998/Math/MathML">
      <mi>M</mi>
      <mtext>sometext</mtext>
      <mi>M</mi>
    </math></li>
  <li>text in a piecewise : <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mrow>
        <mo>&#x2223;</mo>
        <mi>x</mi>
        <mo>&#x2223;</mo>
      </mrow>
      <mo>=</mo>
      <mrow>
        <mo>{</mo>
        <mrow>
          <mtable>
            <mtr>
              <mtd>
                <mi>x</mi>
                <mtext> if </mtext>
                <mrow>
                  <mi>x</mi>
                  <mo>&#x2265;</mo>
                  <mn>0</mn>
                </mrow>
              </mtd>
            </mtr>
            <mtr>
              <mtd>
                <mrow>
                  <mo>&#x2212;</mo>
                  <mi>x</mi>
                  <mtext> otherwise</mtext>
                </mrow>
              </mtd>
            </mtr>
          </mtable>
        </mrow>
      </mrow>
    </math></li>
</ul>

<h2>Space (mspace)</h2>

<p>See the page <a href="mspace.xml">Space</a> for more details.</p>
<ul>
  <li>[<math xmlns="http://www.w3.org/1998/Math/MathML">
      <mspace width="3em"/>
    </math>]</li>
</ul>

<h2>String Literal (ms)</h2>

<p>The content of an <code>ms</code> element is typically rendered with no
extra spacing added arround the string, and a quote character " at the
beginning and the end of the string.</p>
<ul>
  <li>no attribute :<math xmlns="http://www.w3.org/1998/Math/MathML">
      <ms>a string of length 21</ms>
    </math></li>
  <li><code>lquote = "&amp;#39;"</code> : <math
    xmlns="http://www.w3.org/1998/Math/MathML">
      <ms lquote="'">a string of length 21</ms>
    </math></li>
  <li><code>rquote = "&amp;#187;"</code> : <math
    xmlns="http://www.w3.org/1998/Math/MathML">
      <ms rquote="&#187;">a string of length 21</ms>
    </math></li>
</ul>

<p>When the string contains special characters such as quote, they should be
rendered with a special notation, showing that the expression is really a
string literal. For instance :</p>
<ul>
  <li>string containing a quote (\") : <math
    xmlns="http://www.w3.org/1998/Math/MathML">
      <ms>&quot;</ms>
    </math></li>
  <li>string containing a tab (\t) : <math
    xmlns="http://www.w3.org/1998/Math/MathML">
      <ms></ms>
    </math></li>
  <li>string containing a linebreak (\n) : <math
    xmlns="http://www.w3.org/1998/Math/MathML">
      <ms></ms>
    </math></li>
</ul>

<h2>Accessing glyphs for characters from MathML (mglyph)</h2>

<p>This element allows to insert a special character from a font. The alt
attribute is mandatory.</p>
<ul>
  <li>mglyph : [<math xmlns="http://www.w3.org/1998/Math/MathML">
      <mi><mglyph fontfamily="OpenSymbol" alt="computer"/></mi>
    </math>] </li>
</ul>
</body>
</html>
