Thursday, March 24, 2011

LaTeX in Blogger




EDIT AGAIN (August 21, 2011): I seem to have this working again, using the following code:


Which I got from watchmath's author in this blogpost.

(OLD EDIT:  You may notice that you see $$ instead of math formulas.  WatchMath's server used to go down periodically, so they've moved the service to Google's, but I haven't had a chance to change the code.  That's annoying to have to go back to fix old posts and disinterests me in their service.  Here's the post explaining their changes. )

ORIGINAL POST:
Guillermo has a quick post about using LaTeX in blogger.  That's great, as it is frustrating to show nice math.  My question was if you needed a widget, but it turns out you can do it using the Edit HTML tab in the composition window.  For example,

$2x + 3 = \frac{1}{2}$

$\displaystyle \frac{x+3}{(x+2)(2x-1)}$

$$ \frac{x+2}{2x-1} $$




Quick and easy!  It uses the WatchMath service.







Install LaTeX?

6 comments:

  1. Tex the World is another option. http://thewe.net/tex/

    One disadvantage is that as far as I know it only works in Firefox (in terms of writing Tex...reading can be done in any browser).

    One nice advantage is that this also works in other programs like email and google docs.

    It's similar to Guillermo's solution, but does requite an add-on to write scripts (grease monkey).

    [;\sqrt{\frac{x}{y}};]

    Doesn't appear to work in comments, though. :(

    ReplyDelete
  2. Oh wait. Aha! It does work in comments (just didn't show up in the preview.

    ReplyDelete
  3. @Avery: Terence Tao (yes, that one!) has a description of Greasemonkey options for other browsers:
    http://terrytao.wordpress.com/about/google-buzz/

    ReplyDelete
  4. Nice work John. I didn't try pasting it directly.

    ReplyDelete
  5. anyone know how to use latex in a forum post?

    ReplyDelete
  6. I copied mathex3.js to my own server and replaced "script src = " with my own destination. However, blogger does not render the post correctly. Any ideas?

    http://valserb.blogspot.com/2011/07/testing-latex-in-blog.html

    I hosted the script here:
    http://cs-people.bu.edu/breslav/latex.js

    ReplyDelete