ArchiveOrangemail archive

General TeX discussion and questions.


texhax.tug.org
(List home) (Recent threads) (32 other TeX Users Group lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe address with "subscribe" in the subject line, or visit the list's homepage here.
  • Low traffic list: less than 3 messages per day
  • This list contains about 21,036 messages, beginning May 2003
  • 0 messages added yesterday
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

memoir, hyperref, nameref

Ad
Victor Ivrii 1271321443Thu, 15 Apr 2010 08:50:43 +0000 (UTC)
1) At some moment (not sure when, I just noticed, but I presume that
it have happened on not earlier than last summer)

\nameref command stopped working properly with memoir

\documentclass[12pt]{memoir}
\usepackage{hyperref}
\begin{document}
\section{One}
\label{sect-1}
\nameref{sect-1}
\end{document}


produces hyperlink without text (no error returns). With {article}
everything works fine.

2)


\documentclass[12pt]{article}
\usepackage{hyperref}
\begin{document}
\section{One}
\label{sect-1}
\nameref*{sect-1}
\end{document}

returns text "sect-1" instead of "One" without hyperlink.

Should not \nameref* work as \nameref albeit without hyperlink?

As I never tried this before I am not sure if it ever worked right

Victor
Victor Ivrii 1271328194Thu, 15 Apr 2010 10:43:14 +0000 (UTC)
On Thu, Apr 15, 2010 at 4:47 AM, Victor Ivrii wrote: > 1) At some moment (not sure when, I just noticed, but I presume that > it have happened on not earlier than last summer) > > \nameref command stopped working properly with memoir > > \documentclass[12pt]{memoir} > \usepackage{hyperref} > \begin{document} > \section{One} > \label{sect-1} > \nameref{sect-1} > \end{document} > > > produces hyperlink without text (no error returns). With {article} > everything works fine. > > 2) > > > \documentclass[12pt]{article} > \usepackage{hyperref} > \begin{document} > \section{One} > \label{sect-1} > \nameref*{sect-1} > \end{document} > > returns text "sect-1" instead of "One" without hyperlink. > > Should not \nameref* work as \nameref albeit without hyperlink? > > As I never tried this before I am not sure if it ever worked right > > Victor >
I found that examples are fixed by adding \usepackage{nameref} but 1) Example 1 worked before without nameref 2) Still, without nameref package Examples should either work this way or return errors (IMHO). Victor
Lars Madsen 1271332072Thu, 15 Apr 2010 11:47:52 +0000 (UTC)
Victor Ivrii wrote: > 1) At some moment (not sure when, I just noticed, but I presume that > it have happened on not earlier than last summer) > > \nameref command stopped working properly with memoir > > \documentclass[12pt]{memoir} > \usepackage{hyperref} > \begin{document} > \section{One} > \label{sect-1} > \nameref{sect-1} > \end{document} > > > produces hyperlink without text (no error returns). With {article} > everything works fine. >
interesting I just updated, it worked before the update and not after the update Did you change something interesting Heiko, that I need to change i memhfixc?
Heiko Oberdiek 1271512836Sat, 17 Apr 2010 14:00:36 +0000 (UTC)
On Thu, Apr 15, 2010 at 01:46:50PM +0200, Lars Madsen wrote: > Victor Ivrii wrote: > >1) At some moment (not sure when, I just noticed, but I presume that > >it have happened on not earlier than last summer) > > > >\nameref command stopped working properly with memoir > > > >\documentclass[12pt]{memoir} > >\usepackage{hyperref} > >\begin{document} > >\section{One} > >\label{sect-1} > >\nameref{sect-1} > >\end{document} > > > > > >produces hyperlink without text (no error returns). With {article} > >everything works fine. > > > > interesting > > I just updated, it worked before the update and not after the update
Test file, the last page should show "OK" in all nameref links: \listfiles \documentclass{memoir} \usepackage{hyperref}[2010/04/15] \AtBeginDocument{\RequirePackage{nameref}[2010/04/15]}% only date checking \begin{document} \makeatletter \def\List{} \def\Label#1{% \label{#1}% \g@addto@macro\List{% \par #1: [\nameref{#1}]% }% \mbox{}% } \def\Test#1{% \csname#1\endcsname*{OK/#1}% \Label{#1*} \csname#1\endcsname{OK/#1}% \Label{#1}% \csname#1\endcsname[OK/#1-toc]% {WRONG-in-nameref/#1-toc-2}% \Label{#1-toc}% \expandafter\ifx\csname#1\endcsname\part \else \headnamereffalse \csname#1\endcsname[OK/#1-th-toc]% [WRONG-in-nameref/#1-th-toc-2]% {WRONG-in-nameref/#1-th-toc-3}% \Label{#1-th-toc}% \headnamereftrue \csname#1\endcsname[WRONG-in-nameref/#1-th-head-1]% [OK/#1-th-head]% {WRONG-in-nameref/#1-th-head-3}% \Label{#1-th-head}% \fi } \@for\x:=part,chapter,section,subsection,subsubsection\do{% \expandafter\Test\expandafter{\x}% } \List \end{document} *File List* memoir.cls 2010/02/20 v1.618033988c configurable book, report, article doc ument class ifpdf.sty 2010/01/28 v2.1 Provides the ifpdf switch (HO) ifxetex.sty 2009/01/23 v0.5 Provides ifxetex conditional ifluatex.sty 2010/03/01 v1.3 Provides the ifluatex switch (HO) etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB) mem10.clo 2008/01/30 v0.3 memoir class 10pt size option mempatch.sty 2009/07/24 v6.0f Patches for memoir class v1.6180339 hyperref.sty 2010/04/15 v6.80v Hypertext links for LaTeX ltxcmds.sty 2010/04/08 v1.5 LaTeX kernel commands for general use (HO) keyval.sty 1999/03/16 v1.13 key=value parser (DPC) kvsetkeys.sty 2010/03/01 v1.9 Key value parser (HO) infwarerr.sty 2010/04/08 v1.3 Providing info/warning/message (HO) etexcmds.sty 2010/01/28 v1.3 Prefix for e-TeX command names (HO) pdfescape.sty 2010/03/01 v1.9 Provides hex, PDF name and string conversions (HO) pdftexcmds.sty 2010/04/01 v0.9 Utility functions of pdfTeX for LuaTeX (HO) ifvtex.sty 2010/03/01 v1.5 Switches for detecting VTeX and its modes (HO) hycolor.sty 2009/12/12 v1.6 Color options of hyperref/bookmark (HO) xcolor-patch.sty 2009/12/12 xcolor patch letltxmacro.sty 2008/06/24 v1.3 Let assignment for LaTeX macros (HO) pd1enc.def 2010/04/15 v6.80v Hyperref: PDFDocEncoding definition (HO) intcalc.sty 2007/09/27 v1.1 Expandable integer calculations (HO) hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive kvoptions.sty 2010/02/22 v3.7 Keyval support for LaTeX options (HO) url.sty 2006/04/12 ver 3.3 Verb mode for urls, etc. bitset.sty 2007/09/28 v1.0 Data type bit set (HO) bigintcalc.sty 2007/11/11 v1.1 Expandable big integer calculations (HO) atbegshi.sty 2010/03/25 v1.12 At begin shipout hook (HO) memhfixc.sty 2009/02/06 v1.12 nameref/hyperref package fixes for memoir clas s hpdftex.def 2010/04/15 v6.80v Hyperref driver for pdfTeX atveryend.sty 2010/03/24 v1.5 Hooks at very end of document (HO) rerunfilecheck.sty 2010/03/16 v1.6 Rerun checks for auxiliary files (HO) rerunfilecheck.cfg 2010/03/16 Default configuration uniquecounter.sty 2009/12/18 v1.1 Provides unlimited unique counter (HO) nameref.sty 2010/04/15 v2.37 Cross-referencing by name of section refcount.sty 2008/08/11 v3.1 Data extraction from references (HO) gettitlestring.sty 2009/12/18 v1.3 Cleanup title references (HO) test.out test.out ***********
> Did you change something interesting Heiko, that I need to change i > memhfixc?
The following code from memhfixc explains Victor's remark, that adding \usepackage{nameref} works:
| \AtBeginDocument{% | \@ifpackageloaded{nameref}{\let\nameref\titleref}{}% | }
With \usepackage{nameref} this code redefines \nameref. Otherwise, hyperref loads nameref later using \AtBeginDocument. In any case, this code is unhappy, because hyperref has to define a star variant of \nameref, see Victor's other problem. Yours sincerely Heiko Oberdiek
Lars Madsen 1271335346Thu, 15 Apr 2010 12:42:26 +0000 (UTC)
>> >> I just updated, it worked before the update and not after the update > > Test file, the last page should show "OK" in all nameref links: >
[snip] fails miserably
> >> Did you change something interesting Heiko, that I need to change i >> memhfixc? > > The following code from memhfixc explains Victor's remark, > that adding \usepackage{nameref} works: > > | \AtBeginDocument{% > | \@ifpackageloaded{nameref}{\let\nameref\titleref}{}% > | } > > With \usepackage{nameref} this code redefines \nameref. > Otherwise, hyperref loads nameref later using \AtBeginDocument. > > In any case, this code is unhappy, because hyperref has > to define a star variant of \nameref, see Victor's other problem. > > Yours sincerely > Heiko Oberdiek
we change the \label contents after nameref, because we emulate titleref and thus otherwise could not get our hands on the title. So the \let\nameref\titleref fixed that problem it seems the loading sequence have changed, because the memoir data is no longer added to the aux files with the new hyperref/nameref we do provide a *-ed version of \titleref and perhaps nameref should just use that. or perhaps it is about time we seperate the title part out of the labels, thus doubling the lines in the aux files (one line for the 'normal' label, and for for 'other stuff')
Lars Madsen 1271336116Thu, 15 Apr 2010 12:55:16 +0000 (UTC)
> > we change the \label contents after nameref, because we emulate titleref > and thus otherwise could not get our hands on the title. So the > \let\nameref\titleref fixed that problem >
this now fails just adding a \AtBeginDocument{\typeout{test}} at the very end of memhfixc shows that this AtBeginDocument gets executed before nameref is even loaded This also means that the \AtBeginDocument{% \@ifpackageloaded{nameref}{\let\nameref\titleref}{}% } is never executed
Uwe Lueck 1271340514Thu, 15 Apr 2010 14:08:34 +0000 (UTC)
-----Ursprüngliche Nachricht-----
Von: Lars Madsen 
Gesendet: Apr 15, 2010 2:54:25 PM An: Heiko Oberdiek ,Victor Ivrii ,TeXhax Betreff: Re: [texhax] memoir, hyperref, nameref >> we change the \label contents after nameref, because we emulate titleref >> and thus otherwise could not get our hands on the title. So the >> \let\nameref\titleref fixed that problem >this now fails >just adding a >\AtBeginDocument{\typeout{test}} >at the very end of memhfixc shows that this AtBeginDocument gets >executed before nameref is even loaded >This also means that the >\AtBeginDocument{% > \@ifpackageloaded{nameref}{\let\nameref\titleref}{}% >} > >is never executed
So try ctan.org/pkg/afterpackage: \usepackage{afterpackage} \AfterPackage{nameref}{\let\nameref\titleref} HTH!? -- Uwe.
Heiko Oberdiek 1271512836Sat, 17 Apr 2010 14:00:36 +0000 (UTC)
On Thu, Apr 15, 2010 at 04:06:46PM +0200, Uwe Lueck wrote: > -----Ursprüngliche Nachricht----- > Von: Lars Madsen > Gesendet: Apr 15, 2010 2:54:25 PM > An: Heiko Oberdiek ,Victor Ivrii ,TeXhax > Betreff: Re: [texhax] memoir, hyperref, nameref > >> we change the \label contents after nameref, because we emulate titleref > >> and thus otherwise could not get our hands on the title. So the > >> \let\nameref\titleref fixed that problem > >this now fails > >just adding a > >\AtBeginDocument{\typeout{test}} > >at the very end of memhfixc shows that this AtBeginDocument gets > >executed before nameref is even loaded > >This also means that the > >\AtBeginDocument{% > > \@ifpackageloaded{nameref}{\let\nameref\titleref}{}% > >} > > > >is never executed > > So try ctan.org/pkg/afterpackage: > > \usepackage{afterpackage} > \AfterPackage{nameref}{\let\nameref\titleref}
And the star form of \nameref is unsupported ... Yours sincerely Heiko Oberdiek
Lars Madsen 1271372857Thu, 15 Apr 2010 23:07:37 +0000 (UTC)
Heiko Oberdiek wrote: > On Thu, Apr 15, 2010 at 04:06:46PM +0200, Uwe Lueck wrote: > >> -----Ursprüngliche Nachricht----- >> Von: Lars Madsen >> Gesendet: Apr 15, 2010 2:54:25 PM >> An: Heiko Oberdiek ,Victor Ivrii ,TeXhax >> Betreff: Re: [texhax] memoir, hyperref, nameref >>>> we change the \label contents after nameref, because we emulate titleref >>>> and thus otherwise could not get our hands on the title. So the >>>> \let\nameref\titleref fixed that problem >>> this now fails >>> just adding a >>> \AtBeginDocument{\typeout{test}} >>> at the very end of memhfixc shows that this AtBeginDocument gets >>> executed before nameref is even loaded >>> This also means that the >>> \AtBeginDocument{% >>> \@ifpackageloaded{nameref}{\let\nameref\titleref}{}% >>> } >>> >>> is never executed >> So try ctan.org/pkg/afterpackage: >> >> \usepackage{afterpackage} >> \AfterPackage{nameref}{\let\nameref\titleref} > > And the star form of \nameref is unsupported ... > > Yours sincerely > Heiko Oberdiek
replace it with \DeclareRobustCommand\nameref{\@ifstar{\@mem@titlerefnolink}{\@mem@titleref}} that is how titleref is defined internally \@mem@titlerefnolink gets redefined if hyperref is loaded /daleif
Lars Madsen 1271418239Fri, 16 Apr 2010 11:43:59 +0000 (UTC)
Lars Madsen wrote: > Heiko Oberdiek wrote: >> On Thu, Apr 15, 2010 at 04:06:46PM +0200, Uwe Lueck wrote: >> >>> -----Ursprüngliche Nachricht----- >>> Von: Lars Madsen >>> Gesendet: Apr 15, 2010 2:54:25 PM >>> An: Heiko Oberdiek ,Victor Ivrii >>> ,TeXhax >>> Betreff: Re: [texhax] memoir, hyperref, nameref >>>>> we change the \label contents after nameref, because we emulate >>>>> titleref and thus otherwise could not get our hands on the title. >>>>> So the \let\nameref\titleref fixed that problem >>>> this now fails >>>> just adding a >>>> \AtBeginDocument{\typeout{test}} >>>> at the very end of memhfixc shows that this AtBeginDocument gets >>>> executed before nameref is even loaded >>>> This also means that the >>>> \AtBeginDocument{% >>>> \@ifpackageloaded{nameref}{\let\nameref\titleref}{}% >>>> } >>>> >>>> is never executed >>> So try ctan.org/pkg/afterpackage: >>> \usepackage{afterpackage} >>> \AfterPackage{nameref}{\let\nameref\titleref} >> >> And the star form of \nameref is unsupported ... >> >> Yours sincerely >> Heiko Oberdiek > > replace it with > > \DeclareRobustCommand\nameref{\@ifstar{\@mem@titlerefnolink}{\@mem@titleref}} > > > that is how titleref is defined internally > > \@mem@titlerefnolink gets redefined if hyperref is loaded > > > /daleif > > >
Ok, I seem to have found a solution. A functionality similar to afterpackage is build into memoir, so this might do the trick If it is ok by you, I'll add this to memoir in the coming update. \documentclass[12pt]{memoir} \usepackage{hyperref} \makeatletter \AtEndPackage{nameref}{ \@ifundefined{NR@sectm@m}{% haven't fiddled with \M@sect \typeout{Redoing nameref's sectioning} \let\NR@sectm@m\M@sect \def\M@sect##1##2##3##4##5##6[##7][##8]##9{% \setcounter{section@level}{##2}% \def\@currentlabelname{##7}%\NR@sectm@m{##1}{##2}{##3}{##4}{##5}{##6}[{##7}][{##8}]{\Sectionformat{##9}{##2}}}% }{}% \NR@sectm@m has already been defined \@ifundefined{MNR@label}{% haven't fiddled with \label \typeout{Redoing nameref's label} \let\MNR@label\label \def\label##1{\@bsphack\begingroup \protected@edef\@currentlabel{\protect\M@TitleReference {\@currentlabel}{\M@currentTitle}}% \MNR@label{##1}% \endgroup \@esphack}% \let\MNR@old@caption\@caption \long\def\@caption##1[##2]##3{% \MNR@old@caption{##1}[{##2}]{##3}% \def\@currentlabelname{##2}% \M@gettitle{##2}% }% }% {}% \MNR@label has already been defined \DeclareRobustCommand\nameref{\@ifstar{\@mem@titlerefnolink}{\@mem@titleref}} } \makeatother \begin{document} \section{One} \label{sect-1} nameref: \nameref{sect-1} \noindent nameref*: \nameref*{sect-1} \noindent titleref: \titleref{sect-1} \end{document}
Victor Ivrii 1271420507Fri, 16 Apr 2010 12:21:47 +0000 (UTC)
On Fri, Apr 16, 2010 at 7:42 AM, Lars Madsen 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 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" Victor
Heiko Oberdiek 1271512835Sat, 17 Apr 2010 14:00:35 +0000 (UTC)
On Fri, Apr 16, 2010 at 08:20:56AM -0400, Victor Ivrii wrote: > On Fri, Apr 16, 2010 at 7:42 AM, Lars Madsen 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
Victor Ivrii 1271528969Sat, 17 Apr 2010 18:29:29 +0000 (UTC)
attfoo.aux (614 B) attbar.log (9.4 kB)
I took hyperref 2010/04/16 v6.80w (including nameref 2.38) from TUG
and tried again. Still this particular example does not work.
(BTW, thanks for taking care of theorems)

>From foo.aux
\newlabel{MyLabel}{{}{1}{\relax }{}{}}
and
bar.tex stumbles upon \ref{foo-MyLabel}
It does not return ? but an error

{\@thirdoffive }\fi \endgroup  \end {document}
! File ended while scanning use of \Hy@setref@link.
<inserted text>
                \par
<*> bar.tex

? q
OK, entering \batchmode...
! Emergency stop.
<*> bar.tex

*** (job aborted, no legal \end found)

If I manually edit
\newlabel{MyLabel}{{}{1}{\relax }{}{}}
replacing it by
\newlabel{MyLabel}{{My Great Article}{1}{\relax }{}{}}

then foo.tex returns My Great Article


So, I think that if the label is not inside of any environment, it is
*still* inside of the largest environment document itself and the
title of document should go there.

I think that this makes a sense with xr-hyper




\documentclass[12pt]{article}
\usepackage{hyperref}
\usepackage{nameref}
\label{MyLabel}
\begin{document}
blah
\end{document}



%%%bar.tex%%%
\documentclass[12pt]{article}
\usepackage{xr-hyper}
\usepackage{hyperref}
\usepackage{nameref}
\externaldocument[foo-]{foo}[foo.pdf]
\begin{document}
blah
\nameref{foo-MyLabel}
\end{document}


Victor
Heiko Oberdiek 1271556528Sun, 18 Apr 2010 02:08:48 +0000 (UTC)
On Sat, Apr 17, 2010 at 02:28:20PM -0400, Victor Ivrii wrote: > I took hyperref 2010/04/16 v6.80w (including nameref 2.38) from TUG > and tried again. Still this particular example does not work. > (BTW, thanks for taking care of theorems) > > >From foo.aux > \newlabel{MyLabel}{{}{1}{\relax }{}{}} > and > bar.tex stumbles upon \ref{foo-MyLabel} > It does not return ? but an error > > {\@thirdoffive }\fi \endgroup \end {document} > ! File ended while scanning use of \Hy@setref@link. > <inserted text> > \par > <*> bar.tex > > ? q > OK, entering \batchmode... > ! Emergency stop. > <*> bar.tex > > *** (job aborted, no legal \end found) > > If I manually edit > \newlabel{MyLabel}{{}{1}{\relax }{}{}} > replacing it by > \newlabel{MyLabel}{{My Great Article}{1}{\relax }{}{}} > > then foo.tex returns My Great Article > > > So, I think that if the label is not inside of any environment, it is > *still* inside of the largest environment document itself and the > title of document should go there.
But the title can be defined after \begin{document}, the only condition is that \title must be used before \maketitle. > I think that this makes a sense with xr-hyper The problem in this example is rather that xr-hyper/hyperref don't see an anchor name and assumes that the label was written without nameref/hyperref. At least I have updated hyperref v6.80x/nameref v2.39, that the initial value is "Doc-Start" (this will be set as anchor by hyperref in \begin{document}). But I still don't think that \label *before* \begin{document} is not the best recommended way. For example, before the first page it is put on the first page (the way \special works). Thus the page number is "1" instead of a more reasonable "0".
> \documentclass[12pt]{article} > \usepackage{hyperref} > \usepackage{nameref} > \label{MyLabel} > \begin{document} > blah > \end{document} > %%%bar.tex%%% > \documentclass[12pt]{article} > \usepackage{xr-hyper} > \usepackage{hyperref} > \usepackage{nameref} > \externaldocument[foo-]{foo}[foo.pdf] > \begin{document} > blah > \nameref{foo-MyLabel} > \end{document}
For package zref, module xr I had written a more sophisticated parser. Now (zref v2.12) I have updated the module and added the feature to convert the imported references to standard LaTeX references. Therefore I think, xr-hyper/xr can be replaced by: \usepackage{zref-xr} \zxrsetup{% % verbose,% imported labels are shown in the .log file % tozreflabel=false,% if zref is not needed otherwise toltxlabel, } \zexternaldocument*[foo-]{foo}[foo.pdf] If `nameref' is used (hyperref), it must be loaded *before* the first \zexternaldocument. Yours sincerely Heiko Oberdiek
Heiko Oberdiek 1271512836Sat, 17 Apr 2010 14:00:36 +0000 (UTC)
On Thu, Apr 15, 2010 at 02:41:51PM +0200, Lars Madsen wrote: > >>I just updated, it worked before the update and not after the update > > > >Test file, the last page should show "OK" in all nameref links: > > > > [snip] > > > fails miserably
And what's the problem? Yours sincerely Heiko Oberdiek
Lars Madsen 1271629863Sun, 18 Apr 2010 22:31:03 +0000 (UTC)
Heiko Oberdiek wrote: > On Thu, Apr 15, 2010 at 02:41:51PM +0200, Lars Madsen wrote: > >>>> I just updated, it worked before the update and not after the update >>> Test file, the last page should show "OK" in all nameref links: >>> >> [snip] >> >> >> fails miserably > > And what's the problem? > >
race condition, we use \AtBeginDocument + \@ifpackageloaded{nameref} to do our stuff. It is well known that this may cause a race condition. I will change memhfixc to use \AtPackageEnd instead. The minimal example I posted earlier, seems to do the trick, and your test shows ok on all the links /daleif
Heiko Oberdiek 1271512806Sat, 17 Apr 2010 14:00:06 +0000 (UTC)
On Thu, Apr 15, 2010 at 04:47:35AM -0400, Victor Ivrii wrote: > 1) At some moment (not sure when, I just noticed, but I presume that > it have happened on not earlier than last summer) > > \nameref command stopped working properly with memoir > > \documentclass[12pt]{memoir} > \usepackage{hyperref} > \begin{document} > \section{One} > \label{sect-1} > \nameref{sect-1} > \end{document}
Thanks for reporting. Now it's fixed in nameref 2.37.
> 2) > > > \documentclass[12pt]{article} > \usepackage{hyperref} > \begin{document} > \section{One} > \label{sect-1} > \nameref*{sect-1} > \end{document} > > returns text "sect-1" instead of "One" without hyperlink. > > Should not \nameref* work as \nameref albeit without hyperlink?
Yes, therefore I have added it in hyperref 6.80v. Thanks again. Yours sincerely Heiko Oberdiek
Victor Ivrii 1271334404Thu, 15 Apr 2010 12:26:44 +0000 (UTC)
Heiko, when I found \nameref problem with memoir I decided to test it
a bit more and found not only \nameref* problem but also discrepancy
between \ref and \nameref.

In this example \ref returns theorem number but \nameref ignores
theorem and returns section name. Logically one should expect "Great
Theorem"?

Victor

\documentclass[12p]{article}
\usepackage{hyperref}
\usepackage{nameref}
\usepackage{amsthm}
\newtheorem{theorem}{theorem}
\begin{document}
\section{One}
\label{sect-1}

\begin{theorem}[Great Theorem]\label{th-1}
$1+1=2$
\end{theorem}



\ref{th-1}

\nameref{th-1}
\end{document}
Ad
Home | About | Privacy