[l2h] Image conversion

Mark Henning mh at homolog.de
Fri Oct 28 09:18:51 CEST 2005

On Thu, 27 Oct 2005 17:07:21 -0700, you wrote:
>I think I had and solved this one before ... but I'm no Perl expert ... 
>but, after "upgrading" my linux installation I'm getting a bunch of errors.
>When converting images I get:
>pstoimg: Error: "/usr/bin/ppmquant -floyd 256 < 
>/var/tmp/l2h31773/p31811.pnm | /usr/bin/pnmtopng -interlace -trans 
>'gray85'  > img1.png" failed: Bad file descriptor
>Error while converting image
>over and over ...

I had similar problems (under Win2k) in the past and mailed a solution
for them some weeks ago. Maybe it is helpfull for you (Note, this is
not just a copy&paste from my older mail):

While looking for a solution of my image creation problem with l2h I
found some threads here on the list, where people reported a very
similar problem. But I didn't find a solution of the problem. So I
made some experiments, and the following worked well for me:

A) Description of the problem:
Creation of images (for figures and math) failes. Typical error
messages are:

pstoimg: Warning: Cannot use c:/tmp/l2h2810 as temporary directory.  
pstoimg: Temporary directory is c:/tmp
pstoimg: Error: Cannot find file "c:/tmp/l2h2810/_image001.ps": No
such file or directory

Sometimes, the error "Bad file descriptor" is given by pstoimg.

B) Solution (under Win2k, MikTeX):
I assume, your .tex-file is named "mydoc.tex". This file and the
graphic files are in a folder called "mytexdoc". To solve the above
mentioned problem for mathmode-based figures, this folder has to
resist on the same drive than ghostscript and netpbm. Your temporary
directory has to be on the same drive as well. For windows, this
usually means: You have to copy all of your files into

But still, graphics included by means of \includegraphics may be
missing. First ensure, that the filenames in your .tex-file always
contain the filename extension. This means: Write
instead of

Secondly: As the resulting files are written to a subfolder (here it
is "\mydoc") and the image-creating .tex-file also resides there, the
figures are not found. Ensure to copy your graphic files to the
subfolder "\mydoc".

C) Some further remarks
For me, it was necessary to apply the following modifications before
installing l2h:

- As above, l2h has to be configured and installed with all files
being located at drive c:\ (means: the same drive as ghostscript and
netpbm). Otherwise, an error like "gsview32c cannot be found" arises.
In my case, for configuration, all files were at
The installation destination folder was set to

- When running the test example (before installation), the figures for
the equations are not created. This is solved by setting the
environment variable RGBDEF properly before running test.bat:
	set RGBDEF=C:\l2h\styles\rgb.txt

- After installation, I added the following line to
right at the beginning of the script:
	set RGBDEF=c:\Programme\TeX\LaTeX2HTML\styles\rgb.txt

Bis dann,

- Mark

"Echt komisch kaum macht man es richtig, geht es."

(Yüksel Tiryaki am 10.10.2005 in de.soc.recht.misc)

More information about the latex2html mailing list