[l2h] Relative/Absolute paths of images and failure when the images are accessed by the variable $TEXINPUTS

Nasser M. Abbasi nma at 12000.org
Wed Jan 20 21:54:17 CET 2010



> Hi All,
>
> I have managed to generate html files using the png files as input, but 
> only when the png files were located in the same directory as the tex 
> files.

The way I include my png files is as follows

\usepackage{graphicx}
\begin{document}
\includegraphics[]{file.png}

So, if the file.png is NOT in the same folder as the tex file, you could 
change the above to

\includegraphics[]{full_path_name_of_file.png}

You should be able to use either relative file path or absolute file path in 
the above.


>I want to access my png files by adding the respective directories via the 
>$TEXINPUTS variable.

I do not think $TEXINPUTS is meant to be used to locate where the images 
are. I think it is used by the latex engine to help it find where the latex 
packages are if they can't be found in the standard locations.

$TEXINPUTS might also used to locate latex input files which are included 
using \input{file} in the main latex document. But I am not sure about that.

The point is, I do not think it is used to tell \includegraphics[] where the 
images are.

>
> The other question I had is to do with the paths to the images. When the 
> png files are parallel to tex files then the translator works fine with 
> the exception that the paths to the images which are included are 
> absolute, e.g in the generated html the pictures are referenced as 
> follows:
> node2.html: 
> SRC="/scratch/simdoc_build/pdflatex_8904/develop/extern/install/all_in_one//install_lic_install_configure_ini_tab.png"
>
> Is it possible somehow to tell the translator that the paths should be 
> relative?

Relative should work. may be try this:

\usepackage{graphicx}
\begin{document}
\includegraphics[]{..\..\file.png}

>
> The best solution for me would be if the translator copied the png files 
> directly into the directory where the html is generated and they were 
> given the names img1.png, img2.png etc.

This is what it does in my case. it copies all the images to one folder 
where the final .html is. This is the command I use:

latex2html  -no_reuse -subdir -local_icons  foo.tex


--Nasser



More information about the latex2html mailing list