# Beamer: Grouping environment counters

In beamer, when I use \setbeamertemplate{theorems}[numbered] but this groups them all as the following.

What I want is theorems, lemmas and other environments to have different counters such as the following.

Is there a simple way for this? I can use notheorems option for beamer and redefine the environments myself but in this case the colour styles of the environments are removed.

-
You can say \newtheorem{mylemma}{Lemma} or \newtheorem{mylemma}{\translate{Lemma}} if you want to rely on multilingual features. The appearance of the mylemma environment will be the same as for theorems, but with autonomous numbering. This said, I prefer consecutive numbering even for presentations. –  egreg Jul 12 '13 at 13:50
This also kills the colouring for example. –  bkarpuz Jul 12 '13 at 15:55
Please, give an example of what you're doing –  egreg Jul 12 '13 at 16:00
Please see the pictures in OP (just added). –  bkarpuz Jul 12 '13 at 16:11
@bkarpuz Use \theoremstyle according to my changed answer. –  Toscho Jul 12 '13 at 17:09

beamer uses amsthm, which doesn't have a \renewtheorem like ntheorem does. You could hack into beamer (the file is /tex/latex/beamer/beamerbasetheorems.sty) but that is really bad behaviour. It's probably easier, to just \undef (from the package etoolbox) the macro \lemma and recreate the theorem with \newtheorem.

\documentclass{beamer}
\usepackage{etoolbox}
\setbeamertemplate{theorems}[numbered]
\undef{\lemma}
\undef{\example}
\newtheorem{lemma}{\translate{Lemma}}
\theoremstyle{example}
\newtheorem{example}{\translate{Example}}
\begin{document}
\begin{frame}
\begin{lemma}{Foobar}
Foo and bar.
\end{lemma}
\begin{lemma}{Barfoo}
Either bar or foo.
\end{lemma}
\begin{theorem}{Something new}
No, not really.
\end{theorem}
\begin{example}{Color?}
Indeed.
\end{example}
\end{frame}
\end{document}


Concerning other theorem environments: look at the above file. After \mode<all>{ you'll find the definitions, beamer does, which you can \undef and recreate as you like. By default, the counting depends on the counting of theorem (except for proof/beweis of course). You'll also find the theoremstyles used for the different theorems. example for example (no pun intended) uses \theoremstyle{example}.

-
Nope, I do the same for example and it removes the example colouring. It is not green any more... –  bkarpuz Jul 12 '13 at 15:47
I changed the answer to accomodate for that. –  Toscho Jul 12 '13 at 17:10