April 22, 2007

Testing testing 1 2 3

Category: Hackery — em @ 15:25

I’ve been having a mathematical few days, and really enjoying it. Having been struck by an urge to write up the results, I’ve been looking for ways to blog maths. There are many. The heavyweight solution is obviously MathML, which enjoys some support from Firefox but which Wordpress strips by default from comments. It’s not great fun to write directly, so the common approach is to use a LaTeX to MathML translator. There are bits of software that do just this, but the hosting this blog is on doesn’t permit the installation of binaries, so I’m unable to use these directly.

So the options became:

  • Calling a remote LaTeX to MathML translator
  • Calling a remote LaTeX to image translator

As luck would have it, I then fell across a LaTeX to image translation plugin for wordpress and decided to go with that for the time being.
The original homepage I found: Mimetex Plugin. Unfortunately, this hosting doesn’t permit libcurl. But then I found this revision, which very nearly worked perfectly. From there, I got to this version of same. Which did everything right, except for one minor detail, which was that it pointed to a nonexistent public mimetex server. For those with the same problem, the new address is: http://www.forkosh.dreamhost.com/mimetex.cgi - edit line 82 of mimetex-plugin.php

One other interesting issue comes from the need to give a white/near-white background to the transparent gif; I cheated here and edited line 90 of the plugin to put something to wrap around the gif.

Then I just edited the style.css to put a sensible background colour on said class.

I could’ve just set a background colour on the image (of class ‘tex’ - the plugin thoughtfully sets an image class) but I was hoping to get captions in with the same background colour as the image. You know the sort of thing - bracketed labels, like (1), so you can point back to the earlier equations… Haven’t figured out a sane syntax for that step yet though :-)

And the result:

\large f^\prime(xn)\=\lim_{\Delta x\to0}\frac{f(x+\Delta x)-f(xn)}{\Delta xn}

I=\int_{-\infty}^{\infty}f(x)\,dx

Have turned off caption div bgcolor until I figure out what to do with captions, numbering, etc. Opinions on a postcard please.

Tags:
  1. Martin posted the following on April 24, 2007 at 17:55.

    Hi, nice that you are using my revision of the mimeTex plugin … I didn’t notice those problems you were talking about, yet I was not really into my blogpage lately. As of now I just shall link over to your page, mentioning the problems you had ^^ So long.

  2. Washtub posted the following on April 27, 2007 at 15:17.

    Where should we mail postcards to?

    Good job with the hack! I’m trying to decipher the function via my limited recollection of calculus class, which is going laughably. I’ll spare ye the interpretive dance.

  3. zasw posted the following on August 29, 2007 at 04:50.

    excellent texture.a

  4. Robert posted the following on May 2, 2008 at 17:49.

    A lot of shared hosts make it difficult to add stuff like Mimetex.

    However, there is a work around in most cases.

    If your server has a “cron” facility, you can upload a bash file to your server, then execute using cron.

    This will sometimes allow you to compile CGI programs and other binaries.

    Cheers

Trackbacks and Pingbacks

  1. Pingback from Mind Your Decisions Blog » Blog Archive » Testing Math

    [...] A very special thank you to people who made this possible. See how you can add math here [you need to know Tex first] Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages. [...]

  2. Pingback from Walking in the woods - » LaTeX ? Wordpress

    [...] ?????Martin Becker ? blog ??? mimetex ?????? LaTeX ???????????????? mimetex-plugin.php ??? 82 ?? server ???????????? [...]

  3. Pingback from Studium @ Uni Wuerzburg » Blog Archive » Wordpress - mimeTeX_1.1.2 plugin

    [...] Beware of the Leopard » Testing testing 1 2 3 Says: April 22nd, 2007 at 16:45 [...]

  4. Pingback from ericstinson.com » Blog Archive » I can write equations on my blog

    [...] Thanks to etonkin for that useful comment! (note: the link on “etonkin” also take you to his page where he describes the change that needs to be made) [...]


Leave a reply

:mrgreen: :| :twisted: :arrow: 8O :) :? 8) :evil: :D :idea: :oops: :P :roll: ;) :cry: :o :lol: :x :( :!: :?:

  1. You will post the following soon.
    Go ahead and start typing.