[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: repair Acrobatmenu, process hyp keys for hyperxmp (f1f8e7e)

Ulrike Fischer fischer at troubleshooting-tex.de
Sat Jan 30 19:06:50 CET 2021


Repository : https://github.com/latex3/pdfresources
On branch  : reworking-annot
Link       : https://github.com/latex3/pdfresources/commit/f1f8e7e8a92d8cf524752482b4405535f55933c4

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

commit f1f8e7e8a92d8cf524752482b4405535f55933c4
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sat Jan 30 19:06:50 2021 +0100

    repair Acrobatmenu, process hyp keys for hyperxmp


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

f1f8e7e8a92d8cf524752482b4405535f55933c4
 hyperref-generic.dtx | 51 +++++++++++++++++++++++++++++++++++++++++----------
 info/key-list.tex    | 16 ++++++++--------
 2 files changed, 49 insertions(+), 18 deletions(-)

diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index f02ce18..e3061bc 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -280,12 +280,24 @@
 %
 %  Options that must be set as package options are
 %  \begin{itemize}
+%  \item |backref|
+%  \item |CJKbookmarks| this key should not be used anymore. At some time
+%  it will be removed.
 %  \item |destlabels|    (destination names are taken from \cs{label} if possible)
-%  \item |pdfpagelabels| (set PDF page labels)
-%  \item |implicit|      (redefine \LaTeX\ internals)
+%  \item |encap|
 %  \item |hyperfigures|  (according to the \pkg{hyperref} manual
 %  it makes figures hyper links, but actually is a no-op for most drivers, and it
 %  does nothing with this driver either.)
+%  \item |hyperfootnotes|
+%  \item |hyperindex|
+%  \item |implicit|      (redefine \LaTeX\ internals)
+%  \item |nesting| unneeded key, see comment below in \ref{sec:keydesc}. At some time
+%  it will be either removed or extended (if some use can be found).
+%  \item |pagebackref|
+%  \item |pdfpagelabels| (set PDF page labels)
+%  \item |psdextra| this loads some extra definitions used by \cs{pdfstringdef}.
+%  The new driver uses \cs{pdfstringdef} only for the bookmarks, for other strings
+%  it is not relevant.
 %  \end{itemize}
 %
 %  Options that can be set as package options are
@@ -481,7 +493,7 @@
 %  \end{itemize}
 %
 %
-%\section{Assorted key descriptions}
+%\section{Assorted key descriptions}\label{sec:keydesc}
 %The following gives a few details to some keys that are perhaps not
 %completly described in the manual, or are a bit different in this driver.
 %The list is alphabetic.
@@ -528,8 +540,11 @@
 % \end{verbatim}
 % Typically PDF viewer can handle only GoToR annotions pointing to a PDF.
 % So normally the default value |pdf| of this key should not be changed.
+% \DescribeHypkey{nesting}\label{key:nesting}%
+% This key is useless in PDF context. The boolean is only used in
+% the code for anchors/destination where nesting doesn't make sense.
+% It should not be changed.
 %
-
 %^^A %% This is an adapted version of hluatex.def
 %^^A %% meant to test the use of the commands
 %^^A %% from pdfmanagement.sty
@@ -737,8 +752,9 @@
     pdf~version~#2. Value~`#3'~is used instead.
   }
 %    \end{macrocode}
-% During development not all standard hyperref keys are known, this issues a warning
-% for now:
+% During development not all standard hyperref keys are known and the
+% Hyp-handler needs to process some new keys unknown to him.
+% This issues warnings for now:
 %    \begin{macrocode}
 \msg_new:nnn
   { hyp }
@@ -746,6 +762,12 @@
   {
     unknown~key~#2~of~module~’#1’~set~to~’#3’.
   }
+\msg_new:nnn
+  { hyp }
+  { unknown-key-to-Hyp }
+  {
+    ignored~in~family~Hyp~unknown~key~#1.
+  }
 %    \end{macrocode}
 % There are a lot choice keys. This defines messages which shows the valid
 % choices if a faulty one has been used:
@@ -845,16 +867,23 @@
 %    \begin{macrocode}
 \RenewDocumentCommand \Acrobatmenu { m m }
   {
-    \hyper at linknamed #1 #2
+    \hyper at linknamed {#1} {#2}
   }
 %    \end{macrocode}
 %
-% \cs{hypersetup} should set the new keys. As there are a number of new keys
-% which would error with the hyperref key family we do not execute
-% |\kvsetkeys{Hyp}|. This means the driver has to provide code for every key!
+% \cs{hypersetup} should set the new keys.
+% We for now also execute |\kvsetkeys{Hyp}| to avoid compability problems.
+% To avoid errors with the new keys a handler unknown keys is added.
+% But in the end only the new keyval should be used.
+% This means the driver has to provide new code for every key!
+%
 %    \begin{macrocode}
+%  TODO should go at some time ...
+\kv at set@family at handler{Hyp}
+  { \msg_warning:nnx {hyp}{unknown-key-to-Hyp}{#1} }
 \cs_set_protected:Npn \hypersetup #1
   {
+     \kvsetkeys{Hyp} {#1}
      \keys_set:nn { hyp / setup }{ #1 }
   }
 % TODO for now unknown keys should only give warnings.
@@ -3146,6 +3175,7 @@
                 \@@_text_pdfstring_info:nN {##1}\l_@@_tmpa_str
                 \pdfmanagement_add:nnx {Info}{#2}{\l_@@_tmpa_str}
               }
+             \tl_set:cn {@pdf#1}{##1}
           }
       }
     \keys_define:nn { hyp / info }
@@ -3160,6 +3190,7 @@
                 \@@_text_pdfstring_info:nN {##1}\l_@@_tmpa_str
                 \pdfmanagement_add:nnx {Info}{#2}{\l_@@_tmpa_str}
               }
+            \tl_set:cn {@pdf\str_lowercase:n{#1}}{##1}
           }
         ,unknown .code:n =
          {
diff --git a/info/key-list.tex b/info/key-list.tex
index 2bed6e6..090c35b 100644
--- a/info/key-list.tex
+++ b/info/key-list.tex
@@ -7,7 +7,7 @@ The following is a complete listing of available options for
 done    & allbordercolors    &                        & Set all border color options\\
 done    & allcolors          &                        & Set all color options (without border and field options)\\
 dropped & anchorcolor        & \textit{black}         & set color of anchors, ignored by most drivers. \\
-??      & backref            & \textit{false}         & do bibliographical back references \\
+done,package option      & backref            & \textit{false}         & do bibliographical back references \\
 done    & baseurl            & \textit{empty}         & set base URL for document \\
 done    & bookmarks          & \textit{true}          & make bookmarks \\
 done    & bookmarksnumbered  & \textit{false}         & put section numbers in bookmarks \\
@@ -15,7 +15,7 @@ done    & bookmarksopen      & \textit{false}         & open up bookmark tree \\
 done    & bookmarksopenlevel & \ttfamily\ci{maxdimen} & level to which bookmarks are open \\
 done    & bookmarkstype      & \textit{toc}           & to specify which `toc' file to mimic \\
 dropped & breaklinks         & \textit{false}         & allow links to break over lines \\
-?? & CJKbookmarks       & \textit{false}         & to produce CJK bookmarks\\
+done, don't touch & CJKbookmarks       & \textit{false}         & to produce CJK bookmarks\\
 done & citebordercolor    & \textit{0 1 0}         & color of border around cites \\
 done & citecolor          & \textit{green}         & color of citation links \\
 done & colorlinks         & \textit{false}         & color links \\
@@ -29,7 +29,7 @@ done   & draft              & \textit{false}         & do not do any hyperlinkin
 --     & dvips              &                        & use \textsf{dvips} backend \\
 --     & dvipsone           &                        & use \textsf{dvipsone} backend \\
 --     & dviwindo           &                        & use \textsf{dviwindo} backend \\
-??   &encap              &                        & to set encap character for hyperindex \\
+done, package option   &encap              &                        & to set encap character for hyperindex \\
 done  &extension          & \textit{dvi}           & suffix of linked files \\
 done &filebordercolor    & \textit{0 .5 .5}       & color of border around file links \\
 done &filecolor          & \textit{cyan}          & color of file links \\
@@ -37,8 +37,8 @@ done   &final              & \textit{true}          & opposite of option draft \
 dropped &frenchlinks        & \textit{false}         & use small caps instead of color for links \\
 done (ext) & hidelinks          &                        & Hide links (removing color and border) \\
 done,package option,no-op& hyperfigures       & \textit{false}         & make figures hyper links \\
-?? hyperfootnotes     & \textit{true}          & set up hyperlinked footnotes \\
-?? hyperindex         & \textit{true}          & set up hyperlinked indices \\
+done,package option & hyperfootnotes     & \textit{true}          & set up hyperlinked footnotes \\
+done, package option& hyperindex         & \textit{true}          & set up hyperlinked indices \\
 -- & hypertex           &                        & use \textsf{Hyper\TeX} backend \\
 done & hypertexnames      & \textit{true}          & use guessable names for links \\
 done,package option & implicit           & \textit{true}          & redefine \LaTeX\ internals \\
@@ -51,9 +51,9 @@ done & menubordercolor    & \textit{1 0 0}         & color of border around menu
 done & menucolor          & \textit{red}           & color for menu links \\
 -- & nativepdf          & \textit{false}         & an alias for \textsf{dvips} \\
 done & naturalnames       & \textit{false}         & use \LaTeX-computed names for links \\
-?? drop? & nesting            & \textit{false}         & allow nesting of links \\
+done, don't touch & nesting            & \textit{false}         & allow nesting of links \\
 done & pageanchor         & \textit{true}          & put an anchor on every page \\
-?? & pagebackref        & \textit{false}         & backreference by page number \\
+done,package option & pagebackref        & \textit{false}         & backreference by page number \\
 ?? hyperxmp? & pdfauthor          & \textit{empty}         & text for PDF Author field \\
 done (ext) & pdfborder          & \textit{0 0 1}         & width of PDF link border \\
                    & \textit{0 0 0}         & (\texttt{colorlinks)} \\
@@ -107,7 +107,7 @@ done & pdfviewclip        & \textit{empty}         & set /ViewClip of viewer pre
 done & pdfwindowui        & \textit{true}          & make PDF user interface elements visible \\
 done & plainpages         & \textit{false}         & do page number anchors as plain Arabic \\
 -- & ps2pdf             &                        & use \textsf{ps2pdf} backend \\
-psdextra           & \textit{false}         & define more short names for PDF string commands \\
+done,package option& psdextra           & \textit{false}         & define more short names for PDF string commands \\
 ignored & raiselinks         & \textit{false}         & raise up links (for \textsf{Hyper\TeX} backend) \\
 done & runbordercolor     & \textit{0 .7 .7}       & color of border around `run' links \\
 done & runcolor           & \textit{filecolor}     & color of `run' links\\





More information about the latex3-commits mailing list.