2

I want to render latex on a mediawiki installation that I don't have shell access to. I've tried and failed to use the Math installation, so I'd like to include the equivalent of these two scripts in my mediawiki header, so that the scripts are used on all skins. Where can I include the scripts?

    <script type='text/x-mathjax-config'>
        MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: 'all'} } });
    </script>
    <script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&#038;ver=3.5.1'>
    </script>

I tried including the second script by editing in the browser ..wiki/index.php/Mediawiki:Common.js and ..wiki/index.php/Mediawiki:Mobile.js, adding

mw.loader.load( 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&#038;ver=3.5.1' )

Where can I add the MathJax.Hub.Config script?

1 Answer 1

1

I deleted everything in Mediawiki:Common.js and put it all in wiki/includes/OutputPage,php

i.e. I changed

$ret .= $this->buildCssLinks();
$ret .= $this->getHeadScripts() . "\n";

to

$ret .= $this->buildCssLinks();
$ret .= "
            <script type='text/x-mathjax-config'>
                    MathJax.Hub.Config({ TeX: { equationNumbers: {autoNumber: 'all'} } });
            </script>
            <script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&#038;ver=3.5.1'></script> \n";
$ret .= $this->getHeadScripts() . "\n";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.