Last modified: 2014-10-12 08:12:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T14223, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 12223 - Allow distinction between inline and display math
Allow distinction between inline and display math
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
All All
: Low enhancement with 3 votes (vote)
: ---
Assigned To: physikerwelt
Depends on:
Blocks: Wikisource 35479
  Show dependency treegraph
Reported: 2007-12-06 21:43 UTC by Florian
Modified: 2014-10-12 08:12 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---

Screen shots of example text in default, preferred HTML, and proposed mixed modes (24.69 KB, image/png)
2007-12-18 19:30 UTC, Brion Vibber
png-rendering with the proposed option display (124.51 KB, image/png)
2013-09-18 17:05 UTC, physikerwelt
mathml-rendering with the proposed option display (104.76 KB, image/png)
2013-09-18 17:05 UTC, physikerwelt

Description Florian 2007-12-06 21:43:54 UTC
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 !
Comment 1 Brion Vibber 2007-12-07 15:34:44 UTC
Rather than a poll, an example showing what difference it makes might be useful. :)
Comment 2 Florian 2007-12-07 16:49:03 UTC
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 ?
Comment 3 Florian 2007-12-17 11:09:37 UTC
Hey ! Is there someone ?
Comment 4 Brion Vibber 2007-12-18 19:30:29 UTC
Created attachment 4449 [details]
Screen shots of example text in default, preferred HTML, and proposed mixed modes

Taken on Firefox 2/Mac.
Comment 5 Florian 2007-12-18 19:44:12 UTC
Yes, it is exactly what I suggest !
Comment 6 Florian 2008-01-14 11:25:38 UTC
And now ?
Comment 7 Florian 2008-02-23 16:30:38 UTC
Hello !
Comment 8 Florian 2008-03-22 01:48:07 UTC
Three months without even an answer ! At least, tell me that you reject my idea !
Comment 9 Thomas Bleher 2008-03-26 17:51:08 UTC
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.
Comment 10 Frédéric Wang 2013-09-10 12:40:50 UTC
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


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)
Comment 11 physikerwelt 2013-09-17 06:44:38 UTC
The patch that should link here:
Comment 12 Gerrit Notification Bot 2013-09-17 20:28:20 UTC
Change 84629 had a related patch set uploaded by Physikerwelt:
Comment 13 Gerrit Notification Bot 2013-09-17 20:36:58 UTC
Change 84629 merged by Physikerwelt:
Comment 15 physikerwelt 2013-09-18 17:05:05 UTC
Created attachment 13311 [details]
png-rendering with the proposed option display
Comment 16 physikerwelt 2013-09-18 17:05:43 UTC
Created attachment 13312 [details]
mathml-rendering with the proposed option display
Comment 17 physikerwelt 2013-09-18 17:09:18 UTC
Request for comments:

I created a demo page concerning the issue.

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


and the password


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.
Comment 18 physikerwelt 2014-09-03 19:20:57 UTC
I just realized that equations are not centred in PNG mode tested at
The computed style-sheet

 img.mwe-math-fallback-png-display {
    display: block;

seems to be ok
Comment 19 physikerwelt 2014-09-03 19:24:41 UTC
It seems that this would need an additional div block...
do we want that?

Note You need to log in before you can comment on or make changes to this bug.