Requests for comment/Reduce math rendering preferences

This is a requests for comment about reimplementing the info action.

Background

 * wikitech-l thread
 * follow-up threadlet
 * follow-up threadlet
 * w:Wikipedia talk:WikiProject Mathematics
 * w:Wikipedia talk:WikiProject Mathematics

Bug 24207 requests switching the math rendering preference default from its current setting (which usually produces a nice PNG and occasionally produces some kinda ugly HTML) to the "always render PNG" setting.

I'd actually propose dropping the rendering options entirely...


 * "HTML if simple" and "if possible" often produce horrible ugly output that nobody likes, so people use hacks to force PNG rendering. Why not just render to PNG?
 * "MathML" mode is even MORE limited than "HTML if simple", making it entirely useless.
 * nobody even knows what "Recommended for modern browsers" means, but it seems to be somewhere in that "occasionally crappy HTML, usually PNG" continuum.

So we're left with only two sane choices:


 * Always render PNG
 * Leave it as TeX (for text browsers)

Text browsers will show the alt text on the images, which is... the TeX code. So even this isn't actually needed for its stated purpose. (Hi Jidanni! :) lynx should show the tex source when using the PNG mode.)

The feedback I've received so far indicates that the 'leave as tex' option is mostly used in concert with gadgets or user scripts to run MathJax rendering.

But the immediate fix of removing those extra unwanted options seems like it can be an easy win to reduce complexity and inconsistency in the math rendering behavior.

Supplementary possibilities
Integrating MathJax-style rendering automatically in supported browsers could be useful, and might eliminate the need to keep the 'leave it as tex' option.

Not covered
Full core integration of alternate rendering technologies (eg replacing Math + texvc with Wikitex etc) are not considered at this time.

But collecting specific information to make a future change decision is useful!
 * texvc currently cannot send baseline information which is necessary to properly position the image relative to text
 * -> future image rendering should either improve texvc or replace it with a tool that already does this
 * blahtex PNG rendering apparently has this
 * blahtex MathML rendering should also be nicer
 * -> reconsider blahtex in more detail at some point!

Implementation
Key:
 * 1) remove the following options from math preferences:
 * 2) * 'HTML is very simple or else PNG'
 * 3) * 'HTML if possible or else PNG'
 * 4) * 'Recommended for modern browsers'
 * 5) * 'MathML if possible (experimental)
 * 6) Have all of those options, where already present, fall back to the 'Always render PNG' option.

Possible secondary:
 * 1) remove the math rendering preferences entirely, and always send the PNG image
 * 2) create a common gadget, extension, or built-in feature to enable MathJax or similar rendering to replace the image alt text, letting people transition to that mode

Open questions

 * Are there other legit uses for the 'Leave as TeX' option? The TeX source is still available as the alt text on the tag, so custom scripts manipulating it can use that.

Comments
From my perhaps idiosyncratic point of view, the most obvious issues are these:

This page may also shed some light (although much of what it deals with concerns quite different matters). Michael Hardy 20:01, 21 July 2011 (UTC)
 * "Displayed", as opposed to "inline" TeX looks very good in Wikipedia articles, but "inline" TeX usually looks about three or four times as big as the surrounding text, and that looks buffoonish.
 * In "inline" TeX, simple things like a^b and a_b are formatted wrong: obviously in both cases the a should be at the same level as the surrounding text and the b respectively higher or lower.
 * Making everyone use mathJax may be the solution, but mathJax still has bugs. Wikipedia needs more sophisticated behavior from mathJax than do other forums that use it, such as stackexchange and mathoverflow. For problems with the behavior of mathJax within Wikipedia, see this URL. Michael Hardy 19:56, 21 July 2011 (UTC)


 * I find myself worrying that things like $$a^b$$, which currently look just fine, will be turned into things like $$a^b\,$$ , which don't. It's simple formulas like these that get used most often outside of math articles, and while they look fine in HTML, they look terrible as PNGs because their baselines are wrong.  E.g., in en:Chemistry we find, "The speed of a chemical reaction (at given temperature T) is related to the activation energy E, by the Boltzmann's population factor $$e^{-E/kT}$$", which doesn't look great but isn't awful.  If we force PNG rendering then we get, "The speed of a chemical reaction (at given temperature T) is related to the activation energy E, by the Boltzmann's population factor $$e^{-E/kT}\,$$", which is atrocious.  If not for baseline problems, I would support removing HTML rendering, but as it is I'm conflicted.However, I would support reducing the number of possibilities down to three: TeX only, PNG only, and a single HTML option.  There's no reason to have so many different HTML options. Ozob 21:59, 21 July 2011 (UTC)
 *  If not for baseline problems, I would support removing HTML rendering, but as it is I'm conflicted.
 * I agree. Helder 22:25, 21 July 2011 (UTC)
 * Helder, you say $$a^b$$ looks fine, but that actually depends on how the user's preferences are set. I recently went through the steps whose details I prefer not to remember just now (it involved creating a special file....) that caused me to see everything as mathJax makes it appear, so that now both $$a^b$$ and $$a^b\,$$ look good when I view them on Wikipedia, but the latter doesn't look good when I view it here. Michael Hardy 22:37, 21 July 2011 (UTC)
 * Actually, it was Ozob who said that =)
 * And in fact the result depends on the user preferences (for me both formulas are identical since I'm using "Always render PNG" at the moment), so I've added the wikicode on the side of his formulas to help other readers to understand what he said above. Helder 22:47, 21 July 2011 (UTC)
 * Thank you, it's clearer with the wikicode next to it. Ozob 01:17, 22 July 2011 (UTC)

I have now notified the mathJax software developers of the existence of this present page and the one at this URL. I'd really like to see mathJax brought up to the state in which it can make sense to just force everyone who reads Wikipedia math articles to use mathJax. This page elicited some support for that. But it's a page for people discussing how to edit, develop, and maintain Wikipedia's math articles, not for software developers who can actually do something about the software. The software developers (both those who read pages like the present one and those who work on mathJax) need to know what the needs are from the point of view of the people who post to those pages. Robert Miner at mathJax.org, who is interested in supporting Wikipedia, now knows about the following pages, and so should everyone here: Michael Hardy 22:50, 21 July 2011 (UTC)
 * http://en.wikipedia.org/wiki/User_talk:Nageh/mathJax
 * http://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Mathematics
 * http://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Mathematics/Archive/2011/Jul
 * this present page

mathJax
On 25 June 2011, David Eppstein wrote in this discussion: "I would very much like to see mathjax become standard for Wikipedia math formatting, so that no special user-preference tweaking is required; it works well on the other sites I've used that use it (e.g. mathoverflow and mathscinet) and looks a lot better a lot more consistently than the alternatives." It appears to me that would solve the problems everyone's been griping and arguing about on that discussion page since 2003, provided some bugs can be fixed. Bugs are listed at http://en.wikipedia.org/wiki/User_talk:Nageh/mathJax. Those need to get fixed by software people at mathJax.org, who are now aware of that page and are interested in Wikipedia's adopting David Eppstein's suggestion.

The other thing that would need to get done would be done by those who edit the software that Wikipedia uses. Michael Hardy 00:26, 22 July 2011 (UTC)