Latex on WordPress : A Primer
Yesterday I came across a post Math for the Masses on WordPress.com, announcing the avaibility of Latex on WordPress.com . I should learn it, I thought, and started searching for good tutorials to get me started. I got good ones, particularly Short Math Guide for Latex by Michael Downes, that helped me to start. However all sources were not relevant for Latex as implemented on WordPress.com, (i.e. most of codes on beginning pages did not work on WordPress.com). I searched hard to find a tutorial that could start from start, and couldn’t. Now that I have started learning successfully, I though if I could fill this gap.
Latex is designed to help authors write the content without much worrying of how it would reproduce on page. If I had to write constantly on a single line, as I have been doing till now on this post then there is not concern but what if I need to go above or below the line. Of course HTML tags for SubScript and SuperScript would have helped but Latex does more so lets get started with Latex, the SubScript and SuperScript.
Latex code on WordPress.com post should start with $latex and end with a $. To make a character Subscript or Superscript you can add an underscore “_” or an accent “^” respectively. See codes below and their respective Latex rendering.
$latex H_2O$
$latex 2^n+1$
You might have noticed that only one character that immediately follows the “_” or “^” is shifted from its position. What if you wanted it to do it for more than one character say whole of n+1 above? You can achieve that by enclosing them between curly braces { } which can be used everywhere you need to group a particular set of characters and can be nested.
$latex 2^{n+1}$
So these were the most basic things about latex. Latex have a number of commands that start with a backslash “\”. Here is the first command that shows the Latex logo.
$latex \LaTeX$
All the Latex command are case sensitive. So if you make any mistake in that, you will end up with a error note, like below, instead of the desired and expected rendering.
Let’s get on to next command “\frac” which will help you render fractions. This command expects two values to be passed just after it. If you need to render 1/2 the command can be either of the below commands, both will render identically.
$latex \frac12$
$latex \frac{1}{2}$ (For clarity)
You can use frac command to create more complex fractions as the one below:
$latex \frac{a+b}{c+d}$
Now let’s add up all above to form the Compound Interest Formula.
$latex A=P(1+\frac{R}{100})^t$
Using “\sqrt” command you can render the Square root sign as below
$latex h = \sqrt{l^2 + b^2}$
sqrt command in extended form can be used to form Cube root and others too
$latex sqrt[3]{xyz}$
If you want to render trigonomertical formulas then “\alpha”, “\beta”, “\theta”, “\sin”, “\cos”, “\tan” etc. commands can help you get them
$latex \sin\alpha \cos\beta \tan\theta$
Found interesting? then read the PDF file link given on the top of post or visit the Latex Project site. The discussion here is sufficient to get you started with Latex and for more of advanced feature I may post sometime later, as I said the post is related to latex on WordPress.com and I cannot just blindly post all feature of Latex without confirming the working on wordpress.com Blog.

[...] 31, 2007 in LaTeX, Bidules, Links, Linux, Blogging I discovered today thanks to Jalaj that it is possible to embed to posts. We can now write easily equations in our blog posts. [...]
Pingback by LaTeX code on wordpress « Charmi’s Blog — March 31, 2007 @ 4:04 pm
Thanks for the tip, it will be too useful for me !!
Comment by Mohamed Ali — March 31, 2007 @ 4:18 pm
This is really great to know, im going to try it right now in this post, to see if I can post latex code also
Comment by jmonreal — April 1, 2007 @ 4:20 pm
great, it may be done too…Thanks for this knowledge.
Comment by jmonreal — April 1, 2007 @ 4:22 pm
Thank U Jalaj.
Will try out ur advice in a couple of days & revert.
caprg
Comment by citizensalliance — April 13, 2007 @ 2:24 am