[latex3-commits] [git/LaTeX3-latex3-latex3] main: Only use \pdfmanagement_add:nnn if active (996bad17c)

Joseph Wright joseph.wright at morningstar2.co.uk
Mon Aug 2 14:11:57 CEST 2021


Repository : https://github.com/latex3/latex3
On branch  : main
Link       : https://github.com/latex3/latex3/commit/996bad17c0123540a5f5d8f8a84a82efd37a74c9

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

commit 996bad17c0123540a5f5d8f8a84a82efd37a74c9
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon Aug 2 13:11:57 2021 +0100

    Only use \pdfmanagement_add:nnn if active


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

996bad17c0123540a5f5d8f8a84a82efd37a74c9
 l3backend/CHANGELOG.md          | 3 +++
 l3backend/l3backend-color.dtx   | 9 ++++++---
 l3backend/l3backend-opacity.dtx | 8 ++++++--
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/l3backend/CHANGELOG.md b/l3backend/CHANGELOG.md
index fae21bb66..147506180 100644
--- a/l3backend/CHANGELOG.md
+++ b/l3backend/CHANGELOG.md
@@ -6,6 +6,9 @@ this project uses date-based 'snapshot' version identifiers.
 
 ## [Unreleased]
 
+## Changed
+- Only use `pdfmanagement` module if active
+
 ## [2021-07-12]
 
 ### Fixed
diff --git a/l3backend/l3backend-color.dtx b/l3backend/l3backend-color.dtx
index ad3075dff..b5a8f1159 100644
--- a/l3backend/l3backend-color.dtx
+++ b/l3backend/l3backend-color.dtx
@@ -813,7 +813,9 @@
         / \str_convert_pdfname:n {#1} ~ #2 ~
         \pdf_object_ref_last:
       }
-    \cs_if_exist:NT \pdfmanagement_add:nnn
+    \bool_lazy_and:nnT
+      { \cs_if_exist_p:c \pdfmanagement_if_active_p: }
+      { \pdfmanagement_if_active_p:}
       {
         \use:x
           {
@@ -896,8 +898,9 @@
         #2 ~
         \pdf_object_ref_last:
       }
-    \cs_if_exist:NT \pdfmanagement_add:nnn
-      {
+    \bool_lazy_and:nnT
+      { \cs_if_exist_p:c \pdfmanagement_if_active_p: }
+      { \pdfmanagement_if_active_p:}
         \use:x
           {
             \pdfmanagement_add:nnn
diff --git a/l3backend/l3backend-opacity.dtx b/l3backend/l3backend-opacity.dtx
index 6017403ea..f2266046b 100644
--- a/l3backend/l3backend-opacity.dtx
+++ b/l3backend/l3backend-opacity.dtx
@@ -141,7 +141,9 @@
 % \begin{variable}{\c_@@_backend_stack_int}
 %   Set up a stack.
 %    \begin{macrocode}
-\cs_if_exist:NT \pdfmanagement_add:nnn
+\bool_lazy_and:nnT
+  { \cs_if_exist_p:c \pdfmanagement_if_active_p: }
+  { \pdfmanagement_if_active_p:}
   {
     \__kernel_color_backend_stack_init:Nnn \c_@@_backend_stack_int
       { page ~ direct } { /opacity 1 ~ gs }
@@ -180,7 +182,9 @@
       { /opacity #1 ~ gs }
     \group_insert_after:N \@@_backend_reset:
   }
-\cs_if_exist:NF \pdfmanagement_add:nnn
+\bool_lazy_and:nnT
+  { \cs_if_exist_p:c \pdfmanagement_if_active_p: }
+  { \pdfmanagement_if_active_p:}
   {
     \cs_gset_protected:Npn \@@_backend_select_aux:n #1 { }
   }





More information about the latex3-commits mailing list.