boolesrings/Simple-Mathjax-wordpress-plugin

math dont display correctly

thangisme opened this issue · 8 comments

I have the following input:

$\left\{ {\begin{array}{*{20}{c}} {{x_1},{x_2} \in K}\\ {{x_1} < {x_2}} \end{array}} \right. \Rightarrow f({x_1}) < f({x_2})$

It should output the following:

$$\left\{ {\begin{array}{*{20}{c}} {{x_1},{x_2} \in K}\\ {{x_1} < {x_2}} \end{array}} \right. \Rightarrow f({x_1}) < f({x_2})$$

But in my website, the plugin display the following:
image
What have I done wrong?

Have you set the inline math delimiters in your "Custom MathJax config" field? It looks like it hasn't picked up that you want to use $ to delimit inline math.

Have you set the inline math delimiters in your "Custom MathJax config" field? It looks like it hasn't picked up that you want to use $ to delimit inline math.

Isn't it enabled by default? If I type simple expression like $f(x)$ then it display correctly

Is it live on the internet somewhere? We could try to look at it in action...

On 21 Jul 2023, at 11:36, Quang Thắng @.***> wrote: Have you set the inline math delimiters in your "Custom MathJax config" field? It looks like it hasn't picked up that you want to use $ to delimit inline math. Isn't it enabled by default? If I type simple expression like $f(x)$ then it display correctly — Reply to this email directly, view it on GitHub <#34 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIBKJ2A7SKDHIOHLQSSHQLXRJLTDANCNFSM6AAAAAA2QAHYLU. You are receiving this because you are subscribed to this thread.

Yes, you can see it here

pkra commented

Wordpress is stripping a backslash.

\left\{

in your input comes out as

\left{ in the HTML.

The result is invalid TeX (and MathJax behaves somewhat similarly to "real" TeX, rendering the rest).

I don't think there's anythen we can do about wordpress doing unexpected unescaping like this.

pkra commented

Closing but happy to re-open.

I think that this might have come about because WordPress strips out backslashes when you paste plain text in. I wrote \{ x \} in a textarea element on another page, then pasted it into the WP post editor. It appeared as { x }.
I wonder if we can do anything to prevent this if it happens between LaTeX delimiters.