Here's how you can easily define new customized theorem-like blocks; the idea is to define a new style with customized settings, and then use this new style for your structures:
\documentclass{beamer}
\usetheme{Warsaw}
\makeatletter
\def\th@mystyle{%
\normalfont % body font
\setbeamercolor{block title example}{bg=orange,fg=white}
\setbeamercolor{block body example}{bg=orange!20,fg=black}
\def\inserttheoremblockenv{exampleblock}
}
\makeatother
\theoremstyle{mystyle}
\newtheorem*{remark}{Remark}
\begin{document}
\begin{frame}
\begin{theorem}[An important theorem]
Some text
\end{theorem}
\begin{remark}[Some important remark]
Some text
\end{remark}
\end{frame}
\end{document}
![enter image description here](https://i.stack.imgur.com/f8661.png)
Relevant settings for definition of theorem-like structures:
In the file beamerbasetheorems.sty
you find:
\def\th@example{\th@remark}
and
\ifbeamer@countsect
\newtheorem{theorem}{\translate{Theorem}}[section]
\else
\newtheorem{theorem}{\translate{Theorem}}
\fi
\newtheorem{corollary}[theorem]{\translate{Corollary}}
\newtheorem{fact}[theorem]{\translate{Fact}}
\newtheorem{lemma}[theorem]{\translate{Lemma}}
\newtheorem{problem}[theorem]{\translate{Problem}}
\newtheorem{solution}[theorem]{\translate{Solution}}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{\translate{Definition}}
\newtheorem{definitions}[theorem]{\translate{Definitions}}
\theoremstyle{example}
\newtheorem{example}[theorem]{\translate{Example}}
\newtheorem{examples}[theorem]{\translate{Examples}}
which means that the example
style is the same as the remark style; the plain
style is used for theorems, corollaries, lemmas, problems, solutions. The definition
style applies to definitions, and the example
style, to examples.
Also relevant might be the lines
\def\inserttheoremheadfont{\the\thm@headfont}
\def\inserttheoremblockenv{block}
\def\th@example{%
\normalfont % body font
\def\inserttheoremblockenv{exampleblock}
}
which show basically that for the example style, exampleblock
is used, but for all other theorem-like structures block
is used.
In beamerbaseauxtemplates.sty
one finds:
\defbeamertemplate{theorem begin}{ams style}
{%
\begin{\inserttheoremblockenv}
{%
\inserttheoremheadfont
\inserttheoremname
\inserttheoremnumber
\ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
\inserttheorempunctuation
}%
}
\defbeamertemplate{theorem end}{ams style}
{\end{\inserttheoremblockenv}}
\defbeamertemplate{theorem begin}{numbered}
{%
\begin{\inserttheoremblockenv}
{%
\inserttheoremname
\inserttheoremnumber
\ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
}%
}
\defbeamertemplate{theorem end}{numbered}
{\end{\inserttheoremblockenv}}
\defbeamertemplate{theorem begin}{normal font}
{
\normalfont
\begin{\inserttheoremblockenv}
{%
\inserttheoremname
\ifx\inserttheoremaddition\@empty\else\ (\inserttheoremaddition)\fi%
}%
}
\defbeamertemplate{theorem end}{normal font}
{\end{\inserttheoremblockenv}}
If you want to present them as examples and mark them up as such using beamer's example
environment (rather than just using the generic block
) you might try something like this:
\documentclass[]{beamer}
\usetheme{Madrid}
\newtheorem{examplefirst}{Example}
\newtheorem{examplesecond}{Example}
\newenvironment<>{examplefirst}[1][]{%
\setbeamercolor{block title example}{fg=white,bg=red!75!black}%
\begin{example}#2[#1]}{\end{example}}
\newenvironment<>{examplesecond}[1][]{%
\setbeamercolor{block title example}{fg=white,bg=blue!75!black}%
\begin{example}#2[#1]}{\end{example}}
\begin{document}
\begin{frame}
\begin{examplefirst}[An example of the first kind]
Something about this example of the first kind.
\end{examplefirst}
\begin{examplesecond}[An example of the second kind]
Something about this example of the second kind.
\end{examplesecond}
\begin{example}[A regular example]
Something about the regular example.
\end{example}
\end{frame}
\end{document}
which produces:
![3 kinds of example environment](https://i.stack.imgur.com/UeBFP.png)
If you prefer to stick to the generic block
environment perhaps something like this might work:
\documentclass[]{beamer}
\usetheme{Madrid}
\newenvironment<>{examplefirst}[1]{%
\setbeamercolor{block title}{fg=white,bg=red!75!black}%
\begin{block}#2{#1}}{\end{block}}
\newenvironment<>{examplesecond}[1]{%
\setbeamercolor{block title}{fg=white,bg=blue!75!black}%
\begin{block}#2{#1}}{\end{block}}
\begin{document}
\begin{frame}
\begin{examplefirst}{An example of the first kind}
Something about this example of the first kind.
\end{examplefirst}
\begin{examplesecond}{An example of the second kind}
Something about this example of the second kind.
\end{examplesecond}
\begin{block}{A regular block}
Something in the regular block format.
\end{block}
\end{frame}
\end{document}
![enter image description here](https://i.stack.imgur.com/r9lvW.png)
Best Answer
It actually depends on the style used, but you can also use the
block
,alertblock
andexampleblock
environments to get blocked off text.