MathJax: Allow user to configure MathJax
The user can provide his own mathJax.config object. Supersedes: https://gerrit.wikimedia.org/r/61182 PS2: Add relevant info for this feature to README Bug: 35478 Change-Id: I97800317366aafcaad87ecf6644e9417c698c5da
This commit is contained in:
parent
84d531cca0
commit
32acbe3f47
13
README
13
README
|
@ -7,6 +7,19 @@ This version (for MediaWiki 1.19) has some changes since previous versions:
|
||||||
See the README in the math subdirectory for more info on setting up the
|
See the README in the math subdirectory for more info on setting up the
|
||||||
low-level conversion tools.
|
low-level conversion tools.
|
||||||
|
|
||||||
|
MathJax configuration:
|
||||||
|
Client-side configuration of MathJax can be done by specifying a mathJax.config
|
||||||
|
table, which takes a table as described in:
|
||||||
|
http://docs.mathjax.org/en/v1.1-latest/options/index.html#configuration
|
||||||
|
|
||||||
|
Example:
|
||||||
|
if ( typeof mathJax === 'undefined' ) {
|
||||||
|
mathJax = {};
|
||||||
|
mathJax.config = {
|
||||||
|
showProcessingMessages: true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
For testing your installation run
|
For testing your installation run
|
||||||
php tests/phpunit/phpunit.php extensions/Math/tests/
|
php tests/phpunit/phpunit.php extensions/Math/tests/
|
||||||
from your MediWiki home path.
|
from your MediWiki home path.
|
||||||
|
|
|
@ -11,27 +11,29 @@
|
||||||
|
|
||||||
mathJax.loaded = false;
|
mathJax.loaded = false;
|
||||||
|
|
||||||
mathJax.Config = function () {
|
mathJax.config = $.extend( true, {
|
||||||
MathJax.Hub.Config({
|
root: mw.config.get('wgExtensionAssetsPath') + '/Math/modules/MathJax',
|
||||||
root: mw.config.get('wgExtensionAssetsPath') + '/Math/modules/MathJax',
|
config: ['TeX-AMS-texvc_HTML.js'],
|
||||||
config: ['TeX-AMS-texvc_HTML.js'],
|
'v1.0-compatible': false,
|
||||||
'v1.0-compatible': false,
|
styles: {
|
||||||
styles: {
|
'.mtext': {
|
||||||
'.mtext': {
|
'font-family': 'sans-serif ! important',
|
||||||
'font-family': 'sans-serif ! important',
|
'font-size': '80%'
|
||||||
'font-size': '80%'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
displayAlign: 'left',
|
|
||||||
menuSettings: {
|
|
||||||
zoom: 'Click'
|
|
||||||
},
|
|
||||||
'HTML-CSS': {
|
|
||||||
imageFont: null,
|
|
||||||
availableFonts: ['TeX']
|
|
||||||
}
|
}
|
||||||
});
|
},
|
||||||
MathJax.OutputJax.fontDir = mathJax.fontDir = mw.config.get('wgExtensionAssetsPath') + '/Math/modules/MathJax/fonts';
|
displayAlign: 'left',
|
||||||
|
menuSettings: {
|
||||||
|
zoom: 'Click'
|
||||||
|
},
|
||||||
|
'HTML-CSS': {
|
||||||
|
imageFont: null,
|
||||||
|
availableFonts: ['TeX']
|
||||||
|
}
|
||||||
|
}, mathJax.config );
|
||||||
|
|
||||||
|
mathJax.Config = function () {
|
||||||
|
MathJax.Hub.Config( mathJax.config );
|
||||||
|
MathJax.OutputJax.fontDir = mw.config.get('wgExtensionAssetsPath') + '/Math/modules/MathJax/fonts';
|
||||||
};
|
};
|
||||||
|
|
||||||
mathJax.Load = function () {
|
mathJax.Load = function () {
|
||||||
|
|
Loading…
Reference in New Issue