LaTeX to Blogger powered by MathJax (Experimental)

The past weekend I was trying to figure out how to convert \LaTeX source to Blogger compatible sources with the support of the powerful MathJax mechanism to display math.

There’s already an excellent tool (latex2wp) that serves the conversion from \LaTeX to WordPress as I noted before (and best advertised by Terry Tao’s WP blog). But there seem to be numerous legitimate reasons for doing similar thing on Blogger, the most notable one is Blogger allows network scripts to run for the blog (check out the concept of content distribution network, or CDN) and the powerful MathJax engine *happens* to provide such CDN service from recently. If you don’t appreciate why the bother to create yet another math display protocol MathJax, just come down here and have a look at the wonderful demos while imagining what would happen to image-based rendering of math at scaling.

A moment’s research revealed the major difference WordPress and blogger (precisely MathJax) are on handling \LaTeX math: the former uses “$1atex … $” format (I intentionally put the number “1” instead of the letter “l” to avoid invoking the WP interpreter) while the latter just directly the \LaTeX code as “$ … $“. Another major piece lies at how they handle displaying style (vs. the inline style delimited by “$ … $“). WP is to handle the following “<p align=center> $ latex \displaystyle … $ </p>\n“, whereas MathJax can handle “\[ ... \] ” directly (“\begin{equation} … \end{equation}” alike are converted to “\[ ... \]” with proper numbering). Other minor details are different formats of line breaks and so on.

So I have worked on the latex2wp package directly and made necessary changes as discussed. Some simple tests tell that it’s working fine. Probably you’d like to have a try! (Albeit my great admiration for MathJax and blogger, I have no intention to move to Blogger.com yet since it’ll definitely expend a considerable amount of work. ) Here’s the download link from my dropbox

Latex2Blogger.0.6.2b.tar.gz

About these ads
Tagged , , , ,

15 thoughts on “LaTeX to Blogger powered by MathJax (Experimental)

  1. Anonymous says:

    A really usefull article – A big thank you I hope you dont mind me writting about this article on my blog I will also link back to this post Thanks

  2. ateixeira says:

    Excellent! I’ll take a look at your modifications for latex2wp. I also made a few modifications for my blog, but since I’m hardly a specialist in python they had to be very limited.

    By the way can you summarize what you have d0ne?

    • idmsj says:

      In fact Paragraph 3 has by and large summarize that; you can compare my code with the original latex2wp codes, there are minimal modifications.

      Btw, I notice your blog is also being held on wordpress.com. Are you going to make it work with MathJax? If so, I’m sorry to say that it’s impossible currently from my research on that – wordpress.com does not allow editing the head part of Html. On the other hand, if you intend to transfer your blog to your own wordpress server, you may want to check out this plugin
      http://wordpress.org/extend/plugins/latex/

  3. 与非 says:

    Thank you!

    But I want use MathJax in my wordpress.com directly, do you know how to set it?

    • Ju Sun says:

      According to this, it’s not supported. You can try wordpress hosting with other commercial host providers. But it’s not hard too incorporate mathjax into static pages nowadays, this is also cool

      • 与非 says:

        Thank you for your answer!
        If use Octopress, should I built up another website?
        For now, I want stay in wordpress.com :)

  4. Thanks for every other informative website. The place else may I get that kind
    of info written in such an ideal means? I’ve a undertaking that I’m simply now
    operating on, and I have been at the glance out for such info.

  5. aménagés says:

    Interesting blog! Is your theme custom made or did you download it from somewhere?

    A design like yours with a few simple adjustements would really make my blog
    shine. Please let me know where you got your theme. Thanks a lot

  6. Please let me know if you’re looking for a article writer for your blog. You have some really good articles and I think I would be a good asset. If you ever want to take some of the load off, I’d absolutely love to write some content
    for your blog in exchange for a link back to mine.
    Please blast me an e-mail if interested. Many thanks, to you!

  7. I’m very little directly into studying, however by some means I obtained to learn numerous content inside your webpage,nice tips on this blog,you’ve done great job on experimenting on using this method..:)

  8. I usually do not post in Blogs but your blog forced me to, amazing work,
    beautiful. Thank you!

  9. click here says:

    I was wondering if you ever considered changing the structure of your site?
    Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect
    with it better. Youve got an awful lot of text for
    only having 1 or 2 pictures. Maybe you could space it out better?

  10. Pretty! This was an incredibly wonderful article. Thank you for supplying
    this info.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: