[latex3-commits] [git/LaTeX3-latex3-hyperref] testnewkeyval: pdfversion key (0e02114)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon Jul 4 19:12:20 CEST 2022


Repository : https://github.com/latex3/hyperref
On branch  : testnewkeyval
Link       : https://github.com/latex3/hyperref/commit/0e02114edf75cb0063dd937ad5fdae3dcaec4ae9

>---------------------------------------------------------------

commit 0e02114edf75cb0063dd937ad5fdae3dcaec4ae9
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon Jul 4 19:12:20 2022 +0200

    pdfversion key


>---------------------------------------------------------------

0e02114edf75cb0063dd937ad5fdae3dcaec4ae9
 hyperref.dtx | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/hyperref.dtx b/hyperref.dtx
index 18f4b53..78aa9b6 100644
--- a/hyperref.dtx
+++ b/hyperref.dtx
@@ -5022,27 +5022,29 @@
   \Hy at boolkey{psdextra}{#1}%
   \HyPsd at LoadExtra
 }
+
 \DeclareKeys
  {
    ,psdextra .choice:
    ,psdextra / true .code:n =
      {
-       \legacy_if_set_true:n {Hy at psdextra}
+       \Hy at psdextratrue
        \HyPsd at LoadExtra
      }
    ,psdextra / false .code:n =
      {
-       \legacy_if_set_false:n {Hy at psdextra}
+       \Hy at psdextrafalse
      }
    ,psdextra .default:n = true
  }
+
 %    \end{macrocode}
 %
 %    \begin{macrocode}
 \def\hypersetup{\kvsetkeys{Hyp}}
 \def\hypersetup{\SetKeys[hyperref]}
 %    \end{macrocode}
-%
+% TODO: check if the version can be set with the backend (it must have been loaded)
 %    \begin{macrocode}
 \newif\ifHy at setpdfversion
 \define at key{Hyp}{pdfversion}{%
@@ -5056,6 +5058,21 @@
     \@nameuse{Hy at pdfversion@#1}%
   }%
 }
+\DeclareKeys
+ {
+   ,pdfversion .choices:nn = { 1.2,1.3,1.4,1.5,1.6,1.7,2.0 }
+    {
+      \Hy at setpdfversiontrue
+      \@nameuse{Hy at pdfversion@#1}%
+    }
+   ,pdfversion / unknown .code:n =
+    {
+      \PackageWarning{hyperref}{%
+      Unsupported PDF version `#1'.\MessageBreak
+      Valid values: 1.2-1.7, 2.0}
+    }
+   ,pdfversion .usage:n = {preamble}
+ }
 %    \end{macrocode}
 % \verb|\Hy at pdfminorversion| already used elsewhere to denote \verb|\pdfminorversion|
 % or \verb|\pdfvariable majorversion}| so introduce new names here.





More information about the latex3-commits mailing list.