Last active
April 28, 2023 06:29
-
-
Save gjankowiak/9692040 to your computer and use it in GitHub Desktop.
Terrence Tao MathJax
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
// ==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