Dec 21 2009

WordPress LaTeX plugin

Now that I have code highlighting working, I thought that I should still look into getting some easy way to display mathematical notation. Turns out that WordPress once again delivered, there are in fact several different LaTeX plugins available.

The plugin I settled for is WP LaTeX, since it allowed me to use  wordpress.com‘s LaTeX server. This was an easier alternative, as Dreamhost does not have dvipng installed. On a side note, I’m impressed that they have LaTeX installed by default.

Now I only have to insert the following to create a nice looking equation:

H(z) = \frac{1}{1-2 cos(2 \pi k / N) z^{-1} + z^{-2}}
H(z) = \frac{1}{1-2 cos(2 \pi k / N) z^{-1} + z^{-2}}

Bonus points for anyone who can identify the transfer function :)


Dec 21 2009

Syntax highlighters

As I am probably going to post much on programming, I felt that I needed a way of highlighting code syntax and showing it in an easier to read format to you. At first I thought of just using Alex Gorbatchev’s SyntaxHighlighter. It turned out that there were in fact several WordPress plugins using Alex’s highlighter. Many of the existing highlighters did not work very well, they simply included the JavaScript file, requiring users to insert

<pre name="code" class="html">
...
</pre>

into the HTML. The problem is that WordPress’ HTML editor strips out the name=”code” part, rendering the plugins useless.

What I settled on using, for the time being at least, is Vijesh Mehta Syntax Highlighter WordPress Plugin. The plugin still requires manual HTML editing, but avoids the stripping of the name attribute by using class=”brush:language_name” instead.

So, as a start for my posts on programming: the classical “hello world”, in ruby this time.

puts "hello world!"