[latex3-commits] [git/LaTeX3-latex3-pdfresources] testlinkstuff: more conversions (links for file) (92f59bb)
Ulrike Fischer
fischer at troubleshooting-tex.de
Sun Apr 14 00:45:29 CEST 2019
Repository : https://github.com/latex3/pdfresources
On branch : testlinkstuff
Link : https://github.com/latex3/pdfresources/commit/92f59bb34975a180f90beb1516cb03735b87e2db
>---------------------------------------------------------------
commit 92f59bb34975a180f90beb1516cb03735b87e2db
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date: Sun Apr 14 00:45:29 2019 +0200
more conversions (links for file)
>---------------------------------------------------------------
92f59bb34975a180f90beb1516cb03735b87e2db
hluatex-experimental.def | 71 ++++++++++++++++++++++++++--------------------
1 file changed, 40 insertions(+), 31 deletions(-)
diff --git a/hluatex-experimental.def b/hluatex-experimental.def
index 863344e..9376e5c 100644
--- a/hluatex-experimental.def
+++ b/hluatex-experimental.def
@@ -36,7 +36,17 @@
{ pdf }
{ startlink_url_attr }
{ /F }{ 4 } %
- \fi
+
+ \hook_put:nnnn
+ { pdf }
+ { startlink_link_attr }
+ { /F } { 4 }
+
+ \hook_put:nnnn
+ { pdf }
+ { startlink_file_attr }
+ { /F } { 4 }
+ \fi
}
%these are commands to fill various attributes (color, border style) in
% the hooks for links.
@@ -117,9 +127,7 @@
}
}
-\ifHy at pdfa
- \hook_put:nnnn { pdf } { startlink_link_attr }{ /F } { 4 }
-\fi
+
% for now we are updating the attribute manually after \hypersetup
% some better method must be found
\NewDocumentCommand\hypupdateattribute { }
@@ -581,6 +589,7 @@
\let\CurrentBorderColor\@linkbordercolor
\ExplSyntaxOn
+%% this command is used for \url
\def\hyper at linkurl#1#2{%#1:link text #2: URI,
\group_begin:
\Hy at pstringdef\Hy at pstringURI{#2}%
@@ -608,43 +617,42 @@
}
\ExplSyntaxOff
+\ExplSyntaxOn
+%file links (need to find out when exactly it is used ...)
\def\hyper at linkfile#1#2#3{% anchor text, filename, linkname
- \begingroup
+ \group_begin:
\def\Hy at pstringF{#2}%
\Hy at CleanupFile\Hy at pstringF
\Hy at pstringdef\Hy at pstringF\Hy at pstringF
- \Hy at pstringdef\Hy at pstringD{#3}%
+ \Hy at pstringdef\Hy at pstringD{#3}
\Hy at MakeRemoteAction
- \leavevmode
- \pdfstartlink
- attr{%
- \Hy at setpdfborder
- \Hy at setpdfhighlight
- \ifx\@filebordercolor\relax
- \else
- /C[\@filebordercolor]%
- \fi
- }%
- user {%
- /Subtype/Link%
- \ifHy at pdfa /F 4\fi
- /A<<%
- /F(\Hy at pstringF)%
- /S/GoToR%
+ \mode_leave_vertical:
+ \pdf_link_user:nnn { file }
+ {
+ /A<<
+ /F(\Hy at pstringF)
+ /S/GoToR
\Hy at SetNewWindow
- \ifx\\#3\\%
- /D[\Hy at href@page\@pdfremotestartview]%
+ \ifx\\#3\\
+ /D[\Hy at href@page\@pdfremotestartview]
\else
- /D(\Hy at pstringD)%
+ /D(\Hy at pstringD)
\fi
\Hy at href@nextactionraw
- >>%
- }%
- \relax
- \Hy at colorlink\@filecolor#1\Hy at xspace@end
- \close at pdflink
- \endgroup
+ >>
+ }
+ {
+ \Hy at colorlink
+ \@filecolor#1\Hy at xspace@end
+ \Hy at endcolorlink
+ \Hy at VerboseLinkStop
+ }
+ \group_end:
}
+\ExplSyntaxOff
+
+\ExplSyntaxOn
+% use by run links xxxxxxxxxxx
\def\@hyper at launch run:#1\\#2#3{% filename, anchor text linkname
\begingroup
\Hy at pstringdef\Hy at pstringF{#1}%
@@ -678,6 +686,7 @@
\close at pdflink
\endgroup
}
+\ExplSyntaxOff
\begingroup
\count@=\luatexversion
\divide\count@ by 100 %
More information about the latex3-commits
mailing list