[l2h] Sections and labels

Ross Moore ross at ics.mq.edu.au
Thu Feb 12 23:00:09 CET 2009


Hi Mercado,

On 13/02/2009, at 8:15 AM, mercado wrote:

> On Thu, Feb 12, 2009 at 1:21 AM, Ross Moore <ross at ics.mq.edu.au>  
> wrote:
> How would you expect it to be?
>
> The problem is that, when generating multipage HTML, the <BR>  
> pushes the page title down, so pages (sections) with labels are  
> formatted differently than pages without labels.

Then make sure you put a \label on *every* section.
This consistency is good practice anyway, because later
you may decide you want to refer to it afterall,
and the label is in-place already.

Also, you will then have an entry within the  labels.pl
file, so that others can refer to each section using the
\externallabels  feature, even if you do not do so yourself.


It's easy to write a macro that does it for you;
e.g. \newcommand{\mysection}[2]{\section{#1\label{#2}}} .

Put this in the header and it will be recognised as
a home-grown macro, so expanded before page-splitting
occurs. Thus it will work just fine in both LaTeX
and LaTeX2HTML.

BTW, your \label names shouldn't be just Sect-A, Sect-B,
etc. but something that gives a hint of what the section
is all about. This is particularly useful when making
references from external sites.

>
>
> For example, if you generate multipage HTML using the sample  
> document below, you will see that Page A is formatted differently  
> from Page B due to the fact that Page A has a label.  More  
> specifically, the title (inside the the <H1> tag) for Page A is  
> pushed down a line compared to Page B.

   Yes it will --- so treat page B the same way as page A.
   HTML is not a sophisticated page-layout language, so
   you have to work with greater consistency if that is
   what you require of your output.

   Either that, or make greater use of CSS styles.
   You can edit the stylesheet that LaTeX2HTML produces
   automatically. Such edits will *not* be lost.
   Or add a <META ....> reference to an external stylesheet.

>
>
> ---------------------------------------------------------------------- 
> ----------
> \usepackage{html}
>
> \begin{document}
>
> \section{Page A}
> \label{Page-A}
> This is Page A.
>
> \section{Page B}
> This is Page B.
>
> Link to \htmlref{Page A}{Page-A}.
>
> \end{document}
> ---------------------------------------------------------------------- 
> ----------
>

Hope this helps,

	Ross

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





More information about the latex2html mailing list