summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-01-21 21:42:42 +0000
committerKarl Berry <karl@freefriends.org>2020-01-21 21:42:42 +0000
commit7c390d3d29fcbe5f23638ba1a3143e9da3a4b52a (patch)
tree50a74a86e1aec1195a9cf0fc32d894c9f666b6c7 /Master/texmf-dist/source/latex/hyperref/hyperref.dtx
parent7062d8632ec7d062d8f94ed590771e4ece15bb04 (diff)
hyperref (21jan20)
git-svn-id: svn://tug.org/texlive/trunk@53481 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/hyperref/hyperref.dtx')
-rw-r--r--Master/texmf-dist/source/latex/hyperref/hyperref.dtx117
1 files changed, 78 insertions, 39 deletions
diff --git a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
index 0a1965bfd7f..67860c979c1 100644
--- a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
+++ b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
@@ -1,9 +1,10 @@
% \iffalse
-%% File: hyperref.dtx Copyright 1995-2001 Sebastian Rahtz,
-%% with portions written by David Carlisle and Heiko Oberdiek,
-%% 2001-2012 Heiko Oberdiek.
-%% 2016-2019 Oberdiek Package Suport Group
-%% 2019 LaTeX3 Project
+%% 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-2020 LaTeX3 Project
%% https://github.com/latex3/hyperref/issues
%%
%% This file is part of the `Hyperref Bundle'.
@@ -49,7 +50,7 @@
%<puvnenc>\ProvidesFile{puvnenc.def}
%<puarenc>\ProvidesFile{puarenc.def}
%<psdextra>\ProvidesFile{psdextra.def}
-%<!none> [2019/11/10 v7.00c %
+%<!none> [2020/01/14 v7.00d %
%<package> Hypertext links for LaTeX]
%<nohyperref> Dummy hyperref (SR)]
%<driver> Hyperref documentation driver file]
@@ -5280,22 +5281,43 @@
\@ifundefined{Hy@pdfversion@#1}{%
\PackageWarning{hyperref}{%
Unsupported PDF version `#1'.\MessageBreak
- Valid values: 1.2 until 1.9%
+ Valid values: 1.2-1.7, 2.0%
}%
}{%
\Hy@setpdfversiontrue
- \edef\Hy@pdfversion{\@nameuse{Hy@pdfversion@#1}}%
+ \@nameuse{Hy@pdfversion@#1}%
}%
}
-\@namedef{Hy@pdfversion@1.2}{2}%
-\@namedef{Hy@pdfversion@1.3}{3}%
-\@namedef{Hy@pdfversion@1.4}{4}%
-\@namedef{Hy@pdfversion@1.5}{5}%
-\@namedef{Hy@pdfversion@1.6}{6}%
-\@namedef{Hy@pdfversion@1.7}{7}%
-\@namedef{Hy@pdfversion@1.8}{8}%
-\@namedef{Hy@pdfversion@1.9}{9}%
-\def\Hy@pdfversion{5}
+% \end{macrocode}
+% \verb|\Hy@pdfminorversion| already used elsewhere to denote \verb|\pdfminorversion|
+% or \verb|\pdfvariable majorversion}| so introduce new names here.
+% \begin{macrocode}
+\@namedef{Hy@pdfversion@1.2}{\def\Hy@pdf@majorversion{1}\def\Hy@pdf@minorversion{2}}%
+\@namedef{Hy@pdfversion@1.3}{\def\Hy@pdf@majorversion{1}\def\Hy@pdf@minorversion{3}}%
+\@namedef{Hy@pdfversion@1.4}{\def\Hy@pdf@majorversion{1}\def\Hy@pdf@minorversion{4}}%
+\@namedef{Hy@pdfversion@1.5}{\def\Hy@pdf@majorversion{1}\def\Hy@pdf@minorversion{5}}%
+\@namedef{Hy@pdfversion@1.6}{\def\Hy@pdf@majorversion{1}\def\Hy@pdf@minorversion{6}}%
+\@namedef{Hy@pdfversion@1.7}{\def\Hy@pdf@majorversion{1}\def\Hy@pdf@minorversion{7}}%
+\@namedef{Hy@pdfversion@2.0}{\def\Hy@pdf@majorversion{2}\def\Hy@pdf@minorversion{0}}%
+\def\Hy@pdf@majorversion{1}\def\Hy@pdf@minorversion{5}
+% \end{macrocode}
+% Legacy name, earlier releases assumed 1.x
+% \begin{macrocode}
+\let\Hy@pdfversion\Hy@pdf@minorversion
+\def\Hy@pdf@majorminor@version{\numexpr100*\Hy@pdf@majorversion+\Hy@pdf@minorversion\relax}
+\def\Hy@pdfmajorminor@version{\numexpr100*\Hy@pdfmajorversion+\Hy@pdfminorversion\relax}
+% \end{macrocode}
+% if \verb|pdfminorversion| is defined, make sure \verb|pdfmajorversion| is too.
+% \begin{macrocode}
+\@ifundefined{pdfminorversion}{}{%
+\@ifundefined{pdfmajorversion}{%
+\newcount\pdfmajorversion
+\pdfmajorversion=1
+}{}%
+}
+\ifx\pdfmajorversion\@undefined\else
+\def\Hy@pdfmajorversion{\pdfmajorversion}
+\fi
% \end{macrocode}
%
% \section{Options for different drivers}\label{drivers}
@@ -7201,7 +7223,7 @@
%
% \begin{macrocode}
\ifHy@pdfa
- \ifnum \Hy@pdfversion < 4
+ \ifnum \Hy@pdf@majorminor@version< 104
\kvsetkeys{Hyp}{pdfversion=1.4}%
\fi
\Hy@DisableOption{pdfversion}%
@@ -7444,7 +7466,7 @@
\ifx\HyOpt@CustomDriver\ltx@empty
\ifx\Hy@driver\@empty
\def\HyOpt@DriverType{ (autodetected)}%
- \providecommand*{\Hy@defaultdriver}{hypertex}%
+ \providecommand*{\Hy@defaultdriver}{hdvips}%
\ifpdf
\ifx\pdfextension\@undefined
\def\Hy@driver{hpdftex}%
@@ -9124,7 +9146,7 @@
\kv@parse{#1}{%
\Hy@pdfstringdef\kv@key\kv@key
\ifx\kv@value\relax
- \ifnum\Hy@pdfversion<3 % implementation note 122, PDF spec 1.7
+ \ifnum\Hy@pdf@majorminor@version<103 % implementation note 122, PDF spec 1.7
\xdef\Fld@choices{\Fld@choices[(\kv@key)(\kv@key)]}%
\else
\xdef\Fld@choices{\Fld@choices(\kv@key)}%
@@ -13668,12 +13690,12 @@
}%
}{%
\ifHy@ocgcolorlinks
- \ifnum\Hy@pdfminorversion<5 %
+ \ifnum\Hy@pdfmajorminor@version<105 %
\kvsetkeys{Hyp}{pdfversion=1.5}%
\fi
\fi
\ifHy@setpdfversion
- \ifnum\Hy@pdfversion<5 %
+ \ifnum\Hy@pdf@majorminor@version<105 %
\ltx@IfUndefined{pdfobjcompresslevel}{%
}{%
\ifHy@verbose
@@ -13681,13 +13703,13 @@
PDF object streams are disabled, because they are%
\MessageBreak
not supported in requested PDF version %
- 1.\Hy@pdfversion
+ \Hy@pdf@majorversion.\Hy@pdf@minorversion
}%
\fi
\pdfobjcompresslevel=\ltx@zero
}%
\fi
- \ifnum\Hy@pdfminorversion=\Hy@pdfversion\relax
+ \ifnum\Hy@pdfmajorminor@version=\Hy@pdf@majorminor@version\relax
\else
\let\Hy@temp\ltx@empty
\def\Hy@temp@A#1#2{%
@@ -13710,10 +13732,11 @@
\Hy@temp@A\pdflastlink{link}%
}%
\ifx\Hy@temp\ltx@empty
- \Hy@pdfminorversion=\Hy@pdfversion\relax
+ \Hy@pdfmajorversion=\Hy@pdf@majorversion\relax
+ \Hy@pdfminorversion=\Hy@pdf@minorversion\relax
\else
\let\Hy@temp@A\ltx@empty
- \ifnum\Hy@pdfversion=4 %
+ \ifnum\Hy@pdf@majorminor@version=104 %
\IfFileExists{pdf14.sty}{%
\def\Hy@temp@A{%
\MessageBreak
@@ -13731,9 +13754,10 @@
The version should be set as early as possible:%
\MessageBreak
\space\space
- \expandafter\string\Hy@pdfminorversion=\Hy@pdfversion
+ \expandafter\string\Hy@pdfmajorversion=\Hy@pdf@majorversion, %
+ \expandafter\string\Hy@pdfminorversion=\Hy@pdf@minorversion
\string\relax
- \ifnum\Hy@pdfversion<5 %
+ \ifnum\Hy@pdf@majorminor@version<105 %
\ltx@ifundefined{pdfobjcompresslevel}{%
}{%
\MessageBreak
@@ -13746,11 +13770,13 @@
\fi
\fi
\PackageInfo{hyperref}{%
+ \expandafter\string\Hy@pdfmajorversion.%
\expandafter\string\Hy@pdfminorversion
- :=\number\Hy@pdfversion\space
+ :=\number\Hy@pdf@majorversion.\number\Hy@pdf@minorversion\space
}%
\fi
- \edef\Hy@pdfversion{\number\Hy@pdfminorversion}%
+ \edef\Hy@pdf@majorversion{\number\Hy@pdfmajorversion}%
+ \edef\Hy@pdf@minorversion{\number\Hy@pdfminorversion}%
}
\Hy@DisableOption{pdfversion}%
% \end{macrocode}
@@ -17218,18 +17244,31 @@
% \begin{macrocode}
/DvipsToPDF{72.27 mul Resolution div} def%
/PDFToDvips{72.27 div Resolution mul} def%
- /BPToDvips{72 div Resolution mul}def%
+ /BPToDvips{72 div Resolution mul}def
% \end{macrocode}
-% The values inside the /Boder array are not taken literally, but
+% The values inside the /Border array are not taken literally, but
% interpreted by ghostscript using the resolution of the dvi driver.
% I don't know how other distiller programs behaves in this manner.
+%
+% Note GhostScript changed its behaviour here and later versions do
+% not need this scaling, so test the PostScript interpreter is GhostScript
+% and if so check its version.
+%
+% If using gs and release $>$ 9.27 no-op, otherwise patch.
% \begin{macrocode}
- /BorderArrayPatch{%
- [exch{%
- dup dup type/integertype eq exch type/realtype eq or%
- {BPToDvips}if%
- }forall]%
- }def%
+ product (Ghostscript) search {pop pop pop revision 927 gt}%
+ {pop false} ifelse%
+ {%
+ /BorderArrayPatch{} def%
+ }%
+ {%
+ /BorderArrayPatch{%
+ [exch{%
+ dup dup type/integertype eq exch type/realtype eq or%
+ {BPToDvips}if%
+ }forall]%
+ }def%
+ } ifelse
% \end{macrocode}
% The rectangle around the links starts off
% \emph{exactly} the size of the box;
@@ -19788,7 +19827,7 @@
% \begin{macrocode}
\def\PDFForm@@Name#1{%
\begingroup
- \ifnum\Hy@pdfversion<5 % implementation note 117, PDF spec 1.7
+ \ifnum\Hy@pdf@majorminor@version<105 % implementation note 117, PDF spec 1.7
\ifHy@unicode
\Hy@unicodefalse
\fi