Right-to-Left Equation Support in MathJax

237 views
Skip to first unread message

Amine Marref

unread,
Feb 9, 2021, 2:57:08 PM2/9/21
to MathJax Users
Hello Everyone,

I have a twofold question. I am trying to use MathJax to render mathematical text in both English and Arabic (not in a mixed fashion).

I started playing with MathJax version 3 for doing the English-math rendering and I cannot complain about it. Then when I wanted to do the Arabic part, I kind of hit a wall.

My first question: How do I render the equations right-to-left in MathJax version 3?

I found a promising MathJax Arabic extension that should do the job correctly for me, but it is intended for version 2.5+ of MathJax. Now, I tried downgrading MathJax to this version as it might suit my needs amply; but while rendering the normal English equations, I get the error "Uncaught TypeError: MathJax.typeset is not a function". I use MathJax.typeset() after I dynamically insert MathJax-renderable equations in the app.

My second question: What is the equivalent of MathJax.typeset() in the 2.5+ versions of MathJax? Or equivalently, how are dynamically-inserted equations rendered?

Many thanks,
Amine.

Davide Cervone

unread,
Feb 10, 2021, 10:56:52 AM2/10/21
to mathja...@googlegroups.com

I have a twofold question. I am trying to use MathJax to render mathematical text in both English and Arabic (not in a mixed fashion).

I started playing with MathJax version 3 for doing the English-math rendering and I cannot complain about it. Then when I wanted to do the Arabic part, I kind of hit a wall.

My first question: How do I render the equations right-to-left in MathJax version 3?

As you found out, the Arabic extension has not been ported to MathJax v3 yet (it was a third-party extension, and the author has not had time to work on it).  There is currently no RTL support in v3.

I found a promising MathJax Arabic extension that should do the job correctly for me, but it is intended for version 2.5+ of MathJax. Now, I tried downgrading MathJax to this version as it might suit my needs amply; but while rendering the normal English equations, I get the error "Uncaught TypeError: MathJax.typeset is not a function". I use MathJax.typeset() after I dynamically insert MathJax-renderable equations in the app.

My second question: What is the equivalent of MathJax.typeset() in the 2.5+ versions of MathJax? Or equivalently, how are dynamically-inserted equations rendered?

Yes, the API changed substantially from version 2 to version 3.  The documentation for v2 is at


and the function you are looking for is MathJax.Hub.Typeset().  But see 


for details about how to use it.

Davide

Amine Marref

unread,
Feb 10, 2021, 11:42:43 AM2/10/21
to MathJax Users
Cheers, 

I was able to typeset my equations in MathJax 2.7.7 by substituting calls to MathJax.typeset(); by calls to MathJax.Hub.Queue(["Typeset",MathJax.Hub]);

Davide Cervone

unread,
Feb 10, 2021, 11:44:01 AM2/10/21
to mathja...@googlegroups.com
Glad you got it to work.  Note that the latest version of v2 is 2.7.9.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/74487b94-584c-468f-935e-a5f2ebbd3d64n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages