(function(){ var script=document.createElement("script"); script.type="text/javascript"; script.src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default"; var config='MathJax.Hub.Config({TeX:{extensions:["AMSmath.js","AMSsymbols.js"]},tex2jax:{skipTags:["script","noscript","style","textarea"]}});MathJax.Hub.Startup.onload();setInterval(function(){MathJax.Hub.Queue(["Typeset",MathJax.Hub]);},5000);'; if(window.opera){ script.innerHTML=config; }else{ script.text=config; } document.getElementsByTagName("head")[0].appendChild(script); script=document.createElement("script"); script.type="text/javascript"; script.src="http://userscripts.org/scripts/source/92758.user.js"; document.getElementsByTagName("head")[0].appendChild(script); })();

The Math Bookmarklet

The Math Bookmarklet is a script that incorporates both TeX the World and MathJax. Reddit's /r/math seems to have standardized on TeX the World, which is not being maintained anymore. I'd rather see it switch over to MathJax, which has some very nice features and will hopefully be maintained for some time.

This is a bookmarklet mostly because I want to be able to use it in all browsers without necessarily installing Greasemonkey or the like. I especially wanted to get Safari for the iPhone (although bookmarklets are annoying to install on iPhones). Note that TeX the World doesn't work in Internet Explorer so only MathJax works there, I guess.

Note that this does not cause any extra load on Reddit's servers. It does not require that Reddit add new Javascript to its pages. I think we could easily create a Greasemonkey-style user script for this also, if people prefer this to bookmarklets.

How to Install It

Just bookmark this link: The Reddit Math Bookmarklet. Don't click the link (you can, but it won't do anything but decorate this page); bookmark it. I'll talk about how to do it via Safari on iOS later.

How to Use It

Find a page that has TeX-the-World-style markup in it
e.g., [; \lim_{x\to 0} \frac{\sin(x)}{x} = 1 ;],
or MathJax-style markup in it:
e.g., $$\lim_{x\to 0} \frac{\sin(x)}{x} = 1$$
or inline like \(\lim_{x\to 0} \frac{\sin(x)}{x} = 1\).

From that page, use the bookmark. The markup should be replaced. That's about it. I've set it up so that the page is scanned every five seconds for changes to MathJax markup, and I think TeX the World does something like that itself, so it should respond to dynamic page changes as well.

Adding via Safari on iOS: ANNOYING

The easy way to do this is to bookmark the link on your Safari desktop and then sync via iCloud to your iOS device. If you can't do that, read on:

This is very clunky but it seems to be the only way to do it without another machine. First, copy the text inside the textarea below to your clipboard: tap the textarea, tap-and-hold inside the text, choose "Select All", and then "Copy".

Then, bookmark the current page: tap the box-with-arrow-coming-out-of-it icon on the Safari menu, and choose Add Bookmark.

Next, edit the new bookmark: tap the bookmarks icon of the Safari menu, tap "Edit", and tap the line corresponding to the new bookmark. Change the title to whatever you want (e.g., Reddit Math Bookmarklet). Replace the url with the contents of the clipboard: tap the url field, tap-and-hold inside the text, choose "Select All", and then Paste. Then tap "Done" and "Done" and "Done".

You are now done.