Last modified: 2014-10-12 08:12:26 UTC
Hi, I think that adding a tag for inline TeX expressions (like $...$) and reserving <math> for displayed expressions (like \[...\]) would be a good workaround for the known problems -- before we can use MathML. In this way, the users would have a second, similar list of choices in their Math rendering Settings : one for each tag. By default, both would be set to « HTML if very simple », like now. But a user who has enough Unicode might want to set « HTML if possible » for inline TeX, and « Always PNG » for displayed TeX. « HTML if possible » still needs improvements, but it's better than nothing. I'll enter a bug for this too. And please don't tell me « keep your breath for BlahTeX ». We all know that MathML isn't currently usable. And when it'll be, the distinction between inline and displayed will be useful too. I've had this idea in response to the frequent lamentations on the french Wiki about mathematical typography, and it satisfied everyone in the mathematics project. Should I create a poll to show you the support ? A french developer told me that if a developer implemented this in a patch, we could apply it only in the french Wiki. Perhaps is it simpler and quickier to implement it in a patch than into Mediawiki. Thanks for your interest !
Rather than a poll, an example showing what difference it makes might be useful. :)
Consider : Let <math>f:x \mapsto y</math> with <center><math>y = \int_0^x g(t) dt</math></center> we say that blablabla... Currently, with the « HTML if simple » setting, the first expr. is rendered in PNG, which looks awful (bad alignment). But with the « HTML if possible » setting, the first expr. is rendered in HTML (good) but the second expr too, and that's even uglier (an array is used). It would be perfect if the first expr. is rendered in HTML and the second in PNG. Indeed, inline expressions are almost simple, but displayed expr. are generally more complicated and do not need to be perfectly aligned with the text. The two need a different rendering. Is it clearer ?
Hey ! Is there someone ?
Created attachment 4449 [details] Screen shots of example text in default, preferred HTML, and proposed mixed modes Taken on Firefox 2/Mac.
Yes, it is exactly what I suggest !
And now ?
Hello !
Three months without even an answer ! At least, tell me that you reject my idea !
Mediawiki developers are generally very busy, so non-urgent issues may receive not so much attention. There are two ways you can work around that: * Code it up yourself (without looking deeply, what you want should be doable with an extension, without touching the MediaWiki core). If the extension works well and is simple enough, it has a much higher chance of being integrated. * Ask on IRC - maybe someone is interested in fixing the bug for you.
This blocks bug 35479, which would allow to optimize a bit the MathJax mode by dropping the preprocessing phase. Currently the wiki2jax preprocessor has heuristics to guess inline or display mode (with more or less success). The LaTeXML mode does not have this preprocessing phase and directly outputs <script type="math/mml"> for MathJax. However, it does not distinguish between inline or display mode, which is a serious issue atm. Since all the formulas are currently in inline mode, what should be done instead is to add something to distinguish display equations. So for example keep <math>...</math> for inline math and allow something like <math display="block">...</math> or <displaymath>...</displaymath> to specify display mode. (Of course, that would mean that people will have to reedit all the Math pages to explicitly specify display equations)
The patch that should link here: https://gerrit.wikimedia.org/r/#/c/83666/
Change 84629 had a related patch set uploaded by Physikerwelt: Displaystyle https://gerrit.wikimedia.org/r/84629
Change 84629 merged by Physikerwelt: Displaystyle https://gerrit.wikimedia.org/r/84629
Try: http://math-test2.instance-proxy.wmflabs.org/wiki/Displaystyle
Created attachment 13311 [details] png-rendering with the proposed option display
Created attachment 13312 [details] mathml-rendering with the proposed option display
Request for comments: I created a demo page concerning the issue. http://math-test2.instance-proxy.wmflabs.org/w/index.php?title=Displaystyle You can test it with Firefox in MathML mode. (The default behavior.) If you want to test it in png mode you have to log in using the user png and the password iLovePictures MathJaX does not work at the moment, but will be once there is a agreement that the demopage looks like you want it to look like.
I just realized that equations are not centred in PNG mode tested at https://en.wikipedia.org/wiki/User:Physikerwelt/bug5600#foobar The computed style-sheet img.mwe-math-fallback-png-display { display: block; } seems to be ok
It seems that this would need an additional div block... do we want that?