The problem here is that your label is inside the subsection title. If
you move it into the body of the section---just put it at the beginning
of the first paragraph---all should be well. Works for me, anyway.

There's something in the manual about this suggesting it's been fixed.
But it's not fixed in my version. Maybe you should try grabbing the most
recent version of the hyperref bundle and installing that manually.

Here's what seems to be happening. If you look at the .aux file, you'll
see this:

\newlabel{sub:This-is-the}{{2.1}{1}{\label {sub:This-is-the}This is the section I want to x-ref\relax }{}{}}

LaTeX thinks the label is part of the title, so when it substitutes the
title of the section for the occurrences of \nameref, the label gets
included. So you end up with "\label{sub:This-is-the}" three times, the
last of which is in section 3. And if you look at the .aux file on the
next run, you'll see \newlabel occurring an extra three times.

Richard

Stefano Franchi wrote:
Well, I am totally baffled by LyX and LaTeX management of cross references. I cannot get either the LyX command or the \nameref command to produce the correct reference. What happens is that the first pass of LaTeX produces the correct reference, then LyX runs LaTeX again and the reference is changed to an erroneous value. I can actually see this happening in real time if I keep TeXShop open: the document is typeset correctly and then re-typeset with the wrong value. I am enclosing a sample file LyX file below. I suppose I must have misunderstood something very basic in LaTeX referencing system, but rereading the relevant section of the Companion was of no help.
Any advice is appreciated.

Cheers,

S.



__________________________________________________
Stefano Franchi
Department of Philosophy                  Ph:  (64)  9 373-7599 x83940
University Of Auckland            Fax: (64) 9 373-8768
Private Bag 92019                [EMAIL PROTECTED]
Auckland
New Zealand


--
Richard G Heck Jr
[EMAIL PROTECTED]
http://bobjweil.com/heck/


Reply via email to