Difference between revisions of "Latex2html"

From CUC3
Jump to navigation Jump to search
import>Csw34
import>Csw34
Line 3: Line 3:
 
== Installing the script ==
 
== 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. The first change is to the file '''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, '''#D9D9D9'''.
+
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:
 
Here are the before and after lines:
Line 15: Line 15:
 
$trans_color = $TRANSPARENT_COLOR||'#D9D9D9';
 
$trans_color = $TRANSPARENT_COLOR||'#D9D9D9';
 
</pre>
 
</pre>
  +
  +
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:
  +
  +
<pre>
  +
cd ~
  +
mkdir texmf latex2html
  +
cd ~/texmf
  +
mkdir tex
  +
cd tex
  +
mkdir latex
  +
</pre>
  +
This creates the directory structure we need. The configure script is then run as follows
  +
<pre>
  +
./configure --with-texpath=/home/CRSID/texmf/tex --prefix=/home/CRSID/latex2html --enable-png --enable-eps --enable-gif
  +
</pre>
  +
  +
  +
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 [http://ccrma.stanford.edu/~jos/webpub/Eliminating_Black_Rules_Under.html here], but for us, it boils down to editing

Revision as of 15:51, 21 July 2008

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