[l2h] Controlling generation of CLASS and ID attributes from within LaTeX files

Ross Moore ross at ics.mq.edu.au
Sat Jul 30 12:16:43 CEST 2005


On 30/07/2005, at 12:06 AM, William T. Martin wrote:

> I am having trouble with specifying CSS styles for the Itemize
> environment.  I tried this:
>
> \begin[list-style-type: square; margin-top:-0.95em; ]{itemize}
>    \item One
>    \item Two
>    \item Three
> \end{itemize}

The remarks in "The LaTeX Web Companion" indicate that this
mechanism only works for  <DIV> , <SPAN> and <TABLE> tags.

That coding was written so long ago now that I forget why
there was an extra layer of difficulty with <OL>, <UL>
and <DL> tags. I think it's related to the fact that the
true HTML identity of a list-like environment cannot be
determined until it is seen whether any \item commands
have an optional argument.

In short, the relevant coding was just not done in time
for the "Web Companion" book's publishing schedule,
and has not been revisited since.

Thanks for the reminder of this oversight.


However, you can wrap the list within tags, such as
     <DIV class="mylist">  ...  <DIV>
then assign a style rule of the following form:

    DIV.mylist UL   { ... styles ...  }

that is, with a "contextual selector".
(Though not all browsers handle these.)

Within LaTeX you can use:
   \htmlsetstyle{DIV.mylist UL}{.. styles ...}
to pass this rule to the .css file.

See my earlier posting to see how to update the .css file
at each run.


>
> But no CSS style code was generated in the resulting HTML:
>
> <UL>
> <LI>One
> </LI>
> <LI>Two
> </LI>
> <LI>Three
>
> </LI>
> </UL>
>
> This entry was added to the stylesheet:
>
> #itemize192             { list-style-type : square; margin-top :  
> -0.95em;  }


Yes, this happens, but the <UL> isn't tagged with the ID.
See above for a discussion of this.

>
> When I change this to tabular, it works fine.
>
>    \begin[border=2pt,solid,brown; color=maroon; padding:5pt] 
> {tabular}[h]{|l|l}
>    \hline
>    One & Two \\
>    Three& Four \\
>    \hline
>    \end{tabular}
>
> Generates:
>
> <TABLE ID="tabular192" CLASS="tabular" CELLPADDING=3 BORDER="1">
> <TR><TD ALIGN="LEFT">One</TD>
> <TD ALIGN="LEFT">Two</TD>
> </TR>
> <TR><TD ALIGN="LEFT">Three</TD>
> <TD ALIGN="LEFT">Four</TD>
> </TR>
> </TABLE>
>
> Is there something I need to do for the Itemize environment?
>
> I am using these options:
>
> /usr/local/bin/latex2html -debug -info "" -html_version 4.0 -split  
> 0 -nonavigation -t "School of OR&IE Academic Programs" -dir /net/ 
> critical/export/home/apache_modssl/htdocs/orie/latex/academicprogs - 
> mkdir /net/critical/export/home/apache_modssl/htdocs/orie/latex/ 
> academicprogs.tex
>
> Thank you,
>
>  -- Bill Martin --


Hope this helps,

     Ross Moore


------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia  2109                            fax: +61 +2 9850 8114
------------------------------------------------------------------------




More information about the latex2html mailing list