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?
sam
(Sam Saffron)
June 7, 2024, 4:11am
3
I think this is the issue… do you want to try a PR for it and see if it fixes the issue for you?
AI Conversation with Gpt-4o
sam : Given:
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.
Look at the source of the discourse mathjax plugin, fin…
sam : try again, the source is at: GitHub - discourse/discourse-math: Official MathJax support for Discourse
gpt4o_bot : In the file assets/javascripts/initializers/discourse-math-mathjax.js, the initMathJax, decorate, and mathjax functions should be checked and potentially modified to ensure that Chinese punctuation is properly supported.
Identifying the Issue:
The main issue lies in the function decorate, where it’s handling the creation of mathScript and mathWrapper elements that render the MathJax content. I…
sam : I think you are barking up the wrong tree… look at discourse-math/assets/javascripts/lib/discourse-markdown/discourse-math.js at main · discourse/discourse-math · GitHub
...
Read full transcript
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.
Yunpeng Tai:
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.
I tested it, and it works as long as there are spaces before and after, see
mathjax的一个小bug,但有解决办法 没空格 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...
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.
Yunpeng Tai:
As a Chinese person, would you really input mathematical symbols with spaces? That’s rather abstract, isn’t it? It clearly doesn’t align with the input habits of forum users, and it also detracts from the visual appeal.
Just a gentle reminder that it’s much easier for everyone to follow along if posts include an English translation.
2 Likes
sam
(Sam Saffron)
June 11, 2024, 4:47am
9
PR here: should be merged soon.
discourse:main ← discourse:multilingual-punctuation
opened 04:47AM - 11 Jun 24 UTC
Chinese / Korean / Japanese / Thai and Arabic use different punctuations.
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