Showing posts with label latex. Show all posts
Showing posts with label latex. Show all posts

Friday, July 15, 2011

Latex to PNG to Blogger

I just wanted to put at the top what you need to follow along with this post. Everything below is written assuming you're using a Unix terminal and you have pdflatex and imagemagick installed. For Ubunu, the de facto linux distribution, type this into your terminal window to get these programs:

sudo apt-get install imagemagick
sudo apt-get install pdflatex

Due to my failure in making nice looking equations in my last posts, I worked on discovering a solution. Naturally, I tried to google Latex and Blogger. Latex is what I usually use for formatting equations, so that is what I was hoping to find. Unfortunately, most of the ideas I found for inserting equations into Blogger relied on hosted scripts and random people providing image hosting. I tried two solutions described in blogs and both didn't work, due to the site hosting the rendering engine being down. If you would like to convert LaTeX code directly into PNGs on the web, you can try codecogs, but I find the website to appear pretty Spammy and you cannot have very much control over your results. But, hey, it works.

Next idea: use Latex to write equations, use pdflatex to turn them into PDFs, and then use ImageMagick to convert the PDFs into PNGs. Easy, right? Well, here are the results: