Last active
March 7, 2017 02:10
-
-
Save pkra/5500316 to your computer and use it in GitHub Desktop.
Bookmarklet for Wikipedia, replacing PNGs on the fly
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
javascript:(function(){ var s=document.createElement('script');s.setAttribute('src','ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"');document.getElementsByTagName('body')[0].appendChild(s); $('img.tex').wrap('<span class="MathJax_Preview" />');$('.MathJax_Preview').after(function() { tex = $(this).find('img').attr("alt"); return " <script type='math/tex'>" + tex + "</" + "script>" ;});$.getScript('https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML');})() |
Are texvc macros different to the images displayed by default on wikipedia? It looks like they've just got the class 'tex', with the TeX stored in the 'alt' attribute.
@christianp, that's true for almost all websites which use maths images.
If a script was made for that then it would work everywhere, not just on Wikipedia.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Still missing: Wikipedia's texvc macros.