[l2h] My own environments

Fred L. Drake, Jr. fdrake at acm.org
Tue Mar 30 10:25:01 CEST 2004


On Monday 29 March 2004 11:14 am, Sam Clarke wrote:
 > I am fond of deriving my own environments in LaTeX. One such environment
 > is derived from the list environment, and just sets some of the
 > constants for spacings and so on. If I try to run latex2html on this
 > file, it creates images of these lists. If I do the constant definitions
 > at each instance of the environment and rename it back to list, then
 > latex2html creates text in the html file. The question is, can't I add
 > my environment to latex2html, by simply copying the implementation for
 > list? Where do I do this?

You can do better than copying the implementation for the list environment.

If you want your list to act just like the list environment with default 
settings, you can define a simple environment handler in your Perl code:

sub do_env_mylist {
    return do_env_itemize(@_);
}

What I often do is add an additional wrapper around the result so I can affect 
the presentation via style sheets:

sub do_env_mylist {
    return '<div class="mylist">' . do_env_itemize(@_) . "</div>\n";
}


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation



More information about the latex2html mailing list