# Enable MathML by defaultClosed, ResolvedPublicActions

Subscribers
Tokens
"Love" token, awarded by Hungryce."Love" token, awarded by Kulla."Love" token, awarded by Physikerwelt.
Assigned To
Authored By
Whatamidoing-WMF, Mar 29 2016

# Description

This task was merged with other similar tasks
: T131190: Set MathML / SVG as the default rendering mode on de.wikibooks.org
: T130699: Change default [itex] display to utilise "MathML with SVG or PNG fallback" at English Wikisource.

The original request was:
It appears that there was an RFC at enwiki about mathematics preferences. It was closed as a consensus to change the default to MathML. The discussion is here: https://en.wikipedia.org/wiki/Wikipedia_talk:Special:Preferences#RfC:_Change_Default_Math_Appearance_Setting_to_MathML

### Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Physikerwelt moved this task from Incoming to Doing on the Math board.May 10 2016, 1:46 PM

Change 287952 had a related patch set uploaded (by Physikerwelt):
Catch exceptions thrown by restbase

https://gerrit.wikimedia.org/r/287952

As discussed on IRC with @mobrovac the changing of the default mode is scheduled in the following phases:

1. tuesday 2016-05-17 dewikibooks, mediawikiwiki, wikidata, and test
2. thursday 2016-05-19 all wikibooks
3. tuesday 2016-05-26 the rest

@Lydia_Pintscher is that OK for wikidata (we did not get feedback on IRC)

@Physikerwelt I am not able to say as I don't understand the implications of the change. Can you elaborate here or on IRC?

Just talked on IRC with @Physikerwelt. It seems for Wikidata this is a cosmetic change and outside of item pages we likely don't have a lot of formulas anyway so I think it is good to go.

mobrovac claimed this task.May 15 2016, 7:52 AM
mobrovac triaged this task as Normal priority.
1. tuesday 2016-05-17 dewikibooks, mediawikiwiki, wikidata, and test

I ended up putting it up for SWAT for today.

@mobrovac Why did you remove those projects?

@mobrovac Why did you remove those projects?

Ups, wanted to remove only Wikimedia-Site-requests , sorry for the confusion.

@mobrovac Why did you remove those projects?

Ups, wanted to remove only Wikimedia-Site-requests , sorry for the confusion.

Doesn't it need any changes to InitialiseSettings.php or any other config file?

Resurrected that too. Its definition has changed since I last checked it.

Thanks. Consider also adding Mathoid (most of Math tasks have overlap with it...).

Change 286180 merged by jenkins-bot:
Enable MathML rendering by default on test, wikidata and dewikibooks

https://gerrit.wikimedia.org/r/286180

Thanks. Consider also adding Mathoid (most of Math tasks have overlap with it...).

Yup, indeed, but that's not the case here. The Math extension is already actively using Mathoid behind the scenes when the MathML mode is selected, this task is about enabling that in the extension.

And thanks for pointing out my phab-project mistakes.

As of now, MathML is the default rendering mode on:

Is there anything left blocking this or can we go ahead and make the change for en.wikipedia.org as the original RFC was?

Hungryce raised the priority of this task from Normal to High.May 24 2016, 8:12 PM

Our enwiki RFC was closed a long time ago. Can we make the change on en.wikipedia.org now? I can't do this myself as I don't know how it is done and I probably don't have the permissions to do so.

@mobrovac will take care of this task.

Our time schedule was

1  tuesday  2016-05-17 dewikibooks, mediawikiwiki, wikidata, and test
2  thursday 2016-05-19 all wikibooks
3  tuesday  2016-05-26 the rest

My feeling is that T135955 should be closed before 3.

This comment was removed by Urbanecm.
Urbanecm lowered the priority of this task from High to Normal.May 24 2016, 8:33 PM

Usually an assignee decide priority so reverting ir.

@Urbanecm I think it would be much better to wait for @mobrovac so
that this process works smoothly and is coordinated by a single person
keeping track of everything that needs to be done.

Hungryce added a comment.EditedMay 25 2016, 12:22 AM

@Physikerwelt is said "3 tuesday 2016-05-26 the rest" but today is the 24th, not the 26th and it is tuesday. Also, is it done now then?

Change 290644 had a related patch set uploaded (by Mobrovac):
Math: Enable MathML on all wikibooks

https://gerrit.wikimedia.org/r/290644

Moving all wikibooks projects to MathML by default has been scheduled for today, May 25. If all goes according to plan, moving all of the projects to use MathML by default will happen early next week (Monday or Tuesday at the latest).

The delay in schedule has been due to some setbacks with the MW deploy train and some extra bugs we've uncovered in Mathoid, the MathML rendering service.

Thanks, @mobrovac. I hope that everything goes on schedule.

Change 290644 merged by jenkins-bot:
Math: Enable MathML on all wikibooks

https://gerrit.wikimedia.org/r/290644

Just wondering how this works with VE. Currently when editing with VE on mediawiki.org (which I beleive has the new system). The VE displays existing equations in PNG mode, but if you edit them it seems to switch to SVG mode. After a save re-editing seems to all be in SVG mode. I'm also seeing more space than I'd like around display equations in VE

Compare editing
https://www.mediawiki.org/w/index.php?title=User:Salix_alba&oldid=1879446&veaction=edit
displays using PNG

with
https://www.mediawiki.org/w/index.php?title=User:Salix_alba&oldid=2148821&veaction=edit
displays using SVG. If I use <math display="block"> around an equation VE is displaying much too much space around the equation.

I've also managed to cause a situation where the equations didn't display at all. Start editing in source mode, then switch to VE and the equations don't display. I'll file a separate bug for this.

Change 291766 had a related patch set uploaded (by Mobrovac):
Math: Enable MathML everywhere but private wikis

https://gerrit.wikimedia.org/r/291766

MathML has been scheduled to become the default on all wikis on Tuesday, May 31st.

Almost there! I hope we don't have any more delays!

Change 291766 merged by jenkins-bot:
Math: Enable MathML everywhere but private wikis

https://gerrit.wikimedia.org/r/291766

mobrovac closed this task as Resolved.May 31 2016, 3:14 PM

MathML is now the default rendering mode for all users on all projects. Resolving (finally) !

It very very broken at the moment. On en.wikipedia.org

I'm getting messages like

Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "/mathoid/local/v1/":): {\displaystyle A \frac{\pi}{2}}

Hungryce reopened this task as Open.May 31 2016, 9:42 PM

Unless I am missing something it does not appear to be enabled on en-wiki. Using the following link with and without being logged in (I have enabled MathML/SVG) and logging out I can see that while logged in I get SVG and logged out I get PNG: https://en.wikipedia.org/wiki/Fibonacci_number. Bowser is Chrome:
Google Chrome 53.0.2751.0 (Official Build) canary (64-bit)
Revision 25dc7aadaf1e9e972b9e7ae1ca706d61b247c577-refs/heads/master@{#396593}
OS Mac OS X
Blink 537.36 (@25dc7aadaf1e9e972b9e7ae1ca706d61b247c577)
JavaScript V8 5.3.64
Flash 22.0.0.168
User Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2751.0 Safari/537.36
Command Line /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary -psn_0_28679 --restore-last-session --flag-switches-begin --allow-nacl-socket-api=* --enable-app-info-dialog-mac --data-reduction-proxy-lo-fi=slow-connections-only --debug-packed-apps --enable-device-discovery-notifications --disable-gesture-requirement-for-media-playback --disable-hosted-app-shim-creation --enable-hosted-apps-in-windows --enable-new-bookmark-apps --enable-account-consistency --enable-add-to-shelf --enable-app-window-controls --enable-apps-file-associations --enable-display-list-2d-canvas --enable-embedded-extension-options --enable-experimental-canvas-features --enable-experimental-web-platform-features --enable-extension-action-redesign --enable-fast-unload --enable-fill-on-account-select --google-profile-info --enable-gpu-rasterization --enable-grouped-history --enable-harfbuzz-rendertext --enable-hosted-app-quit-notification --javascript-harmony --enable-md-extensions --enable-md-policy-page --enable-message-center-always-scroll-up-upon-notification-removal --enable-native-notifications --enable-navigation-tracing --new-profile-management --enable-offer-store-unmasked-wallet-cards --enable-offline-auto-reload --enable-panels --enable-password-generation --enable-print-preview-register-promos --enable-quic --enable-scroll-prediction --enable-settings-window --use-simple-cache-backend=on --enable-single-click-autofill --enable-site-engagement-service --enable-spelling-feedback-field-trial --enable-suggestions-with-substring-match --enable-tab-audio-muting --enable-translate-new-ux --enable-use-zoom-for-dsf=true --enable-web-bluetooth --enable-wasm --enable-webgl-draft-extensions --enable-webrtc-stun-origin --enable-zero-copy --enable-experimental-extension-apis --extensions-on-chrome-urls --inert-visual-viewport --enable-lcd-text --enable-mac-views-native-app-windows --mark-non-secure-as=neutral --media-router=1 --save-page-as-mhtml --show-autofill-type-predictions --show-saved-copy=secondary --top-chrome-md=material --trace-upload-url=https://performance-insights.appspot.com/upload?tags=flags,TestingTeam --enable-features=AutomaticTabDiscarding,DownloadResumption,MaterialDesignHistory,MaterialDesignUserManager,PrintPreviewDistiller,StaleWhileRevalidate2,WebRTC-H264WithOpenH264FFmpeg,affiliation-based-matching,enable-automatic-password-saving,enable-manual-password-generation,enable-password-force-saving --flag-switches-end
Executable Path /Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary
Profile Path /Users/bryce/Library/Application Support/Google/Chrome Canary/Default
Variations 6a89113b-e4b26eb4
d0bd833b-85fb2903
16e0dd70-3f4a17df
31101bd6-85fb2903
b3888d8d-c9ada70b
da89714-4ad60575
4a449931-3f4a17df
6345b824-3f4a17df
7c1bc906-ff96eb58
ba3f87da-a6404135
f049a919-3f4a17df
76b48ab8-a2567007
31362330-3f4a17df
c70841c8-a2567007
f15c1c09-ca7d8d80
9ffc5535-42aa1e47
dd4da2fc-3f4a17df
43d0dd1e-f23d1dea
6d340565-ca7d8d80
9e243dd-3f4a17df
9e5c75f1-eede013c
64cbdfc2-ca7d8d80
c3ad0f6b-ca7d8d80
f79cb77b-1963db0f
b7786474-64e7d9a
23a898eb-ca7d8d80
868bda90-3f4a17df
4ea303a6-85fb2903
d5b671a5-ca7d8d80
4117e878-23622c9b
9736de91-3f4a17df
dbffab5d-ca7d8d80
30e679f-f23d1dea
ca314179-9597b6c7
69bf80fa-f23d1dea
867c4c68-ca7d8d80
12a73824-3f4a17df
76923fa8-e0ae2f34
3ac60855-486e2a9c
f296190c-9d9eea77
4442aae2-7158671e
ed1d377-e1cc0f14
75f0f0a0-d7f6b13c
e2b18481-4ad60575
e7e71889-4ad60575
9f0416c1-ec60c096
b39ea213-d1372334
fe05be5f-4001c964
61b920c1-61871b8c
46567c16-89e195db
71140742-1963db0f

Further to the above. My preference was set to "MathML with SVG or PNG fallback" before the rollout. When I started editing in the source editor the preview was full of red error messages. These persisted when saving.

I've managed to fix things by switching my preference to PNG mode, saving. Then switching my preference back to ""MathML with SVG or PNG fallback". Things seem to be working OK now.

This has also been discussed on https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#MathML_glitch
it seems like some edits are corrupting the mathematics in some pages, and the pages needed to be purged. It seems to be articles which were edited at around 22:22 on 31 May 2016

TTO added a subscriber: TTO.EditedMay 31 2016, 11:42 PM

This change means that it is no longer possible to copy and paste math (from Chrome at least). It might help to make the SVG fallback an actual inline image, but I can't even seem to get that to copy and paste.

I know a lot of people that copy and paste equations from Wikimedia sites (WP and WB) as a quick and easy way of displaying them in presentations and the like, and this is going to break that.

Hungryce raised the priority of this task from Normal to High.Jun 1 2016, 12:27 AM

It appears whatever problem I had has been fixed. I agree with the above on creating an image so it can be copy/pasted rather than whatever it is now. I think that this can be an easy fix at least temporarily so I am increasing the priority.

mobrovac closed this task as Resolved.Jun 1 2016, 5:54 AM
mobrovac lowered the priority of this task from High to Normal.

Both the errors and the appearance of MathML not being enabled were short-lived side-effects of page caching, should be gone now. For in-lined SVG images, I've created T136672. This is a technical task about the roll-out itself which has been completed.

Rillke added a subscriber: Rillke.Jun 1 2016, 8:00 AM

Is that a result of enabeling MathML?

Seems like its the optional parameter

\begin{arrray}{rcl} ...

works fine but

\begin{arrray}[h]{rcl} ...

fails. I'm not sure what the parameter did and can see any difference or any documentation for the syntax.

Is that a result of enabeling MathML?

Tracked in T136685

SalixAlba reopened this task as Open.Jun 1 2016, 6:59 PM

I'm still getting sporadic

"Math extension cannot connect to Restbase."

and

Failed to parse (Conversion error. Server ("https://en.wikipedia.org/api/rest_") reported: "Cannot get mml. Server problem."): R_{2}

errors. I get a different set of errors each time I press "Show preview" without changing the text.

Hungryce raised the priority of this task from Normal to High.Jun 1 2016, 11:37 PM

I don't think it would work but @SalixAlba can you try purging the page? Also, this is quite important so I am increasing the priority.

Hey @mobrovac and @Physikerwelt, do you think a banner should be put up (for all users or just logged in ones?) that MathML is now the default and if you are logged in that it is recommended to enable it? I have already put up an RFC for T136685#2345546 at https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(proposals)#RFC:_Replace_all_instances_of_.5Bh.5D_in_TeX.2FLaTeX_.28and_in_MathJax.29_with_.5Btcb.5D so I could easily add that banner as part of the RFC for en-wiki at least. I think there is some global version on meta, but I would recommend someone else add that as I am very active in that community.

I'm not sure about a banner but It should probably go in the Tech news https://meta.wikimedia.org/wiki/Tech/News
which appear in the Signpost and elsewhere.

I also think the name of the preference option should be changed. It's misleading to say it is MathML when MathML is never actually served. Its probably simpler just to call it the SVG option.

As to the sporadic errors. This might be a stability issue. How often do the servers fall over?

mobrovac closed this task as Resolved.Jun 2 2016, 10:01 AM
mobrovac added a project: User-notice.

I have already put up an RFC for T136685#2345546 at https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(proposals)#RFC:_Replace_all_instances_of_.5Bh.5D_in_TeX.2FLaTeX_.28and_in_MathJax.29_with_.5Btcb.5D so I could easily add that banner as part of the RFC for en-wiki at least.

Neat! Thnx @Hungryce

I'm not sure about a banner but It should probably go in the Tech news https://meta.wikimedia.org/wiki/Tech/News
which appear in the Signpost and elsewhere.

Great suggestion! Added to 2016 vol 22.

I also think the name of the preference option should be changed. It's misleading to say it is MathML when MathML is never actually served. Its probably simpler just to call it the SVG option.

It's not misleading. It's MathML with SVG fallback. The MML is served, it's just that your browser (and unfortunately the majority of them) doesn't support it.

I'm still getting sporadic

"Math extension cannot connect to Restbase."

and

Failed to parse (Conversion error. Server ("https://en.wikipedia.org/api/rest_") reported: "Cannot get mml. Server problem."): R_{2}

errors. I get a different set of errors each time I press "Show preview" without changing the text.

I understand that you are having issues, but a couple of notes. As I previously stated, this task is about the technical roll-out of the feature. Any fall-outs should be tracked in their own tickets; sticking everything here makes the ticket hard to read and follow, making it counter-productive. Secondly, when you experience problems, please try to provide as many details as possible.

I'm still getting sporadic

"Math extension cannot connect to Restbase."

and

Failed to parse (Conversion error. Server ("https://en.wikipedia.org/api/rest_") reported: "Cannot get mml. Server problem."): R_{2}

errors. I get a different set of errors each time I press "Show preview" without changing the text.

Tracked in T136812, let's continue this discussion there.

Update with regard to 3: It took a while but we got plenty of feedback now. As a result we reconsidered to decision to delver MathML as default for firefox users. Now they get SVG's as well and need to install a add on which provides really good MathML support.

A firefox user who has been using MathML has asked about loosing this at
https://en.wikipedia.org/wiki/Help_talk:Displaying_a_formula#MathML_broken_again.3F
is there a way people who want MathML can get that?

@SalixAlba I wrote a reply on that page. There is a new section on https://www.mediawiki.org/wiki/Extension:Math "Viewing math" that describes method to get optimal rendering results with various browsers.

I'm going to go ahead and put up an RFC for a banner on en-wiki later today. If people think it is a bad idea there, then it won't go up. If not you might see a banner advertising MathML with SVG or PNG fallback soon!

Does anyone know of an extension for native MathML display on Chrome? I have tried a couple of extensions, but they don't seem to work.

No, Chrome is not supported at all. There is a plugin, which works over http but not over https https://github.com/andrusha/mathml-chrome/issues/7

Chrome is what I usually use, and it has all the extensions I use. I should just use another browser as I have every browser available for my computer (except Chromium as I don't feel like compiling it).

This change means that it is no longer possible to copy and paste math (from Chrome at least). It might help to make the SVG fallback an actual inline image, but I can't even seem to get that to copy and paste.
I know a lot of people that copy and paste equations from Wikimedia sites (WP and WB) as a quick and easy way of displaying them in presentations and the like, and this is going to break that.

This little bit of javascript in your vector.js makes it so that when you double click on a maths equation an alert box pops up with latex in it.

$(".mwe-math-mathml-a11y").each(function(ind,ele) {$(ele.parentElement).dblclick(function(ev) {
var root = ev.delegateTarget;
var latex = \$(root).find("annotation").text();
alert(latex);
});
});

You can then copy and paste that. There might be an easier implement this, say a right click menu. At one point the latex was in the title/alt text of the image.

TTO added a comment.Jun 5 2016, 2:50 AM

This little bit of javascript in your vector.js makes it so that when you double click on a maths equation an alert box pops up with latex in it.

Sure, but I wasn't really talking about myself. I was referring to a loss of functionality to a wider, non-technical audience, who just want to copy the mathematical equations as graphics for display.

@TTO, @SalixAlba: @Physikerwelt is also re-adding the alt text attribute to the SVG in T136915. This has been merged today, so should go out this week.

AuFCL removed a subscriber: AuFCL.Nov 21 2016, 7:39 PM