<ms>

  • Revision slug: MathML/Element/ms
  • Revision title: ms
  • Revision id: 303621
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment

Revision Content

The MathML <ms> element represents a string literal meant to be interpreted by programming languages and computer algebra systems. By default, string literals are displayed as enclosed by double quotes (&quot;); by using the lquote and rquote attributes, you can set custom characters to display. Note that quotation marks should not be specified unless they are part of the string literal. The content of an <ms> element is not an ASCII string per se, but rather a sequence of characters and {{ MathMLElement("mglyph") }} and {{ MathMLElement("malignmark") }} elements.

Attributes

class, id, style
Provided for use with stylesheets.
dir
The text direction. Possible values are either ltr (left to right) or rtl (right to left).
lquote
The opening quote character (depends on dir) to enclose the content. The default value is "&quot;".
href
Used to set a hyperlink to a specified URI.
mathbackground
The background color. You can use #rgb, #rrggbb and HTML color names.
mathcolor
The text color. You can use #rgb, #rrggbb and HTML color names.
mathsize
The size of the content. Possible values are:
  • small: Font is rendered smaller than the current font size.
  • normal: Equivalent to 100% or 1em.
  • big: Font is rendered larger than the current font size.
  • or a custom length.
mathvariant (partially implemented, see {{ bug("114365") }} & {{ bug("162405") }})
This attribute specifies the logical class of the identifier, which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed:
  • normal (default value)
  • bold
  • italic
  • bold-italic
  • double-struck {{ unimplemented_inline() }}
  • bold-fraktur {{ unimplemented_inline() }} (bold works)
  • script {{ unimplemented_inline() }}
  • bold-script {{ unimplemented_inline() }} (bold works)
  • fraktur {{ unimplemented_inline() }}
  • sans-serif
  • bold-sans-serif
  • sans-serif-italic
  • sans-serif-bold-italic
  • monospace
  • initial {{ unimplemented_inline() }}
  • tailed {{ unimplemented_inline() }}
  • looped {{ unimplemented_inline() }}
  • stretched {{ unimplemented_inline() }}
rquote
The closing quote mark (depends on dir) to enclose the content. The default value is "&quot;".

Examples

<math>

  <ms lquote="„" rquote="“"> abc </ms>

</math>

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{ CompatNo() }} {{ CompatGeckoDesktop("1.0") }} {{ CompatNo() }} 9.5 {{ CompatNo() }}
dir {{ CompatNo() }} {{ CompatGeckoDesktop("12.0") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
href {{ CompatNo() }} {{ CompatGeckoDesktop("7.0") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
mathsize {{ CompatNo() }} {{ CompatGeckoDesktop("1.0") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
mathvariant {{ CompatNo() }} partially supported (see above) {{ CompatNo() }} partially supported (see above) {{ CompatNo() }}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{ CompatNo() }} {{ CompatNo() }} {{ CompatGeckoMobile("1.9.2") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
dir {{ CompatNo() }} {{ CompatNo() }} {{ CompatGeckoMobile("12.0") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
href {{ CompatNo() }} {{ CompatNo() }} {{ CompatGeckoMobile("7.0") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
mathsize {{ CompatNo() }} {{ CompatNo() }} {{ CompatGeckoMobile("1.9.2") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
mathvariant {{ CompatNo() }} {{ CompatNo() }} partially supported (see above) {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}

Specifications

Specification Status Comment
{{ SpecName('MathML3', 'chapter3.html#presm.ms', 'ms') }} {{ Spec2('MathML3') }} Current specification
{{ SpecName('MathML2', 'chapter3.html#presm.ms', 'ms') }} {{ Spec2('MathML2') }} Initial specification

 

Revision Source

<p>The MathML <code>&lt;ms&gt;</code> element represents a <em>string literal</em> meant to be interpreted by programming languages and computer algebra systems. By default, string literals are displayed as enclosed by double quotes (<code>&amp;quot;</code>); by using the <code>lquote</code> and <code>rquote</code> attributes, you can set custom characters to display. Note that quotation marks should not be specified unless they are part of the string literal. The content of an <code>&lt;ms&gt;</code> element is not an ASCII string per se, but rather a sequence of characters and {{ MathMLElement("mglyph") }} and {{ MathMLElement("malignmark") }} elements.</p>
<h2 id="Attributes">Attributes</h2>
<dl>
  <dt id="attr-class-id-style">
    class, id, style</dt>
  <dd>
    Provided for use with <a href="/en-US/docs/CSS">stylesheets</a>.</dd>
  <dt id="attr-dir">
    dir</dt>
  <dd>
    The text direction. Possible values are either <code>ltr</code> (left to right) or <code>rtl</code> (right to left).</dd>
  <dt id="attr-lquote">
    lquote</dt>
  <dd>
    The opening quote character (depends on <code><a href="#attr-dir">dir</a></code>) to enclose the content. The default value is "<code>&amp;quot;".</code></dd>
  <dt id="attr-href">
    href</dt>
  <dd>
    Used to set a hyperlink to a specified URI.</dd>
  <dt id="attr-mathbackground">
    mathbackground</dt>
  <dd>
    The background color. You can use <code>#rgb</code>, <code>#rrggbb</code> and <a href="/en-US/docs/CSS/color_value#Color_Keywords">HTML color names</a>.</dd>
  <dt id="attr-mathcolor">
    mathcolor</dt>
  <dd>
    The text color. You can use <code>#rgb</code>, <code>#rrggbb</code> and <a href="/en-US/docs/CSS/color_value#Color_Keywords">HTML color names</a>.</dd>
  <dt id="attr-mathsize">
    mathsize</dt>
  <dd>
    The size of the content. Possible values are:
    <ul>
      <li><code>small:</code> Font is rendered smaller than the current font size.</li>
      <li><code>normal<span style="font-family: Verdana,Tahoma,sans-serif;">: </span></code>Equivalent to 100% or 1em.</li>
      <li><code>big</code>:&nbsp;Font is rendered larger than the current font size.</li>
      <li>or a custom <a href="/en-US/docs/MathML/Attributes/Values#Lengths">length</a>.</li>
    </ul>
  </dd>
  <dt id="attr-mathvariant">
    mathvariant (partially implemented, see {{ bug("114365") }} &amp; {{ bug("162405") }})</dt>
  <dd>
    This attribute specifies the logical class of the identifier, which varies in typography. That is, although the names suggest the typographic style for the class, semantically, items with the same class are treated "the same" within an expression, which might or might not involve displaying them with the named typography. The following values are allowed:
    <ul>
      <li><code>normal</code> (default value)</li>
      <li><code>bold</code></li>
      <li><code>italic</code></li>
      <li><code>bold-italic</code></li>
    </ul>
    <ul>
      <li><code>double-struck</code> {{ unimplemented_inline() }}</li>
      <li><code>bold-fraktur</code> {{ unimplemented_inline() }} (bold works)</li>
      <li><code>script</code> {{ unimplemented_inline() }}</li>
      <li><code>bold-script</code> {{ unimplemented_inline() }} (bold works)</li>
      <li><code>fraktur</code> {{ unimplemented_inline() }}</li>
    </ul>
    <ul>
      <li><code>sans-serif</code></li>
      <li><code>bold-sans-serif</code></li>
      <li><code>sans-serif-italic</code></li>
      <li><code>sans-serif-bold-italic</code></li>
      <li><code>monospace</code></li>
    </ul>
    <ul>
      <li><code>initial</code> {{ unimplemented_inline() }}</li>
      <li><code>tailed</code> {{ unimplemented_inline() }}</li>
      <li><code>looped</code> {{ unimplemented_inline() }}</li>
      <li><code>stretched</code> {{ unimplemented_inline() }}</li>
    </ul>
  </dd>
  <dt id="attr-rquote">
    rquote</dt>
  <dd>
    The closing quote mark (depends on <code><a href="#attr-dir">dir</a></code>) to enclose the content. The default value is "<code>&amp;quot;".</code></dd>
</dl>
<h2 id="Examples">Examples</h2>
<pre class="brush: html">
&lt;math&gt;

  &lt;ms lquote="„" rquote="“"&gt; abc &lt;/ms&gt;

&lt;/math&gt;
</pre>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoDesktop("1.0") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>9.5</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>dir</code></td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoDesktop("12.0") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>href</code></td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoDesktop("7.0") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>mathsize</code></td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoDesktop("1.0") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>mathvariant</code></td>
        <td>{{ CompatNo() }}</td>
        <td>partially supported (see above)</td>
        <td>{{ CompatNo() }}</td>
        <td>partially supported (see above)</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Chrome for Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Mobile</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoMobile("1.9.2") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>dir</code></td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoMobile("12.0") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>href</code></td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoMobile("7.0") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>mathsize</code></td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatGeckoMobile("1.9.2") }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
      <tr>
        <td><code>mathvariant</code></td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>partially supported (see above)</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
        <td>{{ CompatNo() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<h2 id="Specifications" name="Specifications">Specifications</h2>
<table class="standard-table" height="49" width="1000">
  <thead>
    <tr>
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ SpecName('MathML3', 'chapter3.html#presm.ms', 'ms') }}</td>
      <td>{{ Spec2('MathML3') }}</td>
      <td>Current specification</td>
    </tr>
    <tr>
      <td>{{ SpecName('MathML2', 'chapter3.html#presm.ms', 'ms') }}</td>
      <td>{{ Spec2('MathML2') }}</td>
      <td>Initial specification</td>
    </tr>
  </tbody>
</table>
<p>&nbsp;</p>
Revert to this revision