[l2h] CSS and theorem environments

Christophe Tournery christophe.tournery@epfl.ch
Tue, 15 Oct 2002 10:30:50 +0200 (CEST)


On Tue, 15 Oct 2002, Ross Moore wrote:

> > Hi there,
> >
> > I am quite new to latex2html, so I guess what I am trying to do should be
> > fairly easy, but I haven't found any doc on this yet.
> >
> > I am using the amsthm package to declare new environments such as
> > 'definition', ...
> > The produced html code looks like this:
> >     '<DIV><B>Definition ...'
> >
> > Now I would like to be able to customize the displayed theorem using a
> > stylesheet. So I would like latex2html to add a CSS class tag for me like
> > this:
> >     '<DIV CLASS="DEFINITON"><B>Definition ...'
> >
> > Any help on how to do this would be much appreciated,
>
> Simply use the command-line option:
>    -html_version 4.0
>
> With HTML 4.0, the variable $USING_STYLES  is set, and several
> class names come automatically.

That's almost what I am already doing (declaring $HTML_VERSION="4.0";
in a config file), but it doesn't help for theorems.

> (You can set also  $USING_STYLES =1;  in an init file, with HTML 3.2;
> but then there would be no guarantee of having validatable HTML.)
>
> You can then edit the .css stylesheet to attach styling properties
> to these classes.
>
> Indeed, commands \htmlsetstyle and  \htmladdtostyle allow the stylesheet
> to be edited from within the LaTeX job.
>
> Also, the \begin command has an optional argument which allows extra
> classes and attributes to be attached to some opening tags.
> (Make sure \usepackage{html} has loaded the html package.)

Well, the \begin[MyOwnClass]{...} construction works well for tabular,
itemize, ..., but not for theorems! When I try to use it with theorems,
l2h processes the theorem as an image and does not even include the
CLASS="MyOwnClass" tag in the html output, although it does include a
DIV.MyOwnClass entry in the CSS file.

Any idea?

> These features are discussed in depth in The LaTeX Web Companion.
>
>
> Hope this helps,
>
> 	Ross Moore
>

-- 
__________________________________________________________________________
Christophe Tournery                            christophe.tournery@epfl.ch