[l2h] referencing embedded images
Mark Jeynes
mark@jeyno.freeserve.co.uk
Thu, 21 Mar 2002 09:01:04 -0000
Ross,
This is so helpful - you are very kind - thanks very much indeed.
Mark
-----Original Message-----
From: latex2html-admin@tug.org [mailto:latex2html-admin@tug.org]On Behalf Of
Ross Moore
Sent: 20 March 2002 22:49
To: Mark Jeynes
Cc: latex2html@tug.org
Subject: Re: [l2h] referencing embedded images
>
> I'm looking for help with latex2html.
>
> I have a .tex file that uses an \includegraphics{image.png} command.
>
> When I run the file through latex2html, the generated html pages refer to
> the image file by its fully qualified filename and path - great when I
> browse it on my local machine, not so great when I move the pages and
image
> directory to an http server.
>
> What I'd like to see is pages where the references are stated as a
relative
> address...
>
> Is there some way I can make this happen?
Definitely.
Since the image is already im .png format, there is no need for
LaTeX2HTML to do any processing of it; it simply needs to refer
to it in an appropriate way for your site.
That is the purpose of the \htmladdimg command, which
is defined in the html package (both LaTeX and Perl).
If you only want the image for web-pages, then using
just \htmladdimg will be sufficient.
But if you also want it in high-quality printed (or PDF)
versions of your document, then use conditional coding,
such as:
\usepackage{html} % in the document's preamble
\begin{latexonly}
\includegraphics{image.png}
\end{latexonly}
\htmladdimg[ ...options... ]{../images/image.png}
where
../images/ is the relative path to where you are storing
the image; that is, relative to the location of the HTML pages.
You could use an absolute reference, or put the images into
the same directory as the HTML pages. That's up to you, and
you have the flexibility to match whatever you choose to do.
The ..options... are described in the LaTeX2HTML manual.
These allow things like: WIDTH=... HEIGHT=... so that the
reader's browser knows how much room to allocate for the image
before it has been downloaded. Also, you can give ALIGN=...
to "float" the image to the left or right of the accompanying
text. Other effects are possible too.
ALT=..... text for the tool-tips pop-ups can be given.
Note that these can be additional effects not applicable to the
appearance of the image in the LaTeX document.
Hence they cannot be deduced from the \includegraphics command
--- at least not with certainty, since you may need different physical
size to account for the different resolutions on-screen and on-paper.
Note also that \htmladdimg is simply ignored (i.e. its arguments
are gobbled) when the document is processed by LaTeX,
so that you do *not* get 2 copies of the image, in that case.
>
> Many thanks
>
Hope this helps,
Ross Moore
> _______________________________________________
> latex2html mailing list
> latex2html@tug.org
> http://tug.org/mailman/listinfo/latex2html
_______________________________________________
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html