Terrence Tao MathJax
// ==UserScript== | |
// @name Tao | |
// @namespace tao | |
// @include https://terrytao.wordpress.com/* | |
// @include http://terrytao.wordpress.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
latex = document.getElementsByClassName('latex'); | |
try { | |
for (i in latex) { | |
new_span = document.createElement('span'); | |
new_span.innerHTML = '$'+latex[i].alt+'$'; | |
latex[i].parentElement.insertBefore(new_span, latex[i]); | |
latex[i].style.display = 'none'; | |
} | |
} catch(e) {} | |
var script = document.createElement("script"); | |
script.type = "text/x-mathjax-config"; | |
script.innerHTML = "MathJax.Hub.Config({tex2jax: { inlineMath: [['$','$']] }});"; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
script = document.createElement("script"); | |
script.type = "text/javascript"; | |
script.src = "https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full"; | |
document.getElementsByTagName("head")[0].appendChild(script); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment