[latex3-commits] [git/LaTeX3-latex3-pdfresources] master: use keys without slash also in startlink (d7bf99a)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Mar 12 00:39:54 CET 2020


Repository : https://github.com/latex3/pdfresources
On branch  : master
Link       : https://github.com/latex3/pdfresources/commit/d7bf99a530991d742cf8d6710acc2eada8ec55e1

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

commit d7bf99a530991d742cf8d6710acc2eada8ec55e1
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu Mar 12 00:39:54 2020 +0100

    use keys without slash also in startlink


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

d7bf99a530991d742cf8d6710acc2eada8ec55e1
 hgeneric-experimental.def | 32 ++++++++++++------------
 pdfresources.dtx          | 62 ++++++++++++++++++++++-------------------------
 2 files changed, 45 insertions(+), 49 deletions(-)

diff --git a/hgeneric-experimental.def b/hgeneric-experimental.def
index 64fa13c..2ac7e8c 100644
--- a/hgeneric-experimental.def
+++ b/hgeneric-experimental.def
@@ -64,22 +64,22 @@
     \hook_put:nnnn
      { pdf }
      { link_begin_url_attr }
-     { /F }{ 4 } %
+     { F }{ 4 } %
 
     \hook_put:nnnn
      { pdf }
      { link_begin_link_attr }
-     { /F } { 4 }
+     { F } { 4 }
 
      \hook_put:nnnn
      { pdf }
      { link_begin_file_attr }
-     { /F } { 4 }
+     { F } { 4 }
 
      \hook_put:nnnn
      { pdf }
      { link_begin_menu_attr }
-     { /F } { 4 }
+     { F } { 4 }
    }
 }
 % variants of hyperref commands to get attributes in the prop
@@ -93,24 +93,24 @@
    {
     \tl_if_empty:NTF \@pdfborder
      {
-      \hook_remove:nnn { pdf } { link_begin_##1_attr } { /Border }
+      \hook_remove:nnn { pdf } { link_begin_##1_attr } { Border }
      }
      {
       \hook_put:nnnn
        { pdf }
        { link_begin_##1_attr }
-       { /Border }
+       { Border }
        { [\@pdfborder] }
      }
     \tl_if_empty:NTF \@pdfborderstyle
      {
-      \hook_remove:nnn  { pdf }{ link_begin_##1_attr } { /BS }
+      \hook_remove:nnn  { pdf }{ link_begin_##1_attr } { BS }
      }
      {
       \hook_put:nnnn
       { pdf }
       { link_begin_##1_attr }
-      { /BS }
+      { BS }
       { <<\@pdfborderstyle>> }
      }
    }
@@ -122,13 +122,13 @@
    {
     \tl_if_empty:NTF \@pdfhighlight
      {
-      \hook_remove:nnn { pdf } { link_begin_##1_attr }{ /H }
+      \hook_remove:nnn { pdf } { link_begin_##1_attr }{ H }
      }
      {
       \hook_put:nnnn
       { pdf }
       { link_begin_##1_attr }
-      { /H }
+      { H }
       { \@pdfhighlight }
      }
   }
@@ -143,11 +143,11 @@
      \hook_put:nnnn
       { pdf }
       { link_begin_##1_attr }
-      { /C }
+      { C }
       { [\tl_use:c {@##1bordercolor}] }
     }
     {
-     \hook_remove:nnn { pdf } { link_begin_##1_attr } { /C }
+     \hook_remove:nnn { pdf } { link_begin_##1_attr } { C }
     }
    }
   }
@@ -487,13 +487,13 @@
     \hook_put:nnnn
      { pdf }
      { link_begin_link_attr }
-     { /C }{ [\tl_use:c { @#1bordercolor }] } %do I need to expand?? seems not
+     { C }{ [\tl_use:c { @#1bordercolor }] } %do I need to expand?? seems not
    }
    {
     \hook_remove:nnn
      { pdf }
      { link_begin_link_attr }
-     { /C }
+     { C }
    }
   \find at pdflink{#1}{#2}% #1=color type
 }
@@ -514,13 +514,13 @@
     \hook_put:nnnn
      { pdf }
      { link_begin_link_attr }
-     { /C }{ [\tl_use:c { @#1bordercolor }] } %do I need to expand?? seems not
+     { C }{ [\tl_use:c { @#1bordercolor }] } %do I need to expand?? seems not
    }
    {
     \hook_remove:nnn
      { pdf }
      { link_begin_link_attr }
-     { /C }
+     { C }
    }
   \find at pdflink{#1}{#2}#3\Hy at xspace@end
   \close at EXPpdflink { link }
diff --git a/pdfresources.dtx b/pdfresources.dtx
index 332d798..1262ed3 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -2628,20 +2628,14 @@
     \@@_backend_annotation_last:
   }
 
-
-
-
+%    \end{macrocode}
 %
-%=====================
 % \subsection{Higher-level link management}
 % \subsubsection{Startlink}
-% packages like ocgx2 and tagpdf wants to add code to links/annotation created
-% by hyperref. So we need a generic command to start a pdflink which allows
+% Packages like hyperref, ocgx2 and tagpdf all wants to add code
+% to links/annotation. So we need a generic command to start a link which allows
 % packages to add their code to the \texttt{attr} argument through hooks.
-% % what is is for??
-%    \begin{macrocode}
-\cs_new:Nn \@@_get_key_value:nn { #1~#2~ } %name?????
-%    \end{macrocode}
+%
 % Attributes are stored in a property list. Packages can add attributes through
 % dedicated command. We assume that there will be different link types
 % (url, file, run, link, is a cite type needed??\ldots)
@@ -2676,7 +2670,7 @@
      {
       \prop_map_function:cN
        { l_@@_hook_link_begin_#1_attr_prop }
-       \@@_get_key_value:nn
+       \@@_dict_item:nn
       }
     }
     {
@@ -2704,7 +2698,7 @@
            {
              \prop_map_function:cN
                { l_@@_hook_link_begin_#1_attr_prop }
-               \@@_get_key_value:nn
+               \@@_dict_item:nn
            }
       }
       { #2 }
@@ -2719,18 +2713,17 @@
      }
    \exp_args:Nxx %xetex needs expansion
    \@@_backend_link_begin_goto:nnw
-    {
-     \prop_if_exist:cT { l_@@_hook_link_begin_#1_attr_prop }
-       {
-        \prop_map_function:cN
-        { l_@@_hook_link_begin_#1_attr_prop }
-        \@@_get_key_value:nn
-       }
-    }
+     {
+       \prop_if_exist:cT { l_@@_hook_link_begin_#1_attr_prop }
+         {
+           \prop_map_function:cN
+             { l_@@_hook_link_begin_#1_attr_prop }
+             \@@_dict_item:nn
+         }
+     }
     { #2 }
   }
 %    \end{macrocode}
-%% ??????????
 %    \begin{macrocode}
 \cs_set_eq:NN \pdf_link_margin:n \@@_backend_link_margin:n
 \cs_set_eq:NN \pdf_link_last: \@@_backend_link_last:
@@ -2749,13 +2742,13 @@
 \seq_new:N \l_@@_hook_link_end_menu_seq
 
 \cs_new_protected:Nn \pdf_link_end:n %#1 type, e.g. url
- {
-  \@@_backend_link_end:
-  \seq_if_exist:cT {l_@@_hook_link_end_#1_seq}
-   {
-    \seq_use:cn { l_@@_hook_link_end_#1_seq }{}
-   }
- }
+  {
+    \@@_backend_link_end:
+    \seq_if_exist:cT {l_@@_hook_link_end_#1_seq}
+      {
+        \seq_use:cn { l_@@_hook_link_end_#1_seq }{}
+      }
+  }
 
 %    \end{macrocode}
 % \subsection{Before the links}
@@ -2772,7 +2765,7 @@
 % \begin{NOTE}{UF}
 % I'm unsure about the backend code of the rectangle (FitR) variant. Should it
 % really typeset a box???
-% I'm also unsure if \cs{pdf_destination:nn} should really allow
+% I'm also unsure if \cs{pdf_destination:nn} should really allow both
 % a type and an integer as second argument. Perhaps a \cs{pdf_destination_zoom:nn}
 % would be better??
 % \end{NOTE}
@@ -2808,9 +2801,9 @@
 %   or an integer representing a  scale factor in percent.
 % \end{function}
 % \begin{function}[added = 2020-03-10]
-%   {\pdf_destination_fitr:nn}
+%   {\pdf_destination_box:nn}
 %   \begin{syntax}
-%     \cs{pdf_destination_fitr:nn} \Arg{name} \Arg {content}
+%     \cs{pdf_destination_box:nn} \Arg{name} \Arg {content}
 %   \end{syntax}
 %   This stores the content in a hbox, outputs the box and
 %   creates a destination with |FitR| type encompassing this box.
@@ -2852,9 +2845,9 @@
  }
 \cs_generate_variant:Nn\pdf_destination:nn {no,nf}
 
-\cs_new_protected:Npn \pdf_destination_fitr:nn #1 #2 %#1 name, #2 box content
+\cs_new_protected:Npn \pdf_destination_box:nn #1 #2 %#1 name, #2 box content
  {
-   \__pdf_backend_destination_rectangle:nn { #1 }{ #2 }
+   \__pdf_backend_destination_box:nn { #1 }{ #2 } %new name!!
  }
 
 %avoid that destinations names are optimized.
@@ -2869,6 +2862,9 @@
 % \section{Document metadata}
 % We plan a \cs{DeclareDocumentMetaData} so let's start with it.
 % It should allow to set the version, to uncompress a pdf, and set the language.
+% \begin{NOTE}{UF}
+% how to setup a backend/driver key? Can it be copied from expl3?
+% \end{NOTE}
 % \begin{function}[added=2019-08-25]{\DeclareDocumentMetaData}
 %    \begin{macrocode}
 \NewDocumentCommand\DeclareDocumentMetaData { m }





More information about the latex3-commits mailing list.