Extension:Math/CustomizationHook

How to Create an MediaWiki Hook to Customize MathJax edit

  • Add the following code in the file Math.php. This defines the hook 'ext.math.mathjax.customize'.
$wgResourceModules += array(
    'ext.math.mathjax.customize' => array(
        'dependencies' => 'ext.math.mathjax.mathjax' )
);
  • Then add the following code to specify where the hook is called.
mw.loader.load( 'ext.math.mathjax.customize' );

You can add this anywhere in the file ext.math.mathjax.enabler.js. However, for most customizations, you can add this after the MathJax.Hub.Config call in the function mathJax.Init.

  • Now you can use the hook to modify the MathJax configuration.