3

I'm preparing a Beamer presentation that looks like the following MWE:

\documentclass{beamer}
\usepackage[spanish,activeacute]{babel}
\usetheme{Madrid}
\usecolortheme{beaver}
\begin{document}
\title{My title}  
\author{My name}
\date{\today} 
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\frametitle{1. First section}
\begin{block}{ONE} 
Text for first block
\end{block}
\begin{block}{TWO}
Text for second block
\end{block}
\end{frame}
\end{document}

What do I need to do so that the two boxes named "ONE" and "TWO" are different colors? I would like to be able to select the color I want for each box in each slide, instead of having a predetermined color for all of them.

1 Answer 1

5

A simple solution could be to adjust the two colours

\setbeamercolor{block body}{fg=black, bg=green!20!white}
\setbeamercolor{block title}{fg=black, bg=green!60!black}

for every block to whatever colour you want the blocks to have.

\documentclass{beamer}
\usepackage[spanish,activeacute]{babel}
\usetheme{Madrid}
\usecolortheme{beaver}
\begin{document}
\title{My title}  
\author{My name}
\date{\today} 
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\frametitle{1. First section}

{
\setbeamercolor{block body}{fg=black, bg=green!20!white}
\setbeamercolor{block title}{fg=black, bg=green!60!black}
\begin{block}{ONE} 
Text for first block
\end{block}
}

\begin{block}{TWO}
Text for second block
\end{block}
\end{frame}
\end{document}

enter image description here

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .