LyX and TeXMacs can do that kind of thing through Maxima plugins. The Maxima frontend itself has some prettifying capabilities. Of course, if you aren't doing symbolic math that is going to be less useful to you.
- http://www.texmacs.org/ - http://www.lyx.org/ - http://maxima.sourceforge.net/
I would really like to not give Stephen Wolfram money every year, but evidently not quite as much as I really like to be free of paragraph-form monospace code blobs from hell. I was hoping that MathJax meant I could wait a few years and have my cake and eat it too, but so far I haven't seen anything that looks serious :(