[l2h] \htmlsetstyle / css file question
Dan Scholnik
Dan Scholnik <scholnik@radar.nrl.navy.mil>
Mon, 21 Feb 2000 02:03:46 -0500
This is something I thought I had figured out a while back, then put
aside, and now I can't remember what I figured out. I'm trying to add
the line
P { line-height : 2.5ex }
to the .css file generated by latex2html (and we'll put aside that
fact that I don't have a clue what the P stands for) by using the
html.sty command
\htmlsetstyle[P]{}{ line-height=2.5ex }
What I get is
DIV.P { line-height : 2.5ex }
Now, I don't really know Perl, but I traced through the latex2html
source (99.2beta6) anyway, and found this block of code:
print "\n *** Adding document-specific styles *** ";
while (($env,$style) = each %env_style) {
if ($env =~ /\./) {
$env =~ s/\.$//;
print STYLESHEET "$env\t\t{ $style }\n";
} elsif ($env =~ /inline|^(text|math)?((tt|rm|sf)(family)?|(up|it|sl|sc)(shape)?|(bf|md)(series)?|normal(font)?)$/) {
print STYLESHEET "SPAN.$env\t\t{ $style }\n";
} elsif ($env =~ /\./) {
print STYLESHEET "$env\t\t{ $style }\n";
} elsif ($env =~ /^(preform|\w*[Vv]erbatim(star)?)$/) {
print STYLESHEET "PRE.$env\t\t{ $style }\n";
} elsif ($env =~ /figure|table|tabular|equation|$array_env_rx/) {
print STYLESHEET "TABLE.$env\t\t{ $style }\n";
} else {
print STYLESHEET "DIV.$env\t\t{ $style }\n";
}
}
This is where the DIV comes from. I'm a bit confused by this, since the
third "if" test is the same as the first. Further, the first case
removes a trailing '.', but the sub process_htmlstyles already does that,
via a fix that was discussed on the list 5/19/99. Now if that fix
was not in place, then the above latex code would result in $env="P.",
which would be caught by the first line, have it's '.' stripped, and
I'd get what I want. But $env="P" doesn't match any of the cases,
and the default DIV.P results.
I can see several ways to change the code to get what I want, but I'd
like to know if I'm missing something fundamental here, and if there
is a "right" way to fix it.
thanks,
Dan Scholnik