[l2h] Relative URLs in png/gif images

Ross Moore ross at ics.mq.edu.au
Thu Jun 5 12:42:49 CEST 2003



On Wed, 4 Jun 2003, Herb W. Swan wrote:

>
> Thanks, Ross, for your prompt reply.  I tried your suggestion, but
> it fell a bit short of expectations:
>
  ....
>
> What happened was that l2h still tried to "convert" the image with
> pstoimg.  Of course it failed, since the image was empty as far as
> LaTeX was concerned.

OK, yes; it tried to make an image of the {figure} environment.

To prevent this, simply insert an empty {makeimage} environment
inside the figure; hence within your macro definition, as shown below.
This is the way to tell LaTeX2HTML to make an image just of the specified
portion of the {figure}, and interpret anything else.
Of course an image is made *only* if the specified portion is not just
whitespace.

> \begin{htmlonly}
> \newcommand{\showpng}[4][]{%
>     \begin{figure}[htb]
> 	\begin{center}
      \begin{makeimage}
      \end{makeimage}
> 	    \htmladdimg[center]{#4#2}
> 	    \caption{\label{#2}#3}
> 	    \end{center}
> 	\end{figure}
>     }
> \end{htmlonly}
>
> \begin{document}
> I'm going to include a png image right here:
> \showpng{l2h}{The figure caption}{../}
> \end{document}
>
> % --------------------------------------------------------
>

Hope this helps,

	Ross


>
> beagle% l2h test37
> Note: Loading ./.latex2html-init
> Note: Initialising with file: .latex2html-init
> This is LaTeX2HTML Version 2002 (1.67)
> by Nikos Drakos, Computer Based Learning Unit, University of Leeds.
>
> Revised and extended by:
>  Marcus Hennecke, Ross Moore, Herb Swan and others
> ...producing markup for HTML version 3.2
>
>
>
> Loading /h/lanhws/l2h/versions/html3_2.pl
>
>  *** processing declarations ***
>
> Loading /h/lanhws/l2h/versions/latin1.pl
> OPENING /h/lanhws/plano/text/www/test/test37.tex
>
> Note: Working directory is /h/lanhws/plano/text/www/test/test37
> Note: Images will be generated in /tmp/l2h9626
>
> texexpand V2002 (Revision 1.11)
>
>
>
> Loading /h/lanhws/l2h/styles/texdefs.perl...
> Loading /h/lanhws/l2h/styles/article.perl
> Loading /h/lanhws/l2h/styles/graphicx.perl
> Loading /h/lanhws/l2h/styles/html.perl
> Reading ...
> %%%%%%%%%,++.
> @@@@@
>
> Reading aux file: /h/lanhws/plano/text/www/test/test37.aux ...
> Processing macros ...++......
> Translating ...
> 0/1:top of test37: for test37.html
>
>  *** translating preamble ***
> .......
>  *** preamble done ***
> ;,.;
>
> 1/1:sectionstar:.."About this document ..." for node1.html
> ;;.
>
> Writing image file ...
>
> This is TeX, Version 3.1415 (C version 6.1)
> (images.tex
> LaTeX2e <1997/12/01> patch level 2
>
>
>  *** processing 1 images ***
>
> Generating postscript images using dvips ...
> This is dvips 5.72 Copyright 1997 Radical Eye Software (www.radicaleye.com)
> ' TeX output 2003.06.04:1704' -> /tmp/l2h9626/image
> (-> /tmp/l2h9626/image001) <texc.pro><special.pro><color.pro>[1]
> Converting image #1
> pstoimg: Error: "/h/lanhws/bin/sun5/pnmcrop < /tmp/l2h9626/p9644.pnm | /h/lanhws/bin/sun5/ppmquant -floyd 256 |
> /h/lanhws/bin/sun5/pnmtopng -interlace  > img1.png" failed: Illegal seek
>
> Error while converting image: No such file or directory
>
> Doing section links ......
>  *** Adding document-specific styles ***
> Done.
>
> --------------------------------------------------------
>
> Not only that, but it didn't even make a link to my image:
>
> I'm going to include a png image right here:
>
> <DIV ALIGN="CENTER"><A NAME="l2h"></A><A NAME="27"></A>
> <TABLE>
> <CAPTION ALIGN="BOTTOM"><STRONG>Figure 1:</STRONG>
> The figure caption</CAPTION>
> <TR><TD></TD></TR>
> </TABLE>
> </DIV>
> <BR><HR>
> <!--Table of Child-Links-->
>
> --------------------------------------------------------
>
> I recall having tried several combinations of \begin{htmlonly},
> \begin{latexonly}, etc. but the one which seemed to work best
> was my original post.  It's one big disadvantage is that it
> relies on a nonstandard LaTeX2HTML, and we both know that there
> are too many of those floating about already!
>
>
>
>
> --
>
>
>
>  /-----------------------+-----------------------------------\
>  | Herbert Swan          | Geoscience Operations             |
>  | Phillips Alaska, Inc. |                                   |
>  | 700 G Street          | Phone:  (907) 263-4043            |
>  | Anchorage, AK  99501  | Fax:    (907) 265-1608            |
>  | Room:  ATO 1370       | e-mail: lanhws at expl.ak.ppco.com   |
>  \-----------------------+-----------------------------------/
>
>
>


More information about the latex2html mailing list