如beamerbasetheorems.sty
看出:
\documentclass[notheorems]{beamer}
\theoremstyle{plain}
\newtheorem{theorem}{\translate{Theorem}}
\newtheorem{example}[theorem]{\translate{Example}}
% or
\theoremstyle{definition}
\newtheorem{theorem}{\translate{Theorem}}
\newtheorem{example}[theorem]{\translate{Example}}
% or
\theoremstyle{example}
\newtheorem{theorem}{\translate{Theorem}}
\newtheorem{example}[theorem]{\translate{Example}}
无论风格你喜欢。您也可以更改[警示|示例]的外观块:
\setbeamercolor{block body}{fg=blue,bg=white}
\setbeamercolor{block body alerted}{fg=blue,bg=white}
\setbeamercolor{block body example}{fg=blue,bg=white}
(没试过,只是看着到投影仪光源)
编辑:还没确定要你想做的事,但你可以定义自己的风格定理:
\makeatletter
\def\[email protected]{%
\normalfont % body font
\def\inserttheoremblockenv{alertblock}
}
\theoremstyle{something}
\newtheorem{warn}[theorem]{WARNING}
\makeatother
\begin{warn}[Attention please]
This is dangerous
\end{warn}
(这工作,我测试了它)
你有3个预定义的块,并且可以使用\ defbeamertemplate进行自定义。查看有关如何执行此操作的来源和文档。如果您需要更多块的环境,看到basebeamerlocalstructure.sty
:
\newenvironment<>{alertblock}[1]{%
\begin{actionenv}#2%
\def\insertblocktitle{#1}%
\par%
\mode<presentation>{%\usebeamerfont{block}%
\setbeamercolor{local structure}{parent=alerted text}}%
\usebeamertemplate{block alerted begin}}
{\par%
\usebeamertemplate{block alerted end}%
\end{actionenv}}
希望帮助
我真正想要做的是创造定理/例子/警报块一个新的选择。 beamerbasetheorems.sty覆盖了amsthm的内部结构,以便在定理类环境开始时使用“定理开始”模板。该模板启动名为'\ insertblockenv'的块环境。这个宏在beamerbasetheorems.sty中被定义为“block”,并且只有在内部'\ th @ example'的重写中,'\ insertblockenv'宏被重新定义为“exampleblock”。所以这些都是你的选择:如果定理样式是例子,block o/w,那么exampleblock。 也许模板可以改编? – 2010-04-09 12:25:33
是否要更改现有的块环境或定义新的块环境? – Meinersbur 2010-04-09 21:07:50
我想更改现有的块环境。我不希望“定理”和“解决方案”(例如)在同一个beamercolorbox中。 我不会再有机会再回到这一两天,但我认为可以在'theorem begin'模板中使用PGF的关键注册表来完成某些事情。 – 2010-04-10 11:27:03