[texhax] memoir, hyperref, nameref
Heiko Oberdiek
oberdiek at uni-freiburg.de
Fri Apr 16 16:21:53 CEST 2010
On Fri, Apr 16, 2010 at 08:20:56AM -0400, Victor Ivrii wrote:
> On Fri, Apr 16, 2010 at 7:42 AM, Lars Madsen <daleif at imf.au.dk> wrote:
>
> > Ok, I seem to have found a solution. A functionality similar to afterpackage
>
>
>
> First of all, after I tested with hyperref 6.80v (from tug, currently
> also on CTAN and probably tomorrow on TL) both problems I reported had
> gone. However still there is a behaviour, I consider as illogical
> (while it is not a bug)
>
> 1) foo.tex
>
> \documentclass[12pt]{article}
> \usepackage{amsthm}
> \usepackage{hyperref}
> %\usepackage{nameref}
> \label{A}
> \newtheorem{theorem}{theorem}
> \begin{document}
> \section{One}
> \label{sect-1}
> \section{Two}
> \label{sect-2}
> \begin{theorem}[Great Theorem]\label{th-1}
> $1+1=2$
> \end{theorem}
> \ref{th-1}
> \nameref{th-1}
> \end{document}
> \ref correctly returns theorem number
> \nameref returns Section Name
It's fixed in nameref 2.38, but I haven't uploaded yet.
> 2) bar.tex
>
> \documentclass[12pt]{article}
> \usepackage{amsthm}
> \usepackage{xr-hyper}
> \usepackage{hyperref}
> %\usepackage{nameref}
> \externaldocument[foo-]{foo}[foo.pdf]
> \begin{document}
> \ref{foo-th-1}
> \nameref*{foo-th-1}
> \ref{foo-A}
> \nameref{foo-A}
> \end{document}
>
> \ref, \nameref, ... to foo-th-1 return the same as th-1 in foo.tex
>
> but
>
> \ref{foo-A}, \nameref{foo-A}
>
> return an error (not just ? like \ref{foo-B}). I would expect from
> \nameref{foo-A} to return a title of "foo.tex"
You have to put \label *after* package nameref is loaded,
hyperref loads it using \AtBeginDocument.
Yours sincerely
Heiko Oberdiek
More information about the texhax
mailing list