[l2h] LyX to WWW toolchain suggestions?

Bruce Miller bruce.miller at nist.gov
Tue Aug 30 13:43:00 CEST 2005


Paul L Daniels wrote:
> Hello all, first time here. 
> 
> I'm currently using LyX to write a medium size build manual for model aircraft, this includes numerous JPEG images
> which are currently included using \includegraphics{}.
> 
> Everything works 'delightfully' when I go from LyX->PDF, so this email isn't about that.
> 
> Where my problems come is when I go LyX -> LaTeX and then pipe that through to L2H.   The images are progressive PNG's
> with a limited colour selection, clearly PNG isn't suited for my situation where I'm using JPEG images.

PNG's don't have a particularly limited color selection, as far as i know;
they're capable of producing just as good (or better) images as jpeg,
but probably not quite as compressed (jpeg uses lossy compression).
Anyway, jpeg is also a reasonable image format for web (as well as pdf), why not use it?

You say you are using JPEG images, but the html below suggests you're using eps
(presumably wrapped/converted from the source jpeg ?).  This is most likely the
source of the problem: latex2html doesn't know there's a jpeg embedded, so it has
to "print" the picture, and extract a bitmapped copy of it (like it does for math),
but in this case, the resolution will mismatch and give bad results.

I don't use LyX, so I don't know if it gets in the way of the following approach:
If you have an original image in jpeg format, say picture1.jpeg.  Then, use
whatever program you like (gimp, ImageMagick,...) to produce a postscript version
and call it picture1.eps.  Now in the latex source use
  \includegraphics[whatever]{picture1}
_without_ the extension.  The includegraphics package is clever and will find the
most appropriate format for the current processsing: LaTeX will use the eps,
pdflatex and latex2html would use the jpeg.  Then you should get pretty good
results in all cases.

> What I thought I might be able to do is to get l2h to reference the image files as a link, since I can upload all the
> required images with the html files ... I tried the following
> 
> latex2html -html_version 4.0 -split 2 -local_icons -show_section_numbers  -external_images -ps_images qf2bm-001.tex
> 
> This generates output like ...
> 
> <IMG
>  WIDTH="170" HEIGHT="128" ALIGN="BOTTOM" BORDER="0"
>  SRC="img130.png"
>  ALT="\includegraphics[%
> width=100dd]{manual-photos/07pic00044.jpg.eps}">
> 
> Where's I'd rather something like   
> 
> 	SRC="manual-photos/07pic00044.jpg.eps">
> 
> from which I could just clean up with sed or other such.
> 
> Other than the images, L2H is fantastic, great work.
> 
> 


-- 
bruce.miller at nist.gov
http://math.nist.gov/~BMiller/



More information about the latex2html mailing list