[latex3-commits] [git/LaTeX3-latex3-latex3] master: Generalise pdfmark function in dvips driver (0d5008a)

Joseph Wright joseph.wright at morningstar2.co.uk
Thu Apr 25 11:04:24 CEST 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/0d5008aacbd6e77a49b0abcabfe509b6cebe0e89

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

commit 0d5008aacbd6e77a49b0abcabfe509b6cebe0e89
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Thu Apr 25 10:04:24 2019 +0100

    Generalise pdfmark function in dvips driver


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

0d5008aacbd6e77a49b0abcabfe509b6cebe0e89
 l3kernel/l3drivers-pdf.dtx |   50 +++++++++++++++++++++++++-------------------
 1 file changed, 29 insertions(+), 21 deletions(-)

diff --git a/l3kernel/l3drivers-pdf.dtx b/l3kernel/l3drivers-pdf.dtx
index a1275e4..7580d71 100644
--- a/l3kernel/l3drivers-pdf.dtx
+++ b/l3kernel/l3drivers-pdf.dtx
@@ -82,6 +82,15 @@
 %<*dvips>
 %    \end{macrocode}
 %
+% \begin{macro}{\@@_pdfmark:n, \@@_pdfmark:x}
+%   Used often enough it should be a separate function.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_pdfmark:n #1
+  { \@@_postscript:n { mark #1 ~ pdfmark } }
+\cs_generate_variant:Nn \@@_pdfmark:n { x }
+%    \end{macrocode}
+% \end{macro}
+%
 % \subsubsection{Objects}
 %
 % \begin{variable}{\g_@@_pdf_object_int, \g_@@_pdf_object_prop}
@@ -123,9 +132,9 @@
 %    \begin{macrocode}
 \cs_new_protected:Npn \driver_pdf_object_write:nn #1#2
   {
-    \@@_postscript:x
+    \@@_pdfmark:x
       {
-        mark /_objdef ~ \driver_pdf_object_ref:n {#1}
+        /_objdef ~ \driver_pdf_object_ref:n {#1}
         /type
         \str_case_e:nn
           { \prop_item:Nn \g_@@_pdf_object_prop {#1} }
@@ -135,7 +144,7 @@
             { fstream } { /stream }
             { stream }  { /stream }
           }
-        /OBJ ~ pdfmark
+        /OBJ
       }
     \use:c
       { @@_pdf_object_write_ \prop_item:Nn \g_@@_pdf_object_prop {#1} :nn }
@@ -143,18 +152,18 @@
   }
 \cs_new_protected:Npn \@@_pdf_object_write_array:nn #1#2
   {
-    \@@_postscript:x
+    \@@_pdfmark:x
       {
-        mark ~ \driver_pdf_object_ref:n {#1}
-          [ ~ \exp_not:n {#2} ~ ] ~ /PUTINTERVAL ~ pdfmark
+        \driver_pdf_object_ref:n {#1}
+          [ ~ \exp_not:n {#2} ~ ] ~ /PUTINTERVAL
       }
   }
 \cs_new_protected:Npn \@@_pdf_object_write_dict:nn #1#2
   {
-    \@@_postscript:x
+    \@@_pdfmark:x
       {
-        mark ~ \driver_pdf_object_ref:n {#1}
-          << \exp_not:n {#2} >> /PUT ~ pdfmark
+        \driver_pdf_object_ref:n {#1}
+          << \exp_not:n {#2} >> /PUT
       }
   }
 \cs_new_protected:Npn \@@_pdf_object_write_stream:nn #1#2
@@ -672,13 +681,13 @@
     \@@_pdf_annotation:nnnn {#1} {#2} {#3} {#4}
     \int_gincr:N \g_@@_pdf_object_int
     \int_gset_eq:NN \g_@@_pdf_annotation_int \g_@@_pdf_object_int
-    \@@_postscript:x
+    \@@_pdfmark:x
       {
-          mark
-            /_objdef { driver.obj \int_use:N \g_@@_pdf_object_int }
-            driver.annotation.border ~
-            #4 ~
-            /ANN ~ pdfmark
+      
+        /_objdef { driver.obj \int_use:N \g_@@_pdf_object_int }
+        driver.annotation.border ~
+        #4 ~
+        /ANN
       }
   }
 \cs_new_protected:Npn \@@_pdf_annotation:nnnn #1#2#3#4
@@ -696,13 +705,12 @@
       }
     \int_gincr:N \g_@@_pdf_object_int
     \int_gset_eq:NN \g_@@_pdf_annotation_int \g_@@_pdf_object_int
-    \@@_postscript:x
+    \@@_pdfmark:x
       {
-        mark
-          /_objdef { driver.obj \int_use:N \g_@@_pdf_object_int }
-         driver.annotation.border ~
-          \c_@@_pdf_AR_fix_tl
-          /ANN ~ pdfmark
+        /_objdef { driver.obj \int_use:N \g_@@_pdf_object_int }
+        driver.annotation.border ~
+        \c_@@_pdf_AR_fix_tl
+        /ANN
       }
   }
 %    \end{macrocode}





More information about the latex3-commits mailing list