[l2h] path problem with \includegraphics

Ross MOORE Ross MOORE <ross@ics.mq.edu.au>
Thu, 24 Jun 1999 17:18:03 +1000 (EST)


[Charset iso-8859-2 unsupported, filtering to ASCII...]
> Hello to all!
> 
> I have a path problem with \includegraphics using latex2html or latex,
> respectively.
> 
> The situation: In the directory
> "AAA/Protocol" there is the master tex-file "protocol.tex" which inputs
> some other tex-file, say "structure.tex".
> In "structure.tex" I placed the command
> \includegraphics[width = 10cm, bb = 0 0 640 480]{../Pictures/test.gif}
> 
> This works for latex but for latex2html I have to use
> \includegraphics[width = 10cm, bb = 0 0 640
> 480]{../../Pictures/test.gif}
> and then latex complains. To be more specific "convert" complains about
> not finding the file "test.gif".

Yes. The problem occurs because LaTeX2HTML processes in a sub-directory
of the source directory, so the revative path needs an extra '..' .

The soltion is to *not* use relative paths at all,
within the \includegraphics command.

Instead, use the  \graphicspath  command, to declare where LaTeX
should look for images to be included.

e.g.  \graphicspath{.:epsfiles:../Pictures} 

Now LaTeX2HTML will convert this to:

    \graphicspath{..:../epsfiles:../../Pictures}

when it runs LaTeX from the subdirectory.


An alternative "quick & dirty" solution is to create a symbolic link
to the directory from an appropriate place; e.g.
	ln -s ../Pictures ./Pictures

Now "convert" should again get the right file, using the OS,
rather than being given the extended path.

 
> What to do ? I am using a Linux-Box with the latest stable release of
> Debian and the latex-stuff from it. Of course, using full path names
> works. But I would like to use relative paths, since the paths are
> rather long and, this is more relevant, I work on different computers,
> with different paths to my home directory.

The \graphicspath  solution is probably best;
since you only need one instance for all the graphics in the document,
rather than messing with each instance individually.

Furthermore, if you move the images, or the LaTeX source,
then there is just one place where edits are required.

 
> Please don't blame me, if the question was asked already. But I couldn't
> find it in the archive of the mailing list.Thanks for the help!
 
It crops up again every 6 months, or so.


Hope this helps,

	Ross Moore