demo · v140

Bidi Text Integration

Real Arabic prose with embedded MathML. Toggle the document direction to see operators flip: < mirrors to >, the integral contour reverses, arrows turn around. The math finally reads naturally inside right-to-left text.

container dir: rtl  |  html dir attribute: <div dir="rtl">
1 — inequality in Arabic algebra textbook format إذا كان س<10 ، فإن س+5<15 < mirrors to > in RTL
2 — integral in an Arabic physics formula الشغل المبذول هو W= a b F(x)dx حيث F0 ∮ contour mirrors in RTL
3 — fraction with arrows in Hebrew mathematical notation אם ab cd = 1 אזי a÷c=b÷d → mirrors; ÷ does not

Operator mirror table

Not all MathML operators mirror in RTL. The table below lists which do and which are direction-neutral.

Operator Unicode LTR form RTL form Mirrors?
Less than U+003C < < Yes — mirrors to >
Greater than U+003E > > Yes — mirrors to <
Right arrow U+2192 Yes — mirrors to ←
Contour integral U+222E Yes — reverses winding
Division sign U+00F7 ÷ ÷ No — symmetric
Plus U+002B + + No — symmetric
Equals U+003D = = No — symmetric
Integral U+222B Yes — slant reverses
<!-- Surrounding HTML sets context -->
<p dir="rtl">
  <span lang="ar">إذا كان</span>

  <!-- MathML inherits dir from the nearest dir="" ancestor -->
  <math>
    <mi>س</mi><mo><</mo><mn>10</mn>
  </math>

  <!-- Or set dir on math explicitly -->
  <math dir="rtl">
    <msubsup><mo>&#x222E;</mo><mi>a</mi><mi>b</mi></msubsup>
  </math>
</p>

see also