Mathjax does not work with chinese punctuation

AI-generated summary

Mathjax does not work with Chinese punctuation

Yunpeng_Tai reports an issue with the Mathjax plugin, which only supports English punctuation. This causes rendering issues with Chinese text, such as $1+1$ failing when preceded by a Chinese comma. Yunpeng_Tai notes that the original Mathjax or KaTeX works well with Chinese punctuation.

sam suggests a potential fix and invites Yunpeng_Tai to try a PR, but Yunpeng_Tai finds it complex and instead points out that using MathJax as per the official instructions should work without heavy modifications.

whitewaterdeu proposes a workaround by adding spaces around the mathematical symbols, but Yunpeng_Tai argues that this is not practical or visually appealing.

sam announces a PR that should fix the issue, but Yunpeng_Tai notes that it still lacks an important feature: rendering equations without punctuation before them in Chinese grammar.

Hi. The current Mathjax plugin can be quite annoying, for it only supports English punctuation.

For instance, 1+1 is ok

However,1+1 fails. This really misses the point of rendering Mathjax. This only renders Mathjax for English only.

I use Mathjax for my blog. The original Mathjax or KaTeX works well with Chinese punctuation.

discourse: latest
discourse-mathjax-plugin: latest
2 Likes

any help of advice please?

I think this is the issue… do you want to try a PR for it and see if it fixes the issue for you?

Thanks for your help. It seems complex for me to deal with this. However, if you utilize MathJax like the official instruction. It should work without some heavy modifications. Have you ever checked this?

I believe this can be a huge bug for the MathJax plugin. Hope someone can fix it. :smile:

I tested it, and it works as long as there are spaces before and after, see

As a Chinese person, would you specifically add spaces when inputting mathematical symbols? Is it that abstract? This clearly does not conform to the input habits of forum users, and it also affects the visual appearance.

Just a gentle reminder that it’s much easier for everyone to follow along if posts include an English translation. :pray:

2 Likes

PR here: should be merged soon.

https://github.com/discourse/discourse-math/pull/84

2 Likes

Thanks so much! However, it still lacks one important feature. If there is no punctuation before the equation, it should also be rendered in Chinese grammar. For instance, 我们拿出$k$个向量

Thanks for your kind help!

1 Like