[latex3-commits] [git/LaTeX3-latex3-latex3] master: Grab link content at the driver level (e1b1d24)
Joseph Wright
joseph.wright at morningstar2.co.uk
Wed Apr 10 19:09:25 CEST 2019
Repository : https://github.com/latex3/latex3
On branch : master
Link : https://github.com/latex3/latex3/commit/e1b1d243e63fddb38febd04167ffa7d0cd1727da
>---------------------------------------------------------------
commit e1b1d243e63fddb38febd04167ffa7d0cd1727da
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Wed Apr 10 18:09:25 2019 +0100
Grab link content at the driver level
We will need this for dvips, and it seems to fit OK with
almost all existing code. See breakurl and hypdvips for
ideas on allowing breaks.
>---------------------------------------------------------------
e1b1d243e63fddb38febd04167ffa7d0cd1727da
l3kernel/l3drivers-pdf.dtx | 51 ++++++++++++-------------------
l3kernel/l3drivers.dtx | 12 +++-----
l3kernel/testfiles/m3expl001.luatex.tlg | 7 ++---
l3kernel/testfiles/m3expl001.ptex.tlg | 7 ++---
l3kernel/testfiles/m3expl001.tlg | 7 ++---
l3kernel/testfiles/m3expl001.uptex.tlg | 7 ++---
l3kernel/testfiles/m3expl001.xetex.tlg | 7 ++---
l3kernel/testfiles/m3expl003.luatex.tlg | 7 ++---
l3kernel/testfiles/m3expl003.ptex.tlg | 7 ++---
l3kernel/testfiles/m3expl003.tlg | 7 ++---
l3kernel/testfiles/m3expl003.uptex.tlg | 7 ++---
l3kernel/testfiles/m3expl003.xetex.tlg | 7 ++---
12 files changed, 54 insertions(+), 79 deletions(-)
diff --git a/l3kernel/l3drivers-pdf.dtx b/l3kernel/l3drivers-pdf.dtx
index e1c18f7..f4aad03 100644
--- a/l3kernel/l3drivers-pdf.dtx
+++ b/l3kernel/l3drivers-pdf.dtx
@@ -196,15 +196,15 @@
%
% \subsubsection{Annotations}
%
-% \begin{macro}{\driver_pdf_link_begin_goto:nn, \driver_pdf_link_begin_user:nn}
-% \begin{macro}{\@@_pdf_link_begin:nnn}
+% \begin{macro}{\driver_pdf_link_goto:nnn, \driver_pdf_link_user:nnn}
+% \begin{macro}{\@@_pdf_link:nnnn}
% Links are all created using the same internals.
% \begin{macrocode}
-\cs_new_protected:Npn \driver_pdf_link_begin_goto:nn #1#2
- { \@@_pdf_link_begin:nnn {#1} { goto~name } {#2} }
-\cs_new_protected:Npn \driver_pdf_link_begin_user:nn #1#2
- { \@@_pdf_link_begin:nnn {#1} { user } {#2} }
-\cs_new_protected:Npx \@@_pdf_link_begin:nnn #1#2#3
+\cs_new_protected:Npn \driver_pdf_link_goto:nnn #1#2#3
+ { \@@_pdf_link_begin:nnnn {#1} { goto~name } {#2} {#3} }
+\cs_new_protected:Npn \driver_pdf_link_user:nn #1#2#3
+ { \@@_pdf_link_begin:nnnn {#1} { user } {#2} {#3} }
+\cs_new_protected:Npx \@@_pdf_link_begin:nnnn #1#2#3#4
{
\cs_if_exist:NTF \tex_pdfextension:D
{ \tex_pdfextension:D startlink ~ }
@@ -212,22 +212,14 @@
attr {#1}
\exp_not:N \tl_if_blank:nF {#2}
{ ~ #2 {#3} }
- }
-% \end{macrocode}
-% \end{macro}
-% \end{macro}
-%
-% \begin{macro}{\driver_pdf_link_end:}
-% Ending a link is easy.
-% \begin{macrocode}
-\cs_new_protected:Npx \driver_pdf_link_end:
- {
+ #4
\cs_if_exist:NTF \tex_pdfextension:D
- { \tex_pdfextension:D endlink }
+ { \tex_pdfextension:D endlink \scan_stop: }
{ \tex_pdfendlink:D }
}
% \end{macrocode}
% \end{macro}
+% \end{macro}
%
% \begin{macro}{\driver_pdf_link_last:}
% Formatted for direct use.
@@ -386,14 +378,14 @@
%
% \subsubsection{Annotations}
%
-% \begin{macro}{\driver_pdf_link_begin_goto:nn, \driver_pdf_link_begin_user:nn}
-% \begin{macro}{\@@_pdf_link_begin:nnn}
+% \begin{macro}{\driver_pdf_link_goto:nnn, \driver_pdf_link_user:nnn}
+% \begin{macro}{\@@_pdf_link_begin:nnnn}
% \begin{macrocode}
-\cs_new_protected:Npn \driver_pdf_link_begin_goto:nn #1#2
- { \@@_pdf_startlink:nnn {#1} { /GoTo } {#2} }
-\cs_new_protected:Npn \driver_pdf_link_begin_user:nn #1#2
- { \@@_pdf_startlink:nnn {#1} { } {#2} }
-\cs_new_protected:Npn \@@_pdf_link_begin:nnn #1#2#3
+\cs_new_protected:Npn \driver_pdf_link_goto:nnn #1#2#3
+ { \@@_pdf_startlink:nnn {#1} { /GoTo } {#2} {#3} }
+\cs_new_protected:Npn \driver_pdf_link_user:nnn #1#2#3
+ { \@@_pdf_startlink:nnn {#1} { } {#2} {#3} }
+\cs_new_protected:Npn \@@_pdf_link_begin:nnnn #1#2#3#4
{
\@@_pdf:n
{
@@ -404,18 +396,13 @@
#1 ~ #2 ~ #3
>>
}
+ #4
+ \@@_pdf:n { eann }
}
% \end{macrocode}
% \end{macro}
% \end{macro}
%
-% \begin{macro}{\driver_pdf_link_end:}
-% \begin{macrocode}
-\cs_new_protected:Npx \driver_pdf_link_end:
- { \@@_pdf:n { eann } }
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\driver_pdf_link_last:}
% Data not available.
% \begin{macrocode}
diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index e47dacb..ba8716e 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -473,15 +473,14 @@
%
% \subsection{PDF Annotations}
%
-% \begin{function}[added = 2019-04-09]
-% {\driver_pdf_link_begin_goto:nn, \driver_pdf_link_begin_user:nn, \driver_pdf_link_end:}
+% \begin{function}[added = 2019-04-10]
+% {\driver_pdf_link_goto:nnn, \driver_pdf_link_user:nnn}
% \begin{syntax}
-% \cs{driver_pdf_link_begin_user:nn} \Arg{attributes} \Arg{target}
-% \meta{content}
-% \cs{driver_pdf_link_end:}
+% \cs{driver_pdf_link_user:nnn} \Arg{attributes} \Arg{target} \Arg{content}
% \end{syntax}
% Creates a link of the \meta{type} |goto| or |user| with the given
-% \meta{attributes} and point toward the \meta{target}.
+% \meta{attributes}, points toward the \meta{target} and surround the
+% \TeX{} \meta{content}.
% \end{function}
%
% \begin{function}[EXP, added = 2019-04-09]{\driver_pdf_link_last:}
@@ -491,7 +490,6 @@
% Expands to the object reference
% \end{function}
%
-%
% \subsection{PDF Objects}
%
% Objects are used to provide a range of data structures in a PDF. At the
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index ce69c5a..63e2be6 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -6462,10 +6462,9 @@ Defining \__driver_image_getbb_auxii:n on line ...
Defining \__driver_image_include_jpg:n on line ...
Defining \__driver_image_include_pdf:n on line ...
Defining \__driver_image_include_png:n on line ...
-Defining \driver_pdf_link_begin_goto:nn on line ...
-Defining \driver_pdf_link_begin_user:nn on line ...
-Defining \__driver_pdf_link_begin:nnn on line ...
-Defining \driver_pdf_link_end: on line ...
+Defining \driver_pdf_link_goto:nnn on line ...
+Defining \driver_pdf_link_user:nn on line ...
+Defining \__driver_pdf_link_begin:nnnn on line ...
Defining \driver_pdf_link_last: on line ...
Defining \g__driver_pdf_object_prop on line ...
Defining \driver_pdf_object_new:nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 6964886..c0bb2df 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -6506,10 +6506,9 @@ Defining \__driver_image_include_auxii:xnn on line ..
Defining \__driver_image_include_auxiii:nnn on line ...
Defining \__driver_pdf:n on line ...
Defining \__driver_pdf:x on line ...
-Defining \driver_pdf_link_begin_goto:nn on line ...
-Defining \driver_pdf_link_begin_user:nn on line ...
-Defining \__driver_pdf_link_begin:nnn on line ...
-Defining \driver_pdf_link_end: on line ...
+Defining \driver_pdf_link_goto:nnn on line ...
+Defining \driver_pdf_link_user:nnn on line ...
+Defining \__driver_pdf_link_begin:nnnn on line ...
Defining \driver_pdf_link_last: on line ...
Defining \g__driver_pdf_object_int on line ...
\g__driver_pdf_object_int=\count...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 018a409..1ac9e60 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -6803,10 +6803,9 @@ Defining \__driver_image_getbb_auxii:n on line ...
Defining \__driver_image_include_jpg:n on line ...
Defining \__driver_image_include_pdf:n on line ...
Defining \__driver_image_include_png:n on line ...
-Defining \driver_pdf_link_begin_goto:nn on line ...
-Defining \driver_pdf_link_begin_user:nn on line ...
-Defining \__driver_pdf_link_begin:nnn on line ...
-Defining \driver_pdf_link_end: on line ...
+Defining \driver_pdf_link_goto:nnn on line ...
+Defining \driver_pdf_link_user:nn on line ...
+Defining \__driver_pdf_link_begin:nnnn on line ...
Defining \driver_pdf_link_last: on line ...
Defining \g__driver_pdf_object_prop on line ...
Defining \driver_pdf_object_new:nn on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index a063685..6836d15 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -6803,10 +6803,9 @@ Defining \__driver_image_include_auxii:xnn on line ..
Defining \__driver_image_include_auxiii:nnn on line ...
Defining \__driver_pdf:n on line ...
Defining \__driver_pdf:x on line ...
-Defining \driver_pdf_link_begin_goto:nn on line ...
-Defining \driver_pdf_link_begin_user:nn on line ...
-Defining \__driver_pdf_link_begin:nnn on line ...
-Defining \driver_pdf_link_end: on line ...
+Defining \driver_pdf_link_goto:nnn on line ...
+Defining \driver_pdf_link_user:nnn on line ...
+Defining \__driver_pdf_link_begin:nnnn on line ...
Defining \driver_pdf_link_last: on line ...
Defining \g__driver_pdf_object_int on line ...
\g__driver_pdf_object_int=\count...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index b7cbc90..5fcca35 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -6482,10 +6482,9 @@ Defining \__driver_image_getbb_pagebox:w on line ...
Defining \__driver_image_include_pdf:n on line ...
Defining \__driver_pdf:n on line ...
Defining \__driver_pdf:x on line ...
-Defining \driver_pdf_link_begin_goto:nn on line ...
-Defining \driver_pdf_link_begin_user:nn on line ...
-Defining \__driver_pdf_link_begin:nnn on line ...
-Defining \driver_pdf_link_end: on line ...
+Defining \driver_pdf_link_goto:nnn on line ...
+Defining \driver_pdf_link_user:nnn on line ...
+Defining \__driver_pdf_link_begin:nnnn on line ...
Defining \driver_pdf_link_last: on line ...
Defining \g__driver_pdf_object_int on line ...
\g__driver_pdf_object_int=\count...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index ce69c5a..63e2be6 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -6462,10 +6462,9 @@ Defining \__driver_image_getbb_auxii:n on line ...
Defining \__driver_image_include_jpg:n on line ...
Defining \__driver_image_include_pdf:n on line ...
Defining \__driver_image_include_png:n on line ...
-Defining \driver_pdf_link_begin_goto:nn on line ...
-Defining \driver_pdf_link_begin_user:nn on line ...
-Defining \__driver_pdf_link_begin:nnn on line ...
-Defining \driver_pdf_link_end: on line ...
+Defining \driver_pdf_link_goto:nnn on line ...
+Defining \driver_pdf_link_user:nn on line ...
+Defining \__driver_pdf_link_begin:nnnn on line ...
Defining \driver_pdf_link_last: on line ...
Defining \g__driver_pdf_object_prop on line ...
Defining \driver_pdf_object_new:nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 6964886..c0bb2df 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -6506,10 +6506,9 @@ Defining \__driver_image_include_auxii:xnn on line ..
Defining \__driver_image_include_auxiii:nnn on line ...
Defining \__driver_pdf:n on line ...
Defining \__driver_pdf:x on line ...
-Defining \driver_pdf_link_begin_goto:nn on line ...
-Defining \driver_pdf_link_begin_user:nn on line ...
-Defining \__driver_pdf_link_begin:nnn on line ...
-Defining \driver_pdf_link_end: on line ...
+Defining \driver_pdf_link_goto:nnn on line ...
+Defining \driver_pdf_link_user:nnn on line ...
+Defining \__driver_pdf_link_begin:nnnn on line ...
Defining \driver_pdf_link_last: on line ...
Defining \g__driver_pdf_object_int on line ...
\g__driver_pdf_object_int=\count...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 018a409..1ac9e60 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -6803,10 +6803,9 @@ Defining \__driver_image_getbb_auxii:n on line ...
Defining \__driver_image_include_jpg:n on line ...
Defining \__driver_image_include_pdf:n on line ...
Defining \__driver_image_include_png:n on line ...
-Defining \driver_pdf_link_begin_goto:nn on line ...
-Defining \driver_pdf_link_begin_user:nn on line ...
-Defining \__driver_pdf_link_begin:nnn on line ...
-Defining \driver_pdf_link_end: on line ...
+Defining \driver_pdf_link_goto:nnn on line ...
+Defining \driver_pdf_link_user:nn on line ...
+Defining \__driver_pdf_link_begin:nnnn on line ...
Defining \driver_pdf_link_last: on line ...
Defining \g__driver_pdf_object_prop on line ...
Defining \driver_pdf_object_new:nn on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index a063685..6836d15 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -6803,10 +6803,9 @@ Defining \__driver_image_include_auxii:xnn on line ..
Defining \__driver_image_include_auxiii:nnn on line ...
Defining \__driver_pdf:n on line ...
Defining \__driver_pdf:x on line ...
-Defining \driver_pdf_link_begin_goto:nn on line ...
-Defining \driver_pdf_link_begin_user:nn on line ...
-Defining \__driver_pdf_link_begin:nnn on line ...
-Defining \driver_pdf_link_end: on line ...
+Defining \driver_pdf_link_goto:nnn on line ...
+Defining \driver_pdf_link_user:nnn on line ...
+Defining \__driver_pdf_link_begin:nnnn on line ...
Defining \driver_pdf_link_last: on line ...
Defining \g__driver_pdf_object_int on line ...
\g__driver_pdf_object_int=\count...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index b7cbc90..5fcca35 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -6482,10 +6482,9 @@ Defining \__driver_image_getbb_pagebox:w on line ...
Defining \__driver_image_include_pdf:n on line ...
Defining \__driver_pdf:n on line ...
Defining \__driver_pdf:x on line ...
-Defining \driver_pdf_link_begin_goto:nn on line ...
-Defining \driver_pdf_link_begin_user:nn on line ...
-Defining \__driver_pdf_link_begin:nnn on line ...
-Defining \driver_pdf_link_end: on line ...
+Defining \driver_pdf_link_goto:nnn on line ...
+Defining \driver_pdf_link_user:nnn on line ...
+Defining \__driver_pdf_link_begin:nnnn on line ...
Defining \driver_pdf_link_last: on line ...
Defining \g__driver_pdf_object_int on line ...
\g__driver_pdf_object_int=\count...
More information about the latex3-commits
mailing list