Latex on wordpress blog
Some time back I came to know that wordpress blogs hosted at wordpress.com supports latex. But no such default functionality for self hosted wordpress blogs. But there are plugins (latexrender, wp-latex) which can facilitate similar things.
But for these to work you will need to install latex on your hosting account. (I have intalled latex on my hostmonster account some time back.).
For installing latexrender wordpress plugin you can find guidelines here
One more thing to remember while setting $latexrender_path_http in latex.php give full http path to latexrender folder like $latexrender_path_http = "http://your blog addr/latexrender";
Now you are set to go. To include
in your posting, use the following:
[tex] your latex code here [/tex] For example:
[tex] (a+b)^3 = (a+b)^2(a+b) [/tex]
produces :
But after setting up latexrender plugin, the png image was still not generated. Error that I got was:
I can’t find the format file ‘latex.fmt’!
But when I tried similar command (latex sample.tex) from shell prompt, It was working fine.
So I thought that problem is in calling latex from php file using exec. So when I copied the latex.fmt file to directory containing .tex file it started working fine. May be some problem in setting environment variable.
You can look for latex.fmt file using :
find -name latex.fmt
For latexrender you can copy latex.fmt file to latexrender/tmp/ folder inside your wordpress installation.
I’m still working on how to set environment variable in php so that I don’t have to copy latex.fmt again and again.
But for now I gave got working latex on my blog
. Now I can write math equations in my blog posts.
You can try latex formulas in comment too.
And if you want to publish LaTeX equation in WordPress blog without installing any software, try jsTeXrender: http://yourequations.com/. Thanks Doug for the tip.
Related Posts:
Latex Beamer
Installing latex on hostmonster
Comments
5 Responses to “Latex on wordpress blog”
Leave a Reply

Add to del.icio.us Network
Google Reader Shared Items
Twitter Feed
Flickr Photos
It works in comments too :

nice tip ajit, .. will definitely give it try this week
Really nice tip, is there something similar on blogger?
For blogger you can try http://wolverinex02.googlepages.com/emoticonsforblogger2
Its actually great. For that you will need to install greasemonkey extension in firefox. It uses latex renderer here http://www.forkosh.com/mimetex.html
Also for blogger, or for any other site you can try CodeCogs Equation editor