# 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

## 2 Answers

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]
...
\usetheme{Boadilla}
\begin{document}
\begin{frame}
\balg[Finding the maximum element in a finite sequence]

...

%this is algorithm 1. i want "Algorithm 1 Finding the..." in the slide but it does not done.%
\ealg
\end{frame}
\end{document}

-
This isn't a good place to post a follow-up question; it won't be seen by many users here. You should ask a new question (and include a link to this one if appropriate). –  Ian Thompson Aug 25 at 12:08