Created
December 31, 2015 14:06
-
-
Save connordavison/078257e8b69ea6cf75cc to your computer and use it in GitHub Desktop.
Inject MathJax into the page (protocol agnostic).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var cdn, config; | |
if (typeof MathJax !== "undefined" && MathJax !== null) { | |
return; | |
} | |
config = document.createElement('script'); | |
config.setAttribute('type', 'text/x-mathjax-config'); | |
config.innerHTML = "MathJax.Hub.Config({\n tex2jax: {inlineMath: [['$','$'], ['\\\\(','\\\\)']]}\n});"; | |
cdn = document.createElement('script'); | |
cdn.setAttribute('type', 'text/javascript'); | |
cdn.setAttribute( | |
'src', | |
window.location.protocol | |
+ '//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' | |
); | |
document.head.appendChild(config); | |
return document.head.appendChild(cdn); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Needed this for https://www.behind-the-enemy-lines.com/2008/01/are-you-bayesian-or-frequentist-or.html?m=1
Thanks! :)