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:
Expected output (Firefox's native):
OS: Windows 11 Browser: Mozilla Firefox 153.0
Steps to Reproduce:
Render the code:
<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
<script src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js" defer></script>Source: mathjax/MathJax