Friday, September 7, 2012

Latex in Blogger

How do you insert equations like the following in Blogger?
\[ \vec{A}(\vec{r})=\frac{\mu_0}{4\pi}\oint_S\frac{\vec{J}(\vec{r'})\times\hat R}{R^2} d\tau'\]

First, you should know $\LaTeX$ typesetting. Second, you need to copy this script into your HTML template file.  


<script type="text/x-mathjax-config">
  MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']],
                       displayMath: [['\\[','\\]'], ['$$','$$']]}});
  blogger.ui().viewType_.prototype.onRenderComplete=function(){MathJax.Hub.Queue(['Typeset',MathJax.Hub])};
</script>
<script type="text/javascript"
  src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>





Here is how you do it. 


1. Go to your posts settings and choose Template from the left-hand bar




2. Click on the "Edit HML" button to edit your template


3. Click on the "Proceed button"




4. Scroll to the point right before the "<\head>" tag and paste the above script, then save your changes.




That's it! Now happy $\LaTeX$-ing.


References:
1. How to get beautifully typeset maths on your blog
2. MathJax: LaTeX on Blogger - finally!
3. Blogging Mathematics

No comments:

Post a Comment