1

It's difficult for me to give an MWE for this question, but I have the following lines in my .sty file. The math alertblocks appear with the color scheme I specified at the end [\usecolortheme[RGB={128,0,0}]{structure}] but the regular alertblocks appear with a brighter red.

What do I need to make alertblocks have the same color as the definition/theorem blocks?

\useoutertheme{split}
\usecolortheme{whale}
\useinnertheme{rounded} 
\usecolortheme{orchid}
\setbeamertemplate{itemize items}[circle]
\setbeamertemplate{enumerate items}[circle]
\setbeamertemplate{sections/subsections in toc}[default]
\setbeamertemplate{blocks}[rounded]
\setbeamertemplate{title page}[default][colsep=-4bp,rounded=true]
\setbeamertemplate{part page}[default][colsep=-4bp,rounded=true]
\setbeamertemplate{navigation symbols}{}
\usecolortheme[RGB={128,0,0}]{structure}

enter image description here

1

The purpose of the alert block is to stand out and draw attention to some content, so making it look like every other block defeats the purpose. In that case you should just use a regular block environment. However, changing the appearance is indeed possible.

The orchid color theme defines regular blocks (used for theorems and definitions) as follows.

\setbeamercolor{block title}{use=structure,fg=white,bg=structure.fg!75!black}
\setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!10!bg}

The alert blocks, however, are defined differently. To make them look identical, you can define the alert block title and body in the same way as the standard blocks. Note this won't change the example block.

\setbeamercolor{block title alerted}{use=structure,fg=white,bg=structure.fg!75!black}
\setbeamercolor{block body alerted}{parent=normal text,use=block title,bg=block title.bg!10!bg}

Here is the result (code follows): enter image description here

\documentclass{beamer}
\useoutertheme{split}
\usecolortheme{whale}
\useinnertheme{rounded} 
\usecolortheme{orchid}
\setbeamertemplate{blocks}[rounded]
\setbeamertemplate{title page}[default][colsep=-4bp,rounded=true]
\setbeamertemplate{part page}[default][colsep=-4bp,rounded=true]
\setbeamertemplate{navigation symbols}{}
\usecolortheme[RGB={128,0,0}]{structure}
% redefine alert block
\setbeamercolor{block title alerted}{use=structure,fg=white,bg=structure.fg!75!black}
\setbeamercolor{block body alerted}{parent=normal text,use=block title,bg=block title.bg!10!bg}

\begin{document}
\begin{frame}
\frametitle{An example slide}
\begin{definition}
Example definition
\end{definition}
\begin{theorem}
Example theorem
\end{theorem}
\begin{alertblock}{Test}
Testing an alert block
\end{alertblock}
\end{frame}
\end{document}
|improve this answer|||||
  • I didn't realize there was a regular block.... thank you! – user369210 Apr 19 '18 at 2:34
  • You're welcome. The standard block color matches the theme (structure), while the exampleblock is green by default and the alertblock is red by default. – erik Apr 19 '18 at 2:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.