<mfenced>

  • Revision slug: MathML/Element/mfenced
  • Revision title: mfenced
  • Revision id: 36920
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment Reverted to earlier version; 28 words removed

Revision Content

Summary

The MathML <mfenced> element provides the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression. 

Attributes

class, id, style
Provided for use with stylesheets.
close
A string for the closing delimiter. The default value is ")" and any white space is trimmed.
href {{ gecko_minversion_inline("7.0") }}
Used to set a hyperlink to a specified URI.
mathbackground {{ gecko_minversion_inline("2.0") }}
The background color. You can use #rgb, #rrggbb and HTML color names.
mathcolor {{ gecko_minversion_inline("2.0") }}
The text color and also the fraction line color. You can use #rgb, #rrggbb and HTML color names.
open
A string for the opening delimiter. The default value is "(" and any white space is trimmed.
separators
A sequence of zero or more characters to be used for different separators, optionally divided by white space, which is ignored. The default value is ",". By specifying more than one character, it is possible to set different separators for each argument in the expression. If there are too many separators, all excess is ignored. If there are too few separators in the expression, the last specified separator is repeated.

Examples

Example 1: The last separator is repeated (,)

{a;b;c,d,e}

<math>
  <mfenced open="{" close="}" separators=";;,"> 
    <mi>a</mi> 
    <mi>b</mi> 
    <mi>c</mi> 
    <mi>d</mi> 
    <mi>e</mi> 
  </mfenced> 
</math>

Example 2: All excess is ignored (,)

[a|b|c|d|e]

<math>
  <mfenced open="[" close="]" separators="||||,"> 
    <mi>a</mi> 
    <mi>b</mi> 
    <mi>c</mi> 
    <mi>d</mi> 
    <mi>e</mi> 
  </mfenced> 
</math>

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{ CompatNo() }} {{ CompatGeckoDesktop("1.0") }} {{ CompatNo() }} 9.5 5.1
separators attribute {{ CompatNo() }} {{ CompatGeckoDesktop("1.0") }} {{ CompatNo() }} {{ CompatNo() }} 5.1
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatNo() }} {{ CompatGeckoMobile("1.9.2") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}
separators attribute {{ CompatNo() }} {{ CompatGeckoMobile("1.9.2") }} {{ CompatNo() }} {{ CompatNo() }} {{ CompatNo() }}

Specification

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

Revision Source

<h2>Summary</h2>
<p>The MathML <code>&lt;mfenced&gt;</code> element provides the possibility to add custom opening and closing parentheses (such as brackets) and separators (such as commas or semicolons) to an expression. </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-close">close</dt> <dd>A string for the closing delimiter. The default value is <code>")</code>" and any white space is trimmed.</dd> <dt id="attr-href">href {{ gecko_minversion_inline("7.0") }}</dt> <dd>Used to set a hyperlink to a specified URI.</dd> <dt id="attr-mathbackground">mathbackground {{ gecko_minversion_inline("2.0") }}</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 {{ gecko_minversion_inline("2.0") }}</dt> <dd>The text color and also the fraction line 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-open">open</dt> <dd>A string for the opening delimiter. The default value is <code>"("</code> and any white space is trimmed.</dd> <dt id="attr-separators">separators</dt> <dd>A sequence of zero or more characters to be used for different separators, optionally divided by white space, which is ignored. The default value is ",". By specifying more than one character, it is possible to set different separators for each argument in the expression. If there are too many separators, all excess is ignored. If there are too few separators in the expression, the last specified separator is repeated.</dd>
</dl>
<h2>Examples</h2>
<p>Example 1: The last separator is repeated (<code>,</code>)</p>
<p><img alt="{a;b;c,d,e}" src="/@api/deki/files/4847/=mfenced01.png"></p>
<pre class="brush: html">&lt;math&gt;
  &lt;mfenced open="{" close="}" separators=";;,"&gt; 
    &lt;mi&gt;a&lt;/mi&gt; 
    &lt;mi&gt;b&lt;/mi&gt; 
    &lt;mi&gt;c&lt;/mi&gt; 
    &lt;mi&gt;d&lt;/mi&gt; 
    &lt;mi&gt;e&lt;/mi&gt; 
  &lt;/mfenced&gt; 
&lt;/math&gt;
</pre>
<p>Example 2: All excess is ignored (<code>,</code>)</p>
<p><img alt="[a|b|c|d|e]" src="/@api/deki/files/4848/=mfenced02.png"></p>
<pre class="brush: html">&lt;math&gt;
  &lt;mfenced open="[" close="]" separators="||||,"&gt; 
    &lt;mi&gt;a&lt;/mi&gt; 
    &lt;mi&gt;b&lt;/mi&gt; 
    &lt;mi&gt;c&lt;/mi&gt; 
    &lt;mi&gt;d&lt;/mi&gt; 
    &lt;mi&gt;e&lt;/mi&gt; 
  &lt;/mfenced&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>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>5.1</td> </tr> <tr> <td><code>separators</code> attribute</td> <td>{{ CompatNo() }}</td> <td>{{ CompatGeckoDesktop("1.0") }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> <td>5.1</td> </tr> </tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatNo() }}</td> <td>{{ CompatGeckoMobile("1.9.2") }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> <td>{{ CompatNo() }}</td> </tr> <tr> <td><code>separators</code> attribute</td> <td>{{ CompatNo() }}</td> <td>{{ CompatGeckoMobile("1.9.2") }}</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.mfenced","MathML 3.0 Presentation Markup mfenced", "REC") }}</li>
</ul>
Revert to this revision