2

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.

3

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

  • @WildFeather You're welcome! – user36296 May 9 '17 at 18:46

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.