Sunday, July 8, 2012

Adding LaTeX to My Blog

Using LaTeX in Blogger and rendering it with Mozilla Firefox requires insertion of the following HTML after the header (<head>) in the Blogger template (Design→Edit HTML→Edit Template).
From the TEX exchange, to enable MathJax (aka LaTeX), just drop in:
<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>
To prove that this works, consider an ordinary presentation of Einstein's famous equation:



E = m * c^2
 

Now consider an LaTeX presentation: $$E = m * c^2$$

No comments:

Post a Comment