This is a minor extension to Michel Fortin's work that helps me add equations using LaTeX syntax (via jsMath) to my blog posts. It's based on v. 1.2.4. There's a brief description here http://www.leancrew.com/all-this/2009/12/php-markdown-extra-math/ and the GitHub repository is here http://github.com/drdrang/php-markdown-extra-math The display math code seems fairly clean to me, but the inline math is a bit messy, as I had to pry open Michel's handleSpanToken function. The code works for me, but suggestions for improvement are welcome.