Subsections


8 Usage

Note: Much of what is in this section is outdated. For current software and its usage instructions go to either http://www.eng.fsu.edu/~dommelen/l2h or http://www.dommelen.net/l2h.

8.1 LATEX file format

Fairly standard format tends to work best.

Equation labels: do not put these on a line by themselves. Put them right behind the end of the actual equation and follow them by a % to avoid a blank line being inserted in the equation, causing the conversion of the equation to an image to fail.

For new versions of LATEX, (or rather hyperref), follow htmlimage commands by an empty pair of braces, like in

\htmlimage{extrascale=3}{}

TEX \defs: assuming that LATEX2HTML does not process them, put a second copy of the \def inside an imagesonly environment. (Requires the html package to be loaded.)

Captions: If you use an optional argument, make sure there is no linebreak between the ] and the {. Or the caption will become part of the image, probably with an incorrect figure number. Try to keep math out, and try to avoid captions with the same text save for the math. If the caption involves (even implicitly) \html or \latexhtml commands, the correct figure number may not be found.

Quotes: type left and right quotes as {\lq} and {\rq}, or they will look poor.

Do not use \hsize or \textwidth in pictures, it will not conform to your document. Specify actual dimensions in pt or in.

Watch for two figures or formulae with long identical starting text. LATEX2HTML may not see the difference in the later text. If necessary, put a strut at the start of one of the two to ensure the difference is noted. (That should be fixed in the new versions.)

Input commands: note subsubsection 9.30.

\framebox inside a picture environment: See subsubsection 9.20.10.

For other problems, see the following listings.

8.2 Elementary usage

Normal operation proceeds as follows: Put (a copy of) your LATEX document in a folder (i.e directory) by itself and rename it index.tex. Add copies of the figures or whatever else there may be.

In the command window obtained by double clicking the Windows_XP or Windows_98-ME icon in the l2hsup folder, (or in an xterm window on Unix), cd to the folder with your document. (In Windows XP, you can get some help on the cd command using help cd or cd /?, on Unix, that is man cd.)

latex index until there are no longer errors. If you want to provide an index.pdf pdf version of the document, to allow easy, high quality printing of the entire document, create that now. (If you do not know how to create one using your version of TeX, try makepdf.)

Then create the web pages using l2h. Load index.html in your browser to check the results.

Have a look at manual.pdf and hthtml/index.html in the docs subfolder of l2h to see what is there.

Occasionally, clean out the folder Temp.

8.3 The “makel2h” alternative

Makel2h is an alternative to the l2h command that puts the web pages in a subfolder. This can be useful if you want to keep the folder with index.tex clean. Also, it allows you to make different web pages for different browsers.

That is important if you are picky about the best possible alignment of the math images with descenders: different browsers are not compatible in such alignment. Internet Explorer is not compatible with any of the Mosaic/ Netscape/ Mozilla/ Firefox line, early Firefox is not compatible with later Firefox, etcetera. To create different pages for different browsers, you must use the makel2h command instead of l2h. Do not mix and match the two. A typical processing sequence would be

latex index
latex index
set L2H_BROWSER=c
makel2h
set L2H_BROWSER=x
makel2h
set L2H_BROWSER=f
makel2h
This will produce superbly aligned math for Firefox 1.5 and later (and any other browsers that align images correctly, according to agreed-upon international standards, but I know no other browsers like that.) It should also produce, on average, slightly better math alignment in Internet Explorer, though I do not guarantee you will see the difference, if there is one, or that it will be an improvement. (But in any case, the new alignment for Internet Explorer, makel2h or l2h, is a vast improvement over earlier versions of LATEX2HTML. No longer math hovering above the line.) There will also be web pages for browsers that think the middle of the lower case letter “x” is where the two lines cross (unlike Internet Explorer, which thinks it is 2/3 of the way up.)

Remember that with makel2h, eps figures must be either in the same directory with the index.tex file, or you must give the full path to the eps files in index.tex, all the way from the top of the disk.


8.4 Changing the looks with the wiz

You can now make basic changes to headers, colors, font sizes, and much more, of the web pages using the wiz.

To do so, cd to the folder with the index.tex whose web pages you want to customize. You must have run (make)l2h at least once up to the actual web page generation. Then simply enter “wiz”. The wiz is menu driven, so just select what you want to do and provide data.

Note that in the majority of cases, you will need to remake the web pages using (make)l2h after running the wiz. And if you have changed the web page background color and your images now have visible ghosting, you will also need to first remove the old images using “clrl2h images” before running (make)l2h.

The wiz is a quick and easy way to change the appearance of your web pages without getting involved in the details of perl, html, style sheets, and init files. Though the latter is of course much more powerful.


8.5 Using jpeg images

The original LATEX2HTML is set up to use gif images. (At least as installed under FU instructions; the original also supports png images.) There are good reasons to use gifs for formulae and line graphs: they allow transparency and can be compact for such images.

However, for pictures, the most popular image format on the web is jpeg (jpg). The reasons are that while gifs only allow 256 different colors in the image, jpegs allow millions. In addition, jpegs are usually much more compact, greatly speeding web page access over phone lines.

The disadvantage of jpegs is that they lose some information in the original picture, (but then, so do gifs if the original image has more than 256 colors.) For jpegs, that can show up, for example, as faint artifacts in light regions. Little is ideal in this world.

LATEX2HTML-FU has an added-on capability to create jpeg figures in addition to gifs. To activate this jpeg generation, do the following in the Windows_XP (or 98-ME) window:

set L2H_JPGQ=80
l2h  (or makel2h)
or in a Unix command window, do
setenv L2H_JPGQ 80
l2h  (or makel2h)
This will create jpeg duplicates of all gifs it makes with quality 80. (Use 75 for smaller jpegs, or 85 for less ghosting. Don't go over 90. Don’t use percent.) You will be asked whether you want to use the gif or jpeg version of each image; look at them in a viewer (your browser would do), and decide which one is best.

Jpegs are only made of images with more than 256 colors, or that have an \htmlimage{extrascale=...}{} within their figure environment. Also, if you want to have jpeg versions made of already existing images, you will need to delete the corresponding gifs first to force them to be remade.

Note that the ppmtojpeg executable must be in your path and with ppmtogif. This is true for the described installations.

To turn of jpeg generation, in Windows do:

set L2H_JPGQ=
and in Unix:
unsetenv L2H_JPGQ
Note that existing jpegs will still continue to be used; simply delete them if you want to get rid of them and rerun (make)l2h.