MathJax in your GitHub blog
I’m patching up a few small dings and cracks that happened while moving my Wordpress blog over here.
That move happened following directions posted here* and it probably would have been completely uneventful, had my blog entries been strictly prose and hyperlinks. But they have some code blocks – some of them in Stata, for which there is no Pygments lexer – and some LaTeX, which is not supported by default.
You fix the LaTeX bit by turning on MathJax support. I followed Christopher Poole’s instructions with two small tweaks:
- You can put that piece of Javascript in a
<head>
section that you stick on top of the page where you’ll be using math, because you can mix html with Markdown in a pinch. I just put it in_includes/head.html
, so it would be available everywhere. - I didn’t change my markdown from
redcarpet
tokramdown
in my_config.yml
file. I mean I did at first, but I switched back becausekramdown
mangled all my code blocks.
* I didn’t use the official Wordpress importer because I liked how these 8thcolor.com people made use of a Wordpress-exported xml file.