how to send output of htlatex to different folder without fixing all image links afterwords
The setup is simple. I have report.tex which includes an image from a folder. I send the output of htlatex to 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"
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.
I searched and 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 TL 2012 debian package.
The setup is simple. I have report.tex which includes an image from a folder. I send the output of htlatex to 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"
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.
I searched and 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 TL 2012 debian package.
No comments:
Post a Comment