It's a tricky problem and one that I'm currently researching. I began with an investigation into MathML, which I have written up here: http://devblog.stuartthompson.net/2009/08/mathnotationontheweb/