我如何为示例块指定颜色?

我如何为示例块指定颜色?

我使用 Beamer 和 XeLaTeX。我没有使用任何 Beamer 主题,因为手动指定一些参数更有用。我为所有块使用了一些颜色,并且所有块都有这些颜色……除了“示例”环境的块。

  1. 为什么示例环境不使用我的颜色?
  2. 我该如何修复它?

系统:Windows 7,MikTeX。

\documentclass[pdf,10pt,unicode]{beamer}
\usefonttheme{professionalfonts}
\usepackage{hyperref}

\usepackage{polyglossia}
\usepackage{tikz}

\setromanfont{Times New Roman}
\newfontfamily\cyrillicfontrm{Times New Roman}
\setsansfont[Mapping=tex-text]{Calibri}
\newfontfamily\cyrillicfontsf[Mapping=tex-text]{Calibri}
\setmonofont{Courier New}
\newfontfamily\cyrillicfonttt{Courier New}
\setmainfont{Cambria}
\newfontfamily\cyrillicfont{Cambria}

\usepackage{unicode-math}
\setmathfont{Cambria Math}

\setdefaultlanguage{english}

\defaultfontfeatures{Mapping=tex-text}
\usepackage{amsmath, amsthm}

\setbeamertemplate{blocks}[rounded][shadow=true]

\definecolor{LightViolet}{RGB}{230,220,255}
\setbeamercolor{frametitle}{bg=LightViolet}

\definecolor{NormalBlue}{RGB}{200,200,255}
\setbeamercolor{block title}{bg=NormalBlue}

\definecolor{LightBlue}{RGB}{220,220,255}
\setbeamercolor{block body}{bg=LightBlue}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{footline}[frame number]

\setbeamertemplate{itemize items}[ball] 
\setbeamertemplate{enumerate items}[circle]

\parskip=0.5em

\begin{document}

\begin{frame}
\frametitle{Frametitle}
\begin{definition}
This is a definition
\end{definition}

\begin{theorem}
This is a theorem
\end{theorem}

\begin{block}{Block}
This is a regular block
\end{block}

\begin{example}
This is a example block
\end{example}
\end{frame}

\end{document}

梅威瑟:麦格韋萊.pdf

答案1

示例和警报块使用自己的颜色,您可以单独设置。

\documentclass[pdf,10pt,unicode]{beamer}

\setbeamertemplate{blocks}[rounded][shadow=true]

\definecolor{LightViolet}{RGB}{230,220,255}
\setbeamercolor{frametitle}{bg=LightViolet}

\definecolor{NormalBlue}{RGB}{200,200,255}
\setbeamercolor{block title}{bg=NormalBlue}

\definecolor{LightBlue}{RGB}{220,220,255}
\setbeamercolor{block body}{bg=LightBlue}

\setbeamercolor{block body example}{bg=red!20!white}
\setbeamercolor{block title example}{fg=red, bg=red!40!white}

\begin{document}

\begin{frame}
\frametitle{Frametitle}
\begin{definition}
This is a definition
\end{definition}

\begin{theorem}
This is a theorem
\end{theorem}

\begin{block}{Block}
This is a regular block
\end{block}

\begin{example}
This is a example block
\end{example}
\end{frame}

\end{document}

在此处输入图片描述

相关内容