Pages

Tuesday, December 17, 2013

MathJax lets you write LaTeX on Blogger

MathJax lets you write LaTeX and get beautifully typeset mathematical notation. And it’s really really easy to set up: you just need to paste some code into the header of your blog’s theme.

Thanks to Weiqi Gao for working out how to get MathJax working on blogger again.


  1. Go to your blog and sign in. 
  2. Select Template.
  3. Select edit HTML
  4. copy and paste the codes just before the < / HEAD > tag. You can be more successful if you go to http://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#blogger to copy.
  1. <script type="text/x-mathjax-config">
      // <![CDATA[   
      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>

  1. 
    <script type='text/x-mathjax-config'>   // <![CDATA[      MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']],                       displayMath: [['\\[','\\]'], ['$$','$$']]}});      blogger.ui().viewType_.prototype.onRenderComplete=function(){MathJax.Hub.Queue(['Typeset',MathJax.Hub])};      // ]]> </script> <script src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' type='text/javascript'> </script>g=TeX-AMS-MML_HTMLorMML' type='text/javascript'> </script>
  1. Click on Save Template, and you’re done! 
  2. To test write the 
    1. Maths between dollars is inline: $\sum_{k=1}^n k = \frac{n(n+1)}{2}$.
      
      Maths between slash-square-brackets is display: 
      \[\sum_{k=1}^n k = \frac{n(n+1)}{2}\]
    2. $\lim_{x\rightarrow 0}$
  3. It should look like this! enjoy! 


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

\[\sum_{k=1}^n k = \frac{n(n+1)}{2}\]
$\lim_{x\rightarrow 0}$


 reference:
http://checkmyworking.com/2012/01/how-to-get-beautifully-typeset-maths-on-your-blog/#blogger

No comments:

Post a Comment