13

I want to add MathJax on my blog hosted on Blogger. The only solution I found is this post, but it requires a hosting server. Any other option?

6

The MathJax people recently started allowing the script to be called from their server.

I added a new post to my blog including the code you have to paste in your template html to get MathJax functionality in Blogger. With the new code you don't need to have MathJax installed in your own server.

Hope it helps.

6

Basically you just need to copy the following code snippet to Blogger template between <head> and </head>.

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js" />

For a detailed instruction or other options e.g. changing inline math delimiters, please follow this post.

  • 1
    In addition to linking to the blog post can you please extract the relevant information and add it to your answer. In it's current form, your answer would be worthless if that link were ever to disappear. By adding in the content to your answer it will still be useful in the future. Thank you. – codingbadger Apr 13 '11 at 18:16
  • Okay but there is a piece of code in the page which I have to copy verbatim to make it work. How can I do that? – puri Apr 14 '11 at 17:58
  • I copied the code and kept only the most basic option. I think it is fine now. – puri Apr 14 '11 at 21:05
  • In fact, the link you provide says that the post you were referring to does not exist. – leo Dec 8 '13 at 16:51
  • I have just updated the link to its old version at archive.org. – puri Dec 8 '13 at 18:51
2

An updated script command for Blogger is available at http://www.mathjax.org/docs/1.1/start.html, where they suggest using

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

For an example of a blog using it at Blogger, is my blog at http://mathjaxtest.blogspot.com. It works fairly well, but one problem is that when one posts a comment in reply, the MathJax script is not applied to the preview version of the comment, only to the published version of the comment. This makes it hard to use MathJax in comments, since there is no way to check to typos in equations. Does anyone know a way to fix this problem with comments?

0

This answer comes from Tex.Stackexchange:
Copy-past the following code

<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> 

in the HTML of the Blogger template (Design→Edit HTML→Edit Template) between <head> and </head>.

The advantage of this code on the other answers here is that the Mathjax rendered is closer to the one practiced on the SE network (in particular with the $). Also one may use macros (\newcommand).

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.