Community Wishlist Survey 2019/Editing/Make the math tag support non-Latin languages

From Meta, a Wikimedia project coordination wiki

Make the math tag support non-Latin languages

  • Problem: There should be a public plugin on web for putting LaTaX into Chinese, so it is not difficult to implement the content in zh supporting wikis modified by the <math> tag (that is, the "mathematical formula" function).



This was posted in Chinese. I've translated it into English, but kept the original Chinese. --Omotecho (talk) 16:21, 6 November 2018 (UTC)[reply]

@脂肪酸钠: Could you provide an example what "putting LaTeX into Chinese" means? Basically LaTeX is a file format, and Chinese are languages and scripts, so I am not sure I understand what is requested here and how these two are related. Thanks a lot! --AKlapper (WMF) (talk) 03:28, 7 November 2018 (UTC)[reply]
I think it's supposed to be "put the Chinese into the math", not "put the math into the Chinese"? Failed to parse (syntax error): {\displaystyle 标 = 签} <- doesn't work too well. --Izno (talk) 04:21, 7 November 2018 (UTC)[reply]
@Izno:You are right. Thanks. 脂肪酸钠 (talk) 07:33, 7 November 2018 (UTC)[reply]
Comment Comment allow me to indent a few lines below so that discussion is better threaded. 10:50, 7 November 2018 (UTC) -->
OK.脂肪酸钠 (talk) 11:16, 7 November 2018 (UTC)[reply]
Example: <chem>2H2{+}O2->[点燃]2H2O</chem>
present output: Failed to parse (syntax error): {\displaystyle \ce{2H2{+}O2->[点燃] 2H_2O}}
Comment Comment expected output: in zh as: 2H2+O2点燃—>2H2O
Over here, TeX does not support Chinese. 脂肪酸钠 (talk) 07:33, 7 November 2018 (UTC)[reply]
Comment Comment @脂肪酸钠: kindly check if my edit above is correct. I am trying to support you convey your idea in en as a translator.this proposal might benefit local languages, if LaTex shows in local language. Thank you to post your idea. Omotecho (talk) 10:50, 7 November 2018 (UTC)[reply]
It's perfect.脂肪酸钠 (talk) 11:16, 7 November 2018 (UTC)[reply]
As a note, this isn't just Chinese--there are a number of languages with this problem. I've added the Phabricator task. --Izno (talk) 13:08, 7 November 2018 (UTC)[reply]
For Chinese, it would be nice if Chinese styling commands can be supported. C933103 (talk) 16:01, 13 November 2018 (UTC)[reply]

@脂肪酸钠: Thank you for all your input. We are kind of working on this, but unfortunately it takes very long and it would be awesome if we could get some support from WMF (see phab:T195861 and Community Wishlist Survey 2019/Reading/Functional and beautiful math for everyone). If you just want to avoid the error, you can use <chem>2H2{} + O2 ->[\text{点燃}] 2H2O</chem>:

However in most browsers, the rendering of 点燃 is very bad which is due to our current math extension setup. This means for a proper solution of the issue, we do not only need to remove the texvcjs which is responsible for the error, but we also need a better rendering that is equivalent to the client-side html rendering other websites use.

Side remark: Please do not use the old workaround with curly brackets around the plus anymore. Apart from removing the normal spacing this can render completely different in some cases. We are planning to make it work according to the specifications without workarounds, i.e. <chem>2H2 + O2 ->[点燃] 2H2O</chem> [1] (you can test the normal behavior at the bottom with \ce{2H2 + O2 ->[点燃] 2H2O}) and for this currently replacing those kind of workarounds with the workaround I used above, because that is a workaround which renders the same without texvcjs (the culprit for falsely removing necessary spaces) and up-to-date mhchem (without bug in {} implementation).

Please also do not try to fix the bad text rendering with workarounds like <chem>2H2{} + O2 ->[\mbox{点}\;\,\mbox{燃}] 2H2O</chem>:

because that will probably look bad for other people and look even worse if one day those rendering problems are fixed.

I would be very happy if you want to support us in phab:T195861, (testing different rendering solutions/devices, give some feedback, replacement work, investigating strange errors, code-review, translation and information for editors...).--Debenben (talk) 13:25, 15 November 2018 (UTC)[reply]

@Debenben: Your first style of "点燃" makes the ~10% right part of "点" and ~10% left part of "燃" overlapped-rendered (which by using that on zhwiki locally, you will trigger an AbuseFilter and so you can't publish your edits). Please, use your second example instead. --Liuxinyu970226 (talk) 04:32, 17 November 2018 (UTC)[reply]
  • "Make LaTeX use UTF-8, properly, natively"... what a wonderful idea. Apart from anything else, sometimes one wishes to cite people whose names are not straight ASCII characters! But as I recall this has a long history... there are kludges, but LaTeX3 has been in the works for over a quarter-century.[2] I'm not sure why, but something must be difficult. HLHJ (talk) 06:42, 18 November 2018 (UTC)[reply]
Well, it works on and 70000 other websites [3] so I would say it is feasible. We just have to use MathJax the right way and for this we might need some help to integrate it properly into the resource loader.--Debenben (talk) 20:57, 19 November 2018 (UTC)[reply]