# Adding Mathjax to Tumblr

I'd like to add mathjax to tumblr site, although I'm a bit confused as to where to begin. Mathjax doesn't offer documentation for tumblr, just sites like wordpress and some others.

Thanks

-

MathJax is now available through a CDN, so you don't have to install it on a server any more. All you need to do is include a few lines in your html header and you can start using mathematics in your posts.

To do this, go to Theme -> Use custom HTML, and insert the following just above the </head> marker:

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>


Save changes, and you're ready to include mathematics on your Tumblr pages. Try, for example

$\exp(x) = \sum_{n=1}^{\infty} \frac{x^n}{n!}$


Good luck, hope this helps.

-
Is it sufficient to just copy and paste that first line? Or are we supposed to replace cdn.mathjax.org/mathjax/latest/… with something else? I attempted to do this on tumblr, and the text post only displayed the raw TeX code. –  yunone Apr 16 '11 at 10:59

We've just released a video tutorial on using MathJax with Tumblr. See http://www.mathjax.org/demos/use-in-web-platforms/

Hope that's useful.

-
That link is now broken; here's a working one –  Andy Jones Feb 14 at 17:33

Looking through the MathJax install notes it appears all you need to do is link to the JavaScript file.

For Tumblr, this means you will need to customize your HTML Theme.

From what I can gather you will need to add this line just before the </head> tag.

<script type="text/javascript" src="path-to-MathJax/MathJax.js"></script>

Where path-to-MathJax is to where ever on your server you have uploaded the JS file.

e.g.

<html>
<title>My Tumblr site</title>
<script type="text/javascript" src="path-to-MathJax/MathJax.js"></script>
<body>
...
</body>
</html>

-
Thanks for the response - The issue I think, I that I'm hosting through tumblr - I just pointed by domain there. I think I may trying just customizing the HTML with the whole Mathjax source, then try. –  tshauck Feb 2 '11 at 20:34

In addition to Barry's answer, you need to add some additional data to let Tumblr know what to do with the '$' and '$$' that you typically use with MathJax. Try adding these lines after what's posted above. <script type="text/x-mathjax-config"> MathJax.Hub.Config({ extensions: ["tex2jax.js"], jax: ["input/TeX", "output/HTML-CSS"], tex2jax: { inlineMath: [[ '','']], displayMath: [['$$','$\$']],
processEscapes: true
},
"HTML-CSS": { availableFonts: ["TeX"] }
});
</script>


[props to http://blog.angjookanazawa.com/post/15081007922/how-to-write-in-latex-use-mathjax-in-tumblr] for providing these.

-