Created
July 28, 2015 10:57
-
-
Save pkra/794a1d9a35ae2428eaff to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// add to User:YOURNAME/common.js to get smooth MathJax rendering | |
var mathTags = $('.mwe-math-mathml-a11y'); | |
if (mathTags.length > 0){ //only do something when there's math on the page | |
window.MathJax = { | |
SVG: {blacker: 1}, // clearer SVG output, in case people switch to SVG output | |
AuthorInit: function () { | |
MathJax.Hub.Register.StartupHook("End",function () { //when MathJax is done... | |
MathJax.Hub.Queue( | |
function(){ | |
mathTags.removeClass('mwe-math-mathml-a11y'); // .. make the span around MathML (now MathJax output) visible | |
$('.mwe-math-fallback-image-inline').addClass('mwe-math-mathml-a11y'); //remove the SVG image thingie | |
} | |
); | |
}); | |
} | |
}; | |
mw.loader.load('https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=MML_HTMLorMML'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment