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ε.

Advertisements
  1. #1 by Mark Simpson (@verdammelt) on August 21, 2012 - 19:01

    I like LaTeX – something about the crazy syntax or something. I use OctoPress for my blog – I wonder if there is a plugin for LaTeX. Or I could create one – because I don’t already have enough yaks to shave….

  2. #2 by Mark Simpson (@verdammelt) on August 21, 2012 - 19:54

    And another yak shaved. Easy to set up in Octopress:

    http://code-and-cocktails.heroku.com/blog/2012/08/21/test-latex-post/

    • #3 by Proctor on August 21, 2012 - 20:09

      Oh, the yaks are just lining up to be shaved now that you have that plugin installed… 😉 Now that you have it setup, I am sure you will find a number of things (excuses) to use it for.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: