Category Archives: Tips & Tricks

Hello World!

First off, here are a couple of cool formatting tools that I ran into getting my feet wet with WordPress:

Using Latex typesetting

Using  \LaTeX  in WordPress for nice typesetting of mathematical expressions is super easy (and one of the reasons I’m using WordPress instead of other blogging resources like Blogger). To do so just surround an expression in standard \LaTeX syntax with the $ symbol. For instance the following

i\hbar \frac{\partial}{\partial t}\Psi = \hat{H} \Psi 

results in what is likely a familiar expression if you have any experience with quantum mechanics

i\hbar \frac{\partial}{\partial t} \Psi= \hat{H} \Psi

The &s=3 entry in the above statement sets the size of the  \LaTeX expression  (s can range from -4 to 4). For more info see the following link

Inserting formatted source code

WordPress also makes it easy to directly paste formatted source code using the shortcode syntax:

Using the above syntax, you can display matlab code with highlighting. For example, replacing “SOME MATLAB CODE” above with actual source code…

function outPut = myFun(input1,input2)
outPut = 1;
for iI = 1:1000
   outPut = outPut*input1*input2 / iI;

There are a number of languages and options that are available under the shortcode syntax. For more info, see the following link.