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:
Derk-Jan Hartman 2013-04-27 15:28:46 +02:00
parent 84d531cca0
commit 32acbe3f47
2 changed files with 35 additions and 20 deletions

13
README
View File

@ -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
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
php tests/phpunit/phpunit.php extensions/Math/tests/
from your MediWiki home path.

View File

@ -11,27 +11,29 @@
mathJax.loaded = false;
mathJax.Config = function () {
MathJax.Hub.Config({
root: mw.config.get('wgExtensionAssetsPath') + '/Math/modules/MathJax',
config: ['TeX-AMS-texvc_HTML.js'],
'v1.0-compatible': false,
styles: {
'.mtext': {
'font-family': 'sans-serif ! important',
'font-size': '80%'
}
},
displayAlign: 'left',
menuSettings: {
zoom: 'Click'
},
'HTML-CSS': {
imageFont: null,
availableFonts: ['TeX']
mathJax.config = $.extend( true, {
root: mw.config.get('wgExtensionAssetsPath') + '/Math/modules/MathJax',
config: ['TeX-AMS-texvc_HTML.js'],
'v1.0-compatible': false,
styles: {
'.mtext': {
'font-family': 'sans-serif ! important',
'font-size': '80%'
}
});
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 () {