[l2h] mnemonic anchors

Ross Moore ross at ics.mq.edu.au
Fri Jan 2 12:49:14 CET 2004


Hi Jens,

On Fri, 2 Jan 2004, Jens Lehmann wrote:

> > So where is the problem ?
>
> The document can be found here:
> http://www.xith.org/tutes/GettingStarted/html/
>
> Let's say in section 8 you add a new subsection "foo" at the beginning
> of the section. Then a link which used to point to "The Model" now
> points to "foo". This is what I want to avoid.
>
> I assume (and this has proven to be true) that most users actually copy
> the link out of the table of contents or the listing of sub(sub)sections
> at the beginning of each page and paste it into forums. So, I'm not
> talking about links within the document, but links from outside to the
> document.

OK; so it's meant as a convenience in non-LaTeX2HTML situations.


> > Are you recording some of these names as constants, then creating
> > hyperlinks to them ?   That's not a recommended technique.

Yet this is indeed what you want to allow.
OK, that needs some thought.


> > Instead you should use LaTeX's symbolic \label--\ref mechanism,
> > which assigns your own choice of name for anchor targets.
> >
> > Either syntax should work:
> >    \subsection{... subsection name ...\label{..label...}}
> >    \subsection{... subsection name ...}\label{..label...}
> > creating an anchor that immediately precedes the subsection title,
> > so that hyperlinks jump to the window location that has the title
> > at the top.
>
> Actually I can do this, but most users won't see this link, because they
> copy&paste the link from the TOC and the listing of sub(sub)sections at

True. That \label  is pretty-much only used when you make an explicit
\ref (or \hyperref or similar) to it from withhin the body of the
document.
It is *not* used in the structure of the document's web-site.


> the beginning of each section. (I assume there is no magic involved and
> the links in the TOC stay the same like before if I use the technique
> above.)

Nope; not at present.
Though this is probably what we want.

There should be a hierarchy of choices for the label to use
when building the TOC and mini-TOCs:

  a.   use a symbolic \label if there is one
else
  b.   construct a label from the section-title;
       use this, if it is unique for the HTML-page
else
  c.   use the current label based on the section-numbers.

This should be possible to do; but a full solution will take some time
to develop.

> >>of the subsections and subsubsections as anchor names. I'm aware that
> >>this causes trouble if a heading appears more than once within one html
> >>file, but this is not a problem in our case. It's important that the
> >>mnemonic anchors are the ones which are actually used in the document
> >>(for example in the table of contents). How can this be achieved?
> >
> >
> > You will have to explain to me why this is necessary, for a single site.
> > It sounds like you have a complicated site which is not always updated
> > as a single unit, and want some parts to link into others.
>
> I already tried to explain it above. Links within the document are not a
> problem.
>
> I hope the problem is now clearer.

Yes, it is.
Do my comments above agree with your own thoughts ?


All the best in the New Year,

	Ross Moore


>
> Jens
>
>
> --
> PGP Public Key: http://studenten-dresden.de/public_key.asc
>
>


More information about the latex2html mailing list