[l2h] Argument to \htmlimage{} ignored?

Ross Moore ross at ics.mq.edu.au
Sun Apr 30 03:20:26 CEST 2006


Hello Philipp,

On 30/04/2006, at 7:47 AM, Philipp K. Janert, Ph.D. wrote:

>
> The documentation to the \htmlimage{} command
> states that several options can be used with it.
>
> However, when I look into the source file (html.perl)
> that defines this command, any options are explicitly
> ignored.

No. You have misunderstood how \htmlimage is used.
It is only ignored when something else has not already
handled it's arguments, as intended.


To understand the difficulties that you are having,
would require that you post an example of how you are
attempting to use this "declaration".

It isn't really a "command", as it does not create any
output by itself. Rather, it can change the kind of output
that LaTeX2HTML produces, in some situations.


The \htmlimage affects mainly floating environments,
such as  {figure}  and  {table} and displayed equations.
In the latter case, it can force an image of the display,
where otherwise you might get a table containing smaller
pieces (perhaps images) of parts of mathematical expressions.

It may also be used to affect the values of attributes for
the IMG tags that would result in the above situations.
For example, it can be used to give meaningful ALT tags
to your images.
This applies also to environments that are otherwise
undefined (to LaTeX2HTML); e.g. those coming from
a LaTeX package that has no corresponding .perl coding.


If you want to make an image from other material, such
as paragraphs or {tabular} environments, then use the
  {makeimage}  environment, and use \htmlimage inside it
to specify the tags and any special effects.


The actual Perl coding that handles this is the
subroutine block, from the main  latex2html.perl  script:

   sub extract_parameters {
    ...
      #remove the \htmlimage commands and arguments before...
      $contents =~ s/$htmlimage_rx/$_ = $2;''/ego;
      $contents =~ s/$htmlimage_pr_rx/$_ .= $2;''/ego;
    ...
  }

This captures the \htmlimage  command contained in LaTeX
source that is intended to be used in making an image.
Later within this subroutine, the contents of  $_
are scanned to pick out appropriate key-words and the
values associated with them:


     s/extrascale=([\.\d]*)/$exscale=$1;''/ie;
     s/\bscale=([\.\d]*)/$scale=$1;''/ie;
     s/(^|,\s*)external/$external=1;''/ie;
     s/(^|,\s*)((no)?_?anti)alias(_?(text))?/$aalias = $2.$4;''/ie;
     s/(^|,\s*)((no)?_?trans)parent/$trans = $2;''/ie;
     s/thumbnail=([\.\d]*)/$thumbnail=$1;''/ie;
     s/usemap=([^\s,]+)/$usemap=$1;''/ie;
     s/map=([^\s,]+)/;$map=$1;''/ie;
     s/align=([^\s,]+)/$align=$1;''/ie;
     s/flip=([^\s,]+)/$flip=$1;''/ie;
     s/color_?(depth)?=([^\s,]+)/$cdepth=$2;''/ie;



>
> My version of latex2html (as given by latex2html -V) is:
> This is LaTeX2HTML Version 2002-2-1 (1.70)
>
> And the identifier in the respective html.perl file is:
> # $Id: html.perl,v 1.38 1999/11/05 11:44:47 RRM Exp $
>
> Is there a newer version floating around? (Possibly
> in alpha/beta?)


I doubt that anyone has made any changes to this aspect
of the coding any time recently.



BTW,  the subroutine in  html.perl  starting:

    sub  do_cmd_htmlimage { ....

is just a catch-all in case the  \htmlimage  command
somehow does not get caught by the processing of
environments.  If it ends up in normal paragraphing,
then it is ignored, apart from placing a warning message
into the screen-output.



>
> Best,

Hope this helps,

	Ross Moore


>
> 		Ph.

------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114
------------------------------------------------------------------------




More information about the latex2html mailing list