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.


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="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js"></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

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.


        <title>My Tumblr site</title>
    <script type="text/javascript" src="path-to-MathJax/MathJax.js"></script>
  • 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">
extensions: ["tex2jax.js"],
jax: ["input/TeX", "output/HTML-CSS"],
tex2jax: {
  inlineMath: [[ '$','$']],
  displayMath:  [['$$','$$']],
  processEscapes: true
"HTML-CSS": { availableFonts: ["TeX"] }

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.