[latex3-commits] [git/LaTeX3-latex3-pdfresources] reworking-annot: switch to new shipout hooks (d9693aa)

Ulrike Fischer fischer at troubleshooting-tex.de
Mon Jan 18 19:25:41 CET 2021


Repository : https://github.com/latex3/pdfresources
On branch  : reworking-annot
Link       : https://github.com/latex3/pdfresources/commit/d9693aad97874c33587c8f39cfc75e201901630f

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

commit d9693aad97874c33587c8f39cfc75e201901630f
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Mon Jan 18 19:25:41 2021 +0100

    switch to new shipout hooks


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

d9693aad97874c33587c8f39cfc75e201901630f
 l3backend-pdf-extra.dtx | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/l3backend-pdf-extra.dtx b/l3backend-pdf-extra.dtx
index 2c59bbc..d0c5f8d 100644
--- a/l3backend-pdf-extra.dtx
+++ b/l3backend-pdf-extra.dtx
@@ -150,17 +150,42 @@
 %    \end{macrocode}
 % \subsubsection{Add the \enquote{shipout} hooks}
 % Now we add to the shipout hooks the relevant token lists.
+% We also push the page resources in shipout/firstpage (AtBeginDvi)
+% as the backend code sets color stack there. The xetex driver needs a rule here.
+% If it clashes on the first page, we will need a test ...
 %    \begin{macrocode}
 %<*drivers>
-\hook_gput_code:nnn{shipout/background}{pdf}
+\tl_if_exist:NTF \@kernel at after@shipout at background
   {
-    \hook_use:n {pdf/management/thispage_shipout}
+    \g at addto@macro \@kernel at before@shipout at background{\relax}
+    \g at addto@macro \@kernel at after@shipout at background
+      {
+        \hook_use:n {pdf/management/thispage_shipout}
+      }
+    \g at addto@macro \@kernel at after@shipout at lastpage
+      {
+        \hook_use:n {pdf/management/lastpage_shipout}
+      }
   }
-\hook_gput_code:nnn {shipout/lastpage} {pdf}
   {
-     \hook_use:n {pdf/management/lastpage_shipout}
+    \hook_gput_code:nnn{shipout/background}{pdf}
+      {
+        \hook_use:n {pdf/management/thispage_shipout}
+      }
+    \hook_gput_code:nnn {shipout/lastpage} {pdf}
+      {
+        \hook_use:n {pdf/management/lastpage_shipout}
+      }
+  }
+\hook_gput_code:nnn {shipout/firstpage} {pdf}
+  {
+    \hook_use:n {pdf/management/thispage_shipout}
   }
+
 %</drivers>
+%<*dvipdfmx|xdvipdfmx>
+\hook_gset_rule:nnnn{shipout/firstpage}{l3backend-xetex}{after}{pdf}
+%</dvipdfmx|xdvipdfmx>
 %    \end{macrocode}
 % \subsection{ The /Pages dictionary (pdfpagesattr) }
 % \begin{macro}{\@@_backend_Pages_primitive:n}





More information about the latex3-commits mailing list.