[latex3-commits] [git/LaTeX3-latex3-pdfresources] testbeamercolor: add code to smuggle colors out of a group (ee6bca0)

Ulrike Fischer fischer at troubleshooting-tex.de
Thu Jan 20 12:26:11 CET 2022


Repository : https://github.com/latex3/pdfresources
On branch  : testbeamercolor
Link       : https://github.com/latex3/pdfresources/commit/ee6bca0f8f9fd247bde94908d10638b62b8e8fa2

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

commit ee6bca0f8f9fd247bde94908d10638b62b8e8fa2
Author: Ulrike Fischer <fischer at troubleshooting-tex.de>
Date:   Thu Jan 20 12:26:11 2022 +0100

    add code to smuggle colors out of a group


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

ee6bca0f8f9fd247bde94908d10638b62b8e8fa2
 firstaid/beamerbasecolor-ltx.sty | 36 +++++++++++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)

diff --git a/firstaid/beamerbasecolor-ltx.sty b/firstaid/beamerbasecolor-ltx.sty
index 3a9e77d..2a99a85 100644
--- a/firstaid/beamerbasecolor-ltx.sty
+++ b/firstaid/beamerbasecolor-ltx.sty
@@ -41,6 +41,36 @@
   \csname beamer at thcbg@#1\endcsname%
 }
 
+%\def\beamer at thc@usecolor#1{%
+%  \begingroup%
+%    \beamer at thc@prepcolor%
+%    \beamer at thc@docolor{#1}%
+%    \ifx\beamer at thc@fg\@empty\def\beamer at thc@fg{fg}\fi%
+%    \ifx\beamer at thc@bg\@empty\def\beamer at thc@bg{bg}\fi%
+%    \global\let\beamer at thc@gfg\beamer at thc@fg%
+%    \global\let\beamer at thc@gbg\beamer at thc@bg%
+%    %\globalcolorstrue%
+%  \endgroup%
+%   \colorlet{#1.fg}{\beamer at thc@gfg}%
+%   \colorlet{#1.bg}{\beamer at thc@gbg}%
+%}
+
+% Joseph, https://chat.stackexchange.com/transcript/message/60198801#60198801
+\newcount\beamer at smuggle@color at cnt
+\def\bearm at smuggle@color#1#2{%
+  \global\advance\beamer at smuggle@color at cnt 1 %
+  \edef\@tempa{beamer at smuggle@color@\number\beamer at smuggle@color at cnt}%
+  \expandafter\xdef\csname\@tempa\endcsname
+    {%
+      \noexpand\colorlet{#1}{\noexpand#2}%
+      \noexpand\ifnum\noexpand\currentgrouplevel=0 \noexpand\else
+        \noexpand\aftergroup\expandafter\noexpand
+          \csname\@tempa\endcsname
+      \noexpand\fi
+    }%
+  \expandafter\aftergroup\csname\@tempa\endcsname
+}
+
 \def\beamer at thc@usecolor#1{%
   \begingroup%
     \beamer at thc@prepcolor%
@@ -49,12 +79,12 @@
     \ifx\beamer at thc@bg\@empty\def\beamer at thc@bg{bg}\fi%
     \global\let\beamer at thc@gfg\beamer at thc@fg%
     \global\let\beamer at thc@gbg\beamer at thc@bg%
-    %\globalcolorstrue%
+    \bearm at smuggle@color{#1.fg}{\beamer at thc@gfg}%
+    \bearm at smuggle@color{#1.bg}{\beamer at thc@gbg}%
   \endgroup%
-   \colorlet{#1.fg}{\beamer at thc@gfg}%
-   \colorlet{#1.bg}{\beamer at thc@gbg}%
 }
 
+
 \def\setbeamercolor{\@ifstar{\beamer at clearbeamercolor}{\beamer at setbeamercolor}}
 
 \newcommand\beamer at clearbeamercolor[2]{%





More information about the latex3-commits mailing list.