summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/hyperref/hyperref.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/hyperref/hyperref.dtx')
-rw-r--r--macros/latex/contrib/hyperref/hyperref.dtx534
1 files changed, 211 insertions, 323 deletions
diff --git a/macros/latex/contrib/hyperref/hyperref.dtx b/macros/latex/contrib/hyperref/hyperref.dtx
index 20414ef7e8..6096fad1d1 100644
--- a/macros/latex/contrib/hyperref/hyperref.dtx
+++ b/macros/latex/contrib/hyperref/hyperref.dtx
@@ -1,31 +1,31 @@
% \iffalse
%% File: hyperref.dtx
-%% Copyright
-%% 1995-2001 Sebastian Rahtz, with portions written by David Carlisle and Heiko Oberdiek,
-%% 2001-2015 Heiko Oberdiek.
-%% 2016-2019 Oberdiek Package Support Group
-%% 2019-2021 LaTeX Project
-%% https://github.com/latex3/hyperref/issues
-%%
-%% This file is part of the `Hyperref Bundle'.
-%% -------------------------------------------
-%%
-%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either version 1.3
-%% of this license or (at your option) any later version.
-%% The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%% and version 1.3 or later is part of all distributions of LaTeX
-%% version 2005/12/01 or later.
-%%
-%% This work has the LPPL maintenance status `maintained'.
-%%
-%% The Current Maintainer of this work is the LaTeX Project.
-%%
-%% The list of all files belonging to the `Hyperref Bundle' is
-%% given in the file `manifest.txt'.
-%%
-%<package|nohyperref|driver|check>\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+% Copyright
+% 1995-2001 Sebastian Rahtz, with portions written by David Carlisle and Heiko Oberdiek,
+% 2001-2015 Heiko Oberdiek.
+% 2016-2019 Oberdiek Package Support Group
+% 2019-2022 LaTeX Project
+% https://github.com/latex3/hyperref/issues
+%
+% This file is part of the `Hyperref Bundle'.
+% -------------------------------------------
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3 or later is part of all distributions of LaTeX
+% version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status `maintained'.
+%
+% The Current Maintainer of this work is the LaTeX Project.
+%
+% The list of all files belonging to the `Hyperref Bundle' is
+% given in the file `manifest.txt'.
+%
+%<package|nohyperref|driver|check>\NeedsTeXFormat{LaTeX2e}[2020/10/01]
%<package>\ProvidesPackage{hyperref}
%<nohyperref>\ProvidesPackage{nohyperref}
%<driver>\ProvidesFile{hyperref.drv}
@@ -52,7 +52,7 @@
%<puvnenc>\ProvidesFile{puvnenc.def}
%<puarenc>\ProvidesFile{puarenc.def}
%<psdextra>\ProvidesFile{psdextra.def}
-%<!none> [2022-02-21 v7.00n %
+%<!none&!packageEnd> [2022-05-13 v7.00o %
%<package> Hypertext links for LaTeX]
%<nohyperref> Dummy hyperref (SR)]
%<driver> Hyperref documentation driver file]
@@ -1036,6 +1036,23 @@
% converted to the final form.
% \end{enumerate}
%
+% \cs{MakeUppercase} and \cs{MakeLowercase} do not work by expansion in
+% legacy code but if the expl3 code is available we can handle them.
+%
+% \begin{macro}{\MakeUppercaseUnsupportedInPdfStrings}
+% \begin{macro}{\MakeLowercaseUnsupportedInPdfStrings}
+% \begin{macrocode}
+\ExplSyntaxOn
+\@ifundefined{text_uppercase:n}{}
+ {
+ \def\MakeUppercaseUnsupportedInPdfStrings#1{\use:e {\text_uppercase:n {#1}}}
+ \def\MakeLowercaseUnsupportedInPdfStrings#1{\use:e {\text_lowercase:n {#1}}}
+ }
+\ExplSyntaxOff
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\pdfstringdef}
% \cs{pdfstringdef} works on the tokens in |#2| and converts them to
% a PDF string as far as possible:
@@ -4219,13 +4236,6 @@
%
% \section{Support of other packages}
%
-% \subsection{Class memoir}
-%
-% \begin{macrocode}
-\@ifclassloaded{memoir}{%
- \Hy@AtEndOfPackage{\RequirePackage{memhfixc}}%
-}{}
-% \end{macrocode}
%
% \subsection{Package subfigure}
% Added fix for version 2.1. Here \cmd{\sub@label} is defined.
@@ -4258,10 +4268,6 @@
\fi
\@esphack
}%
- \@ifpackagelater{subfigure}{2002/03/26}{}{%
- \providecommand*{\toclevel@subfigure}{1}%
- \providecommand*{\toclevel@subtable}{1}%
- }%
}%
}{}
% \end{macrocode}
@@ -4712,6 +4718,9 @@
% \end{macrocode}
% \begin{macrocode}
\define@key{Hyp}{localanchorname}[true]{%
+ \Hy@WarningNoLine{%
+ Option `localanchorname' is deprecated%
+ }%
\Hy@boolkey{localanchorname}{#1}%
}
% \end{macrocode}
@@ -7288,23 +7297,6 @@
\Hy@DisableOption{colorlinks}%
\Hy@DisableOption{frenchlinks}%
\ifHy@texht
- \long\def\@firstoffive#1#2#3#4#5{#1}%
- \long\def\@secondoffive#1#2#3#4#5{#2}%
- \long\def\@thirdoffive#1#2#3#4#5{#3}%
- \long\def\@fourthoffive#1#2#3#4#5{#4}%
- \long\def\@fifthoffive#1#2#3#4#5{#5}%
- \providecommand*\@safe@activestrue{}%
- \providecommand*\@safe@activesfalse{}%
- \def\T@ref#1{%
- \Hy@safe@activestrue
- \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}%
- \Hy@safe@activesfalse
- }%
- \def\T@pageref#1{%
- \Hy@safe@activestrue
- \expandafter\@setref\csname r@#1\endcsname\@secondoffive{#1}%
- \Hy@safe@activesfalse
- }%
\else
\ifHy@typexml
\else
@@ -7312,36 +7304,34 @@
\RequirePackage{nameref}[2012/07/28]%
}%
\fi
+% \end{macrocode}
+% With active links we have to redefine the starred versions
+% to avoid that they get links from the include |\@setref|:
+% \begin{macrocode}
+ \ifHy@implicit
+ \let \T@Ref\HyRef@Ref
+ \def\@refstar#1{%
+ \NR@ref@showkeys{#1}%
+ \HyRef@StarSetRef{#1}\@firstoffive
+ }
+ \def\@pagerefstar#1{%
+ \NR@ref@showkeys{#1}%
+ \HyRef@StarSetRef{#1}\@secondoffive
+ }
+ \def\@namerefstar#1{%
+ \NR@ref@showkeys{#1}%
+ \HyRef@StarSetRef{#1}\@thirdoffive
+ }
+ \def\@Refstar#1{%
+ \NR@ref@showkeys{#1}%
+ \HyRef@StarSetRef{#1}\HyRef@MakeUppercaseFirstOfFive
+ }%
+ \else
+ \fi
\fi
- \DeclareRobustCommand\ref{%
- \@ifstar\@refstar\T@ref
- }%
- \DeclareRobustCommand\pageref{%
- \@ifstar\@pagerefstar\T@pageref
- }%
-% \@ifclassloaded{memoir}{%
-% \ltx@IfUndefined{@mem@titlerefnolink}\ltx@secondoftwo{%
-% \ltx@IfUndefined{@mem@titleref}\ltx@secondoftwo\ltx@firstoftwo
-% }%
-% }\ltx@secondoftwo
-% {%
-% \DeclareRobustCommand*{\nameref}{%
-% \@ifstar\@mem@titlerefnolink\@mem@titleref
-% }%
-% }{%
- \DeclareRobustCommand*{\nameref}{%
- \@ifstar\@namerefstar\T@nameref
- }%
-% }%
- \ifHy@implicit
- \else
- \let \@pagerefstar\T@pageref
- \let \@refstar\T@ref
- \let \@namerefstar\T@nameref
- \fi
}
\Hy@AtBeginDocument{%
- \ifHy@texht
+ \ifx\ReadBookmarks\relax
\else
\Hy@CatcodeWrapper\ReadBookmarks
\fi
@@ -9384,15 +9374,18 @@
% \end{macrocode}
% Ignore star from referencing macros:
+% This is only needed if LaTeX doesn't define the starred
+% variants itself.
% \begin{macrocode}
-\LetLtxMacro\NoHy@OrgRef\ref
-\DeclareRobustCommand*{\ref}{%
+\@ifundefined{@kernel@ref}
+ {\LetLtxMacro\NoHy@OrgRef\ref
+ \DeclareRobustCommand*{\ref}{%
\@ifstar\NoHy@OrgRef\NoHy@OrgRef
-}
-\LetLtxMacro\NoHy@OrgPageRef\pageref
-\DeclareRobustCommand*{\pageref}{%
+ }
+ \LetLtxMacro\NoHy@OrgPageRef\pageref
+ \DeclareRobustCommand*{\pageref}{%
\@ifstar\NoHy@OrgPageRef\NoHy@OrgPageRef
-}
+ }}{}
% \end{macrocode}
%
% \section{Localized nullifying of package}
@@ -9482,16 +9475,21 @@
\long\def\@gobbleopt[#1]{}
\let\hyperpage\@empty
% \end{macrocode}
-% Ignore star from referencing macros:
+% Ignore star from referencing macros. This is only
+% needed in older formats.
% \begin{macrocode}
-\LetLtxMacro\NoHy@OrgRef\ref
-\DeclareRobustCommand*{\ref}{%
- \@ifstar\NoHy@OrgRef\NoHy@OrgRef
-}
-\LetLtxMacro\NoHy@OrgPageRef\pageref
-\DeclareRobustCommand*{\pageref}{%
- \@ifstar\NoHy@OrgPageRef\NoHy@OrgPageRef
-}
+\@ifl@t@r\fmtversion{2022-06-01}
+ {}%
+ {%
+ \LetLtxMacro\NoHy@OrgRef\ref
+ \DeclareRobustCommand*{\ref}{%
+ \@ifstar\NoHy@OrgRef\NoHy@OrgRef
+ }
+ \LetLtxMacro\NoHy@OrgPageRef\pageref
+ \DeclareRobustCommand*{\pageref}{%
+ \@ifstar\NoHy@OrgPageRef\NoHy@OrgPageRef
+ }%
+ }
%</nohyperref>
% \end{macrocode}
%
@@ -9508,8 +9506,10 @@
% a document.
%
% Write some stuff into the aux file so if the next run is done
-% without hyperref, then |\contentsline| and |\newlabel| are defined
+% without hyperref, then |\newlabel| is defined
% to cope with the extra arguments.
+% 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
\ifHy@typexml
@@ -9522,11 +9522,6 @@
\string\AtBeginDocument}^^J%
\string\HyperFirstAtBeginDocument{%
\string\ifx\string\hyper@anchor\string\@undefined^^J%
- \string\global\string\let\string\oldcontentsline\string\contentsline^^J%
- \string\gdef\string\contentsline%
- \string#1\string#2\string#3\string#4{%
- \string\oldcontentsline%
- {\string#1}{\string#2}{\string#3}}^^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%
@@ -9540,7 +9535,6 @@
% \begin{macrocode}
\string\AtEndDocument{%
\string\ifx\string\hyper@anchor\string\@undefined^^J%
- \string\let\string\contentsline\string\oldcontentsline^^J%
\string\let\string\newlabel\string\oldnewlabel^^J%
\string\fi%
}^^J%
@@ -9561,28 +9555,12 @@
% Now the code to deal with adding the hyperref package to a document
% with aux and toc written the standard way.
%
-% If hyperref was used last time, do nothing. If it was not used,
-% or an old version of hyperref was used, don't use that TOC at all
-% but generate a warning. Not ideal, but better than failing
-% with pre-5.0 hyperref TOCs.
+% If hyperref was used last time, do nothing.
+% change 2022-03-28: removed the test for an old toc.
+% |\contentsline|
+% has now always four arguments.
% \begin{macrocode}
\ifx\hyper@last\@undefined
- \def\@starttoc#1{%
- \begingroup
- \makeatletter
- \ltx@ifpackageloaded{parskip}{\parskip\z@}{}%
- \IfFileExists{\jobname.#1}{%
- \Hy@WarningNoLine{%
- old #1 file detected, not used; run LaTeX again%
- }%
- }{}%
- \if@filesw
- \expandafter\newwrite\csname tf@#1\endcsname
- \immediate\openout\csname tf@#1\endcsname \jobname.#1\relax
- \fi
- \@nobreakfalse
- \endgroup
- }%
\def\newlabel#1#2{\@newl@bel r{#1}{#2{}{}{}{}}}%
\fi
}
@@ -10256,7 +10234,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-%<*package>
+%<*packageEnd>
% \end{macrocode}
%
% \begin{macrocode}
@@ -10312,6 +10290,7 @@
\Hy@CounterExists{section}{%
\providecommand\theHequation{\theHsection.\arabic{equation}}%
}
+\providecommand\theHequation{\arabic{equation}}%
\Hy@CounterExists{part}{%
\providecommand\theHpart{\arabic{part}}%
}
@@ -10366,36 +10345,42 @@
% \begin{macrocode}
\let\H@refstepcounter\refstepcounter
\edef\name@of@eq{equation}%
-\edef\name@of@slide{slide}%
% \end{macrocode}
% We do not want the handler for |\refstepcounter| to cut in
% during the processing of |\item| (we handle that separately),
% so we provide a bypass conditional.
+% change 2022-04-22: removed test for the slide counter
+% and for the equation name.
+% change 2022-05-02: added the new boolean set by
+% |\LinkTargetOn/\LinkTargetOff|
+%
% \begin{macrocode}
\newif\if@hyper@item
\newif\if@skiphyperref
\@hyper@itemfalse
\@skiphyperreffalse
+\ExplSyntaxOn
\def\refstepcounter#1{%
- \ifHy@pdfstring
- \else
+ \legacy_if:nF {Hy@pdfstring}
+ {
\H@refstepcounter{#1}%
- \edef\This@name{#1}%
- \ifx\This@name\name@of@slide
- \else
- \if@skiphyperref
- \else
- \if@hyper@item
- \stepcounter{Item}%
- \hyper@refstepcounter{Item}%
- \@hyper@itemfalse
- \else
- \hyper@refstepcounter{#1}%
- \fi
- \fi
- \fi
- \fi
+ \bool_lazy_and:nnT
+ { \l__hyp_target_create_bool }
+ { ! \legacy_if_p:n{@skiphyperref} }
+ {
+ \legacy_if:nTF {@hyper@item}
+ {
+ \stepcounter{Item}%
+ \hyper@refstepcounter{Item}%
+ \@hyper@itemfalse
+ }
+ {
+ \hyper@refstepcounter{#1}%
+ }
+ }
+ }
}
+\ExplSyntaxOff
\let\Hy@saved@refstepcounter\refstepcounter
% \end{macrocode}
% AMS\LaTeX\ processes all equations twice; we want to make sure
@@ -10558,24 +10543,14 @@
}
% \end{macrocode}
% \end{macro}
-% \begin{macro}{\hyper@hook@dest@make}
% We define a hook to allow to overwrite the next destination name.
% \begin{macrocode}
-\@ifl@t@r\fmtversion{2020-10-01}
- {%
- \NewHook{__hyp/dest/make }
- \def\hyper@hook@dest@make
- {\UseHook{__hyp/dest/make}}
- \define@key{Hyp}{next-anchor}{%
- \AddToHookNext{__hyp/dest/make}%
+\NewHook{__hyp/target/setname }
+\define@key{Hyp}{next-anchor}{%
+ \AddToHookNext{__hyp/target/setname}%
{\Hy@MakeCurrentHref{#1}}%
}
- }
- {
- \def\hyper@hook@dest@make{}
- }
% \end{macrocode}
-% \end{macro}
% \begin{macro}{\hyper@makecurrent}
% Because of Babel mucking around, nullify |\textlatin| when making names.
% And |\@number| because of babel's lrbabel.def.
@@ -10627,7 +10602,7 @@
\else
\global\let\@currentHref\HyperGlobalCurrentHref
\fi
- \hyper@hook@dest@make
+ \UseHook{__hyp/target/setname}%
}
% \end{macrocode}
% \end{macro}
@@ -10654,7 +10629,7 @@
\def\Hy@MakeCurrentHrefAuto#1{%
\Hy@GlobalStepCount\Hy@linkcounter
\Hy@MakeCurrentHref{#1.\the\Hy@linkcounter}%
- \hyper@hook@dest@make}
+ \UseHook{__hyp/target/setname}}
% \end{macrocode}
% \end{macro}
%
@@ -10728,17 +10703,21 @@
% Fix provided by Felix Neubauer (\Email{felix.neubauer@gmx.net}).
% This fix will no longer be needed with latex 2021-11-15.
% \begin{macrocode}
-\AtBeginDocument{%
-\def\Hy@varioref@undefined{{??}{??}{}{}{}}
-\@ifpackageloaded{varioref}{%
- \def\vref@pagenum#1#2{%
- \@ifundefined{r@#2}{%
- \expandafter\let\csname r@#2\endcsname\Hy@varioref@undefined
- }{}%
- \edef#1{\getpagerefnumber{#2}}%
- }%
-}{}
-}
+\@ifl@t@r\fmtversion{2021-11-15}
+ {}%
+ {
+ \AtBeginDocument{%
+ \def\Hy@varioref@undefined{{??}{??}{}{}{}}
+ \@ifpackageloaded{varioref}{%
+ \def\vref@pagenum#1#2{%
+ \@ifundefined{r@#2}{%
+ \expandafter\let\csname r@#2\endcsname\Hy@varioref@undefined
+ }{}%
+ \edef#1{\getpagerefnumber{#2}}%
+ }%
+ }{}
+ }
+ }
% \end{macrocode}
%
% \section{Package longtable support}
@@ -10794,7 +10773,7 @@
% Overload equation, temporarily reverting to original
% |\refstepcounter|. If, however, it is in AMS math, we do not
% do anything, as the tag mechanism is used there (see section \ref{ams}).
-% The execption is that we move the equation incrementation inside
+% The exception is that we move the equation incrementation inside
% the math environment to avoid specials outside and a wrong vertical
% spacing of equation environments.
% \begin{macrocode}
@@ -11121,8 +11100,10 @@
% text, separately from whatever labels the text assigns. Too hard
% to keep track of markers otherwise. If the raw forms |\footnotemark|
% and |\footnotetext| are used, force them to use un-hyper original.
-%
+% If |\hyper@nopatch@footnote| is defined we don't patch but assume
+% that addings links to footnotes is handled elsewhere.
% \begin{macrocode}
+\@ifundefined{hyper@nopatch@footnote}{%
\ifHy@hyperfootnotes
\newcounter{Hfootnote}%
\let\H@@footnotetext\@footnotetext
@@ -11315,7 +11296,7 @@
}{}%
% \end{macrocode}
%
-% KOMA-Script defines \cs{footref} that uses both
+% KOMA-Script or newer LaTeX defines \cs{footref} that uses both
% \cs{ref} and \cs{@footnotemark} resulting in two links,
% one of them wrong.
% \begin{macrocode}
@@ -11368,8 +11349,8 @@
% Does anyone remember the function and purpose of \cmd{\realfootnote}?
% \begin{macrocode}
\def\realfootnote{%
- \@ifnextchar[\@xfootnote{%
- \stepcounter{\@mpfn}%
+ \@ifnextchar[\@xfootnote%]
+ {\stepcounter{\@mpfn}%
\protected@xdef\@thefnmark{\thempfn}%
\H@@footnotemark\H@@footnotetext
}%
@@ -11377,12 +11358,13 @@
% \end{macrocode}
% \begin{macrocode}
\fi
+}{}
\Hy@DisableOption{hyperfootnotes}
% \end{macrocode}
% \end{macro}
%
% \begin{macrocode}
-%</package>
+%</packageEnd>
%<*check>
\checklatex
\checkcommand\def\@xfootnotenext[#1]{%
@@ -11407,7 +11389,7 @@
\relax
}
%</check>
-%<*package>
+%<*packageEnd>
% \end{macrocode}
%
% \section{Float captions}\label{captions}
@@ -11518,7 +11500,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-%</package>
+%</packageEnd>
%<*check>
\checklatex[1999/06/01 - 2000/06/01]
\checkcommand\def\caption{%
@@ -11546,7 +11528,7 @@
\endgroup
}
%</check>
-%<*package>
+%<*packageEnd>
% \end{macrocode}
%
% \section{Bibliographic references}\label{bib}
@@ -11559,7 +11541,7 @@
% and \emph{drftcite} may break.
%
% However, lets make an attempt to get \emph{natbib} right, because
-% thats a powerful, important package.
+% that's a powerful, important package.
% Patrick Daly (\Email{daly@linmpi.mpg.de}) has
% provided hooks for us, so all we need to do is activate them.
% \begin{macrocode}
@@ -11660,7 +11642,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-%</package>
+%</packageEnd>
%<*check>
\checklatex
\checkcommand\def\@lbibitem[#1]#2{%
@@ -11685,7 +11667,7 @@
\ignorespaces
}
%</check>
-%<*package>
+%<*packageEnd>
% \end{macrocode}
%
% \subsection{Package harvard}
@@ -12065,7 +12047,7 @@
% \end{macro}
%
% \begin{macrocode}
-%</package>
+%</packageEnd>
%<*check>
\checklatex
\checkcommand\def\addcontentsline#1#2#3{%
@@ -12073,7 +12055,7 @@
}
\checkcommand\def\contentsline#1{\csname l@#1\endcsname}
%</check>
-%<*package>
+%<*packageEnd>
% \end{macrocode}
%
% \section{New counters}\label{counters}
@@ -12179,10 +12161,10 @@
% \end{macrocode}
%
% \begin{macro}{\numberwithin}
-% A appropiate definition of hyperref's companion counter
+% A appropriate definition of hyperref's companion counter
% (\cmd{\theH...}) is added for correct link names.
% \begin{macrocode}
-%</package>
+%</packageEnd>
%<*check>
\checkpackage{amsmath}[1999/12/14 - 2000/06/06]
\checkcommand\newcommand{\numberwithin}[3][\arabic]{%
@@ -12196,30 +12178,22 @@
}%
}%
%</check>
-%<*package>
+%<*packageEnd>
\@ifpackageloaded{amsmath}{%
- \@ifpackagelater{amsmath}{1999/12/14}{%
- \renewcommand*{\numberwithin}[3][\arabic]{%
- \@ifundefined{c@#2}{\@nocounterr{#2}}{%
- \@ifundefined{c@#3}{\@nocnterr{#3}}{%
- \HyOrg@addtoreset{#2}{#3}%
- \@xp\xdef\csname the#2\endcsname{%
- \@xp\@nx\csname the#3\endcsname .\@nx#1{#2}%
- }%
- \@xp\xdef\csname theH#2\endcsname{%
- \@xp\@nx
- \csname the\@ifundefined{theH#3}{}H#3\endcsname
- .\@nx#1{#2}%
- }%
+ \renewcommand*{\numberwithin}[3][\arabic]{%
+ \@ifundefined{c@#2}{\@nocounterr{#2}}{%
+ \@ifundefined{c@#3}{\@nocnterr{#3}}{%
+ \HyOrg@addtoreset{#2}{#3}%
+ \@xp\xdef\csname the#2\endcsname{%
+ \@xp\@nx\csname the#3\endcsname .\@nx#1{#2}%
+ }%
+ \@xp\xdef\csname theH#2\endcsname{%
+ \@xp\@nx
+ \csname the\@ifundefined{theH#3}{}H#3\endcsname
+ .\@nx#1{#2}%
}%
}%
}%
- }{%
- \Hy@WarningNoLine{%
- \string\numberwithin\space of package `amsmath' %
- only fixed\MessageBreak
- for version 2000/06/06 v2.12 or newer%
- }%
}%
}{}
% \end{macrocode}
@@ -12501,7 +12475,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-%</package>
+%</packageEnd>
%<*check>
\checklatex
\checkcommand\def\@setref#1#2#3{%
@@ -12516,7 +12490,7 @@
\fi
}
%</check>
-%<*package>
+%<*packageEnd>
% \end{macrocode}
%
% Now some extended referencing. |\ref*| and |\pageref*| are not linked,
@@ -12549,26 +12523,25 @@
\def\@namerefstar#1{%
\HyRef@StarSetRef{#1}\@thirdoffive
}
-
+\def\@Refstar#1{%
+ \HyRef@StarSetRef{#1}\HyRef@MakeUppercaseFirstOfFive
+}%
+\def\HyRef@MakeUppercaseFirstOfFive#1#2#3#4#5{%
+ \MakeUppercase#1%
+}%
+\def\HyRef@Ref#1{%
+ \hyperref[{#1}]{\Ref*{#1}}%
+}%
\Hy@AtBeginDocument{%
\@ifpackageloaded{varioref}{%
- \def\@Refstar#1{%
- \HyRef@StarSetRef{#1}\HyRef@MakeUppercaseFirstOfFive
- }%
- \def\HyRef@MakeUppercaseFirstOfFive#1#2#3#4#5{%
- \MakeUppercase#1%
- }%
- \DeclareRobustCommand*{\Ref}{%
- \@ifstar\@Refstar\HyRef@Ref
- }%
- \def\HyRef@Ref#1{%
- \hyperref[{#1}]{\Ref*{#1}}%
- }%
% \end{macrocode}
-% Test if we are running new 2019 varioref or old one:
+% This are the patches for a varioref newer after 2019-09
+% Older versions are no longer supported.
+% If |\hyper@nopatch@varioref| is defined we don't patch but assume
+% that varioref handles the hyperlinks.
% \begin{macrocode}
-%FMi
- \ifdefined\vp@gerefstar
+ \@ifundefined{hyper@nopatch@varioref}
+ {
\renewcommand\Vref@star[2][]{%
\begingroup
\let\T@pageref\@pagerefstar
@@ -12601,33 +12574,11 @@
\vpageref[#1]{#2}%
\endgroup
}%
-% \end{macrocode}
-% old varioref:
-% \begin{macrocode}
- \else
- \def\Vr@f#1{%
- \leavevmode\unskip\vref@space
- \hyperref[{#1}]{%
- \Ref*{#1}%
- \let\vref@space\nobreakspace
- \@vpageref[\unskip]{#1}%
- }%
- }%
- \def\vr@f#1{%
- \leavevmode\unskip\vref@space
- \begingroup
- \let\T@pageref\@pagerefstar
- \hyperref[{#1}]{%
- \ref*{#1}%
- \vpageref[\unskip]{#1}%
- }%
- \endgroup
- }%
- \fi
-%FMi -end mod
+ }{}%
}{}%
}
-
+% \end{macrocode}
+% \begin{macrocode}
\DeclareRobustCommand*{\autopageref}{%
\@ifstar{%
\HyRef@autopagerefname\pageref*%
@@ -12651,10 +12602,9 @@
% \cs{leavevmode} is added to make package wrapfigure happy, if
% \cs{autoref} starts a paragraph.
% \begin{macrocode}
-\DeclareRobustCommand*{\autoref}{%
- \leavevmode
- \@ifstar{\HyRef@autoref\@gobbletwo}{\HyRef@autoref\hyper@@link}%
-}
+\NewDocumentCommand\autoref{s}
+ {\leavevmode
+ \IfBooleanTF{#1}{\HyRef@autoref\@gobbletwo}{\HyRef@autoref\hyper@@link}}
\def\HyRef@autoref#1#2{%
\begingroup
\Hy@safe@activestrue
@@ -12737,9 +12687,7 @@
% \begin{macrocode}
\let\HyRef@ShowKeysRef\@gobble
\def\HyRef@ShowKeysInit{%
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname SK@@label\endcsname\relax
- \else
+ \ifcsname SK@@label\endcsname
\ifx\SK@ref\@empty
\else
\def\HyRef@ShowKeysRef{%
@@ -12785,7 +12733,7 @@
% \end{macrocode}
%
% \begin{macrocode}
-%</package>
+%</packageEnd>
% \end{macrocode}
%
% \section{Configuration files}
@@ -13096,15 +13044,7 @@
\expandafter\endgroup
\expandafter\pdflinkmargin\the\dimen@\relax
}
-\ifx\pdfstartlink\@undefined% less than version 14
- \let\pdfstartlink\pdfannotlink
- \let\pdflinkmargin\@tempdima
- \let\pdfxform\pdfform
- \let\pdflastxform\pdflastform
- \let\pdfrefxform\pdfrefform
-\else
- \pdflinkmargin1pt %
-\fi
+\pdflinkmargin1pt %
% \end{macrocode}
% First set up the default linking
% \begin{macrocode}
@@ -15463,7 +15403,7 @@
% is used by writing some clipped text.
% \begin{macrocode}
%<dviwindo>\def\literalps@out#1{\special{ps:#1}}%
-%<package>\providecommand*{\Hy@DistillerDestFix}{}
+%<packageEnd>\providecommand*{\Hy@DistillerDestFix}{}
%<*pdfmark|dviwindo>
\def\Hy@DistillerDestFix{%
\begingroup
@@ -19334,7 +19274,7 @@
% \end{macro}
% \begin{macrocode}
%</pdfform>
-%<*package>
+%<*packageEnd>
% \end{macrocode}
%
% \section{Bookmarks in the PDF file}
@@ -19354,7 +19294,7 @@
\Hy@MakeCurrentHrefAuto{section*}%
\Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
}
-%</package>
+%</packageEnd>
% \end{macrocode}
%
% \subsection{Bookmarks}
@@ -19827,6 +19767,8 @@
\hss
}%
}
+\@ifundefined{hyper@nopatch@sectioning}
+{
\let\H@old@ssect\@ssect
\def\@ssect#1#2#3#4#5{%
\Hy@MakeCurrentHrefAuto{section*}%
@@ -19922,6 +19864,7 @@
\H@old@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}%
}%
}
+}{}
% \end{macrocode}
% \begin{macrocode}
%</outlines|hypertex>
@@ -19944,61 +19887,6 @@
%</outlines>
% \end{macrocode}
%
-% \section{Compatibility with koma-script classes}
-%
-% \begin{macrocode}
-%<*outlines|hypertex>
-% \end{macrocode}
-%
-% Hard-wire in an unpleasant over-ride of komascript `scrbook' class
-% for Tobias Isenberg (\Email{Tobias.Isenberg@gmx.de}).
-% With version 6.71b the hack is also applied to `scrreprt' class
-% and is removed for koma-script versions since 2001/01/01,
-% because Markus Kohm supports hyperref in komascript.
-% \begin{macrocode}
-\def\Hy@tempa{%
- \def\@addchap[##1]##2{%
- \typeout{##2}%
- \if@twoside
- \@mkboth{##1}{}%
- \else
- \@mkboth{}{##1}%
- \fi
- \addtocontents{lof}{\protect\addvspace{10\p@}}%
- \addtocontents{lot}{\protect\addvspace{10\p@}}%
- \Hy@MakeCurrentHrefAuto{\Hy@chapapp*}%
- \Hy@raisedlink{%
- \hyper@anchorstart{\@currentHref}\hyper@anchorend
- }%
- \if@twocolumn
- \@topnewpage[\@makeschapterhead{##2}]%
- \else
- \@makeschapterhead{##2}%
- \@afterheading
- \fi
- \addcontentsline{toc}{chapter}{##1}%
- }%
-}
-\@ifclassloaded{scrbook}{%
- \@ifclasslater{scrbook}{2001/01/01}{%
- \let\Hy@tempa\@empty
- }{}%
-}{%
- \@ifclassloaded{scrreprt}{%
- \@ifclasslater{scrreprt}{2001/01/01}{%
- \let\Hy@tempa\@empty
- }{}%
- }{%
- \let\Hy@tempa\@empty
- }%
-}%
-\Hy@tempa
-% \end{macrocode}
-%
-% \begin{macrocode}
-%</outlines|hypertex>
-% \end{macrocode}
-%
% \section{Encoding definition files for encodings of PDF strings}
% This was contributed by
% Heiko Oberdiek.