[latex3-commits] [git/LaTeX3-latex3-pdfresources] main, reworking-annot: moved xcolor patch (98b7a85)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Feb 11 19:17:32 CET 2021


Repository : https://github.com/latex3/pdfresources
On branches: main,reworking-annot
Link       : https://github.com/latex3/pdfresources/commit/98b7a8565ffd89dd1896905ff7fa70735cacaa10

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

commit 98b7a8565ffd89dd1896905ff7fa70735cacaa10
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu Feb 11 19:17:32 2021 +0100

    moved xcolor patch


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

98b7a8565ffd89dd1896905ff7fa70735cacaa10
 hyperref-generic.dtx       | 15 ---------------
 pdfmanagement-firstaid.dtx | 18 +++++++++++++++++-
 2 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/hyperref-generic.dtx b/hyperref-generic.dtx
index df7bd43..38353c0 100644
--- a/hyperref-generic.dtx
+++ b/hyperref-generic.dtx
@@ -780,26 +780,11 @@
 
 \RequirePackage{etoolbox} %why?
 %    \end{macrocode}
-% We need l3color for the color export command and need to activate
-% the patches for color and xcolor.
-% It would be too late for colors defined earlier, but is the best one
-% can do for now.%
 %    \begin{macrocode}
-\@ifundefined{color_set:nn}{
-\RequirePackage{l3color}}{}
 \ExplSyntaxOn
 \cs_gset_eq:NN \@expl at color@set@@@@nnn \color_set:nnn
 \file_input:n {hyperref-colorschemes.def}
 \ExplSyntaxOff
-\@ifpackageloaded{xcolor}{\@firstoftwo}{\@secondoftwo}
-  {
-    \RequirePackage{xcolor-patches-tmp}
-    \XC@@@@names
-  }
-  {
-    \AddToHook{package/after/xcolor}
-      {\RequirePackage{xcolor-patches-tmp-ltx}\XC@@@@names}
-  }
 %    \end{macrocode}
 %
 %
diff --git a/pdfmanagement-firstaid.dtx b/pdfmanagement-firstaid.dtx
index 50610df..af63f85 100644
--- a/pdfmanagement-firstaid.dtx
+++ b/pdfmanagement-firstaid.dtx
@@ -62,7 +62,7 @@
   {experimental pdf-resource management / firstaid}
 
 %<@@=pdfmanagement>
-\clist_map_inline:nn {pgf,transparent,hyperxmp,pdflscape}
+\clist_map_inline:nn {pgf,transparent,hyperxmp,pdflscape,xcolor}
   {
     \bool_new:c       { g_@@_firstaid_#1_bool }
     \bool_gset_true:c { g_@@_firstaid_#1_bool }
@@ -77,6 +77,22 @@
 \msg_new:nnn  { pdfmanagement } { firstaid }
               { loading~pdfmanagement~firstaid~code~for~#1 }
 %    \end{macrocode}
+% \subsection{\pkg{xcolor}}
+%
+%  \pkg{xcolor} is not incompatible, but the new \pkg{hyperref} driver makes use of
+%  \pkg{l3color} to set the colors. It is therefore necessary to patch \pkg{xcolor}, so
+%  that colors defined with its \cs{definecolor} command are known to \pkg{l3color} and
+%  so \pkg{hyperref}.
+%
+%    \begin{macrocode}
+\@ifundefined{color_set:nn}{
+\RequirePackage{l3color}}{}
+\bool_if:NT \g_@@_xcolor_pgf_bool
+  {
+    \AddToHook{package/after/xcolor}
+       {\RequirePackage{xcolor-patches-tmp-ltx}\XC@@@@names}
+  }
+%    \end{macrocode}
 % \subsection{\pkg{pgf}}
 %
 % In \pkg{pgf}, resource management is set up in the file |pgfutil-common.tex|.





More information about the latex3-commits mailing list.