On Sun, 14 Jun 1998, Greg Gamble wrote:
> Hi,
> 
> 1.The docs do warn against using \def (a TeX-ism). LaTeX2HTML is
>   a LaTeX translator (though it will translate most plain TeX
>   stuff).

Yes, I saw that in the docs.  But the warning was vague.  It would
have saved me a lot of time if it flat out stated that what I wanted
to do with defs was not supported.

>   So you should use
> 
>     \newcommand{\foo}[1]{foo#1}
> 
>   or
> 
>     \renewcommand{\foo}[1]{foo#1}
> 
>   I get problems with using \def when the command already
>   exists and is being redefined (using \renewcommand invariably
>   makes the problems go away). Also, LaTeX2HTML can't translate
>   complicated \def templates. You should be able to convert
>   most of your \def s to \newcommand s with a few global
>   substitute commands using an editor like vi or emacs.

Thanks for the tips.  The vast majority of \def's are in one place, a
macro package we developed to modify and extend LaTeX for our purposes
(most of it written in plain TeX).  I'm hoping that it won't be too
big of a task. 

> 2.Why are you using \documentstyle? ... haven't you updated to
>   LaTeX2e yet? If you can use \documentclass ... then you will
>   find that latex (if you have updated) will run without going
>   into LaTeX2.09 compatibility mode ... and I believe there are
>   significant differences with how LaTeX2HTML behaves.

We're not using LaTeX2e because we have redefined many of the LaTeX
internals to suit our purposes.  It is almost certain that upgrading
would break most, if not all of our patches.  Usage of LaTeX is on the
decline now, and part of the reason we're interested in latex2html is
so we can migrate away from it.  Therefore, we are not interested in
expending the considerable development effort that we anticipate would
be required to go to LaTeX2e.  (If it ain't broke, don't fix it.)

> 3.The right place for definitions/macros is in the *preamble*
>   of the LaTeX document, i.e. *after* \documentclass and 
>   \usepackage commands and *before* \begin{document}.
>   Why? ... consider what happens if the documentclass or
>   packages you use define some of the macros/definitions
>   you put before the \documentclass line. Also, 
>   LaTeX2HTML may expect macros to be in the preamble??
>   Ross will have to clarify that.

Of course, you are right here.  I hastily constructed this contrived
example and didn't notice I had put the definition outside of the
preamble.  In all of our documentation the definitions come between
the \documentstyle and the \begin{document}.

> In conclusion ... try something like:
> 
>   \documentclass{article}
>   % \usepackage{amsmath}    % Example of how to input a .sty file
>   \newcommand{\foo}[1]{foo#1}
>   \begin{document}
>   \foo{bar}
>   \end{document}

If LaTeX2html will indeed run better on LaTeX2e documents than
LaTeX2.09, I may have to abandon our customizations of the language
(if this is, in fact, possible without an enormous amount of work)  so
I can try this.  We are currently also evaluating other translators
that, although probably not as comprehensive as LaTeX2html, may be
more tolerant of the sorts of ways in which we've mucked with LaTeX. 

Anyway, thanks again for the help.  Much appreciated.

Ben
--
      Ben Armstrong                -.       Medianet Development Group,
      [EMAIL PROTECTED]         `-.    Dymaxion Research Limited
      <URL: http://www.dymaxion.ca/>    `-  Halifax, Nova Scotia, Canada


Reply via email to