[latex3-commits] [git/LaTeX3-latex3-latex3] master: Delay color stack init to start of DVI (c96fe059b)

Joseph Wright joseph.wright at morningstar2.co.uk
Tue Jan 12 11:45:31 CET 2021


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

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

commit c96fe059bc3cb5a7ba8ca90880add0f1b0ad76cd
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Tue Jan 12 10:45:31 2021 +0000

    Delay color stack init to start of DVI


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

c96fe059bc3cb5a7ba8ca90880add0f1b0ad76cd
 l3backend/l3backend-color.dtx | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/l3backend/l3backend-color.dtx b/l3backend/l3backend-color.dtx
index f3087b090..6f578a37e 100644
--- a/l3backend/l3backend-color.dtx
+++ b/l3backend/l3backend-color.dtx
@@ -187,16 +187,22 @@
 \int_compare:nNnF \c__kernel_sys_dvipdfmx_version_int < { 20201111 }
   {
     \int_new:N \g__color_stack_int
-    \cs_new_protected:Npn \__kernel_color_stack_init:Nnn #1#2#3
+    \cs_new_protected:Npx \__kernel_color_stack_init:Nnn #1#2#3
       {
-        \int_gincr:N \g__color_stack_int
-        \int_const:Nn #1 { \g__color_stack_int }
-        \__kernel_backend_literal:x
+        \int_gincr:N \exp_not:N \g__color_stack_int
+        \int_const:Nn #1 { \exp_not:N \g__color_stack_int }
+        \cs_if_exist:NTF \AtBeginDvi
+          { \exp_not:N \AtBeginDvi }
+          { \exp_not:N \use:n }
           {
-            pdfcolorstackinit ~
-            \int_use:N \g__color_stack_int \c_space_tl
-            \tl_if_blank:nF {#2} { #2 ~ }
-            (#3)
+            \__kernel_backend_literal:x
+              {
+                pdfcolorstackinit ~
+                \exp_not:N \int_use:N \exp_not:N \g__color_stack_int
+                \c_space_tl
+                \exp_not:N \tl_if_blank:nF {#2} { #2 ~ }
+                (#3)
+              }
           }
       }
   }





More information about the latex3-commits mailing list.