3

I was wondering whether it is possible to change beamer's color theme locally only for a couple of slides. I am teaching a graduate class and sometimes include summaries of topics that may be relevant only to graduate students who actively do research in that specific area. I would like to distinguish these slides using a more greyish color scheme so that students who don't come to class later know that these slides are not exam relevant.

I noticed that \usecolortheme{colortheme} works only in the preamble and that the frame environment has no options to change its color theme. I know I could generate those slides from a separate .tex file and concatenate the slides later but then I would lose some interactive functionality. Is there any workaround that allows me to change the color theme locally?

Edit: I guess what Schrödinger's cat is suggesting is to define structure and section in head/foot using your own colors, to define every other beamercolor by inheriting from those two, and to create custom commands as follows to switch between the themes:

\newcommand{\maintheme}{
  \setbeamercolor{structure}{fg=main,bg=secondary}
  \setbeamercolor{section in head/foot}{fg=main,bg=secondarylight}
}
\newcommand{\sidetheme}{
  \setbeamercolor{structure}{fg=white,bg=gray}
  \setbeamercolor{section in head/foot}{fg=white,bg=lightgray}
}

Great idea, but I had some unexpected behavior where colors either did not change (background color of sectionnavigation), colors changed one slide late (itemize bullets) or to a different color than originally defined (enumerate item). Do you have any idea what this is so?

I apologize that the MWE is a bit lengthy, mostly to include a block, an itemize, and an enumerate environment on each slide:

\documentclass[10pt]{beamer}
\usetheme{Frankfurt}

\definecolor{main}{rgb}{0.4675, 0.11, 0.115}
\definecolor{secondary}{rgb}{0.75, 0.625, 0.15}
\definecolor{secondarylight}{rgb}{0.896, 0.83, 0.56}

\setbeamercolor{structure}{fg=main,bg=secondary}
\setbeamercolor{section in head/foot}{fg=main,bg=secondarylight}
\setbeamercolor{frametitle}{parent=structure}
\setbeamerfont{frametitle}{size=\large}
\setbeamercolor{title}{parent=section in head/foot}
\setbeamercolor{item}{fg=structure.bg}
\setbeamertemplate{enumerate items}[default]
\setbeamercolor{enumerate item}{parent=structure}

\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamerfont{block title}{series=\bfseries}
\setbeamercolor{block title}{fg=structure.fg,bg=structure.bg} 
\setbeamercolor{block body}{bg=white}

\beamertemplatenavigationsymbolsempty

\newcommand{\sidetheme}{
  \setbeamercolor{structure}{fg=white,bg=gray}
  \setbeamercolor{section in head/foot}{fg=white,bg=lightgray}
  \setbeamercolor{item}{fg=section in head/foot.bg}
  \setbeamercolor{enumerate item}{fg=structure.bg}
}

\newcommand{\maintheme}{
  \setbeamercolor{structure}{fg=main,bg=secondary}
  \setbeamercolor{section in head/foot}{fg=main,bg=secondarylight}
  \setbeamercolor{item}{fg=structure.bg}
  \setbeamercolor{enumerate item}{parent=structure}
}

\title{Changing Color Schemes Locally}

\begin{document}
\thispagestyle{empty}
\maketitle
\setcounter{beamerpauses}{1}
\setcounter{framenumber}{0}

\section{Topic 1}

\begin{frame}
\frametitle{Information Central to the Course}

\begin{definition}
Some very insightful definition.
\begin{enumerate}
\item Yada
\item Yada
\end{enumerate}
\end{definition}
\medskip

\textbf{Interpretation:}
\begin{itemize}
\item Important point.
\item Another important point.
\end{itemize}
\end{frame}

\sidetheme

\begin{frame}
\frametitle{Additional Information}

\begin{definition}
Some very insightful definition.
\begin{enumerate}
\item Yada
\item Yada
\end{enumerate}
\end{definition}
\medskip

\textbf{Interpretation:}
\begin{itemize}
\item Important point.
\item Another important point.
\end{itemize}
\end{frame}

\begin{frame}
\frametitle{Additional Information}

\begin{definition}
Some very insightful definition.
\begin{enumerate}
\item Yada
\item Yada
\end{enumerate}
\end{definition}
\medskip

\textbf{Interpretation:}
\begin{itemize}
\item Important point.
\item Another important point.
\end{itemize}
\end{frame}

\maintheme

\section{Topic 2}

\begin{frame}
\frametitle{Information Central to the Course}

\begin{definition}
Some very insightful definition.
\begin{enumerate}
\item Yada
\item Yada
\end{enumerate}
\end{definition}
\medskip

\textbf{Interpretation:}
\begin{itemize}
\item Important point.
\item Another important point.
\end{itemize}
\end{frame}

\end{document}
5
  • 1
    Welcome! Does this go in the right direction?
    – user194703
    Dec 20, 2019 at 4:37
  • @Olafsson, I think the suggestion by Schrödinger'scat is good enough for your purpose. If you want to make some slides, to look a bit different, then it is better to change some colors slightly (say, fg and bg) than to jump to a totally different color theme. Dec 20, 2019 at 8:40
  • @Schrödinger'scat Thank you. It does go into the right direction, but I had some unexpected behavior. I added an MWE to illustrate what went wrong. Dec 21, 2019 at 8:43
  • @CyriacAntony I disagree. Of course the color palette should be related (same colors, lower intensity or, as in the MWE, simply a grayed out version), but I think it is imperative that the entire slide changes colors so that even if I don't use a block on one slide, students can tell the difference. Dec 21, 2019 at 8:43
  • Is this question still and active matter ? Did the above comments help solve your problem ?
    – BambOo
    May 15, 2020 at 18:48

0

Browse other questions tagged .