Mobile app version of vmapp.org
Login or Join
Caterina187

: How to configure Mathjax in Mediawiki? 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

@Caterina187

Posted in: #Javascript #Mediawiki

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Caterina187

1 Comments

Sorted by latest first Latest Oldest Best

 

@Caterina187

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";

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme