[l2h] pixelimages and latex2html

Ross Moore Ross Moore <ross@ics.mq.edu.au>
Fri, 24 Nov 2000 09:19:15 +1100 (EST)


> I want to include some screenshots in a LaTeX document and a HTML
> document generated from this. If I use *.png files for the screeshots,
> I can use the directly with pdfLaTeX for inclusion. If I write
> 
>   \includegraphics[width=\linewidth]{screenshot}
> 
> pdfLaTeX will take "screenshot.png", LaTeX will use
> "screenshot.eps". Now I would like to tell latex2html to use
> "screenshot.png" instead of rendering "screenshot.eps" and using the
> result. Is there a way to get this?

Yes.
Since you already have screenshot.png available as an image file,
there is no need to have LaTeX2HTML recreate an image for your
HTML pages; simply use the one that you have already.

The best way to acive this is to use a macro in your document source,
but have that macro expand differently, depending on the TeX engine
processing the document.

e.g.
your source should read something like:

A view of the screen is given below, in figure~\ref{screenA}.
In this one sees .....
.....

\begin{figure}
\screenshotA
\caption{A view of .....}
\label{screenA}
\end{figure}


In the preamble to your document, or in a separate input file,
use code like:

%begin{latexonly}
 \newcommand{\screenshotA}{\includegraphics{screenshot}}
%end{latexonly}
\begin{htmlonly}
 \newcommand{\screenshot}{%
  \htmladdimg[align=top,width=....,height=....,alt="...."]
  {../images/screenshot.png}}
\end{htmlonly}

Notice how the \htmladdimg command (from  \usepackage{html} ) allows  you
to specify all the meta-information about how to image is to be handled
in the HTML file, including alignment, WIDTH/HEIGHT and ALT-text attributes.
 

> Thanks

Hope this helps,

	Ross Moore


> 
> Berthold
> -- 
>        email: hoel@GermanLloyd.org
>    )   tel. : +49 (40) 3 61 49 - 73 74
>   (
> C[_]  These opinions might be mine, but never those of my employer.