Vertically Stretched (Fence) Operators

Q

What are virtically stretched (fence) operators?

✍: FYIcenter.com

A

MathML defines a list of virtically stretched operators that are stretched vertically to match the maximum height of neighboring elements. Here are some examples:

  • Parentheses: ( and )
  • Square Brackets: [ and ]
  • Angle Brackets: < and >
  • Braces: { and }
  • Vertical Bars: | and ‖
  • Square-Root: √
  • Vertical Arrows: ↑, ↓ and ↕

The example below shows that 2 vertical bars are stretched to match the height of the fraction element.

<math><mo>|</mo><mo>&#x2212;</mo>
  <mfrac><mn>1</mn><mn>2</mn></mfrac><mo>|</mo>
  <mo>=</mo><mn>0.5</mn></math>
    |−
      12|
      =0.5

Note that some old browsers do not support automatical stretched operators. In this case, you can add fence="true" and stretchy="true" attributes to force it:

<math><mo fence="true" stretchy="true">|</mo><mo>−</mo>
  <mfrac><mn>1</mn><mn>2</mn></mfrac><mo fence="true" stretchy="true">|</mo>
  <mo>=</mo><mn>0.5</mn></math>
    |−
      12|
      =0.5

Or try to use the <mfenced> element to replace stretched operators:

<math><mfenced open="|" close="|"><mrow><mo>−</mo>
  <mfrac><mn>1</mn><mn>2</mn></mfrac></mrow></mfenced>
  <mo>=</mo><mn>0.25</mn></math>
    −
      12
      =0.25

Or try to add <mrow> next to the operator to trigger the stretchy detection.

<math><mrow><mo>|</mo><mo>−</mo>
  <mfrac><mn>1</mn><mn>2</mn></mfrac><mo>|</mo></mrow>
  <mo>=</mo><mn>0.5</mn></math>
    |−
      12|
      =0.5

 

⇒ "mrow" as Virtical Stretch Boundary

⇐ Stretched and Large Operators

⇑ Stretched and Large Operators

⇑⇑ MathML (Mathematical Markup Language)

2026-10-24, ∼1860🔥, 0💬