Latex and WordPress

Sometimes you want to put some equations in your blog.

[allowphp]
require_once(“/usr/local/apache2/htdocs/wordpress_3.5.1/myphptex.inc”);
tex(‘begin{equation}
Re{z} =frac{73npi dfrac{theta +psi}{2}}{
left(dfrac{theta +psi}{2}right)^2 + left( dfrac{1}{2}
log leftlvertdfrac{B}{A}rightrvertright)^2}.
end{equation}’);
[/allowphp]

If you are familiar with latex, you can come up with the following source code immediately.

begin{equation}
Re{z} =frac{npi dfrac{theta +psi}{2}}{
left(dfrac{theta +psi}{2}right)^2 + left( dfrac{1}{2}
log leftlvertdfrac{B}{A}rightrvertright)^2}.
end{equation}

Note: The above equation is from Short Math Guide for LaTex.

And using php, the image file for your equations is generated automagically, as is described in http://oku.edu.mie-u.ac.jp/~okumura/stat/phptex.php.

The problem is how you can put Prof. Okumra’s scheme into WordPress. First you need to put the php code into your posts, perhaps by using a plugin.

I am now using Allow PHP in posts and pages. A small trick here is to use the “Advanced Filter” option of the plugin.

You may also need to modify your style.css so that the image file generated looks nicely on the screen. And after some efforts, voilĂ !

allowphp

Leave a Reply

Your email address will not be published. Required fields are marked *