summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/hyperref/hyperref.dtx
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-10-23 03:03:04 +0000
committerNorbert Preining <norbert@preining.info>2023-10-23 03:03:04 +0000
commit6864ad38da5412fd65e655da307e368cea282091 (patch)
treeaf4a82290110f8dcb185a91b44bfc4e9c121c3fd /macros/latex/contrib/hyperref/hyperref.dtx
parentd42d70e713e5b740e457a4d56e4dad6e5e0e9b94 (diff)
CTAN sync 202310230302
Diffstat (limited to 'macros/latex/contrib/hyperref/hyperref.dtx')
-rw-r--r--macros/latex/contrib/hyperref/hyperref.dtx113
1 files changed, 70 insertions, 43 deletions
diff --git a/macros/latex/contrib/hyperref/hyperref.dtx b/macros/latex/contrib/hyperref/hyperref.dtx
index b36201dbc0..228069a9ee 100644
--- a/macros/latex/contrib/hyperref/hyperref.dtx
+++ b/macros/latex/contrib/hyperref/hyperref.dtx
@@ -51,7 +51,7 @@
%<puvnenc>\ProvidesFile{puvnenc.def}
%<puarenc>\ProvidesFile{puarenc.def}
%<psdextra>\ProvidesFile{psdextra.def}
-%<!none&!packageEnd> [2023-07-08 v7.01b %
+%<!none&!packageEnd> [2023-10-21 v7.01c %
%<package> Hypertext links for LaTeX]
%<nohyperref> Dummy hyperref (SR)]
%<driver> Hyperref documentation driver file]
@@ -1311,6 +1311,12 @@
\def\MakeLowercase{\MakeLowercaseUnsupportedInPdfStrings}%
% \end{macrocode}
%
+% \paragraph{TextOrMath}
+% The \cs{TextOrMath} command is protected in a current \LaTeX{} and
+% so can not be processed.
+% \begin{macrocode}
+ \def\TextOrMath{\ifmmode\expandafter\@secondoftwo\else\expandafter\@firstoftwo\fi}%
+% \end{macrocode}
% \paragraph{Support of math commands without prefix \texttt{text}.}
% This is controlled by option ``psdextra'' and only
% activated with Unicode PDF strings.
@@ -5704,7 +5710,7 @@
%
% \begin{macrocode}
\def\HyLang@DeclareLang#1#2#3{%
- \@ifpackagewith{babel}{#1}{%
+ \ifcsname extras#1\endcsname
\expandafter\HyLang@addto
\csname extras#1\expandafter\endcsname
\csname HyLang@#2\endcsname
@@ -5714,7 +5720,7 @@
}%
\x
\@namedef{HyLang@#1@done}{}%
- }{}%
+ \fi
\begingroup
\edef\x##1##2{%
\noexpand\ifx##2\relax
@@ -9532,9 +9538,14 @@
% to a document without having to remove .aux and .toc files
% (this section is by David Carlisle)
% All the code is delayed to |\begin{document}|
+% change 2023-08-13: with a new format it is no longer
+% needed to handle different |\newlabel|
+% definitions. The code can be removed completly later.
% \begin{macrocode}
%<*package>
-\Hy@AtBeginDocument{%
+\@ifl@t@r\fmtversion{2023-06-01}{}
+ {
+ \Hy@AtBeginDocument{%
% \end{macrocode}
% First the code to deal with removing the hyperref package from
% a document.
@@ -9545,40 +9556,40 @@
% change 2022-03-28: removed the code for |\contentsline|, it is no
% longer needed as |\contentsline| has now always four arguments.
% \begin{macrocode}
- \if@filesw
- \immediate\write\@auxout{%
- \string\providecommand\string\HyperFirstAtBeginDocument{%
- \string\AtBeginDocument}^^J%
- \string\HyperFirstAtBeginDocument{%
- \string\ifx\string\hyper@anchor\string\@undefined^^J%
- \string\global\string\let\string\oldnewlabel\string\newlabel^^J%
- \string\gdef\string\newlabel\string#1\string#2{%
- \string\newlabelxx{\string#1}\string#2}^^J%
- \string\gdef\string\newlabelxx%
- \string#1\string#2\string#3\string#4\string#5\string#6{%
- \string\oldnewlabel{\string#1}{{\string#2}{\string#3}}}^^J%
+ \if@filesw
+ \immediate\write\@auxout{%
+ \string\providecommand\string\HyperFirstAtBeginDocument{%
+ \string\AtBeginDocument}^^J%
+ \string\HyperFirstAtBeginDocument{%
+ \string\ifx\string\hyper@anchor\string\@undefined^^J%
+ \string\global\string\let\string\oldnewlabel\string\newlabel^^J%
+ \string\gdef\string\newlabel\string#1\string#2{%
+ \string\newlabelxx{\string#1}\string#2}^^J%
+ \string\gdef\string\newlabelxx%
+ \string#1\string#2\string#3\string#4\string#5\string#6{%
+ \string\oldnewlabel{\string#1}{{\string#2}{\string#3}}}^^J%
% \end{macrocode}
%
% But the new aux file will be read again at the end, with the normal
% definitions expected, so better put things back as they were.
% \begin{macrocode}
- \string\AtEndDocument{%
- \string\ifx\string\hyper@anchor\string\@undefined^^J%
- \string\let\string\newlabel\string\oldnewlabel^^J%
- \string\fi%
- }^^J%
+ \string\AtEndDocument{%
+ \string\ifx\string\hyper@anchor\string\@undefined^^J%
+ \string\let\string\newlabel\string\oldnewlabel^^J%
+ \string\fi%
+ }^^J%
% \end{macrocode}
%
% If the document is being run with hyperref put this definition
% into the aux file, so we can spot it on the next run.
% \begin{macrocode}
- \string\fi%
- }^^J%
- \string\global\string\let\string\hyper@last\relax^^J%
- \string\gdef\string\HyperFirstAtBeginDocument\string#1{\string#1}%
- }%
- \fi
- \let\HyperFirstAtBeginDocument\ltx@firstofone
+ \string\fi%
+ }^^J%
+ \string\global\string\let\string\hyper@last\relax^^J%
+ \string\gdef\string\HyperFirstAtBeginDocument\string#1{\string#1}%
+ }%
+ \fi
+ \let\HyperFirstAtBeginDocument\ltx@firstofone
% \end{macrocode}
%
% Now the code to deal with adding the hyperref package to a document
@@ -9589,9 +9600,10 @@
% |\contentsline|
% has now always four arguments.
% \begin{macrocode}
- \ifx\hyper@last\@undefined
- \def\newlabel#1#2{\@newl@bel r{#1}{#2{}{}{}{}}}%
- \fi
+ \ifx\hyper@last\@undefined
+ \def\newlabel#1#2{\@newl@bel r{#1}{#2{}{}{}{}}}%
+ \fi
+ }
}
% \end{macrocode}
%
@@ -10970,11 +10982,13 @@
\H@refstepcounter{#1}%
\hyper@makecurrent{#1}%
\global\let\Hy@dth@currentHref\@currentHref
- \AddToHookNext{para/begin}
- {\let\Hy@tempa\@currentHref
- \MakeLinkTarget*{\Hy@dth@currentHref}%
- \global\let\@currentHref\Hy@tempa
- }%
+ \AddToHookNext{cmd/item/before}
+ {\AddToHookNext{para/begin}
+ {\let\Hy@tempa\@currentHref
+ \MakeLinkTarget*{\Hy@dth@currentHref}%
+ \global\let\@currentHref\Hy@tempa
+ }%
+ }%
}
\@ifundefined{hyper@nopatch@thm}{%
\AtBeginDocument{%
@@ -11729,19 +11743,28 @@
% early, if lots of float pages will follow.
% Therefore currently nothing is done by hyperref.
%
-% This where we supply a destination for each page.
+% This where we supply a destination for each page.
+%
+% \marginpar{Experimental!}The name of destination
+% is stored in the global command \cs{@currentHpage}, this allows it to retrieve
+% it with an extended reference system like zref or the new property code from \LaTeX{}
+% 2023-11-01.
+% \begin{macrocode}
+\def\@currentHpage{Doc-Start}
+% \end{macrocode}
% \begin{macrocode}
\ltx@ifclassloaded{slides}{%
\def\Hy@SlidesFormatOptionalPage#1{(#1)}%
\def\Hy@PageAnchorSlidesPlain{%
\advance\c@page\ltx@one
- \edef\Hy@TempPageAnchor{%
- \noexpand\hyper@@anchor{%
- page.\the\c@slide.\the\c@overlay.\the\c@note%
+ \xdef\@currentHpage{page.\the\c@slide.\the\c@overlay.\the\c@note%
\ifnum\c@page=\ltx@one
\else
.\the\c@page
- \fi
+ \fi}%
+ \edef\Hy@TempPageAnchor{%
+ \noexpand\hyper@@anchor{%
+ \@currentHpage
}%
}%
\advance\c@page-\ltx@one
@@ -11792,6 +11815,7 @@
\ifHy@hypertexnames
\ifHy@plainpages
\def\Hy@TempPageAnchor{\hyper@@anchor{page.\the\c@page}}%
+ \xdef\@currentHpage{page.\the\c@page}%
\Hy@PageAnchorSlidesPlain
\else
\begingroup
@@ -11802,12 +11826,14 @@
\endgroup
\EdefUnescapeString\@the@H@page{\@the@H@page}%
\def\Hy@TempPageAnchor{\hyper@@anchor{page.\@the@H@page}}%
+ \xdef\@currentHpage{page.\@the@H@page}%
\fi
\else
\Hy@GlobalStepCount\Hy@pagecounter
\def\Hy@TempPageAnchor{%
\hyper@@anchor{page.\the\Hy@pagecounter}%
}%
+ \xdef\@currentHpage{page.\the\Hy@pagecounter}%
\fi
\vbox to 0pt{%
\kern\voffset
@@ -12605,14 +12631,15 @@
% \begin{macrocode}
\let\HyRef@ShowKeysRef\@gobble
\def\HyRef@ShowKeysInit{%
- \ifcsname SK@@label\endcsname
+ \@ifundefined{SK@@label}{}
+ {%
\ifx\SK@ref\@empty
\else
\def\HyRef@ShowKeysRef{%
\SK@\SK@@ref
}%
\fi
- \fi
+ }%
}
\AddToHook{package/showkeys/after}{\HyRef@ShowKeysInit}
% \end{macrocode}