Skip to main content

LaTeX

A bookmarklet to replace WordPress.com’s image-based maths with MathJax

I finally got fed up enough with WordPress.com’s blurry image-based maths rendering to write a bookmarklet which goes through the page replacing them with the equivalent MathJax code. I’ve added it to my MathJax bookmarklet installation page. Drag the “image replacement bookmarklet” to your bookmarks bar, go to a WordPress.com blog (I recommend Gowers’s Weblog), then click the “Replace image maths with MathJax” bookmarklet.

Update 19/09/2013: Following a suggestion by Peter Krautzberger, I’ve updated the bookmarklet to do the image replacement differently, so the images don’t disappear while MathJax is working. I’ve also made it work on Wikipedia.

Instant MathJax preview of LaTeX typed into HTML textareas

I’ve completely rewritten my write maths, see maths library to be a little jQuery plugin that attaches itself to editable areas on pages, like contenteditable elements, textareas, and input boxes. When your cursor is inside some LaTeX, a little preview box appears just above it with the LaTeX rendered through MathJax. I’ve made a demo page on GitHub, and the code itself is available there too. It also works in TinyMCE, if you’re into that sort of thing.

The first I thing I did with it was to write a WordPress plugin which applies the plugin to the comment boxes underneath posts (source code). I’ve installed it on this site and The Aperiodical, so you can use LaTeX with confidence, knowing that it’ll appear how you want on the page. Please try it in the comments box below!

A little applet to make maths for screengrabbing

Paul Taylor wanted an easy way to write some maths he could take a screengrab of, for use as an icon. Before I intervened he was doing something unnatural with wikipedia, so I wrote a little applet using MathJax: “make big maths“.

Quite a few tools like this exist, using mimetex or some other CGI tool to run LaTeX on a server and produce an image file. That’s far too slow and rubbish-looking for my liking, so I made my own with MathJax.

How to get beautifully typeset maths on your blog

Lots of people have blogs where they talk about maths. Lots of these people just use plain text for mathematical notation which, while it gets the point across, isn’t as easy to read or as visually appealing as it could be. MathJax lets you write LaTeX and get beautifully typeset mathematical notation. And it’s really really easy to set up: you just need to paste some code into the header of your blog’s theme. To make it really really really easy, I’ve written some very detailed instructions of what to do for each big blogging service. (If you’re reading this after I wrote it, which you definitely are, beware that the interfaces I describe may have changed, so the advice below might be inaccurate. If it is, or if you’re just having trouble following along, please leave a comment below.)

Read more…

Testing MathJax

Maths between dollars is inline: k=1nk=n(n+1)2.

Maths between slash-square-brackets is display: k=1nk=n(n+1)2

Personal opinions on LaTeX

I’m editing a paper (12 months and counting!) and I’ve had a few thoughts about LaTeX that I thought I’d write down. I don’t even care if this makes me a neckbeard, that’s the mood I’m in currently.

The hyperref package makes your references clickable when you compile to PDF. I can’t think of a reason not to use it.

I dislike people who set their editors to have a fixed maximum line-width! Word-wrap works fine, and means the window is full no matter how big it is. Also, newlines can be used to separate thoughts more clearly.

Avoid eqnarray.

A bookmarklet which typesets TeX on any page using MathJax

MathJax is the best thing to happen to the web since the web began. I’ve said this a lot of times.

Sadly, MathJax isn’t loaded on every page. To fix this appalling situation, add the MathJax bookmarklet to your browser.

Update 21/05/2012: Jakub Kozisek has started maintaining a much better version of the bookmarklet on Github, so I’ll just link to that now: http://dzejkej.github.com/mathjax-bookmarklet/

Update 30/01/2013: Google+ uses some of the same CSS class names as MathJax, which made maths look all mangled when you run the bookmarklet there. I’ve updated the bookmarklet to override Google+’s CSS. For now, I’ve put the fixed version up here so you can install it, and I’ve started pull request on Jakub’s Github repository so he can merge the fix in.

Bloggers: if you’re looking for instructions on how to use MathJax on your blog, I’ve written another post with very detailed instructions.