Archive for 2006-05-22

Installed inline LaTeX plugin

2006-05-22

I just happen to know this LaTeX rendering plugin for wordpress (was FigureRender) from Lilypond mailing list, which claims to render both mathematical equation written in LaTeX, and lilypond snipplets. This interests me much, thus I decided to give it a try. Here is the result:

[tex]\displaystyle \frac{x^2}{sgn(x)} =
\frac{x^3}{\left|x\right|} =
\left[ \begin{tabular}{l l}
$x^2$&$x>0$\\
undefined&$x=0$\\
$-x^2$&$x<0$ \end{tabular} \right. [/tex]

[Unparseable or potentially dangerous latex formula. Error 2 ]

The result is so sweet, but the setup is not.

  • After enabling plugin, what is shown in the site is a one-line php error message, before I realize the plugin is for PHP 5.x only.
  • Thus I have to hack it to work with PHP 4.x. Needless to say, the hack is really ugly (e.g. leaking local variables to global context)
  • Under Wordpress admin page, there is no figurerender plugin option shown in Options subpage. I have to guess the page name and enter URL manually. Not fixed yet.
  • After pressing ‘update’ to change setting, it only gives SQL error. Apparently it forget to enclose value in quotes, which is followed by some more hack.
  • It took almost half an hour before I realize my image cache dir is wrong.
  • It conflicts with Smiley plugin (basically Smiley plugin replaces stuff like (x) in f(x)), so in the future I need to enter equations more carefully. It is already demonstrated in the above equation, in the sign function sgn(x).

So this is it. This plugin is good enough for my usage, though I doubt if I would install lilypond 2.8.x on my machine, which is an old stable version of Ubuntu which only has pre-packaged lilypond 2.2.x (from Debian). Either compiling or packaging 2.8.x would need substantial effort, not to mention both.

24/5 update: The figurerender option page fail to show because it requires user level = 10, i.e. site admin. After I change it to 8 or 9 (common among all other plugins) the options can indeed show in options page.

2007-03-03 update: Changed formula so that it works with LatexRender plugin. I’m dropping FigureRender in favor of LatexRender plus my own music rendering plugin.