A. Problems resolved in LaTeX2HTML

Here is a list of problems I found in LATEX2HTML 99.2 and corresponding FU fixes.

  1. Problem: It crashes, requiring a Ctrl-Alt-Del removal of the DOS box, and fairly soon a complete reboot.

    Reason: DOS has only very marginal redirection capabilities. pstoimg.bat does three redirections to reduce screen output. Each of them by itself is enough to crash the DOS box.

    Solution: I removed all three. My l2hcrop does less output anyway.

  2. Problem: Commands executed through batch files, such as LATEX, crash

    Reason: Perl does not pass the parameters to batch files. LATEX cannot process images.tex if it does not know the file name.

    Solution: Create a Gnu 77 Fortran program rb.exe, (for run bat), and run all batch files through that executable.

  3. Problem: Batch files do not return error status.

    Reason: DOS.

    Solution: Make a batch file, latexl2h.bat, that returns a pointer, C:\Temp\rb.err, if an error occurs, and then make rb.exe return an error status to Perl.

  4. Problem: Messages go off the screen before they can be read.

    Reason: DOS boxes do not have a buffer, and output redirection of stderr would be very difficult even without all the other redirection already there.

    Solution: Create a log file C:\Temp\l2h.log and copy all the output, of at least in latex2html.bat, pstoimg.bat, and texexpand.bat, to that file. Allow an environment variable L2H_SLEEP to be set with a delay. (Note that reading from the keyboard tends to fail with all the input redirection being done.)

  5. Problem: There is a roughly 95% chance that the program does not work even with the crashes removed.

    Reason: It tries to accomodate every possible version and variation of about 30 different external utilities not under the authors' control.

    Solution: Specify specific version numbers for the netpbm utilities in a constant state of flux. Ignore alternate possibilities to freely available programs, and specify the latest version of the more consistent ghostscript, dvips, and perl utilities.

  6. Problem: Netpbm 10.18 has compatibility problems, including with the vital pnmcrop, which does not work correctly in latex2html.

    Reason: latex2html was written a long time ago.

    Solution: Switch to the earliest I could find, Netpbm 10.6.

  7. Problem: Various utilities in netpbm 10.6 do not work properly, such as the jpeg ones.

    Reason: It is an old version.

    Solution: Get those from the last version, 10.18.

  8. Problem: Anytopnm is a unix shell script.

    Reason: Netpbm was not really designed for Windows.

    Solution: Substitute a batch file as a crude fix.

  9. Problem: Some Netpbm utilities miss the .exe file extension.

    Reason: Seems to be an indication that they are obsolete.

    Solution: Rename them.

  10. Problem: Gifs turn out with horrible, completely wrong colors.

    Reason: A known bug in PPMQUANT.

    Solution: Substitute a batch file that runs pnmmap and pnmremap instead.

  11. Problem: Latex2html.bat fails renaming existing images, to be reused, back from .old to .gif.

    Reason: DOS cannot keep up with the amount of files being renamed.

    Solution: On failure, put in a one second delay, and then try again.

  12. Problem: The installation procedure insists on a html checker.

    Reason: Beats me.

    Solution: Provide a fake one, chckhtml.bat, doing nothing. You can always put one in there, following the lines of latexl2h.bat.

  13. Problem: Insists on making png instead of gif images if png is enabled.

    Reason: Beats me.

    Solution: Change prefs.pm to get rid of png completely.

  14. Problem: You get an address in your web pages even if you blank out the variable.

    Reason: Whatever you set address to, it is redefined in latex2html.bat.

    Solution: Change latex2html to not set address if it is already defined.

  15. Problem: The configuration procedure cannot handle required switches and arguments of executables.

    Reason: The authors did not put it in.

    Solution: Put suitable switches and parameters in the pin files.

  16. Problem: Seems to be an aliasing problem. Text is varying thickness.

    Reason: Page color is set to grey scale in l2hconf.

    Solution: Set page color to the more general white.

  17. Problem: The -E dvips option is set twice, once unconditionally in l2hconf.

    Reason: A new line after a comment symbol.

    Solution: Remove the new line.

  18. Problem: Almost all latex2html web pages on the net have missing icons, including a number of old ones of my own.

    Reason: An insane idea to have the icons placed on some central location on the web server, rather than safely with each document. You have to be a system administrator yourself to trust they will keep these icons safe for eternity. If these system administrators are still working here next year, and still remember what the icons were for in the first place, and are willing to figure out whether someone is still using them instead of simply deleting and waiting for complaints, that is.

    Solution: Set the local icons option as default.

  19. Problem: HTML 3.2 is used.

    Reason: For historical reasons, it says.

    Solution: Use HTML 4.

  20. Problem: Web pages drive you crazy with some having a navigation panel at their bottom and some not.

    Reason: Beats me.

    Solution: Set default options to enable bottom panels on all pages.

  21. Problem: You cannot just click the forward and backward icons to scroll through the web pages. Also, part of the upcoming section name is lost. The order of the icons is counter-intuitive. Navigation panels visually dominate the web page.

    Reason: Putting section names between the icons causes them to flip back and forth from one page to the next. With all the text, there is not enough space for full titles.

    Solution: Get rid of the text except that of the upcoming section, and put that behind the icons. Put them in an intuitive order. Move the navigation panel formatting to .latex2html-init to make it easier to customize.

  22. Problem: Navigation icons look unimpressive and dominatingly big.

    Reason: Beats me.

    Solution: Remade the icons. Still not very impressive, but better. Added some support for people to make their own.

  23. Problem: There is no utility to make figures with MS Paint and convert them to eps.

    Reason: Authors do not use MS Paint?

    Solution: Add bmptopnm.exe from netpbm and create a batch file bmptoeps.bat.

  24. Problem: Usage is not very user-friendly.

    Reason: Not designed that way.

    Solution: Provide a batch file makel2h.bat to do the usage overhead and a utility l2hnewer.exe to check file dates.

  25. Problem: The manual is not easy to process and the segmented document you are asked to produced cannot be created.

    Reasons: Use of special style files, some with file names over 8 characters long. Use of a makefile, which simply does not work, for one reason since DOS batch files do not return error codes.

    Addition: the two poorly documented makefiles do not work under Unix, either. Half the manual is not processed.

    The official online manual is not that great either. For example, what to make from figure 3?

    Solution: Provide the processed manual in pdf form, and the hthtml page in html form and just zip the rest.

  26. Problem: Style file verbatimfiles.sty does not work since its name is more than eight characters. The same for changebar.sty.

    Reason: No acount is taken of older TeX versions.

    Solution: Make a note to the users to rename it.

  27. Problem: Installation creates weird error messages if an executable is missing.

    Reason: Beats me.

    Solution: Make sure none is missing.

  28. Problem: Inline mathematics is a completely different font size than the rest. On some pages on the web, it is three times bigger.

    Reason: The font sizes are not fixed, depending on options and user browser setting.

    Solution: If you represent math by images, you no longer have a choice about font size. So, set the chosen font size for the nonmath to the same fixed size using style sheets. (Note however that web page readers may set their browser to ignore style sheet font sizes. That is up to them. Their math will still be the same size.)

  29. Problem: Inline images are not aligned correctly vertically.

    Reasons: Mozilla and Internet Explorer do not vertically align images at the same height. Also, for both browsers, image alignment depends on font size. Raised images are not correctly aligned by the latex2html pnmcrop procedure. If there is more than one image in the same line, Internet Explorer will mess up the alignment of one because of the presence of the other.

    Solutions: Provide separate web pages for Mozilla and Internet Explorer. Provide an older version of pnmcrop instead of the latest which does not work correctly. Provide a program, l2hcrop.exe, that crops more reliably. Fix the font size, and make l2hcrop compute the correct alignment for that font size. L2hcrop will correctly crop raised images. The IE problem with multiple images in the same line cannot be resolved, but l2hcrop minimizes it by cropping the mages to the minimum size required.

  30. Problem: Weird black bars show up below or to the left of math images.

    Reasons: Sometimes latex2html produces alignment bars that are too short. In that case, pnmcrop will leave this artifact in the image. In addition, pnmcrop may be a wrong, too recent, version.

    Solution: Use l2hcrop, and make it check and correct for the possibility that the alignment bars are too short. Ensure a compatible version of pnmcrop for the rare case that l2hcrop runs out of memory.

  31. Problem: Line spacing is widely varying from one line to the next.

    Reason: The whitespace put in to vertically align images.

    Solution: Let l2hcrop cut the images to the smallest size possible to minimize the problem.

  32. Problem: Figures have incomplete characters and missing lines.

    Reason: Ghostscript does not anti-alias embedded bitmaps.

    Solution: Apropriate the extrascale option, ignored by latex2html for figures, to let ghostscript oversize the figures, then provide l2hcomp.exe to put them back to size with proper anti-aliasing.

  33. Problem: Excessive white space around formulae.

    Reason: Apparently the authors want to simulate mathsurround, even if it just looks funny on a screen with much less real estate than a printed page.

    Solution: Class the whitespace, and use style sheets to get rid of it.

  34. Problem: Navigation panels are not easily customized beyond simple changes.

    Reason: Icons are hard coded, even with their links and file names.

    Solution: None.

  35. Problem: Left quotes look lousy.

    Reason: Seems to be intentional, probably a bug fix for something else.

    Solution: Tell users to use {\lq} and {\rq}.

  36. Problem: Creating 500 images is very slow.

    Reason: Well, what do you expect.

    Solution: L2hcrop provides a partial solution, because one invocation of l2hcrop replaces about four invocations of pnmcrop, one of pnmquant, as well potentially a pnmflip one. Also, l2hcrop reads the image file only once, keeping it in memory. The Quantum Mechanics for Engineers web pages, with well over 500 images, take 15 minutes to create, per browser, on my four or five year old Windows 98 laptop.

    I do find that it runs many times more slowly (though correctly) on my desktop at work, also a 98, but with 128 Mb memory instead of 256, and slower disks. Neither disk or memory is the problem, however. The problem is that the processor is maxed out to 100% while running. It however, is virtually the same processor as my laptop's. If anyone can solve this complete mystery for me..?

  37. Problem: Images are not always remade.

    Reason: The algorithm ignores changes in spaces, as well as missing backslashes and brackets that you correct.

    Solution: Warn the user to delete the image. Also note to try browser refresh.

  38. Problem: In debug mode, intermediate images are not kept as promised.

    Reason: They are named by process ID. DOS reuses process IDs.

    Solution: Use time instead of process id for the name.

  39. Problem: Ridiculous long HTML name tags for section starts.

    Reason: I don't know.

    Solution: None.

  40. Problem: Somehow, the document, part, chapter, and section titles are all set the exact same way, and in the same font size.

    Reason: They are all converted into classless H1 tags, because really important divisions such as subparagraph need their own tag, and html has only 6.

    Solution: Let subparagraph suffer.

  41. Problem: The style file is hardcoded in latex2html, and incomplete.

    Reason: Beats me.

    Solution: Let makel2h move in a style file before latex2html gets the chance.

  42. Problem: Small images are not being created.

    Reason: ppmtogif crashes trying to interlace gifs that are only 3 pixels or so high.

    Solution: Let l2hcrop return a warning if the image is less than 16 pixels high, and turn off interlace if it is.

  43. Problem: Images.tex tends to fail to process.

    Reason: It is pushed in a subdirectory. I don't know why this file could not be processed in the original directory and then moved down, but anyway.

    Solution: Warn the users more clearly about .. in texinputs, providing a test for it, and about not having relative path names. Pause the screen if latex returns a warning on images.tex and copy the files to the Temp directory for examination.

  44. Problem: Html.sty does not account for the possibility that paragraph is not defined.

    Reason: Beats me.

    Solution: Warn the user.

  45. Problem: Sections/figures/tables are not correctly numbered.

    Reason: The numbers are retrieved from latex for the given title. Unfortunately, Latex and html do not always agree on what is the title.

    Solution: (1) Added a last resort search that first removes embedded mathematics from the titles, that makes the tex and html agree on the &, (very common in legends because of references), and that prints to the log file to show why the search fails, if it still does. (2) If this last resort fails too, increment the previous number by one, which works most of the time. Warn the user, anyway. Also add a warning to problem shooting not to use discretionary hyphens, they cannot be fixed without also affecting true hyphens.

  46. Problem: It tries to process \input{abstract} as \begin{abstract}, making a mess.

    Reason: Unknown. It does input the file.

    Solution: Warn the user to not make input file names look like environments.

  47. Problem: Addcontentsline is not supported.

    Reason: Don't know.

    Fix: Set default to have starred section titles go to toc.

  48. Problem: Resetting section numbers does not work.

    Reason: Unknown.

    Solution: None. (This does not seem to be much of a problem since it gets its numbers from latex anyway.)

  49. Problem: Thumbnails are not cropped.

    Reason: The crop option is not passed to pstoming.

    Solution: Add it.

  50. Problem: Captions of figures have each word on a separate line.

    Reason: The figure and caption are put in a html table. The browsers then make the table as wide as the figure, which can be very small.

    Solution: Specify the table to be 65% of the page width.

  51. Problem: Code is very hard to figure out.

    Reason: Perl asks for messy code, and not providing full comments in the code does not help. The code is also full of adhoc fixes, not just mine.

    Solution: None.

  52. Problem: Figure environments with two captions are made into a single image.

    Reason: That is how it is.

    Solution: Warn the user to split it into two figure environments.

  53. Problem: Text in figure environments ends up as part of the figure.

    Reason: Yes.

    Solution: Warn the user to put it in a caption, or live with it.

  54. Problem: Pnmflip does not work.

    Reason: It is a unix script running Perl running pamflip.

    Solution: Provide the earlier netpbm utility for Windows, include pamflip in Unix.

  55. Problem: Config.pl searches through directories in the wrong order.

    Reason: Seems to be subroutine that removes duplicate entries.

    Solution: Removed.

  56. Problem: Two files in versions/ had crashing perl.

    Reason: Unknown

    Solution: Commented out the lines, which should not be needed anyway.

  57. Problem: LATEX2HTML is not able to correctly process its own manual, using the versions required by the manual. Weird marks are put behind various equation.

    Reason: A sharp is missing in the end of equation marker in versions/math.pl, so these markers stay in. How was the manual on the web made??

    Solution: Added the sharp.

  58. Problem: The official online LATEX2HTML manual has figure 3 messed up (wrong image is displayed). The same for figure 1. This is unfortunate since these figures were supposed to make specific points. Its table of figures is in the wrong order. The Installation and Further Support section is out of date compared to the manual accompanying the distribution. For example, the Windows instructions are missing. (But the ones in the distribution are not right either.) The graphic could have been anti-aliased a bit. The pictures in the bibliography are external references and have, of course, long disappeared. So have most of the links in the exemplary documents section.

    Reason: Unknown.

    Solution: The LATEX2HTML-FU remake fixes some of the problems. Nothing can be done about links that have disappeared.

  59. Problem: The frame version overwrites the user's definition of the navigation buttons.

    Reason: Incorrect perl.

    Solution: Renamed the subroutine not to overwrite the user's.

  60. Problem: The frames do not disappear even when completely leaving the document.

    Reason: The Up link out of the document is loaded into a frame.

    Solution: Maintain the external link at TARGET="_top"

  61. Problem: Config fails under Windows XP.

    Reason: Windows XP returns a bit set instead of a bit-cleared status.

    Solution: Took out the status test.

  62. Problem: Defs with arguments to complex are not added to the preamble.

    Reason: Unknown.

    Solution: Added a note to the problem solving section to unset TEXDEFS.

  63. Problem: Error message that PPMQUANT cannot be found if the graphics or graphicx packages are loaded.

    Reason: graphics_support.perl wants it, but the true version no longer exists.

    Solution: It seems unlikely to be of much importance unless you include non eps graphics. I just added a note in the graphics problem solving section.

  64. Problem: MiKTeX 2.4 cannot find the input files.

    Reason: The authors of MiKTeX 2.4 lost the entire environment, including TEXINPUTS. They plan to fix it in 2.5, out some time in summer 2006.

    Solution: Install script l2hinm24 creates a local miktex.ini that points dvips to the files. Latexl2h.m24 (.bat) uses a command line option to do the same with latex.

  65. Problem: Newer TeX versions leave underlines below some formulae. I am grateful to Prof. Rogelio Alcántara for pointing this out and helping me get it fixed.

    Reason: Another alignment bar bug. Probably due to the newer dvips. Ghostscript produces a sidebar that is too long.

    Solution: Fixed that one too in l2hcrop.

  66. Problem: MiKTeX 2.5, beta 7 or earlier, cannot find the input files.

    Reason: While TeX was fixed, dvips was not. This was fixed in beta 8.

    Solution: Install script l2hinmkt appends to dvips.ini in the main config directory for the earlier versions of 2.5.

  67. Problem: Firefox 1.5 image alignment is incorrect.

    Reason: Firefox seems to have switched to w3c recommended alignment.

    Solution: Added this cropping too to l2hcrop. Made it the default instead of the Mozilla alignment.

  68. Problem: I found my implementation of NOEPS on Windows was excessive (only two files were truly different, and I created an entire new directory), and it was simply wrong on Unix.

    Reason: My stupidity and/or lack of careful examination of the differences.

    Solution: Both versions of the two files are now provided in a single LATEX2HTML directory, and l2h and makel2h swap in the appropriate versions.

  69. Problem: The NOEPS option does not work correctly with newer versions of TeX like MiKTeX.

    Reason: Unknown. I am guessing an internal difference between dvips 5.83 and 5.85. Pstoimg.bat cannot find the page dimensions in the new version. But they are there the same way.

    Solution: NOEPS is only used as a fix for problem figures. Noted that it does not work in new versions of TeX in the corresponding problem shooting subsubsection. The other, better, solution will have to be used. A solution of the pstoimg problem goes on the wishlist.

  70. Problem: LATEX2HTML arbitrarily removes all attributes from empty table cells.

    Reason: Unknown.

    Solution: Curse. Put in a few  s.

  71. Problem: LATEX2HTML loses $TITLE on its way to the navigation panels.

    Reason: Unknown.

    Solution: Curse. Copy it over into $RUNNING_TITLE.

  72. Problem: Jpegs are no longer created.

    Reason: A test that ppmtojpeg was an executable file. Sometime after Shankar’s thesis, I took out the path from the executables.

    Solution: Drop this test. When installed according to instructions, ppmtojpeg is there. Otherwise, do not use L2H_JPGQ.

  73. Problem: Thumbnails are not anti-aliased.

    Reason: I guess it did not seem important to me at the time.

    Solution: Added.

  74. Problem: Jpegs of thumbnails are not correctly processed.

    Reason: I did not think that thumbnail entries in images.pl would be different.

    Solution: Fixed.

  75. Problem: Floating point numbers are not correctly read by the wiz.

    Reason: I am teaching math??

    Solution: Fixed.

  76. Problem: Eqnarrays alignment is lousy in html 3.2, marginal in html 4.0.

    Reason: This is an html table limitation. Html 4.0 used a dirty trick to improve things a bit.

    Solution: Put in a better dirty trick.

  77. Problem: Left or right align in the htmlimage command does not do what you would normally want it to do.

    Reason: The obvious reason is that it is applied to the image itself, not to the table containing it. Whether there is a deeper reason for this??

    Solution: Copied it to the containing table, if align=right or align=left is specified in htmlimage in lower case, with no quotes. If that is interfering with something I do not know about, just change case.

  78. Problem: Return of the dreaded underlines!!

    Reason: The alignment bar thickness for larger magnifications increases beyond the limits used in l2hcrop.

    Solution: Made the bar thicknesses fontsize dependent.

  79. Problem: LATEX2HTML will not remake figures or equations that change by whitespace, braces, or backslashes, and will put the wrong figures where the latex source code of two figures is the same for the first 80 or so characters.

    Reason: By design, LATEX2HTML only looks at the first 80 characters of the latex source code of a figure or equation to see whether it is different from another. In addition, while doing so it will completely ignore all whitespace, braces, backslashes and more. (Look at the keys in an images.pl file to see what I mean.)

    Solution: As of Sep. 2007, the keys now include a 32 bit CRC check sum of the entire latex source code of the figure or equation.

  80. Problem: Excessive whitespace behind eqnarray* environments.

    Reason: For reasons unknown to mankind, these environments were terminated by three line breaks and additionally three blank paragraphs!

    Solution: Eliminated two breaks and two empty paragraphs.

  81. Problem: Natbib's \citeindextrue does not make any links to in-text citations, just to items in the bibliography.

    Reason: In natbib.perl, someone has disabled links to in text citations, "if desired", unconditionally. Apparently, disabling them is always desirable in the view of this person.

    Solution: Killed off the line that killed of the links.

  82. Problem: Natbib's \citeindextrue does not work with numerical references.

    Reason: In natbib.perl, someone turned it off for numerical references.

    Solution: Killed off the code that turned it off. If \citeindextrue works for LaTeX, it should also work for LATEX2HTML. (However, the references in the index will show authors and year, rather than authors and citation number.)

  83. Problem: Figures and math images have inconsistent sizes, or overful boxes occur.

    Reason: LATEX2HTML makes just a guess at \textwidth and \textheight. So they are inconsistent with the document.

    Solution: Latex2html now takes these values, in pt, from $TEXTWIDTH and $TEXTHEIGHT if set in .latex2html-init.

  84. Problem: Odd-byte CJK strings of plain latex or pdflatex sources got junk appended at the end, like say \end{CJK}.

    Reason: CJK.perl assumed the input encoding is in pairs of bytes, which is untrue for UTF-8.

    Solution: Skipped the relevant pre-pre-processing if $CJK_AUTO_CHARSET is set to UTF-8. LATEX2HTML seems to handle it fine by itself.

  85. Problem: LATEX2HTML stops working with Perl error messages.

    Reason: Like linux developers, Perl developers hate backward compatibility. Their motto, too, is if it works, fix it.

    Solution: Removed defined commands, added backslashes, changed substitution command modifiers, etcetera.

  86. Problem: Weird strings show up in figures and mathematics processed by Perl version 5.22.

    Reason: Like linux developers, Perl developers hate backward compatibility. Their motto, too, is if it works, fix it.

    Solution: Found a regexp using a \G anchor in latex2html that removes comments but no longer worked correctly under Perl 5.22 (without error messages being generated). Rewrote the regexp to be far less convoluted, making it work again.