Edit a default latex/beamer theme to show section numbers

I am using beamer to create a presentation. The theme I chose is Singapore. It has a nice header with section names and bullets for subsections.

What is the easiest way to modify the header so that it will also display the section number, not just the title?

Introduction Concepts Realisation

it should be:

1. Introduction 2. Concepts 3. Realisation
-

migrated from stackoverflow.comAug 24 '12 at 0:29

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your question was migrated here from another stackexchange site. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Gonzalo Medina Aug 24 '12 at 2:16

You can redefine the section in head/foot and section in head/foot shaded templates to add \insertsectionheadnumber. For the bonus, you need to redefine section in toc to add \inserttocsectionnumber; an example illustrating these redefinitions:

\documentclass{beamer}
\usetheme{Singapore}

\setbeamertemplate{section in toc}{\inserttocsectionnumber.~\inserttocsection}

\begin{document}

\section{Test Section One}
\begin{frame}
test
\end{frame}
\section{Test Section Two}
\begin{frame}
test
\end{frame}
\section{Test Section Three}
\begin{frame}
test
\end{frame}

\end{document}


An image of the resulting ToC showing the numbering both in the ToC entries and in the headline:

-
Thanks, that worked perfectly! – Serban Sep 3 '12 at 7:14