Troubleshooting

Here are some curable symptoms:

* Cannot run any of the Perl programs:
If your Perl installation is such that Perl programs are not allowed to run as shell scripts you may be unable to run latex2html, texexpand, pstoimg and install-test. In this case change the first line in each of these programs from
#!/usr/local/bin/perl
to
: # *-*-perl-*-*
    eval 'exec perl -S  $0 "$@"'
    if $running_under_some_shell;

* The install-test script gives uninformative error messages:
If, for any reason, you have trouble running install-test, do not despair. Most of what it does is to do with checking your installation rather than actually installing anything. To do a manual installation just change the variable $LATEX2HTMLDIR in the beginning of the file latex2html to point to the directory where the LATEX2HTML files can be found.

Also, make sure that the files pstoimg, texexpand and latex2html are executable; if necessary use the Unix chmod command to make them executable.

* It just stops.
Check the style files that you are using. It is possible that you are using a style file which contains raw TEX commands. In such a case start LATEX2HTML with the option -dont_include <style-file name> . Alternatively, add the name of the style to the variable $DONT_INCLUDE in your $HOME/.latex2html-init file. If you don't have such a file then create one and add the lines:
$DONT_INCLUDE = "$DONT_INCLUDE" . ":<style file name>";
1; # This must be the last line

Another reason why LATEX2HTML might stop is that the LATEX source file itself contains raw TEX commands. In this case you may put such commands inside a latexonly environment.

The $VERBOSITY variable can be used to create tracing messages, which may help to locate which command or environment was being processed when everything stopped.

* It appears to be doing nothing.
Perhaps the processor has fallen into an unending loop. Usually there will be a bad definition, or other faulty source code, which has caused this. The $VERBOSITY variablecan be set to generate tracing messages, which may help to locate which command or environment is being processed repeatedly. Try setting a value of `3'; e.g. using the commandline switch -verbosity 3 . This will print command and environment names, as thaey are processed. It should soon become apparent where any such looping occurs.

* It just fills the endlessly with dots.
No `perhaps' here; the processor has definitely fallen into an unending loop. See the previous item for how to detect which command or environment is causing the problem.


change_begin98.1

* Perl cannot parse the latex2html script:
If Perl refuses to start LATEX2HTML and issues errors, your Perl version is not up to date. Update your Perl to 5.003 or later. You can check which version of Perl you are using by invoking Perl with the -v option.

If Perl issues errors during runtime, this is most probably related to bugs within LATEX2HTML or one of its modules. In this case you will need help from the developers or experienced users; this can be obtained via the discussion list.

* It crashes (dumps core) as soon as it starts:
Update your Perl to 5.003 or later.
change_end 98.1


change_begin98.1

* It does not show any of your images:
You can't run LATEX2HTML in a subdirectory that contains a dot within the directory name, such as latex2html-98.1, or in name of any higher directory. This is because dvips's -o option will change 98.1 into 98.001 and use that as the resulting output file, instead of image001 . The PostScript files will be placed higher up in the directory tree.

For instance, if pwd returns something like:

/usr/people/nelson/files/latex2html-98.1/work/tests
and you run LATEX2HTML, then dvips will generate image output files here:
/usr/people/nelson/files
called latex2html-98.001, latex2html-98.002, ... instead of image001, image002, image003, ... in the subdirectory where your .html files were created. As a result the images will not show in your documents.

If you are getting `File Not Found' errors, then reprocess your job using the -debug switch, to see what options are passed to dvips. If there is a `.' in some parts of any directory name, then look above that directory to see if files are being generated there.


One obvious fix is to rename the offending directory to remove the `.' from its name.

If that is not possible, then define an alternative location for image generation to take place; set $TMP to contain the name for this location. Typically $TMP = '/usr/tmp'; . (This use of $TMP is a good thing to do anyway, especially if your Unix account is subject to quota limitations.)

* It stops after having run LATEX, displaying a message about dvips:
See the previous item for the reason and `fix'. This version of LATEX2HTML detects the problem and will not allow images to be generated in the wrong place.
change_end 98.1

* dvips complains about incorrect arguments:
Please use a version which supports the command-line options -M , -S , -o and -i . ``Recent'' versions, at least after 5.516, do support them.

* It gives an ``Out of memory'' message and dies:
Try splitting your source file into more than one file, using the LATEX commands \input or \include. Also, try using the -no_images option.

Perhaps the processor has fallen into an infinite loop. Usually there will be a bad definition, or other faulty source code, which has caused this. See an earlier problem for how to set the $VERBOSITY variable to help locate the bad code leading to this memory exhaustion.

As a last resort you may consider increasing the virtual memory (swap space) of your machine.


change_begin98.1

* install-test issues ``dbm'' related error messages:
LATEX2HTML requires a DataBase Management system (NDBM, GDBM, or SDBM) in order to run. This is usually part of each Unix-like operating system and SDBM is part of Perl 5, but sometimes this is either missing on your operating system or left out in a binary Perl distribution. Use to find one or (better) update to a complete Perl 5 distribution.

* latex2html issues ``dbm'' related error messages:
If you get warnings like
ndbm store returned -1, errno 28, key "xyz" at latex2html line 123
this is related to an overflow of LATEX2HTML internals. You will need help from the list, here.

If you get real error messages which cause LATEX2HTML to abort, run install-test to check if your DataBase management works. You will probably need to re-install Perl 5 (see above topic).
change_end 98.1

This can happen when an image is being created from a large piece of LATEX source code. The image-reuse mechanism uses the code itself to construct a database key. If too long, the key is invalid and may crash DBM or NDBM. (In fact this error should no longer occur in V97.1, so please advise the LATEX2HTML developers if you get error messages of this kind.)
The message should contain the name of environment which caused the problem, along with an identifying number; e.g. eqnarray268. To find which exact piece of code this represents, run LATEX2HTML again, using the -debug switch. Then look at the files in the TMP subdirectory of the working directory named TMP/part001, TMP/part002, etc. Use the unix grep command: grep 268 <dir>/TMP/part* to find that number in these files. This should enable you to locate exactly where the problem occurs.

One solution may be to wrap the whole environment within \begin{makeimage} and \end{makeimage}. This will still cause the image to be created, but uses just the environment name and number as the database key.

* The \verb"ABC" command doesn't work:
This is an unfortunate bug which can be avoided by using any character other than quotes; e.g. \verb+ABC+.

* Cannot get the ``tilde'' (~) to show:
The trick here is to use \~{}.
Alternatively try using something like: mylink">mylink.

Warning: Some browsers may not be able to interpret the %7E as a ``tilde'' character.

Try using \char126 . In any case tildes within \htmladdnormallink and similar commands should be handled correctly.

* Macro definitions don't work correctly:
As mentioned in other places, not all plain TEX \def-initions can be converted. But you may also have problems even when using LATEX definitions (with \newcommand and \newenvironment) if such definitions make use of sectioning or \verbatim commands. These are handled in a special way by LATEX2HTML and cannot be used in macro definitions.

* \input commands:
There is a bug in the expansion of \input commands which may cause a problem when more than one \input command appears on the same line. There is no quick fix other than suggesting that you put each \input command on a line by itself, in the LATEX source files.

* \input commands in verbatim environments:

change_begin98.1
These should no longer cause problems (actually since 97.1). \input commands are also handled correctly within comment environments declared using \excludecomment and when loading multiple .aux files, due to use of the \include command. Alternatively you might want to use either the verbatim or the verbatimfiles package.
change_end 98.1

* Optional arguments in description environments:
If you have optional arguments for the \item command in a description environment containing nested ``]'' characters then these may not show up correctly. To avoid the problem enclose them in {}s;
e.g. \item[{[nested [angle [brackets] are ok]]}]

* LATEX2HTML behaves differently even when you run it on the same file:
 
If you notice any strange side-effects from previous runs of LATEX2HTML, try using the option -no_reuse and choose (d) when prompted. This will clear any intermediate files generated during previous runs. Note that this option will disable the image-reuse mechanism.

* Cannot convert PostScript images which are included in the LATEX file:
 
It is likely that the macros you are using for including PostScript files (e.g. \epsffile) are not understood by LATEX2HTML. To avoid this problem enclose them in an environment which will be passed to LATEX anyway; e.g.
\begin{figure}
\epsffile{<PostScript file name>}
\end{figure}

Another reason why this might happen is that your shell environment variable TEXINPUTS may be undefined. This is not always fatal but if you have problems you can use full path-names for included PostScript files (even when the PostScript files are in the same directory as the LATEX source file). Alternatively try setting TEXINPUTS to `.::'. With some TEX and LATEX installations setting TEXINPUTS to `.::' may cause problems in the normal operation of LATEX. If you get errors such as LATEX complaining that it can no longer find any style files then you must set TEXINPUTS to "<path to your LaTeX installation>:." if you want to use both LATEX and LATEX2HTML.

* Some of the inlined images are in the wrong places:
There are several known ways that this may occur.

* Unacceptable quality of converted images:
Try changing the size of the image (see image conversion).

* The bibliographic references are missing:
Run latex and then bibtex on the original source file in order to generate a .bbl file. LATEX2HTML may need the .bbl file in order to generate the references.

* The labels of figures, tables or equations are wrong:
This can happen if you have used any figures, tables, equations or any counters inside conditional text; i.e. in a latexonly or a htmlonly environment.

* Problems after changing the configuration files:
Please make sure that the last line in the configuration files (i.e. .latex2html-init and latex2html.config) is:
1;      # This is the last line
This is a Perl quirk.

* Problems when producing the .dvi version:
If you are using any of the new LATEX commands which are defined in the html.sty file make sure that html.sty is included; e.g. as one of the optional arguments to the \documentclass command.

Of course you also have to make sure that LATEX knows where the html.sty file is, either by putting it in the same place as the other style-files on your system, or by changing your TEXINPUTS shell environment variable 17.

* Some of the fonts are translated incorrectly:
There is a fault in way the LATEX scoping rules have been interpreted in LATEX2HTML. Consider this:
\ttfamily fixed-width font.
\begin{something}
nothing here
\end{something}
default font.
When processed by LATEX, the effect of the \tt command is delimited by the beginning of the environment ``something'', so that ``default font'' will appear in the default font. But LATEX2HTML will not recognise ``something'' as a delimiter and ``default font'' will appear in the wrong font.

To avoid this problem (until it is fixed) you may delimit the scope of some commands explicitly using {}'s; i.e.

\texttt{fixed-width font}.
\begin{something}
nothing here
\end{something}
default font.


change_begin98.1
Nesting of font changing commands is now handled correctly. Such problems should no longer occur, though it always helps to use explicitly delimited `pseudo'-environments; e.g. {\bf ... }, or LATEX's commands requiring an explicit argument, such as \textbf.
change_end 98.1

* Cannot get it to generate inlined images:
Run LATEX2HTML on your document, using the -debug switch. Look in the directory where the HTML files are generated for two files named images.tex and images.log. Examine their contents. Do you notice anything unusual in them?

Copy images.tex into the directory of your original LATEX file and run latex on images.tex. Can you see any errors in images.log? If so, can you fix images.tex to get rid of the errors? After fixing images.tex you can put it back in the directory of HTML, then run LATEX2HTML on the original document using the -images_only switch.

However if you make changes or additions to the original source then the same problems may occur again. Thus it is better to understand why the changes were required and alter your document's source code appropriately.


If you get into a mess delete all the image files and run LATEX2HTML again. Often it is sufficient to just delete the file images.pl.

If you still get into a mess, try running LATEX2HTML with the options -no_reuse and -no_images ; e.g.

cblipca% latex2html -no_reuse -no_images test.tex
This is LaTeX2HTML Version 95 (Tue Nov 29 1994) by Nikos Drakos, 
Computer Based Learning Unit, University of Leeds.

OPENING /tmp_mnt/home/cblelca/nikos/tmp/test.tex 
Cannot create directory /usr/cblelca/nikos/tmp/test: File exists
(r) Reuse the images in the old directory OR
(d) *** DELETE *** /usr/cblelca/nikos/tmp/test AND ITS CONTENTS OR
(q) Quit ?
:d

Reading ...
Processing macros ....+.
Reading test.aux ......................
Translating ...0/1........1/1.....
Writing image file ...

Doing section links .....

*********** WARNINGS ***********

If you are having problems displaying the correct images with Mosaic,
try selecting "Flush Image Cache" from "Options" in the menu-bar 
and then reload the HTML file.

Done.
Then try to have a look in the file images.tex (as described earlier) and perhaps fix it. Once you are happy that images.tex is OK, run LATEX2HTML again with the option -images_only .

Some problems in displaying the correct inlined images, may be due to the image caching mechanisms of your browser. With some browsers a simple ``Reload Current Document'' will be enough to refresh the images but with others (e.g. Mosaic) you may need to request for the cache to be refreshed. With Mosaic try selecting ``Flush Image Cache'' from ``Options'' in the menu-bar and then reload the HTML file.

* It cannot do slides, memos, etc.
If you use SliTEX you can go a long way just by replacing the {slides} argument of the \documentclass command with something like {article} just before using LATEX2HTML. One problem may be that all your slides will end up in the same HTML file. If you use lslide.sty you may get much better results (use to find this or any other style files).



Footnotes

... variable17
If you don't know how to do either of these things, copy (or link) html.sty to the directory of your LATEX document.