[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: enabling link tagging in toc (\hyper at linkstart) (1de986a)

Ulrike Fischer fischer at troubleshooting-tex.de
Sat Apr 6 18:55:53 CEST 2019


Repository : https://github.com/latex3/pdfresources
On branch  : testlinkstuff
Link       : https://github.com/latex3/pdfresources/commit/1de986a568a4050613945c4dd6f855c978ef8655

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

commit 1de986a568a4050613945c4dd6f855c978ef8655
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Sat Apr 6 18:55:53 2019 +0200

    enabling link tagging in toc (\hyper at linkstart)


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

1de986a568a4050613945c4dd6f855c978ef8655
 hluatex-experimental.def |   36 ++++++++++++++++++++++++++----------
 pdfresources.dtx         |   11 +++++++----
 2 files changed, 33 insertions(+), 14 deletions(-)

diff --git a/hluatex-experimental.def b/hluatex-experimental.def
index bf2dbfc..b102a3f 100644
--- a/hluatex-experimental.def
+++ b/hluatex-experimental.def
@@ -6,7 +6,7 @@
 %%
 
 \ProvidesFile{hluatex-experimental.def}
-  [2019/03/09 v0.1 %
+  [2019/04/06 v0.2 %
   Hyperref driver for luaTeX]
 %%\Hy at VersionCheck{hluatex.def}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -496,17 +496,33 @@
   \pdf at endanchor
   \Hy at activeanchorfalse
 }
+
+\ExplSyntaxOn
+% #1 is for the color only: found {cite} and {link}
+% #2 is the destination find at pdflink uses than named link
 \def\hyper at linkstart#1#2{%
-  \Hy at VerboseLinkStart{#1}{#2}%
-  \ltx at IfUndefined{@#1bordercolor}{%
-    \let\CurrentBorderColor\relax
-  }{%
-    \edef\CurrentBorderColor{\csname @#1bordercolor\endcsname}%
-  }%
-  \find at pdflink{#1}{#2}%
+  \Hy at VerboseLinkStart{#1}{#2}% only for debug
+  \tl_if_exist:cTF  %or test for blank??
+   { @#1bordercolor }
+   {
+    \hook_put:nnnn
+     { pdf }
+     { startlink_link_attr }
+     { /C }{ [\tl_use:c { @#1bordercolor }] } %do I need to expand?? seems not
+   }
+   {
+    \hook_remove:nnn
+     { pdf }
+     { startlink_link_attr }
+     { /C }
+   }
+  \find at pdflink{#1}{#2}% #1=color type
 }
-\def\hyper at linkend{\close at pdflink}
-\ExplSyntaxOn
+
+% the endlink muss have the same type as the start?
+% probably always link works
+\def\hyper at linkend{\close at EXPpdflink { link }}
+
 \def\hyper at link#1#2#3{%
   \Hy at VerboseLinkStart{#1}{#2}%
   \tl_if_exist:cTF
diff --git a/pdfresources.dtx b/pdfresources.dtx
index eb4b4c2..1998e31 100644
--- a/pdfresources.dtx
+++ b/pdfresources.dtx
@@ -184,10 +184,11 @@
 % So we need a generic command to start a pdflink which allows packages to add
 % their code to the \texttt{attr} argument through hooks.
 %    \begin{macrocode}
-\cs_new:Nn \pdf__get_key_value:nn { #1~#2~ } %name?????
+\cs_new:Nn \__pdf_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, \ldots)
+% dedicated command. We assume that there will be different link types
+% (url, file, run, link, is a cite type needed??\ldots)
 % and that they should have their own attribute list.
 % Probably we will need some commands to fill more than one prop ...
 %
@@ -199,6 +200,7 @@
 %    \end{macrocode}
 %
 % High-level startlink commands that uses the stored attributes:
+% At first one with the \texttt{user} argument:
 %    \begin{macrocode}
 \cs_new_protected:Nn \pdf_startlink_user:nn %#1 type, #2 action spec
 {
@@ -207,11 +209,12 @@
   {
     \prop_map_function:cN
      { l__pdf_hook_startlink_#1_attr_prop }
-     \pdf__get_key_value:nn
+     \__pdf_get_key_value:nn
   }
   { #2 }
 }
 
+% At second one with the \texttt{goto name} argument:
 \cs_new_protected:Nn \pdf_startlink_goto_name:nn %#1 type, #2 destination
 {
  \seq_use:cn { l__pdf_hook_startlink_#1_seq }{}
@@ -219,7 +222,7 @@
   {
     \prop_map_function:cN
      { l__pdf_hook_startlink_#1_attr_prop }
-     \pdf__get_key_value:nn
+     \__pdf_get_key_value:nn
   }
   { #2 }
 }





More information about the latex3-commits mailing list