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.dtx81
1 files changed, 32 insertions, 49 deletions
diff --git a/macros/latex/contrib/hyperref/hyperref.dtx b/macros/latex/contrib/hyperref/hyperref.dtx
index 2c6347a623..8f6096d77d 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> [2024-01-20 v7.01h %
+%<!none&!packageEnd> [2024-05-23 v7.01i %
%<package> Hypertext links for LaTeX]
%<nohyperref> Dummy hyperref (SR)]
%<driver> Hyperref documentation driver file]
@@ -594,6 +594,7 @@
% change 2021-08-14: require expl3
% change 2023-11-26: no longer require pdftexcmds
% change 2023-11-26: no longer require expl3, we assume kernel is new enough.
+% change 2024-05-23: load stringenc always (for pdfx)
% \begin{macrocode}
\RequirePackage{iftex}[2019/10/24]
\RequirePackage{keyval}[1997/11/10]
@@ -601,9 +602,9 @@
\RequirePackage{kvdefinekeys}[2011/04/07]
\RequirePackage{pdfescape}[2007/11/11]
\RequirePackage{hycolor}
-\RequirePackage{auxhook}[2009/12/14]
\RequirePackage{nameref}[2012/07/28]
\RequirePackage{etoolbox}
+\RequirePackage{stringenc}[2009/12/15]%
\def\Hy@Error{\PackageError{hyperref}}
\def\Hy@Warning{\PackageWarning{hyperref}}
\def\Hy@WarningNoLine{\PackageWarningNoLine{hyperref}}
@@ -1864,30 +1865,27 @@
%
% \begin{macrocode}
\ifx\HyPsd@pdfencoding\HyPsd@pdfencoding@auto
- \@ifundefined{StringEncodingConvertTest}{%
- }{%
- \EdefUnescapeString\HyPsd@temp#1%
- \iftutex
- \let\HyPsd@UnescapedString\HyPsd@temp
- \StringEncodingConvertTest\HyPsd@temp\HyPsd@temp
- {utf16be}{ascii-print}{%
- \EdefEscapeString\HyPsd@temp\HyPsd@temp
- \global\let#1\HyPsd@temp
- \HyPsd@EscapeTeX#1%
- \Hy@unicodefalse
- }{%
- \HyPsd@EscapeTeX#1%
- }%
- \else
- \StringEncodingConvertTest\HyPsd@temp\HyPsd@temp
- {utf16be}{pdfdoc}{%
- \EdefEscapeString\HyPsd@temp\HyPsd@temp
- \global\let#1\HyPsd@temp
- \HyPsd@EscapeTeX#1%
- \Hy@unicodefalse
- }{}%
- \fi
- }%
+ \EdefUnescapeString\HyPsd@temp#1%
+ \iftutex
+ \let\HyPsd@UnescapedString\HyPsd@temp
+ \StringEncodingConvertTest\HyPsd@temp\HyPsd@temp
+ {utf16be}{ascii-print}{%
+ \EdefEscapeString\HyPsd@temp\HyPsd@temp
+ \global\let#1\HyPsd@temp
+ \HyPsd@EscapeTeX#1%
+ \Hy@unicodefalse
+ }{%
+ \HyPsd@EscapeTeX#1%
+ }%
+ \else
+ \StringEncodingConvertTest\HyPsd@temp\HyPsd@temp
+ {utf16be}{pdfdoc}{%
+ \EdefEscapeString\HyPsd@temp\HyPsd@temp
+ \global\let#1\HyPsd@temp
+ \HyPsd@EscapeTeX#1%
+ \Hy@unicodefalse
+ }{}%
+ \fi
\fi
\fi
% \end{macrocode}
@@ -4819,9 +4817,6 @@
\hypersetup{unicode}%
\ifHy@unicode
\def\HyPsd@pdfencoding{#1}%
- \ifx\HyPsd@pdfencoding\HyPsd@pdfencoding@auto
- \HyPsd@LoadStringEnc
- \fi
\else
\Hy@Warning{Cannot switch to unicode bookmarks}%
\let\HyPsd@pdfencoding\HyPsd@pdfencoding@pdfdoc
@@ -4844,22 +4839,6 @@
% \begin{macrocode}
\let\HyPsd@pdfencoding\HyPsd@pdfencoding@unicode
\HyPsd@LoadUnicode
-\def\HyPsd@LoadStringEnc{%
- \RequirePackage{stringenc}[2009/12/15]%
- \let\HyPsd@LoadStringEnc\relax
-}
-\Hy@AtBeginDocument{%
- \@ifpackageloaded{stringenc}{%
- \let\HyPsd@LoadStringEnc\relax
- }{%
- \def\HyPsd@LoadStringEnc{%
- \Hy@WarningNoLine{%
- Missing package `stringenc'. Use `pdfencoding=auto'\MessageBreak
- in the preamble or load the package there%
- }%
- }%
- }%
-}
% \end{macrocode}
%
% \begin{macrocode}
@@ -7414,7 +7393,8 @@
% command, you can use |#| and |%| unescaped, to produce themselves.
% even if, say, |#| is entered as |#| it will be converted to |\#|
% so it does not die if written to an aux file etc. |\#| will write
-% as |#| locally while making |\special|s.
+% as |#| locally while making |\special|s. The catcode |:| is set to other
+% to avoid problems with expl3 syntax.
% \begin{macrocode}
\begingroup
\endlinechar=-1 %
@@ -7427,6 +7407,7 @@
\catcode`\&\active
\gdef\hyper@normalise{^^A
\begingroup
+ \@makeother{:}^^A
\catcode`\^^M\active
\def^^M{ }^^A
\catcode`\%\active
@@ -10119,7 +10100,6 @@
\else
\let\HyPsd@pdfencoding\HyPsd@pdfencoding@auto
\fi
-\HyPsd@LoadStringEnc
\define@key{Hyp}{unicode}[true]{%
\Hy@boolkey{unicode}{#1}%
\ifHy@unicode
@@ -12035,14 +12015,17 @@
% The whole theorem business makes up new counters on the fly;
% we are going to intercept this. Sigh. Do it at the level where
% new counters are defined.
+% change 2024-02-14: use a csname to handle counter names with commands,
+% see issue \#330
% \begin{macrocode}
\@ifundefined{hyper@nopatch@counter}
{
\let\H@definecounter\@definecounter
\def\@definecounter#1{%
\H@definecounter{#1}%
- \expandafter\gdef\csname theH#1\endcsname{\arabic{#1}}%
- }
+ \expandafter
+ \gdef\csname theH#1\expandafter\endcsname\expandafter
+ {\expandafter\@arabic\csname c@#1\endcsname}}%
}{}
% \end{macrocode}
% But what if they have used the optional argument to e.g. |\newtheorem|