[l2h] images in a separate directory

Ross Moore ross at ics.mq.edu.au
Mon Feb 10 16:44:29 CET 2003


> hello Ross,
> 
> specifying the graphics path too does not work. the pdflatex reports an
> error saying the file is missing and latex2html compiles, but the images
> are still in the same root html directory. 
> 
> i have also tried the following:
> 
> \newcommand{\screenshot}[2]{
>     \begin{figure}[H]
>     \htmladdimg{#1}
>     \begin{latexonly}
>     \begin{center}
>     \includegraphics{#1}
>     \end{center}
>     \end{latexonly}
>     \caption{#2}
>     \end{figure}
>     }
> 
> \screenshot{images/custom_script.jpg}{Custom Script Interface}
> 
> 
> i thought this should work flawlessly, but alas, that too has problems in
> the latex2html, while pdflatex seems to work fine. 

For this approach, it is better to use a conditional definition:

\begin{htmlonly}
 \newcommand{\screenshot}[2]{%
  \begin{figure}[H]
  \htmladdimg{../#1}%%% <---  get the path right here !
  \caption{#2}%
  \end{figure}%
 }
\end{htmlonly}

%begin{latexonly}
 \newcommand{\screenshot}[2]{%
  \begin{center}%
  \includegraphics{#1}%
  \end{center}%
 }
%end{latexonly}

so that LaTeX2HTML (and pdfTeX, for that matter) doesn't
have to carry around twice the baggage whenever \screenshot
is used.


> i am foxed and wonder what the problem is. any siggestions?

I'm surprised that using \graphicspath was not enough.
You could try setting paths directly, using  $GRAPHICS_PATH  .


Hope this helps,

	Ross Moore
 
> prabhakar
> 
> 
> 
> On Sat, 8 Feb 2003, Ross Moore wrote:
> 
> > > hi,
> > > 
> > > all except the inline-math images are already there in the
> > > the directories images/ and icons/. 
> > > 
> > > i want the the image src in html to point to these directories, but they
> > > are instead copying the images into the root html directory. so i have two
> > > copies of the images and the html directory had all the clutter of .jpg
> > > and .png. ofcourse the inline images are generated and planted in the same
> > > directory. that is fine. 
> > > 
> > > infact the previous version had the images linked and i installed the new
> > > version bevcause the lot and lof files were not linking to appropriate
> > > images. now the link works but the images are duplicated. there has been
> > > discussion on these issues on the list before. and no solution seems to
> > > work for me!
> > 
> > Have you tried using the  \graphicspath  command ?
> > 
> > For example, put this into the document preamble:
> >   \graphicspath{{icons}{images}}   
> >  
> > > below are the commnands that matter:
> > > 
> > > \newcommand{\screenshot}[2]{
> > >     \begin{center}
> > >     \begin{figure}[H]
> > >     \includegraphics{#1}
> > >     \caption{#2}
> > >     \end{figure}
> > >     \end{center}
> > >     }
> > > 
> > > \screenshot{images/custom_script.jpg}{Custom Script Interface}
> > 
> >  ... and don't use the directory (or suffix) in the body of the document:
> > e.g.
> >  \screenshot{custom_script}{Custom Script Interface}
> > 
> > Now both LaTeX and LaTeX2HTML should be able to find whatever image
> > exists already, with an appropriate suffix.
> > 
> > 
> > The module that should be being used is called:  graphics_support.perl
> > There is a fair bit of commentary on what can be done.
> > 
> > 
> > Hope this helps,
> > 
> > 	Ross Moore
> > 
> > > 
> > > thanks
> > > 
> > > prabhakar
> > > 
> > > 
> > > 
> > 
> 



More information about the latex2html mailing list