How to use latex2html

one of Rob's "unofficial" Help Guides


To use the version that I maintain, make sure that the suhep directory
~webkeep/server/web-bin
is in your path.

For example, in my .cshrc file

set path=($HOME/bin ~webkeep/server/web-bin ~webkeep/JAVA-alpha/bin ...)


To check,
suhep% which latex2html
/home4/webkeep/server/web-bin/latex2html

To run,
suhep% latex2html myfile.tex


In converting a LaTeX2e document, to include .eps figures
\documentclass{article}
\usepackage[dvips]{epsfig} 

\begin{document}
Blah, Blah, Blah,...

        \epsfig{file=myfig.eps}

...Blah, Blah, Blah

\end{document}


Here is an explicit example.

Look at the latex source: sample.tex

\documentclass{article}
\usepackage[dvips]{epsfig} 

\begin{document}

This is a test. Pythagoras says $c^2=a^2+b^2$. 

\begin{eqnarray}
c^2&=&a^2+b^2\\
1&=&\cos^2\theta+\sin^2\theta
\end{eqnarray}

\epsfig{file=sample-xfig.eps}

That was a picture.

\end{document}

To use latex2html, simply type:
latex2html sample
It will begin processing the latex source.
This is LaTeX2HTML Version 96.1 (Feb 5, 1996) by Nikos Drakos, 
Computer Based Learning Unit, University of Leeds.
.
.
.
GS>Writing img2.gif
ppmtogif: computing colormap...
ppmtogif: 2 colors found
ppmtogif: computing colormap...
ppmtogif: 2 colors found

Doing section links .....
Done.
Now, a newly created directory called sample contains the html-version. Let's look at it.
cd sample
ls -l
-rw-r--r--   1 salgado  webdoc        393 Jul 31 12:45 contents.pl
-rw-r--r--   1 salgado  webdoc          8 Jul 31 12:45 images.aux
-rw-r--r--   1 salgado  webdoc       3071 Jul 31 12:45 images.log
-rw-r--r--   1 salgado  webdoc        400 Jul 31 12:45 images.pl
-rw-r--r--   1 salgado  webdoc        664 Jul 31 12:45 images.tex
-rw-r--r--   1 salgado  webdoc        189 Jul 31 12:45 img1.gif
-rw-r--r--   1 salgado  webdoc        624 Jul 31 12:45 img2.gif
-rw-r--r--   1 salgado  webdoc       1925 Jul 31 12:45 img3.gif
lrwxr-xr-x   1 salgado  webdoc         11 Jul 31 12:45 index.html -> sample.html
-rw-r--r--   1 salgado  webdoc       1757 Jul 31 12:45 node1.html
-rw-r--r--   1 salgado  webdoc        344 Jul 31 12:45 sample.css
-rw-r--r--   1 salgado  webdoc       1441 Jul 31 12:45 sample.html
-rw-r--r--   1 salgado  webdoc        428 Jul 31 12:45 sections.pl
Take a look at the html-version: index.html or sample.html.

To make it web-accessible, copy the entire directory into a web-accessible directory:

mkdir ~/public_html/sample/
cp * ~/public_html/sample/



Consult the The Latex2html Manual for other details.


Rob Salgado (salgado@physics.syr.edu)
Last modified: Wed Sep 2 11:36:27 1998