Closed barillax closed 5 years ago
After looking at #16, I inspected the DOM and found that if I added the .mar class to the surrounding element, it fixed the display. See image below illustrating what I mean:
The top square root in the above image renders incorrectly, while the bottom one displays properly thanks to the CSS giving the span border-width: 0.45 em 0;
I'm not super familiar with the code, but it kind of looks like the issue here is that when you use one of the \trans*
functions, the resulting token(s) don't have arabicFontLang
set to ar
, which leads to the code in https://github.com/OmarIthawi/arabic-mathjax/blob/master/src/html.js#L51 not being run to add the mar
class?
@barillax this PR https://github.com/OmarIthawi/arabic-mathjax/pull/20 should solve your issue. Please wait for it to be merged and pushed to npm
CC: @OmarIthawi
Thank you @shadinaif !
As shown below, when you put a decimal number into a square root, wrapped in
\transn
, it displays incorrectly. E.g.:\sqrt{\transn{0.04}}
https://codepen.io/barillax/pen/BvVQBX
I wonder if the fix for this might be similar to https://github.com/OmarIthawi/arabic-mathjax/pull/16 ?
EDIT: this also happens for
\transt{}{}
inside of a square root, i.e.:%% \sqrt{{\transt{speed}{السرعة}}} %%