Wednesday, September 4, 2013

MathJax with Blogger

MathJax in blogger.com is useful when I need to input equation in my blog. This is a instruction and test of using MathJax in blogger.com.
  1. set blogger.com template to "Simple". "Dynamic Views" seems not working.
  2. edit HTML by adding the following code between <head> and </head>.
    <script src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' type='text/javascript'/>
    
  3. type math equation in the blog.
Note that, enclosing math in single $'s does not work. Instead, I use "\(" and "\)" for inline math and "\[" and "\]" for displayed math. For example:
\(\frac{2}{3}\)
will show an inline math "\(\frac{2}{3}\)", and
\\[z=\sqrt{x^2+y^2}\\]
will show a displayed math \[z=\sqrt{x^2+y^2}\]

1 comment: