Friday, February 14, 2014

Issues with MathJax and Blogger Preview

In the past few weeks, I noticed that I was having trouble with MathJax (which I have come to love) and Blogger. While there is a plethora of problems being reported on the internet, my symptoms were
  1. MathJax and Blogger seemed to work fine for the most part
  2. However, while composing a new post (with LaTeX commands in it), and previewing it using Blogger's Preview feature, the LaTeX would not be rendered.
  3. Once I published the blog, the rendering would work fine.
After some googling, I found that problem has a somewhat easy - albeit manual fix. The "preview" page normally has an "https://" prefix. Changing that to "http://" in the browser seems to solve the problem.

For example, upon normal preview:


After the change, the preview changed to:


I hope this is a temporary band-aid, because it is still a little annoying!

EDIT: Changing the source of the MathJax engine to https as pointed out here does fix it for good. Just swap the old "src=http" part with the new "src=https" part, as described in the link.

7 comments:

Zelaznog said...

Cheers mate!
I was wondering why it wasn't working... but it actually was.

Sachin Shanbhag said...

I'm glad it helped!

Paul Rubin said...

Thanks! I have the same problem, and this got me on the right trail. FYI, switching the code in my blog to load the MathJax script via HTTPS (http://docs.mathjax.org/en/latest/start.html#secure-access-to-the-cdn) seems to have fixed the preview issue (without my having to manually fiddle with the protocol at each preview).

Paul

Sachin Shanbhag said...

Thanks Paul.

I did what you suggested there, and that seemed to fix the issue for good!

Liviu said...

Thanks! I was dumbfounded. It helped a lot.

Ryan Walker said...

Thank you! I was going crazy trying to figure out what was up with this.

harmony said...

Thanks. I had the same problem.