[latex3-commits] [git/LaTeX3-latex3-latex3] main: Add "pdfcolorstack n current" to (x)dvipdfmx scopes (3e1892e81)
Joseph Wright
joseph.wright at morningstar2.co.uk
Thu Mar 18 18:08:32 CET 2021
Repository : https://github.com/latex3/latex3
On branch : main
Link : https://github.com/latex3/latex3/commit/3e1892e810c6f47c4b7f6de87aeda7b64db0a257
>---------------------------------------------------------------
commit 3e1892e810c6f47c4b7f6de87aeda7b64db0a257
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date: Wed Mar 17 10:49:44 2021 +0000
Add "pdfcolorstack n current" to (x)dvipdfmx scopes
>---------------------------------------------------------------
3e1892e810c6f47c4b7f6de87aeda7b64db0a257
l3backend/CHANGELOG.md | 3 +++
l3backend/l3backend-color.dtx | 11 +++++++++++
2 files changed, 14 insertions(+)
diff --git a/l3backend/CHANGELOG.md b/l3backend/CHANGELOG.md
index ed6da43a3..4152526f4 100644
--- a/l3backend/CHANGELOG.md
+++ b/l3backend/CHANGELOG.md
@@ -6,6 +6,9 @@ this project uses date-based 'snapshot' version identifiers.
## [Unreleased]
+### Fixed
+- Maintain stack color correctly with `(x)dvipdfmx`
+
## [2021-03-02]
### Changed
diff --git a/l3backend/l3backend-color.dtx b/l3backend/l3backend-color.dtx
index 50271f57b..84cc7def3 100644
--- a/l3backend/l3backend-color.dtx
+++ b/l3backend/l3backend-color.dtx
@@ -240,6 +240,17 @@
\c_@@_backend_main_stack_int
\int_const:cn { main at pdfcolorstack } { \c_@@_backend_main_stack_int }
}
+% \end{macrocode}
+% The backend automatically restores the stack color from the \enquote{classical}
+% approach (\texttt{pdf:bcolor}) after a scope. That will be an issue for us, so
+% we manually ensure that the one we are using is inserted.
+% \begin{macrocode}
+ \cs_gset_protected:Npn \__kernel_backend_scope_end:
+ {
+ \__kernel_backend_literal:n { x:grestore }
+ \__kernel_backend_literal:n
+ { pdfcolorstack ~ \g_@@_backend_stack_int current }
+ }
}
% \end{macrocode}
% \end{variable}
More information about the latex3-commits
mailing list.