[l2h] Too many <p>'s
Ross Moore
ross@ics.mq.edu.au
Sun, 18 Nov 2001 11:10:12 +1100 (EST)
> Hi All,
>
> I have found a couple of interesting things. I am making a slide show
> with some figures etc using latex2html. On one slide I have a page that
> has:
>
> \subsection*{Title}
>
> \begin{itemize}
> \item Some text here
> \end{itemize}
> %
> \begin{figure}[H]
> \centering \mbox{ \epsfig{file=file.eps,width=100mm}}
> %\label{fig:temp}
> \end{figure}
>
> If I convert it to html, then I get (basicaly the right thing!), but I get
> an extra "<p></p>" right above the "<DIV ALIGN="CENTER">" in the html
> code.
Yes; this is to ensure that there is a reasonable amount of space above
a figure; there is a similar amount below, also.
The point is that the <DIV> tag does not require browsers to insert vertical
space, or even to start on a new line. It was found that with some browsers
there was no space inserted at all, and <P></P> is the only convenient way
to force browsers to insert vertical space.
I've just been doing some developing, which tie the insertion of this
space to the 'h' optional argument for a {figure}.
That is, if there is an 'h' in the argument: \begin{figure}[htp]
^
then the extra <P></P> is omitted, else it is included.
This at least would give some control from the LaTeX source.
> If I uncomment the label line in the latex, then I get an extra <p></p>
> around the anchor that defines the label.
That is for a good practical reason.
The anchor has to occur above the content it labels, else when you
hyperlink to the label, you won't see the text or image.
Having the same baseline is not good enough.
In many cases, having the contents included as the content of the <A>
anchor would work fine. But the content of figures can be very
complicated. This runs into problems of validity with the nesting of tags.
So placing the anchor above was the easy solution that always hyperlinks
adequately.
> Normally I wouldn't care about this type of thing, but when space on a
> "slide" is a premium, I do care. Obviously, I can go through and remove
> the extra <p>'s.
Yes; with HTML you always have that option.
LaTeX2HTML produces quite clean code, with lots of comments,
so that you can easily find your way around in it.
> Is there an easy way to suppress these types of things. Can someone
> suggest where in the latex2html code where I could remove these?
Look for the subroutine block:
sub do_env_figure {
Once there, it isn't hard to find the places where these occur.
> [BTW, I reallly do like latex2html, it is a fantastic tool. Keep up the
> good work!]
Thanks.
I hope the above comments help you to achieve what you want.
All the best,
Ross Moore
> Thanks,
>
> Craig.
>
> _______________________________________________
> latex2html mailing list
> latex2html@tug.org
> http://tug.org/mailman/listinfo/latex2html