<ms>

  • Revision slug: MathML/Element/ms
  • Revision title: ms
  • Revision id: 34417
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment new compat table; 159 words added, 42 words removed

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 {{ unimplemented_inline("534963") }}
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 {{ unimplemented_inline("534968") }}
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 Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support {{ CompatGeckoDesktop("1.0") }} {{ CompatNo() }} {{ CompatNo() }} 9.5 {{ CompatNo() }}
mathsize attribute {{ CompatGeckoDesktop("1.0") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
mathvariant attribute partially supported (see above) {{ CompatNo() }} {{ CompatNo() }} partially supported (see above) {{ CompatNo() }}
Feature Firefox Mobile (Gecko) Android IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatGeckoMobile("1.9.2") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
mathsize attribute {{ CompatGeckoMobile("1.9.2") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
mathvariant attribute partially supported (see above) {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}

Specification

  • {{ spec("http://www.w3.org/TR/MathML/chapter3.html#presm.ms","MathML 3.0 Presentation Markup ms", "REC") }}

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 <strong>lquote</strong> and <strong>rquote</strong> 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>Attributes</h2>
<dl> <dt id="attr-class-id-style">class, id, style</dt> <dd>Provided for use with <a href="/en/CSS" title="en/CSS/">stylesheets</a>.</dd> <dt id="attr-dir">dir {{ unimplemented_inline("534963") }}</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 <strong><a href="#attr-dir">dir</a></strong>) to enclose the content. The default value is "<code>&amp;quot;".</code></dd> <dt id="attr-href">href {{ unimplemented_inline("534968") }}</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/CSS/color_value#HTML.2fSVG.2fX11.c2.a0_Color_Keywords" title="en/CSS/color value#HTML.2fSVG.2fX11.c2.a0 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/CSS/color_value#HTML.2fSVG.2fX11.c2.a0_Color_Keywords" title="en/CSS/color value#HTML.2fSVG.2fX11.c2.a0 Color Keywords">HTML color names</a>.</dd> <dt id="attr-mathsize">mathsize</dt> <dd>The size of the content. Possible values are: <br> <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>: Font is rendered larger than the current font size.</li> <li>or a custom <a href="/en/CSS/length" title="en/CSS/length">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:<br> <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 <strong><a href="#attr-dir">dir</a></strong>) to enclose the content. The default value is "<code>&amp;quot;".</code></dd>
</dl>
<h2>Examples</h2>
<pre class="brush: html">&lt;math&gt;

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

&lt;/math&gt;
</pre>
<h2>Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
<table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Firefox (Gecko)</th> <th>Chrome</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatGeckoDesktop("1.0") }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> <td>9.5</td> <td>{{ CompatNo() }}</td> </tr> <tr> <td><code>mathsize</code> attribute</td> <td>{{ CompatGeckoDesktop("1.0") }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> </tr> <tr> <td><code>mathvariant</code> attribute</td> <td>partially supported (see above)</td> <td>{{ CompatNo() }}</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>Firefox Mobile (Gecko)</th> <th>Android</th> <th>IE Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatGeckoMobile("1.9.2") }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> </tr> <tr> <td><code>mathsize</code> attribute</td> <td>{{ CompatGeckoMobile("1.9.2") }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> </tr> <tr> <td><code>mathvariant</code> attribute</td> <td>partially supported (see above)</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> </tr> </tbody>
</table>
</div>
<h2>Specification</h2>
<ul> <li>{{ spec("http://www.w3.org/TR/MathML/chapter3.html#presm.ms","MathML 3.0 Presentation Markup ms", "REC") }}</li>
</ul>
Revert to this revision