[ Introduction | How-To | Requirements | Download ]



NOTE: webtex used to be called webmath; however, I changed the name because now it does more than 'just' maths. In fact, it can do just about anything that TeX/LaTeX can. For example, while sitting in this sweaty little room in a Bangkok guesthouse, I implemented support for the beautiful Thai script.

WebTeX is a program to bring the beauty of TeX/LaTeX-rendered formulae and text to the web. It's not the first program which attempts to do so. There are many others (latex2html, tth, latexwiki, gladtex, ...) and they have influenced the design of webtex.

However, webtex offers a feature set (IMHO) not met by any of the others:

Webtex was written by Dirk-Jan C. Binnema aka djcb. You can e-mail me. You can read my Advogato-blog. Or you can read my ChangeLog (in Dutch).

I am actively working on webtex, and the current versions are admittedly spartan. But fear not, I have some great ideas (and a little bit of free time...). However, webtex is useful right now! But please mail me if you have any difficulties.

How does it work


Now... how does it work. It's really simple. Really. In your webpage you put an img-element like this:
  <img src="abc.png" class="webtex-math" name="x_1,x_2={\frac {-b\pm{\sqrt{b^2-4ac}}}{2a}}">
So... you include an img-element of class 'webtex-math', and you put the TeX/LaTeX formula in the name-attribute. Then, process your page with webtex:
% webtex index.html
which will process the formula with TeX/LaTex and put the result in abc.png. (Therefore, the src should refer to a local filesystem location). Really easy, and your index.html is not changed in any way...

Now, this is the result:


I have also implemented support for the Thai language. This requires you to have the thai-latex package, as well as a Thai word-separator (such as swath).

Now, add your Thai-stuff like this:

  <img src="abc.png" class="webtex-thai" name="˴Ҿˡһ¨">

Now, this is the result:

Editor support

If that's still too much typing, I have also written an emacs-minor-mode, which makes it even easier. If you write something similar for your favourite editor, please let me know...

Optimization note: webtex stores the formula in a comment field in the resulting PNG-file and uses this to determine whether an image needs updating.

What do you need

webtex requires you to have a number of programs to be able to run...


Well, the installation is a bit sub-optimal right now. Unpack the tarball and copy LaTeXImage.pm to somewhere in your Perl include path (@INC). You can check your include path with:
% perl -e "print \"@INC\\n\";"
You might want to check the locations of various execubles in LaTeXImage.pm as well, and change them if needed. They should be OK though. Now webtex should be ready for use!


webtex is licensed under the terms of the GNU General Public License (GPL). You can download it from my website (includes this webpage and the emacs-mode):
Emacs, the UberEditor
Last modified: Mon May 3 19:11:04 CEST 2004