# Numbered Definitions, Theorems in beamer

How to get numbered Lemmas, Definitions, Theorems and so on in beamer?

-
Could you post an example of your code where this isn't working? I don't know of any particular problem with getting numbered environments in beamer (not that I've much experience with it) so if you could post what isn't working it would help clarify where you need most help. –  Loop Space Aug 10 '12 at 14:19
\setbeamertemplate{theorems}[numbered] –  Marco Daniel Aug 10 '12 at 14:40

You can set the theorems template with the numbered option:

\setbeamertemplate{theorems}[numbered]


or with the ams style option:

\setbeamertemplate{theorems}[ams style]


If additionally you use the envcountsect class option by loading beamer in the following way:

\documentclass[envcountsect]{beamer}


then theorems, definitions, and so on to be numbered locally to each section (by default they are numbered consecutively throughout the presentation).

-
 ...

\theoremstyle{definition}
\newtheorem{alg}{algorithm}

\newcommand{\balg}{\begin{alg}}
\newcommand{\ealg}{\end{alg}}
\setbeamertemplate{alg}[numbered]
...