Instantly share code, notes, and snippets.

# pkra/wikipedia2mj.js Last active Mar 7, 2017

Bookmarklet for Wikipedia, replacing PNGs on the fly
 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('');$('.MathJax_Preview').after(function() { tex = \$(this).find('img').attr("alt"); return "
Owner Author

### pkra commented Jul 24, 2013

 Still missing: Wikipedia's texvc macros.

### christianp commented Sep 19, 2013

 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.

### ghost commented Sep 16, 2015

 @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.