Skip to content

Commit

Permalink
Fix setting background
Browse files Browse the repository at this point in the history
  • Loading branch information
tvalimaki committed Nov 9, 2022
1 parent 2369b45 commit bcd7969
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ For a more detailed explanation of the standard installation process of packages

## License

Copyright (C) 2019 by Tuomas Välimäki
Copyright (C) 2019-2022 by Tuomas Välimäki

This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version. The latest version of this license is in:

Expand Down
35 changes: 23 additions & 12 deletions beamerthemetuni.dtx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% \iffalse meta-comment ------------------------------------------------------
%
% Copyright (C) 2019 by Tuomas Välimäki
% Copyright (C) 2019-2022 by Tuomas Välimäki
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
Expand All @@ -23,7 +23,7 @@
% ------------------------------------------------------------------------ \fi
% \iffalse
%<*driver|package>
\def\tuniversion{2019/07/29 v1.1}
\def\tuniversion{2022/11/09 v1.2}
%</driver|package>
%<*internal>
\def\nameofplainTeX{plain}
Expand All @@ -41,7 +41,7 @@

This is a generated file.

Copyright (C) 2019 by Tuomas Välimäki
Copyright (C) 2019-2022 by Tuomas Välimäki

This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either
Expand Down Expand Up @@ -401,22 +401,33 @@ and beamercolorthemetuni.sty.
%
% \begin{macro}{purple}
%
% The color of the slide is inherited from the background of |normal text|,
% so we set that at the beginning of each slide. We define a key |purple| to
% change the slide background to purple, foreground to white, and structure
% to blue.
% \changes{v1.2}{2022/11/09}{Fix the way backgrounds are set}
%
% The color of the slide is inherited from the background of |normal text|.
% We define a key |purple| to change the slide background to purple,
% foreground to white, and structure to blue.
%
% In order to make this work, we need to patch |\setkeys| to be nestable.
%
% \begin{macrocode}
\BeforeBeginEnvironment{frame}{%
\setbeamercolor{normal text}{fg=black,bg=white}%
\usebeamercolor[fg]{normal text}%
\setbeamercolor{structure}{fg=tuniPurple}%
}
\let\my@setkeys@orig\setkeys
\def\setkeys{\expandafter\my@setkeys@aux\expandafter{\KV@prefix}}
\long\def\my@setkeys@aux#1#2#3{\my@setkeys@orig{#2}{#3}\def\KV@prefix{#1}}

\newif\if@purpleFrame
\define@key{beamerframe}{purple}[true]{%
\@purpleFrametrue
\begingroup
\setbeamercolor{normal text}{fg=white,bg=tuniPurple}%
\usebeamercolor[fg]{normal text}%
\setbeamercolor{structure}{fg=tuniBlue}%
}
\pretocmd{\beamer@reseteecodes}{%
\if@purpleFrame
\endgroup
\@purpleFramefalse
\fi
}{}{}
% \end{macrocode}
% \end{macro}
%
Expand Down

0 comments on commit bcd7969

Please sign in to comment.