0

I'm moving my blog to Octopress. I have a small niggle with the interaction between Octopress and MathJax, in that the markdown parsing in Octopress happens first, and it tramples all over the MathJax code.

For an example of what I mean, you can see my raw .md file here and the result after processing here.

I need some way of telling Octopress to ignore a chunk of text, so that it is passed through processing unchanged, and the MathJax script can correctly render it as mathematics.

I've tried surrounding the math with <pre> and <span> tags, and surrounding it with backticks, none of which have helped.

Chris Taylor
  • 46,912
  • 15
  • 110
  • 154

1 Answers1

2

It turns out that if you search hard enough on Google, this is a known and solved problem. One approach is detailed on chico's blog, and involves switching the markdown parser to kramdown.

A simpler solution, which only allows for display math (no inline math) can be found on Gregory Lussier's blog and involves using a , which stops markdown processing.

The solution I've decided to go with is detailed on Luikore's blog and involves a custom markdown processor, which is a fork of rdiscount. It also solves several other niggling problems at the same time.

Chris Taylor
  • 46,912
  • 15
  • 110
  • 154