WPIntell

Source evidence

Incompatible with rtl languages

KaTeX · support · 2021-09-08T12:29:00+00:00

mixedsentiment
mediumseverity
0.84relevance
7replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

1 / 15 rows with source links

6.7% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

14 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Sharif Payenda resolved
In rtl pages katex renders equations from rtl direction and they will not be readable. For instance f(x)=2x will be rendered 2x=f(x) This is a simple example but for complex equations and expressions they are not even readable. Is there any solution that katex does not obey site direction and always should render equations in ltr direction just like what mathjax is doing? Hi! Thank you for this issue report. Please try adding the following to your site’s stylesheet. It should work even for inline KaTeX. .katex-eq { direction: ltr; } This’ll work with <body dir="rtl"> . Depending on how RTL is set on your page, you may have to be more persuasive: .katex-eq { direction: ltr !important; } Hi @beskhue Unfortunately above css did not solve the problem. This reply was modified 4 years, 8 months ago by Sharif Payenda . Could you provide an example page? The fix worked in my tests, so there must be something going on. Hi @beskhue Please visit following link. https://app-6128b891c1ac18b2a03403ae.closte.com/general/113323/ Hmm, I see. I played around a bit and found something that does work. .katex-eq { direction: ltr; } .katex-eq > .katex { display: inline-block; } This works on your example page. I’m not sure why inline-block is required for the inline equations. There is a somewhat related issue upstream, you might want to chime in there: https://github.com/KaTeX/KaTeX/issues/343 Actually, this may be a bit more future-proof, if this plugin ever changes the element layout a bit: .katex-eq { direction: ltr; } .katex-eq[data-katex-display="false"] { display: inline-block; } This reply was modified 4 years, 8 months ago by Tom Churchman . Thanks @beskhue Looks perfect. Regards

Comments

7 shown
Tom Churchman 2021-09-08T13:48:00+00:00

Hi! Thank you for this issue report. Please try adding the following to your site’s stylesheet. It should work even for inline KaTeX. .katex-eq { direction: ltr; } This’ll work with <body dir="rtl"> . Depending on how RTL is set on your page, you may have to be more persuasive: .katex-eq { direction: ltr !important; }

Sharif Payenda 2021-09-10T13:56:00+00:00

Hi @beskhue Unfortunately above css did not solve the problem. This reply was modified 4 years, 8 months ago by Sharif Payenda .

Tom Churchman 2021-09-10T13:59:00+00:00

Could you provide an example page? The fix worked in my tests, so there must be something going on.

Sharif Payenda 2021-09-10T14:01:00+00:00

Hi @beskhue Please visit following link. https://app-6128b891c1ac18b2a03403ae.closte.com/general/113323/

Tom Churchman 2021-09-10T14:14:00+00:00

Hmm, I see. I played around a bit and found something that does work. .katex-eq { direction: ltr; } .katex-eq > .katex { display: inline-block; } This works on your example page. I’m not sure why inline-block is required for the inline equations. There is a somewhat related issue upstream, you might want to chime in there: https://github.com/KaTeX/KaTeX/issues/343

Tom Churchman 2021-09-10T14:17:00+00:00

Actually, this may be a bit more future-proof, if this plugin ever changes the element layout a bit: .katex-eq { direction: ltr; } .katex-eq[data-katex-display="false"] { display: inline-block; } This reply was modified 4 years, 8 months ago by Tom Churchman .

Sharif Payenda 2021-09-10T14:32:00+00:00

Thanks @beskhue Looks perfect. Regards