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.

4 comments:

  1. Move to wordpress. It may seem a little too radical, but if you are serious about posting math that requires LaTeX it is the only reasonable option. I did, and have absolutely no regrets...

    ReplyDelete
  2. You could use a web service that renders your LaTeX into images, and embed those.

    ReplyDelete
  3. Hi, the mathtex server that I used before is unavailable now. Now I am switch back to mathtex server of John Forkosh.
    If you want to be as stable as wordpress we can use the latex server of wordpress too :D.

    ReplyDelete
  4. Thanks for all the suggestions. I have looked into Wordpress - the best thing about their LaTeX support (IMHO) is that it shows up in readers - I am going to keep trying it out. The mathURL site is a good option for generating images from $/LaTeX$ and then using them in the blog (a manual operation). For now I have switched back to the old Watchmath method using this script:


    <script src="http://www.watchmath.com/cgi-bin/mathtex3.js" type="text/javascript"></script>
    <script type="text/javascript">
    replaceMath( document.body );</script>

    ReplyDelete