Re: [l2h] Sections and labels

2009-02-12 Thread Finn Aarup Nielsen


Hi Ross and Mercado,


On Thu, 12 Feb 2009, Ross Moore wrote:

 Hi Mercado,

 On 12/02/2009, at 12:46 PM, mercado wrote:

 I am creating a document using LaTeX and LaTeX2HTML, and I am unsure
 how to use the \section command and the \label command together.

 If I use the \label command before the \section command, then my link
 doesn't go to the right page.  If I use the \section command before
 the \label command, then I get strange markup with a br / tag within
 the h1 tag:

 Try putting the \label inside the section command;
 viz.

   \section{whatever section\label{Page-C}}

 or immediately after, on the same line (no break at all):

   \section{whatever section}\label{Page-D}

 At least one of these should work for you.

Did you actually try these? I have tried them with 2002-2-1 (1.71) and 
get - as in Mercado's version - the BR inserted.


best regards
Finn

___

  Finn Aarup Nielsen, DTU Informatics, Denmark
  Lundbeck Foundation Center for Integrated Molecular Brain Imaging
http://www.imm.dtu.dk/~fn/  http://nru.dk/staff/fnielsen/
___

___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] Sections and labels

2009-02-12 Thread Ross Moore
Hi Mercado,

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

 On Thu, Feb 12, 2009 at 1:21 AM, Ross Moore r...@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   r...@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




___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


[l2h] Sections and labels

2009-02-11 Thread mercado
I am creating a document using LaTeX and LaTeX2HTML, and I am unsure
how to use the \section command and the \label command together.

If I use the \label command before the \section command, then my link
doesn't go to the right page.  If I use the \section command before
the \label command, then I get strange markup with a br / tag within
the h1 tag:


H1A NAME=SECTION0002/A
A NAME=Page-B/A
BR

Page B
/H1


Is this a bug is LaTeX2HTML?  I am including a small, self-contained
sample below.

I am using LaTeX2HTML version 2002-2-1 (1.71).

Thanks in advance.


\usepackage{html}

\begin{document}

\label{Page-A}
\section{Page A}
This is Page A.

Link to \htmlref{Page B}{Page-B}.

\section{Page B}
\label{Page-B}
This is Page B.

Link to \htmlref{Page A}{Page-A}.

\end{document}

___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] Sections and labels

2009-02-11 Thread Ross Moore
Hi Mercado,

On 12/02/2009, at 12:46 PM, mercado wrote:

 I am creating a document using LaTeX and LaTeX2HTML, and I am unsure
 how to use the \section command and the \label command together.

 If I use the \label command before the \section command, then my link
 doesn't go to the right page.  If I use the \section command before
 the \label command, then I get strange markup with a br / tag within
 the h1 tag:

Try putting the \label inside the section command;
viz.

   \section{whatever section\label{Page-C}}

or immediately after, on the same line (no break at all):

   \section{whatever section}\label{Page-D}

At least one of these should work for you.



 -- 
 --
 H1A NAME=SECTION0002/A
 A NAME=Page-B/A
 BR

 Page B
 /H1
 -- 
 --

 Is this a bug is LaTeX2HTML?  I am including a small, self-contained
 sample below.

 I am using LaTeX2HTML version 2002-2-1 (1.71).

 Thanks in advance.

 -- 
 --
 \usepackage{html}

 \begin{document}

 \label{Page-A}
 \section{Page A}
 This is Page A.

 Link to \htmlref{Page B}{Page-B}.

 \section{Page B}
 \label{Page-B}
 This is Page B.

 Link to \htmlref{Page A}{Page-A}.

 \end{document}
 -- 
 --


Hope this helps,

Ross


Ross Moore   r...@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




___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] Sections and labels

2009-02-11 Thread mercado
On Wed, Feb 11, 2009 at 9:32 PM, Ross Moore r...@ics.mq.edu.au wrote:

 Try putting the \label inside the section command;
 viz.

  \section{whatever section\label{Page-C}}

 or immediately after, on the same line (no break at all):

  \section{whatever section}\label{Page-D}

 At least one of these should work for you.


Hi Ross,

Thanks for the quick and helpful reply.

I tried both of your suggestions, but unfortunately neither of them worked.
Both produced the funny html that I included in my first email.

Any other ideas?
___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] Sections and labels

2009-02-11 Thread Ross Moore
Hi Mercado,

On 12/02/2009, at 12:46 PM, mercado wrote:

 I am creating a document using LaTeX and LaTeX2HTML, and I am unsure
 how to use the \section command and the \label command together.

 If I use the \label command before the \section command, then my link
 doesn't go to the right page.  If I use the \section command before
 the \label command, then I get strange markup with a br / tag within
 the h1 tag:

 -- 
 --
 H1A NAME=SECTION0002/A
 A NAME=Page-B/A
 BR

 Page B
 /H1
 -- 
 --

 Is this a bug is LaTeX2HTML?

No -- this is by design!
It ensures that the target anchor is above the actual title,
so that when you jump to the anchor you see the title at the top
of the page.

Before CSS rules, this used to be the only way to get the
desired result upon hyperlinking to the target.

I suppose an alternative would be to put the targets above
the H1 but that was rather hard to program, with the
page-splitting algorithm.


How would you expect it to be?
And does it actually work properly with such HTML coding?

 I am including a small, self-contained
 sample below.

 I am using LaTeX2HTML version 2002-2-1 (1.71).

 Thanks in advance.


Hope this helps,

Ross

PS.
sorry, I didn't look closely enough before my previous reply.


Ross Moore   r...@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




___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html