Thursday, 25 December 2014

How to write Math Formulas on Blogspot / Blogger


Blogger also has a way to typeset Math Formulas!

To type Formulas in LaTeX format, simply follow the instructions on the following website:

In case the above website goes down, here is how to do it:

Basically, go to your blogspot website while signed in. On the top right hand corner, click on "Design". Click on "Edit HTML", and paste the following code right after the <head> in the HTML.

<script src='' type='text/javascript'>    
        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 } }

Then, you can type formulas enclosed in dollar signs "$", in the usual LaTeX manner.

For instance $e^{i \pi}+1=0$.

In my opinion, this method is even superior to WordPress' LaTeX capabilities, which require a "$latex" which is more cumbersome to write.

Some other fancy formulae using the Displaystyle (Double Dollar signs "$$")
$$a^p \equiv a \pmod p$$
$$\int_0^\frac{\pi}{2} \sin x\ dx=1$$

No comments:

Post a Comment