Graham wrote:
>In the following example I use a LaTeX picture environment to build a
>symbol, which is supposed to resemble the symbol on the Return key of
>a PC keyboard.
>
>    \documentclass{article}
>
>    \newcommand{\return}{\begin{picture}(30,5)
>    \put(25,2){\vector(-1,0){16}}
>    \put(25,2){\line(0,1){3}}
>    \end{picture}}
>
>    \begin{document}
>    ls -l \return
>    \end{document}
>
>In LaTeX the symbol appears where it should do (immediately after the
>ls -l) but in the HTML generated by l2h a <BR> is inserted before the image.


>Any idea what I can do to get rid of this behaviour?

Several.

 1.  The problem is that LaTeX2HTML sees the \begin{picture} environment
and doesn't know how to handle it, apart from making an image.
Since it is an environment,
it will assume that some logical separation from other material is required.
Usually this is white space, e.g. a line-break.

You want it to be inline:  try  $\return$ or $\hbox{\return}$.


 2.  Now that you have the image you want, as a .gif file,
     make a copy of this, and put it with your icons.
        call it  return.gif  (or something similar)
     or somewhere accessible externally (i.e. on the Web).
     Refer to it as an inline image:

\newcommand{\return}{\htmladdimg{http://..../icons/return.gif}}

     This allows you to use it in many different documents,
     without regenerating it afresh for each one.

Use conditional code to keep the document compatible in LaTeX:

\usepackage{html}

%begin{latexonly}
 \newcommand{\return}{\begin{picture}(30,5)
   \put(25,2){\vector(-1,0){16}}\put(25,2){\line(0,1){3}}
  \end{picture}}
%end{latexonly}
\begin{htmlonly}
 \newcommand{\return}{\htmladdimg{http://..../icons/return.gif}}
\end{htmlonly}


 3. a more technical solution involves a declaration via the Perl
    subroutine:  &process_commands_inline_in_tex
    Email me for more details, if you are interested in this solution.


>I'm using l2h 98.2beta4

Glad to hear it.


Hope this helps,

        Ross Moore


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ross Moore                             email: [EMAIL PROTECTED]
Mathematics Department                 phone:      +612 9850 8955
Macquarie University                     fax:      +612 9850 8114
Sydney, NSW 2109                      office:             E7A-419
Australia              WWW: http://www-math.mpce.mq.edu.au/~ross/

                ***************************

for the best in (La)TeX-nical typesetting and Web page production
join the  TeX Users Group (TUG) --- browse at  http://www.tug.org

                 <[EMAIL PROTECTED]>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to