Latex2html

From CUC3
Revision as of 15:54, 21 July 2008 by import>Csw34
Jump to navigation Jump to search

The latex2html script takes a latex document, and turns it into an equivalent set of HTML pages - broken down by section and then subsection. It generates an index.html page linking to each section and subsection as can be seen for the OPTIM documentation, here. The script itself is available for download here.

Installing the script

As you are most likely installing the script on a workstation where you do not have root access, you need to slightly deviate from the instructions in the INSTALL file. Before you start the install process however, you need to fix some bugs! Firstly - you need to edit pstoimg.pin. When converting from pmn to png, the latex2html script tells the converter to use a transparent background colour of 'gray85'. Unfortunately, the new version of the converter does not accept this and so you need to use the correct hex code instead in pstoimg.pin, #D9D9D9.

Here are the before and after lines:

Before:

$trans_color = $TRANSPARENT_COLOR||'gray85';

After:

$trans_color = $TRANSPARENT_COLOR||'#D9D9D9';

In order to fix the next problem, we need to first run the configure script. As you don't have root access, you need to specify a different installation path for both the script, and the latex style files. This should be done as follows:

cd ~
mkdir texmf latex2html
cd ~/texmf
mkdir tex
cd tex
mkdir latex

This creates the directory structure we need. The configure script is then run as follows

./configure --with-texpath=/home/CRSID/texmf/tex --prefix=/home/CRSID/latex2html --enable-png --enable-eps --enable-gif


There is also a known problem where you get black bars at the bottom of equations. This is an artefact of the image processing....process. latex2html converts all math mode characters into images and when the converter was recently changes, its ability to remove the temporary black lines (put in to help it identify the bottom of images) was broken. There is a detailed explanation here, but for us, it boils down to editing l2hconf.pm.

Here again is the before and after code.

Before:

# Options for dvips as determined by configure
#
$DVIPSOPT = ' -Ppdf  -E';

After:

# Options for dvips as determined by configure
#
$DVIPSOPT = ' -E';