Hex, Bugs and More Physics | Emre S. Tasci

a blog about physics, computation, computational physics and materials…

Using LaTeX within WordPress

November 18, 2007 Posted by Emre S. Tasci

Renderu – LaTeX parsing WordPress plugin

Adapting from Titus Barik’s “LaTeX Equations and Graphics in PHP” titled article from the Linux Journal magazine, I was able to write a plugin for WordPress that enables me to include LaTeX-type

 $\sum\limits_{j = 1}^m {p\left( X \right)H\left( {Y|X = x_i } \right)} $

in the form of a PNG file format as :

Formula: </p>  <p>$\sum\limits_{j = 1}^m {p\left( X \right)H\left( {Y|X = x_i } \right)} $</p>  <p>

(Although there is problem with multi lined entries such as matrix)

Barik’s article explained the method for Linux, but it can easily be run on a Windows environment (as it is been running on my computer at this very moment). Just install a LaTeX distribution like MikTeX and an image manipulation package like ImageMagick and it’s ready!

One Response to “Using LaTeX within WordPress”

  1. admin Says:

    Solved the multi-lined entry problem by switching from standard plain TeX to AMS-LaTeX.

    plain TeX code for a 3×3 matrix :
    $$
    \matrix{
    1 & 2 & 3 \cr
    4 & 5 & 6 \cr
    7 & 8 & 9 \cr

    }
    $$

    and the same matrix in AMS-LaTeX format:
    \[
    \begin{array}{*{20}c}
    1 & 2 & 3 \\
    4 & 5 & 6 \\
    7 & 8 & 9 \\

    \end{array}
    \]

Leave a Reply