Dear all, six months back I went through installing LaTeX2HTML in a W98 system, and I wrote my experiences. I put the document in my server and it has helped many people. I thank all of the persons who sent feedback and corrections. Now my server is down, and will be so for the rest of August, and I will be off, but every now and then some people ask for the document. So I attach it to this message, in an attempt to find a kind soul that could host it temporarily (I know of free web spaces provided by ISP, but I don't want to bother now) and tell it to the list and to me. Also, Steve Mayer was kind enough to include a point to my Web server in his TeX converter software; perhaps the link will be active again but the fault is mine. The document is not on the public domain. You can read it and learn from it, but not make money with it, or pretend you are the author. Donations to the author (me) or to the translator (Joseph Hilferty) are wellcome. ;-) Regards, Luis Seidel -- ======================================================================= Luis Seidel Gómez de Quero Dpto. de Física Aplicada E.T.S.I. Industriales UPM +34-1-3363101 fax +34-1-3363000 [EMAIL PROTECTED] =======================================================================Title: Installing LATEX2HTML with MiKTEX
Installing LATEX2HTML with MiKTEX
Luis Seidel Gómez de Quero
CervanTEX
Dpto. de Física Aplicada ETSI Industriales UPM
Translated by
Joseph Hilferty
Version 1. 4 February 2000
1 Preliminary comments
This document describes how to install the LATEX2HTML package as part of a scientific typesetting system implemented with MikTEX in a Windows 9x environment. My hope is that it will be useful for the users of this system and that it will be a valuable tool for converting LATEX documents to html. It is not the only tool of this type, nor will I say that it is the best; I of course do not want to discount similar efforts, such as TtH or fpTEX.
Mi aim is to show that LATEX2HTML can be installed under Windows 9x (something I did not believe just a few days ago) and that it is not too complicated (to be sure, with Linux it is all much simpler). The source of this small adventure was the course that I will be teaching at my university. I therefore would like to extend my thanks to my department, ICE at the Polytechnical University of Madrid, and Professor J.M. Goicolea, who invited me to teach the subject.
I have tried my best to make this document error-free and precise, but be warned that I have only tested what I describe herein on two systems: a Pentium 166MMX (64Mb RAM, W98) and another 166 (32Mb RAM, W95). I do not have access to an NT system, but I doubt it would be very different in the essentials. It goes without saying that this document HAS NO GUARANTEES WHATSOEVER. USE IT UNDER YOUR OWN RESPONSIBILITY AND AT YOUR OWN RISK. In no case can the present author, his institution, the developers of LATEX2HTML MiKTEX, or the members of CervanTEX be faulted. If something goes wrong, it's Mr. Gates' fault.1
Unfortunately, I cannot guarantee that I will be able to update this document, nor can I guarantee that I will be able to take care of questions that may arise. This document should therefore be considered PROVISIONAL and only valid for this week (and maybe next).
2 Ingredients
Before starting, we need to be sure that we have all the necessary programs.
I assume that MiKTEX is installed and that it is the most recent version.
It is not especially necessary that it be the latest version (1.20e), though. My
setup includes the installation directory c:\texmf
and the local
directory c:\localtexmf
. Note the directory
c:\texmf\miktex\bin
, which is located in the $PATH.2As usual, you should have Ghostscript installed. I am going to assume that
version 5.50 is installed in c:\texutils\gs5.50
.3 I am
going to put all the utilities in the texutils directory so as to
maintain a bit of order. Nonetheless, it is probably a good idea to avoid
directories or folders with spaces (e.g., Program Files).
You should get a version of perl for Windows9x/NT. As mentioned in MiKTEX 's Local Guide, the most recommended option can be found at http://www.activestate.com/ActivePerl/download.htm. The size of the installation file is about 5.5 Mb and is called APi522e.exe. This file is not freely distributable, although the Web page says that it can be distributed to everybody at every institution. You may also notice that you will need DCOM for Win95. However, for our purposes this is not the case.
At the MiKTEX update page http://www.miktex.de/download/index.html you can find the file netpbm.zip. This contains graphics-conversion utilities such as LATEX2HTML.
Finally, you will need LATEX2HTML. You can get this program at http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/ (it is important to get the latest version). As of right now the most recent version is latex2html-99.2beta6.tar.gz. It is important to remember that LATEX2HTML is just a set of scripts written in perl. Therefore, nothing has to be compiled, so long as you have perl and the above-mentioned auxiliary utilities.
3 Installing perl and netpbm
To install perl no instructions are needed. Just execute the installation
program and it will do the rest, including modify your autoexec.bat so
that it is included in the $PATH. I assume that it will install itself
in c:\Perl
.
You now have to unzip the file netpbm.zip. Be sure to keep all the
folder names intact. I assume that everything will be unzipped into the
c:\texutils\netpbm
subdirectory.
4 Installing and configuring LATEX2HTML
Now we have to unzip latex2html-99.2beta6.tar.gz into a temporary
directory, also making sure that we keep the folder names intact. Next,
we can configure and install LATEX2HTML. This is quite simple thanks
to the scripts config.bat, test.bat, and install.bat.
Since they are .bat files, it is best to open an MS-DOS window (if
we remember what that is). It is also useful to print and read the
install file that can be found in c:\TEMP\latex2html-99.2beta6
.
4.1 Editing prefs.pm
Look in the c:\TEMP\latex2html-99.2beta6
subdirectory. There you
will find the file prefs.pm. Open it with your favorite editor and
modify:
- line 123
-
$prefs('EXTRAPATH')='C:\\TEXUTILS\\GS5.50;C:\\TEXUTILS\\NETPBM\\BIN';
- line 129
-
$prefs('PREFIX')= 'C:\\TEXUTILS\\L2H';
(Note the double backslashes.) By doing this we are saying where to find
Ghostscript and netpbm and we are deciding that the directory in which we
are going to install LATEX2HTML is c:\texutils\l2h
.
4.2 Executing config.bat
In our venerable MS-DOS window, we now change directories to
c:\TEMP\latex2html-99.2beta6
and execute config.bat. This
is the most critical moment of all. In my experience the program hangs
when it is going to recognize the version of dvips. Nevertheless,
pressing the return button a couple of times is enough to get it going
again. I have also already mentioned that the the latest version of
Ghostscript (5.99) does not recognize it very well. Except for these
potential problems, everything should go well. If not, then start
over again. For reference purposes, I include the result that is
saved in the config.log file.
config.pl, Release 99.2 beta 6 (Revision 1.30) Accompanies LaTeX2HTML, (C) 1999 GNU Public License. checking for old config file (cfgcache.pm)... not found (ok) checking for platform... MSWin32 (Windows 32 bit) checking for C:\Perl\bin\perl.exe... C:\Perl\bin\perl.exe checking perl version... 5.00503checking if perl supports some dbm... yes checking if perl globbing works... yes checking for tex... C:\TEXMF\MIKTEX\BIN\tex.exe checking for latex... C:\TEXMF\MIKTEX\BIN\latex.exe checking for initex... C:\TEXMF\MIKTEX\BIN\initex.exe checking for kpsewhich... no checking for TeX include path... NONE Warning: Will not automatically install LaTeX2HTML style files. checking for dvips... C:\TEXMF\MIKTEX\BIN\dvips.exe checking dvips version... 5.86 checking if dvips supports the combination of -E and -i -S 1... yes checking for html4-check... no checking for gswin32c... \TEXUTILS\GS5.50\gswin32c.exe checking for ghostscript version... 5.50 checking for ghostscript portable bitmap device... pnmraw checking for full color device for anti-aliasing... ppmraw checking for ghostscript library and font paths... built-in paths are correct checking for pnmcrop... \TEXUTILS\NETPBM\BIN\pnmcrop.exe checking if pnmcrop can crop from one direction... yes checking for pnmflip... \TEXUTILS\NETPBM\BIN\pnmflip.exe checking for ppmquant... \TEXUTILS\NETPBM\BIN\ppmquant.exe checking for pnmfile... \TEXUTILS\NETPBM\BIN\pnmfile.exe checking for pnmcat... \TEXUTILS\NETPBM\BIN\pnmcat.exe checking for pbmmake... \TEXUTILS\NETPBM\BIN\pbmmake.exe checking for ppmtogif... \TEXUTILS\NETPBM\BIN\ppmtogif.exe checking if ppmtogif can make transparent GIFs... yes checking if ppmtogif can make interlaced GIFs... yes checking for pnmtopng... \TEXUTILS\NETPBM\BIN\pnmtopng.exe checking if multiple pipes work... no Unfortunately multiple pipes are not reliable on this OS. checking for temporary disk space... C:\WINDOWS\TEMP creating cfgcache.pm creating test.bat creating install.batNote: Will install... ... executables to : C:\TEXUTILS\L2H\bin ... library items to : C:\TEXUTILS\L2H
4.3 Executing test.bat and install.bat
So as to be sure that everything has gone perfectly, try executing the test.bat file. This will check the program and the utilities on a small TEX file. The result can be seen on our favorite Web browser. You should see various equations against a rather ugly grey background. By default, LATEX2HTML creates images of equations and uses the PNG format; the problems is that Web browsers do not render transparent-background PNGs very well. This can be changed if we do not mind the controversy surrounding the GIF-format patents.
Lastly, execute install.bat. This will copy certain necessary files
to C:\TEXUTILS\L2H
(about 5.5 Mb). Now we can erase the temporary
directory c:\TEMP\latex2html-99.2beta6
. The only thing left to do
is configure a few things so it suits our needs. Perhaps this is a good
moment to copy what is in C:\TEXUTILS\L2H\texinputs
so that
MiKTEX can find everything (for example, C:\localtexmf\tex\l2h
,
remember to update the database (Maintenance -- Refresh Filename Database)).
4.4 Configuring LATEX2HTML
Although configuring LATEX2HTML can be done by command-line options or by a file (.latex2html-init) for every user and every task, I would suggest editing the l2hconf.pm file, which is now found inC:\TEXUTILS\L2H
, to make a few general modifications. From here
on, you should read the manual (125 pages).
Edit the above-mentioned file and make the following changes:
- line 52
-
@IMAGE_TYPES = qw(gif png);
- line 290
-
$LOCAL_ICONS = 1;
- line 553
-
$HTML_VERSION = '3.2,math';
- line 567
-
$UNSEGMENT = 1;
- line 767
-
$EXTRA_IMAGE_SCALE = 2;
In order to understand the usefulness of these modifications, you will
have to use the program. As the manual (which can be generated with
LATEX or converted to HTML), LATEX2HTML converts the file, say,
thesis.tex into a series of tt HTML and GIF files, which are then
saved in a subdirectory (e.g., thesis) containing the source file.
It is not the purpose of this document to explain the ins and outs of
LATEX2HTML. Note that, upon executing latex2html thesis.tex,
what you will see in the MS-DOS window might be a bit disquieting and
it can take a while. It is worthwhile to test a few examples (i.e.,
simple small files) before trying to convert a book-length monograph
with lots of equations and figures.
I have almost forgotten to mention that you will want to have the
folder C:\localtexmf\tex\l2h\bin
in your $PATH.
Surely there are more elegant or simple ways to do what I have just described. To give me signs of support, helpful pointers or criticisms, please write author.
About this document ...
Installing LATEX2HTML with MiKTEXThis document was generated using the LaTeX2HTML translator Version 99.2beta6 (1.42)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -split 0 -no_navigation -show_section_numbers l2h_eng.tex
The translation was initiated by usuario on 2000-02-04
Footnotes
- ... fault.1
- Translator's note: Despite the Italian saying tradutore, traditore, the translator also washes his hands of anything that can be attributed to him.
- ...$PATH.2
- I assume that the reader already knows how the change this variable.
- ... .3
- The latest Beta, version 5.99, has been giving problems with script config.bat. If you have this version installed, you should make some modifications.
usuario 2000-02-04
/* Century Schoolbook font is very similar to Computer Modern Math: cmmi */ .MATH { font-family: "Century Schoolbook", serif; } .MATH I { font-family: "Century Schoolbook", serif; font-shape: italic } .BOLDMATH { font-family: "Century Schoolbook", serif; font-weight: bold } /* implement both fixed-size and relative sizes */ SMALL.XTINY { font-size : xx-small } SMALL.TINY { font-size : x-small } SMALL.SCRIPTSIZE { font-size : smaller } SMALL.FOOTNOTESIZE { font-size : small } SMALL.SMALL { } BIG.LARGE { } BIG.XLARGE { font-size : large } BIG.XXLARGE { font-size : x-large } BIG.HUGE { font-size : larger } BIG.XHUGE { font-size : xx-large } /* heading styles */ H1 { } H2 { } H3 { } H4 { } H5 { } /* mathematics styles */ DIV.displaymath { } /* math displays */ TD.eqno { } /* equation-number cells */ /* document-specific styles come next */