The setup is simple. I have a file report.tex which includes an image from a folder. I send the output of htlatex to a separate directory. htlatex copies all images and HTML to that directory. The problem though, now all the links in the HTML are broken, since the links are generated relative to original location of report.tex and not to where the HTML now lives.
In pictures, I have this
report.tex ...\includegraphics{e1/image.png}
|
+--------------------------+
| |
/e1/image.png /report/
report.htm ....<img src="e1/image.png"
image.png
One can see the problem. The HTML is using src=
thinking it was in the original location of the .tex file. So, I end up editing the HTML files fixing links by adding "../" to each image src link or by removing "e1/" since the image was copied!
I searched and was not able to find an option to fix this. Does anyone know of a solution to this?
Here is minimal working example:
\documentclass{article}%
\usepackage{graphicx}
\begin{document}
\includegraphics{e1/image.png}
\end{document}
Here is the command used
mkdir report; htlatex report.tex "htm" "" -dreport
and now looking in the folder report/report.htm shows the problem. The image does not show up without manually fixing the links.
Doing this works:
htlatex report.tex "htm"
now the report.htm shows the image ok as expected. But I want all the output to go to separate folder.
I am using the TeXlive 2012 Debian package.