[tex4ht] How to make tex4ht process .png files with scale option for \includegraphics?

Jaroslav Sobota jsobota at kky.zcu.cz
Fri Mar 22 08:50:53 CET 2013


As far as I understand, you have to generate bounding box file (.bb) for 
each PNG image. Use "ebb image.png" command on your command line prompt. 
Ebb.exe is part of ghostcript. Then you will get rid of the "Cannot 
determine size of graphic..." error.

The quality of resulting images is determined by parameters of convert 
command in the <convert> section of the tex4ht.env file, namely e.g. 
"-density 110x110"

With kind regards,
Jaroslav Sobota

Dne 22.3.2013 9:01, Nasser M. Abbasi napsal(a):
>
> Is there a way to make tex4ht use .png files and not having
> to covert all the images to .eps?
>
> I am trying to build large latex document with hundreds of
> lines like this:
>
> \documentclass{article}
> \usepackage{graphicx}
> \begin{document}
> ....
> \includegraphics[scale=0.7]{image_1.png}
> \includegraphics[scale=1]{image_2.png}
> ...
> \end{document}
>
> Before I was using Latex2html and now trying to build it with tex4ht.
>
> I know tex4html is latex based and not pdflatex, so images
> are supposed to be in eps only?
>
> I tried once to convert images from png to eps using the convert
> command on Linux and the final image quality became much worst.
>
> Is there a way to have tex4ht process these .png images as is?
>
> The message I get is
>
> "TeX4ht warning --- Cannot determine size of graphic in"
>
> Then when I look at the HTML page, all what I see are the words
>
> PIC
> PIC
> PIC
>
> etc...
>
> in place of where the image is supposed to be.
> The command I use is
>
> htlatex foo.tex "my.cfg,htm,pic-align"
>
> and my.cfg  is
>
> \Preamble{html}
> \begin{document}
> \Configure{$}{\PicMath}{\EndPicMath}{}
> \Configure{PicMath}{}{}{}{ class="math" align="absmiddle"}
> \Css {
>     BODY {font-family: Verdana, Helvetica, Arial,   sans-serif ;
> font-size:0.9em;}
> }
> \EndPreamble
>
> Using (TeX Live 2012/Debian)
>
> thanks
> --Nasser
>


More information about the tex4ht mailing list