Archive

Archive for the ‘latex’ Category

Latex on wordpress

September 8th, 2007 rohitj 20 comments

So, you are a geek. You want to write lot of technical things on your wordpress blog. And since you are a geek you want to write technical things in Latex. How do you do? One way is that you write latex code, make pdf, take screenshot, pick the desirable part, and use that image on blog. Ofcourse thats inconvenient and surely doesn’t go with your nerd personality. You want to write Latex code in your blog post. Here are 2 solutions. One is that you use wp-latex plugin. Using this plugin you will be able to write proper Latex code in your blog using <latex></latex> tags. But the problem is that this plugin uses Latex, which is not usually supported by web hosts, including Bluehost. And installing tetex locally is painful. So, here comes the second solution. Use mimetex. Checkout http://www.forkosh.dreamhost.com/mimetex.cgi?l_2 . Similarly you can get other latex output by replacing l_2. One guy used this property and made a plugin. Using this plugin you can use latex code, basically mimetex (which is a bit different from Latex) with <tex></tex> tags. I couldn’t get it working. Another guy changed this script and made it working with \[tex\]\[\/tex\] tags. It didn’t work as well. This new plugin downloads this image and stores in wp-content/cache folder. But it downloads this image every time someone opens the post. Of course it consumes lot of server and bandwidth. So, I made a small tweak in it. I replaced it’s 15 lines with 1 line. :) Basically, now instead of downloading the image, it puts src as http://www.forkosh.dreamhost.com/mimetex.cgi? blah blah. And see I am able to use latex code.

 f(x) = x^2 + l_2

Enjoy

Update : You can download the plugin (after my modification) from Plugin for using Latex

Update2 : The plugin is under GPL.

Update3 : So, the code I changed was suggested by Nitin Munjal. You can find him here

Categories: Bluehost, Wordpress, latex Tags: