Archive for category Uncategorized

LaTeX in WordPress

Writing up my post Project Euler in Clojure – Problem 15 I wanted to represent the formulation for combinations in a nice manner. As I previously had found the [sourecode] tags, I figured it was worth a shot at doing some searching to see if WordPress.com supported any forumla formatting plug ins out of the box.

I have known of LaTeX for formulas but as I use a wordpress.com site, I knew it only ships with a limited number of plug ins, so I did a search about mathematical formula formatting in WordPress.com. Through the blog post Math for the Masses, I discovered that WordPress.com does indeed support LaTeX.

In my previous post mentioned above, I had the following formula for combinations: $\frac{n}{\big((n-k)!*k!\big)}$

So to break that down and outline how I display that lets give the WordPress markup I used to get that: $\frac{n}{\big((n-k)!*k!\big)}&s=3$

So to start with we have $latex which begins our LaTex statement, and if you notice we have a$ that signifies the end of the expression. The example on for the LaTeX in LaTeX is coded: $\LaTeX$

Which results in the following: $\LaTeX$

The next part in the LaTex statement begins the expression, which is the fraction part of the expression where

\frac{numerator}{denominator}

giving: $\frac{numerator}{denominator}$

The parenthesis are done using \big( and \big). The last part of the expression is parameters to update the size of the display in WordPress. The WordPress support page for LaTeX discusses the different parameters available for the LaTeX. The parameter s is the parameter to specify the size of the LaTeX, of which I set as 3 which is the numeric representation of \LARGE.

The posts mentioned above contained links to other resources for LaTeX. The two additional ones I used were: a LaTeX wiki on The Student Room and The Not So Short Introduction to LATEX 2ε.