Friday, May 25, 2012

MathJax: LaTeX on Blogger - finally!

I am easily excited when I find yet another place where I can use LaTeX syntax to typeset mathematics (Google Docs, OpenOffice, again, presentations using BeamerInkscape).

Finally, it seems, it is not incredibly clunky to write math in Blogger. In fact, it is as convenient as writing it in a native LaTeX document.

The latest avataar of MathJax, while not really new, is new to me. Here are a few links which describe how to go about empowering your Blogger account.

The easiest permanent fix is to add some script in your Blogger template file, as described here.

If you don't like messing with your template, you can take the approach outlined here. Basically, you add some lines to each post in the "html" view, which has math in it.

Here is a mandatory test:
\[\frac{df}{dx} = \frac{1}{2} \left(\frac{ab \textrm{ sech}^2(b \sqrt{x})}{x} - \frac{a \tanh(b \sqrt{x})}{x^{3/2}} \right)\]
Beautiful!

26 comments:

  1. Testing if MathJax works in comments

    $$\frac{df}{dx} = \frac{1}{2} \left(\frac{ab \textrm{ sech}^2(b \sqrt{x})}{x} - \frac{a \tanh(b \sqrt{x})}{x^{3/2}} \right)$$

    ReplyDelete
  2. Does this still work?
    $$\sum_{n=0}^{N-1} x^n

    ReplyDelete
  3. $$\sum _{2}^{2}$$

    ReplyDelete
  4. It doesn't seem to work anymore... At least I cannot see any LaTeX rendered.

    ReplyDelete
  5. $$\theta(x) = t$$

    Do we put a double $$ sign around the code, or how is it done.?

    ReplyDelete
  6. @Giacomo: Seems to work fine for me. Could it be your browser?
    @NotYet: You got it!

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. test
    (∑k=1nakbk)2≤(∑k=1na2k)(∑k=1nb2k)

    ReplyDelete
  9. As a matter of curiosity, I'm using MathJax with a 'Classic' Blogger template. And I'm inserting the necessary code in each post in which it is needed.

    ReplyDelete
  10. On blogger/blogspot there is a security feature that prevents the loading of http: links in https: content (like blogger/blogspot). I don't know if it's a new feature, but it can prevent latex rendering on some browsers. If you're having trouble, replace the url to the MathJax.js library with:
    https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js

    It's not pretty, but it's a legit https link to the mathjax library. It is discussed on the official mathjax site here: http://www.mathjax.org/resources/faqs/#problem-https

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. \int e^{\alpha x²}dx

    ReplyDelete
  14. No one is dumb who is curious. The people who don't ask questions remain clueless throughout their lives. See the link below for more info.


    #clueless
    www.ufgop.org

    ReplyDelete
  15. I would like to hear more about latex typesetting. Really good article

    ReplyDelete
  16. Awesome work, So if you need an online converter for your files then use this;

    Best File Converter

    ReplyDelete