[latex3-commits] [git/LaTeX3-latex3-latex3] master: Driver should not add /Subtype /Link to user class (38ad731)

Joseph Wright joseph.wright at morningstar2.co.uk
Sun May 5 00:51:31 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/38ad73140cb8ce866325f00885aee68d4ef6add6

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

commit 38ad73140cb8ce866325f00885aee68d4ef6add6
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Sat May 4 23:51:31 2019 +0100

    Driver should not add /Subtype /Link to user class
    
    For goto, \pdfstartlink does add /Subtype /Link, so we
    need to do the same for other drivers.


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

38ad73140cb8ce866325f00885aee68d4ef6add6
 l3kernel/l3drivers-pdf.dtx |   12 ++++++------
 l3kernel/l3drivers.dtx     |    5 ++++-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/l3kernel/l3drivers-pdf.dtx b/l3kernel/l3drivers-pdf.dtx
index d754b7e..40b4be6 100644
--- a/l3kernel/l3drivers-pdf.dtx
+++ b/l3kernel/l3drivers-pdf.dtx
@@ -893,7 +893,7 @@
 %   approach and |\tex_savepos:D|. That plus format mode are still to re-examine.
 %    \begin{macrocode}
 \cs_new_protected:Npn \driver_pdf_link_begin_goto:nnw #1#2
-  { \@@_pdf_link_begin:nw { #1 /A << /S /GoTo /D ( #2 ) >> } }
+  { \@@_pdf_link_begin:nw { #1 /Subtype /Link /A << /S /GoTo /D ( #2 ) >> } }
 \cs_new_protected:Npn \driver_pdf_link_begin_user:nnw #1#2
   { \@@_pdf_link_begin:nw {#1#2} }
 \cs_new_protected:Npn \@@_pdf_link_begin:nw #1
@@ -906,7 +906,7 @@
     \bool_gset_true:N \g_@@_pdf_link_bool
     \@@_pdf_annotation:nnnn { 3pt } { 3pt } { 0pt } { }
     \@@_postscript:n
-      { /driver.link.dict ( /Subtype /Link #1 ) def }
+      { /driver.link.dict ( #1 ) def }
     \int_gincr:N \g_@@_pdf_object_int
     \int_gset_eq:NN \g_@@_pdf_link_int \g_@@_pdf_object_int
     \@@_postscript:x
@@ -964,7 +964,8 @@
     \@@_postscript:x
       {
         mark
-        \g_@@_pdf_link_dict_tl /Subtype /Link ~
+        \l_@@_breaklink_obj_tl
+        \g_@@_pdf_link_dict_tl \c_space_tl
         driver.rect
         /ANN ~ driver.pdfmark
       }
@@ -1255,7 +1256,7 @@
 \cs_new_protected:Npn \driver_pdf_link_begin_goto:nnw #1#2
   { \@@_pdf_link_begin:nnnw {#1} { goto~name } {#2} }
 \cs_new_protected:Npn \driver_pdf_link_begin_user:nnw #1#2
-  { \@@_pdf_link_begin:nnnw {#1} { user } { /Subtype /Link #2 } }
+  { \@@_pdf_link_begin:nnnw {#1} { user } {#2} }
 \cs_new_protected:Npx \@@_pdf_link_begin:nnnw #1#2#3
   {
     \@@_pdf_AR_fix:
@@ -1738,7 +1739,7 @@
 %   All created using the same internals.
 %    \begin{macrocode}
 \cs_new_protected:Npn \driver_pdf_link_begin_goto:nnw #1#2
-  { \@@_pdf_link_begin:n { #1 /A << /S /GoTo /D ( #2 ) >> } }
+  { \@@_pdf_link_begin:n { #1 /Subtype /Link /A << /S /GoTo /D ( #2 ) >> } }
 \cs_new_protected:Npn \driver_pdf_link_begin_user:nnw #1#2
   { \@@_pdf_link_begin:n {#1#2} }
 \cs_new_protected:Npn \@@_pdf_link_begin:n #1
@@ -1749,7 +1750,6 @@
          bann
          <<
            /Type /Annot
-           /Subtype /Link
            #1
          >>
       }
diff --git a/l3kernel/l3drivers.dtx b/l3kernel/l3drivers.dtx
index 04a7311..cdbd3f5 100644
--- a/l3kernel/l3drivers.dtx
+++ b/l3kernel/l3drivers.dtx
@@ -483,7 +483,7 @@
 %   and \meta{depth} and featuring the \meta{dictionary}.
 % \end{function}
 %
-% \begin{function}[added = 2019-04-17]
+% \begin{function}[added = 2019-04-17, updated = 2019-05-03]
 %   {
 %     \driver_pdf_link_begin_goto:nnw,
 %     \driver_pdf_link_begin_user:nnw,
@@ -502,6 +502,9 @@
 %   \TeX{} \meta{content}. The |begin| and |end| functions must be given
 %   at the same box level. Depending upon the back-end in use, the
 %   \meta{content} may be placed in a hbox as part of processing.
+%   The |goto| type will automatically add |/Subtype /Link| to the PDF
+%   dictionary for the annotation produced; other classes do not add
+%   this, so the |/Subtype| must be provided as part of the \meta{action}.
 % \end{function}
 %
 % \begin{function}[EXP, added = 2019-04-09]{\driver_pdf_link_last:}





More information about the latex3-commits mailing list