[l2h] I believe this must be a latex2html 99.2(or 3) bug

Ross Moore ross@ics.mq.edu.au
Wed, 28 Feb 2001 08:32:59 +1100 (EST)


 
You wrote:
> I have a TeX document that latex2html cannot process, apparently because
> it has this bit in the preamble:
> 
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
>  \newenvironment{HangIndent}
>   {\list{}{%
>     \setlength\leftmargin{1.5cm}%  leftmargin
>     \itemindent-\leftmargin}\item{}}
>   {\endlist}
>  \newcommand\myHangIndent[1]{
>      \begin{HangIndent} #1
>      \end{HangIndent}
>      }
> 
> If that bit is in the preamble, then the processing of math breaks, and
> equations get written to image files with format "hatb" instead of a hat
> over a b.

Hmm; sounds like a space got gobbled somewhere, for the \hat b.
It's always safer to write  \hat{b} .
Indeed LaTeX documentation tends to avoid saying the \hat b works,
due to the underlying TeX engine,
and encourages the full {...} notation for arguments to macros.

Note that LaTeX2HTML is *not* based on a TeX engine,
so it is dangerous to assume that
  "because it works in TeX it should also work in LaTeX2HTML" 
(though mostly it does!).


> If I delete the HangIndent from the Tex preamble and remove its one
> usage, then latex2html is able to process the file without trouble.

There is no need to delete the HangIndent declarations, since you want
these for when LaTeX processes the file.
However you could limit their applicability to LaTeX only, as follows:

%begin{latexonly}
\newenvironment{HangIndent}
 {\list{}{%
   \setlength\leftmargin{1.5cm}%  leftmargin
   \itemindent-\leftmargin}\item{}}
 {\endlist}
\newcommand\myHangIndent[1]{
    \begin{HangIndent} #1
    \end{HangIndent}
    }
%end{latexonly}

\begin{htmlonly}
 \newenvironment{HangIndent}{}{}
 \newcommand{\myHangIndent}{}
%%% or \newcommand{\myHangIndent}[1]{#1}
\end{htmlonly}

Make sure that you also  \usepackage{html}
so that the  {htmlonly}  environment is defined.


Of course with HangIndent defined this way for LaTeX2HTML,
it does nothing. Once you've worked out just what you would
like it to do in HTML (which is much more limited that dvi
as a page-layout language) then you can build up an alternative
non-trivial expansion.

 
> I get this same result with latex2html 99.2 or 99.3, but one other user
> in the lyx user group showed me his version 96 worked fine on Solaris.
 
> If you can tell me what I did wrong, I'd appreciate it.

LaTeX2HTML is designed to interpret clean LaTeX-style markup,
into good uncluttered HTML.
It is not designed to do everything that a TeX engine can do,
and cannot be expected to produce effects that have no easy HTML
counterpart.


I will look more closely at your example to see why it produced the
kind of bad results that you described. There may well be a small 
change that can be made which avoids subtle problems without creating
any new ones.


Hope this helps,

	Ross Moore


> -- 
> Paul E. Johnson                       email: pauljohn@ukans.edu
> Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
> University of Kansas                  Office: (785) 864-9086
> Lawrence, Kansas 66045                FAX: (785) 864-5700
> _______________________________________________
> latex2html mailing list
> latex2html@tug.org
> http://tug.org/mailman/listinfo/latex2html