I have a complex document which I'm trying to convert to html
with tex4ht
and TeXLive under Ubuntu, but I'm not able to coherently control the image size of jpg
and eps
images. In html
output, jpg
images get direct reference to original image and seems to display at 1 to 1 pixel, while eps
images are converted into a png
image whose size is specified in html
but seems to display too small. In both (or at least some) cases the original \includegraphics[width=mymeasure]{myimage.jpg-eps}
specification isn't respected. I've tried a lot of tricks, configurations and snippets (like this and this) without success.
Is it possible to transfer the size specified for images in LaTeX source to html
output?
Here is my MWE:
\documentclass{book}
\usepackage{graphicx}
\begin{document}
Lorem ipsum dolor sit amet, consectetur adipisici elit:
\begin{centering}
\includegraphics[width=0.5\textwidth]{myimage.jpg}
\includegraphics[width=1.0\textwidth]{myimage.jpg}
\includegraphics[width=0.5\textwidth]{myimage.eps}
\includegraphics[width=1.0\textwidth]{myimage.eps}
\end{centering}
\end{document}
which I compile with htlatex myfile
.
And here is the html
output.
As you can see, the big (as well as the small) jpg
and eps
images should have the same (100%) width, whereas they don't (in html
, but they do in the pdf
).
Also, the two jpg
images should have one the half width of the other, whereas they don't (in html
, but they do in the pdf
).
Best Answer
Edit: This answer is quite old. Look here for a more recent information.
This works correctly for me with TeX Live 2012 on Linux.
Resulting html:
Note that
width=.7\textwidth
and\the\dimexpr .7\textwidth\relax
are producing the same value:241.49895pt
.Regarding
jpg
images, dimension information isn't saved for some reason. But we can use custom config file:This will increase seze of the included image by factor os
1.5
. Save it asmyconf.cfg
and compile the source file with