我正在使用模板的修改版本这里我听从了给出的建议这里以“内联”模式而不是“块”模式排版定理。
我现在需要修改定理的字体,使其变为浅蓝色,包括标题“定理”(或任何其他名称)和数学。我一直尝试但未成功的代码是这样的
\makeatletter
\setbeamertemplate{theorem begin}
{%
%\inserttheoremheadfont %\bfseries
{\bfseries \inserttheoremname} %\inserttheoremnumber
\ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
%\inserttheorempunctuation
\hspace{.01em}
\normalfont
\setbeamercolor{block body}{fg=black,bg=blue!40}
}
\setbeamertemplate{theorem end}{%
% empty
}
\makeatother
我也尝试过\AtBeginEnvironment{theorem}{% \setbeamercolor{block body}{fg=black,bg=blue!40} }
按照建议这里但我收到“未定义的控制序列:\AtBeginEnvironment”错误。
有什么想法吗?提前致谢!
答案1
以下是一种方法:
代码:
\documentclass{beamer}
\setbeamercolor*{thcolor}{fg=blue!60}
\makeatletter
\setbeamertemplate{theorem begin}
{\usebeamercolor[fg]{thcolor}% for the heading
{\bfseries\inserttheoremname~}%
\ifx\inserttheoremaddition\@empty\else(\inserttheoremaddition)\ \fi%
\hspace{.01em}\normalfont\usebeamercolor[fg]{thcolor}% for the body
}
\setbeamertemplate{theorem end}{}
\makeatother
\begin{document}
\begin{frame}
\begin{theorem}
A test theorem.
\end{theorem}
\begin{corollary}
A test corollary.
\end{corollary}
\begin{theorem}[Zorn's Lemma]
A test theorem with annotation.
\end{theorem}
\end{frame}
\end{document}