Tuesday

Setting up MathJax in Google Blogger

If you want something like this in your posts...

$$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$

  1. Go to your blog settings.
  2. To design.
  3. Click edit html.
  4. Search this: </head>
  5. Copy and past the following right before </head>: 
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX", "output/HTML-CSS"],
    tex2jax: {
      inlineMath: [ ['$','$'], ["\\(","\\)"] ],
      displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
      processEscapes: true
    },
    "HTML-CSS": { availableFonts: ["TeX"] }
  });
</script>
<script type="text/javascript" src="path-to-MathJax/MathJax.js">
</script>
 
(See also: http://docs.mathjax.org/...

For an overview on the syntax see: https://math.meta.stackexchange.com/questions/5020/...


Help, doesn't work!


If you do not see an equation but only the raw input, check the HTML view of your post and make sure your equation is not surrounded by <code> tags. Google Blogger seems to do this automatically.

No comments:

Post a Comment

Chosse "anonymous" if you don't have a login.