Write maths, see maths, Act II

This method is a lot easier than the old one!

Using Rangy, I can get the position of the cursor in screen co-ordinates, which allows me to position a MathJax preview of the TeX you're typing directly above it.

For example, click somewhere in the following: $\frac{x}{2}$

  1. Or here: $e^{\pi i} + 1 = 0$
  2. Display maths too: \[ \int e^{-x^2} \textrm{d}x \]

This whole area is just a contenteditable div.