summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/hyperref/nameref.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-06-25 22:26:58 +0000
committerKarl Berry <karl@freefriends.org>2023-06-25 22:26:58 +0000
commite2b471ee57adf753b0637108df1aa1e2fc378721 (patch)
tree2e1751d161f2fdb660da6fcd61ac707f26646fc7 /Master/texmf-dist/source/latex/hyperref/nameref.dtx
parentebae48848fc5e4574efcff1e149bff84aca7e993 (diff)
hyperref (26jun23)
git-svn-id: svn://tug.org/texlive/trunk@67471 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/hyperref/nameref.dtx')
-rw-r--r--Master/texmf-dist/source/latex/hyperref/nameref.dtx23
1 files changed, 20 insertions, 3 deletions
diff --git a/Master/texmf-dist/source/latex/hyperref/nameref.dtx b/Master/texmf-dist/source/latex/hyperref/nameref.dtx
index e370a40fe11..d50f4fee362 100644
--- a/Master/texmf-dist/source/latex/hyperref/nameref.dtx
+++ b/Master/texmf-dist/source/latex/hyperref/nameref.dtx
@@ -33,7 +33,7 @@
%<driver>\ProvidesFile{nameref.drv}
% \fi
% \ProvidesFile{nameref.dtx}
- [2023-05-16 v2.51 Cross-referencing by name of section]%
+ [2023-06-18 v2.52 Cross-referencing by name of section]%
%
%
% \iffalse
@@ -274,8 +274,10 @@
% \begin{macro}{\label@hook}
% Starting with LaTeX 2023-06-01 it is not longer needed to
% redefine \cs{label} as the kernel provides a hook and
-% stores \cs{@currentlabelname}. We still support
-% \cs{label@hook} for now as it is used below in \cs{slabel}
+% stores \cs{@currentlabelname}. But as there are packages like ntheorem
+% and revtex which overwrites the kernel definition and then break nameref
+% and hyperref we add a guard.
+% We still support \cs{label@hook} for now as it is used below in \cs{slabel}
% and also in hyperref.
% \begin{macrocode}
\providecommand*{\label@hook}{}
@@ -284,6 +286,21 @@
}
\@ifl@t@r\fmtversion{2023-06-01}
{
+ \def\NR@label@copy#1{\@bsphack
+ \begingroup
+ \UseHookWithArguments{label}{1}{#1}%
+ \protected@write\@auxout{}%
+ {\string\newlabel{#1}{{\@currentlabel}{\thepage}%
+ {\@currentlabelname}{\@currentHref}{\@kernel@reserved@label@data}}}%
+ \endgroup
+ \@esphack}
+ \ifx\label\NR@label@copy
+ \else
+ \PackageWarning{nameref}{The definition of \string\label\space has changed!
+ \MessageBreak Check your packages!
+ \MessageBreak Replacing it with the kernel definition}
+ \let\label\NR@label@copy
+ \fi
\AddToHookWithArguments{label}{\def\label@name{#1}\label@hook}
}
{