Workaround for issue with MathJax 4 in RTL contexts - #3106
Merged
pstaabp merged 1 commit intoAug 3, 2026
Conversation
Member
|
Make sure to run |
See mathjax/MathJax#3589 where @dpvc provided the workaround added here into mathjax-config.js. For the future, MathJax 4.2 will fix the issue by adding a dir="ltr" attribute to the mjx-container element. That is in mathjax/MathJax-src#1526 so this change can be removed WeBWorK transitions to MathJax 4.2.
taniwallach
force-pushed
the
mathjax-413-rtl-patch
branch
from
August 3, 2026 18:17
7a669ec to
84de776
Compare
Member
Author
Thanks - done. Sorry, I have not been doing much coding for WW recently, and am not on top of these additional steps. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MathJax 4.1.3 does not display math properly when inside an RTL setting, and that version will be in WeBWorK 2.21 (unless MathJax 4.2 is released and a transition is made before the release of 2.21).
The problem occurs in both SVG an CHTML output.
Things were fine with MathJax 3.
@dpvc provided the workaround added here in mathjax/MathJax#3589 .
For the future, MathJax 4.2 will fix the issue by adding a
dir="ltr"attribute to themjx-containerelement. That is in mathjax/MathJax-src#1526so this change can be removed WeBWorK transitions to MathJax 4.2.
The issue can be seen using the following sample problem. Pay attention to how the inline math renders in the Hebrew portion which is in a DIV set to
rtl.Here is an images of the issue when this problem is rendered before the change in this PR.

Once the patch is applied, the two portions of inline math will display properly.