Monday, October 19, 2009

whither blogger LaTeX?

If you have a Blogger blog, you may be using some $\LaTeX$ renderer to make your math look nice. A couple of days ago, the one I was using (from www.watchmath.com) stopped working (hopefully it will be up again by now, or soon...).

My limited research has shown me that most Blogger use of $\LaTeX$ relies on a small piece of javascript embedded somewhere on the page that calls a larger piece of javascript (possibly located on another server) that in turn invokes some other hosted program that actually does the rendering (possibly located on yet another server): lots of potential points of failure. Another unfortunate aspect of this method is that it doesn't allow the rendered math to show up in readers - you have to look at the page itself to have the script run.

If you have lost your math rendering you can learn a little about these things by reading the replacemath.js docs and the mathtex docs.

For now, I am using the following bit of script to render the math:

 <script src="http://mathcache.s3.amazonaws.com/replacemath.js" type="text/javascript"></script> <script type="text/javascript"> replaceMath( document.body );  </script> 

Place this somewhere on your page, and it will invoke the replaceMath function that is defined in 'replacemath.js' - see the documentation about this at the link mentioned above.

Although the rendering isn't doing quite as nice a job as the watchmath version did, it's not too bad. I'll look for something better when I have the time...

PS: This blog post provides a good overview of the LaTeX rendering options that are out there.