Sunday, August 11, 2013

Include Latex in Blogger

The original post is at:

http://webapps.stackexchange.com/questions/13053/mathjax-on-blogger

The basic step is to include the following javascript in the header section of the template (which can be accessed by Design→Edit HTML→Edit Template)

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

With the body, the blogger can write something like the one below:

$f(x, y)=\frac{x^2}{y}$

which will be turned into:

$f(x, y)=\frac{x^2}{y}$

1 comment: