MathJax isn’t currently supported out-of-the-box with Octopress. The main reason seems to be that the Markdown processor — rdiscount — doesn’t deal with the MathJax escaping very well. However, since Maruku supports it, I thought I’d try switching over.

I made the following two changes:

switch Markdown processors in _config.yml

1

markdown:maruku

enable MathJax in source/_includes/custom/head.html link

This allows for inline $\TeX$ expressions between dollar signs e.g. $\TeX$. MathJax display expressions (i.e. non-inline) are delimited by double dollar signs:

example expression from Paul Snivey’s article link

1

$$\forall x, y : \mathbb{Z}, x > 3\land y < 2\Rightarrow x^2-2y > 5$$

renders as:

$$\forall x, y : \mathbb{Z}, x > 3 \land y < 2 \Rightarrow x^2 - 2y > 5$$

Right-click issue

There was also a problem with the theme. When right clicking a MathJax expression, the whole page goes blank! Zete has a great fix for this:

importData.List(group)-- DatatypestypeEncoded=[(Int,Char)]-- An encoded String with form [(times, char), ...]typeDecoded=String-- Takes a decoded string and returns an encoded list of tuplesrlencode::Decoded->Encodedrlencode=map(\g->(lengthg,headg)).group-- Takes an encoded list of tuples and returns the associated decoded Stringrldecode::Encoded->Decodedrldecode=concatMapdecodeTuplewheredecodeTuple(n,c)=replicatencmain::IO()main=do-- Get inputputStr"String to encode: "input<-getLine-- Output encoded and decoded versions of inputletencoded=rlencodeinputdecoded=rldecodeencodedputStrLn$"Encoded: "++showencoded++"\nDecoded: "++showdecoded