mediawiki-extensions-Math/modules/ext.math.mathjax.js
Moritz Schubotz (physikerwelt) 11dc0e4b97 Add MathJax rendering option
When collecting user feedback regarding the native
rendering option on the German Wikipedia (T346795)
it became apparent that some power users aim for bigger
and bolder fonts and a more LaTeX-like layout.
MathML, however, aims to format math as an integral part
of the text with uniform fonts and spacing.

To match both user needs, this patch adds a new rendering
option that uses client-side MathJax (without a need for
restbase or mathoid).

* Adjust MathJax`s loader to be compatible with the mw loader
* Add new rendering mode
* Copy MathJax source to resource module as foreign repo

Bug: T354136
Change-Id: I1ecf9c77fefc3b0f717107d81979276023f6cb84
(cherry picked from commit 277663b822)
2024-06-24 00:03:07 +00:00

15 lines
392 B
JavaScript

( function () {
'use strict';
const extensionAssetsPath = mw.config.get( 'wgExtensionAssetsPath' );
window.MathJax = {
loader: {
// see https://docs.mathjax.org/en/latest/input/mathml.html
load: [ '[mml]/mml3' ],
// see https://docs.mathjax.org/en/latest/options/startup/loader.html
paths: {
mathjax: extensionAssetsPath + '/Math/modules/mathjax/es5'
}
}
};
}() );