Vision and Around

Dedicated to my research and life

LaTeX to Blogger Powered by MathJax (Experimental)

| Comments

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 latex ... format, 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 yet since it’ll definitely expend a considerable amount of work. ) Here’s the download link from my dropbox