#3594·MathJax

Directionality of text is not respected in MathML output

Author: samimaattaCeliaCreated Jul 28, 2026Updated Jul 28, 2026
LabelsFeature Requestv4

Issue Summary

dir attribute can be used to change the text direction even on individual MathML elements. MathJax does not respect this in rendering.

MathJax 4 output: Equation that should be read from right to left is rendered right to left.

Expected output (Firefox's native): Equation correctly read from right to left.

OS: Windows 11 Browser: Mozilla Firefox 153.0

Steps to Reproduce:

Render the code:

xml
<math xmlns="http://www.w3.org/1998/Math/MathML" dir="rtl">
  <mi>n</mi>
  <mo>=</mo>
  <mfrac>
    <mrow>
      <mn>1</mn>
      <mo>+</mo>
      <msqrt>
        <mn>5</mn>
      </msqrt>
    </mrow>
    <mn>2</mn>
  </mfrac>
</math>

Attribute dir="rtl" should make so that the text direction changes.

Technical details:

  • MathJax Version: 4
  • OS: Windows 11
  • Browser: Mozilla Firefox 153.0

I am using the default following MathJax configuration and and loading MathJax via

xml
<script src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js" defer></script>