An Update to Mathematics in a Blog Post

Given that there was a bit more interest than usual in my Mathematics in a Blog Post post, I want to update it with a couple of things I’ve learned in the mean time. This only applies to those using Org mode to write their posts.

It turns out that Org runs its own MathJax server and automatically arranges for it to be called. That’s great if you only occasionally use MathJax but the Org folks ask that if you use it a lot or have a large readership that you serve your own copy or use the MathJax CDN. This means that my suggested solution of adding

#+HTML_HEAD: <script type="text/javascript"
#+HTML_HEAD:  src="http://cdn.mathjax.org/mathjax/latest/MathJax.js">
#+HTML_HEAD: </script>

isn’t optimal. It results in another copy of MathJax being pulled in, which may or may not be the same. One of the advantages of using the MathJax CDN is that you’re guaranteed to get the latest version so unless you have strong reasons to do otherwise, you should use the MathJax CDN.

The proper way to get the CDN version is to add the line

#+HTML_MATHJAX: align:"center" path:"http://cdn.mathjax.org/mathjax/latest/MathJax.js"

to your post’s source file. Alternatively, you can edit the org-html-mathjax-options variable to set it once and for all.

This entry was posted in Blogging and tagged . Bookmark the permalink.