If I get your question right (I hope so) the following could work. It uses tcolorbox
and not the default proof-boxes from beamer. I don't know how to do this with beamer. For that, you might have a look at the beamer documentation.
\documentclass{beamer}
\usetheme{Warsaw}
\usepackage{lipsum}
\usepackage[skins]{tcolorbox}
\definecolor{proofhead}{HTML}{006000}
\definecolor{proofbody}{HTML}{e6efe6}
\newcounter{proofs}
\newtcolorbox{myproofbox}[1][]{%
beamer,%
colback=proofbody,%
colframe=proofhead,%
boxsep=0pt,
top=3pt,
bottom=5pt,
left=4pt,%
right=4pt,%
fuzzy shadow={1mm}{-1mm}{0mm}{0.1mm}{black!50!white},%
#1%
}
\newenvironment<>{myproof}[1][]{%
\refstepcounter{proofs}
\begin{myproofbox}[%
adjusted title=\normalfont{\proofname~\theproofs~#1},% you might change this line to set a default title
]}
{\end{myproofbox}}
\begin{document}
\begin{frame}
This is how it should look like:
\begin{example}
\lipsum[2]
\end{example}
\end{frame}
\begin{frame}
This is how my code looks like:
\begin{myproof}
\lipsum[2]
\end{myproof}
\end{frame}
\begin{frame}
\addtocounter{proofs}{-1}% This reduces the counter so it's the same number
\begin{myproof}[(Cont.)]
\lipsum[2]
\end{myproof}
\end{frame}
\end{document}
To set a complete custom title you can also use the following instead of \begin{myproof}...\end{myproof}
:
\begin{myproofbox}[adjusted title=\normalfont{<Insert your Title here>}]
<Insert the content of the box here>
\end{myproofbox}
Note that this doesn't step the counter. To step the counter in a way that you can label the box you should use \refstepcounter{proofs}
. To use the counter value (e.g. in your title) you can use \theproofs
or something like \roman{proofs}
for other formatting of the number.
\examplename
and the\end{document}
are missing. – Skillmon Apr 9 '17 at 17:46#2
in the definition of your newenvironment? And the\usebeamertemplate{example begin}
doesn't seem to do anything. If I change all your\begin{examples}...\end{examples}
to use{example}
I do get three green boxes. And what do you mean with "same number"? They don't have any number as far as I can tell. – Skillmon Apr 9 '17 at 17:56\addtocounter{<insert counter name here>}{-1}
– Skillmon Apr 9 '17 at 18:08