我想知道是否有可能拥有不同类型的块以及如何在投影机中做到这一点。
举个例子,一个是四舍五入的,另一个是未四舍五入的,用于定理。
是否有可能做到这一点 ?
谢谢
答案1
厚颜无耻地结合samcarter 的这个回答很不错和samcarter 的这个回答很不错。唯一改进:加载tikzmarmots
包(由 samcarter 提供)。
\documentclass{beamer}
\useinnertheme[shadow=true]{rounded}
\usepackage{tikzmarmots}
\usepackage{etoolbox}
\setbeamercolor{block title}{use=structure,fg=structure.fg,bg=structure.fg!20!bg}
\setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!50!bg}
\setbeamercolor{block title example}{use=example text,fg=example text.fg,bg=example text.fg!20!bg}
\setbeamercolor{block body example}{parent=normal text,use=block title example,bg=block title example.bg!50!bg}
\addtobeamertemplate{proof begin}{%
\setbeamercolor{block title}{fg=black,bg=red!50!white}
\setbeamercolor{block body}{fg=red, bg=red!30!white}
\setbeamertemplate{blocks}[default]
}{}
\BeforeBeginEnvironment{theorem}{
\setbeamercolor{block title}{fg=black,bg=orange!50!white}
\setbeamercolor{block body}{fg=orange, bg=orange!30!white}
}
\AfterEndEnvironment{theorem}{
\setbeamercolor{block title}{use=structure,fg=structure.fg,bg=structure.fg!20!bg}
\setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!50!bg, fg=black}
}
\BeforeBeginEnvironment{definition}{%
\setbeamercolor{block title}{fg=black,bg=pink!50!white}
\setbeamercolor{block body}{fg=pink, bg=pink!30!white}
}
\AfterEndEnvironment{definition}{
\setbeamercolor{block title}{use=structure,fg=structure.fg,bg=structure.fg!20!bg}
\setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!50!bg, fg=black}
}
\begin{document}
\begin{frame}
\begin{definition}[Marmot]
A marmot is a \emph{being}.
\end{definition}
\begin{theorem}[My theorem]
The colder the winter, the longer the hibernation time.
\end{theorem}
\begin{proof}[My proof]
$t_\mathrm{hibernate}\propto T^\alpha$ with $\alpha<0$.
\end{proof}
\begin{example}[My example]
\tikz{\marmot[teeth,whiskers,blush]}
\end{example}
\begin{block}{My block}
A block.
\end{block}
\end{frame}
\end{document}