How to Setup MathJax on Blogger




If you have always wanted to use math symbols in html, go to Irrep for an indepth tutorial.

Paste the code below after the first <head> tag of your layout

<script src='http://cdn.mathjax.org/mathjax/latest/MathJax.js' type='text/javascript'>    
    MathJax.Hub.Config({
        HTML: ["input/TeX","output/HTML-CSS"],
        TeX:extensions: ["AMSmath.js","AMSsymbols.js"], 
               equationNumbers: { autoNumber: "AMS" } },
        extensions: ["tex2jax.js"],
        jax: ["input/TeX","output/HTML-CSS"],
        tex2jax: { inlineMath: [ ['$','$'], ["\\(","\\)"] ],
                   displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
                   processEscapes: true },
        "HTML-CSS": { availableFonts: ["TeX"],
                      linebreaks: { automatic: true } }
    });
</script>
 
Take this example

The expression to type when you want to display the sqaure root of a fraction a/b is \sqrt{\frac{a}{b}}. To make sure that the exression is transformed by MathJax, you have to enclose it in $ $ like $expression$ and here is how it looks $\sqrt{\frac{a}{b}}$.

Here is trigonometric identity expression \cos^2\theta + \sin^2\theta=1 which would display $\cos^2\theta + \sin^2\theta=1$

2 comments

avatar

\[\sum_{k=1}^n k = \frac{n(n+1)}{2}\]

avatar

\[\sqrt{\frac{a}{b}}\]

Share your thoughts