Skip to main content

Math on the web without TeX?

tex
harvard
web
php
latex
Published

May 8, 2007

This post is from the blog I kept as Preceptor in Mathematics at Harvard (2005–2008). It’s kept here as an archive; some links are dead and references are dated.

I just found PhpMathPublisher on the web and it looks kind of interesting. The name pretty much describes it: a PHP package that parses a kind of math input and produces image-based output.

Most packages (such as LaTeXRender) along these lines serve as a front end to TeX or LaTeX, then serve up a generated image file. There are some drawbacks to this:

PhpMathPublisher has a tex-like syntax but seems to parse the input on its own and use GD to assemble a formula. Here’s the markup:


<m>delim{|}{{1/N} sum{n=1}{N}{gamma(u_n)} - 1/{2 pi} int{0}{2 pi}{gamma(t) dt}}{|} <= epsilon/3</m>

In LaTeX we would write

\left|\frac{1}{N}\sum_{n=1}^n \gamma(u_n) - \frac{1}{2\pi}\int_0^{2\pi} \gamma(t)\,dt\right| \leq \frac{\varepsilon}{3}

to get

\displaystyle\left|\frac{1}{N}\sum_{n=1}^n \gamma(u_n) - \frac{1}{2\pi}\int_0^{2\pi} \gamma(t)\,dt\right| \leq \frac{\varepsilon}{3}

It does get the job done, and the finished product is not so bad.