Installing mathtex.cgi

In order to make and install mathtex.cgi, latex and dvipng are prerequisite. You need to install latex first and divpng will come along with it.

You can follow the instruction


Following will show how I have done with it for example.

# wget
# mkdir mathtex
# cd mathtex
# unzip ../
# cc mathtex.c –DLATEX=\\"$(which latex)\\" \\
–DDVIPNG=\\"$(which dvipng)\\" –o mathtex.cgi
# cp mathtex.cgi /public_html/xxx.../cgi-bin/

For test of mathtex.cgi, in your web browser, you can do it by^2+y^2

It will give you the gif image showing equation by latex syntax.

Installing Latex

The latex can be installed by following instruction:

Followings are showing how I installed for example.

# wget
# tar -xvzf install-tl-unx.tar.gz
# cd install-tl-20091126
# ./install-tl

While running “install-tl”, I used ‘D’ option to change the directory to be installed, and ‘O’ to select ‘use letter size instead of A4 by default’ option.

It took around 1 hour to be installed. I have installed it in “~/texlive/” and latex and divpng are installed in “~/texlive/bin/x86_64-linux”

If you want to test the latex, please do

# latex small2e

It will give small2e.dvi in your directory. Using dvipng tool, you can make it gif or png image file.