我正在准备一个 Beamer 演示文稿,其内容类似于以下 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}
我需要做什么才能使名为“ONE”和“TWO”的两个框具有不同的颜色?我希望能够为每张幻灯片中的每个框选择所需的颜色,而不是为所有框预先确定颜色。
答案1
一个简单的解决方案是调整两种颜色
\setbeamercolor{block body}{fg=black, bg=green!20!white}
\setbeamercolor{block title}{fg=black, bg=green!60!black}
将每个块设置为您想要的颜色。
\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}