Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

Bonus question: how can I make the section numbers also appear in the table of contents?

So instead of:

Introduction Concepts Realisation

it should be:

  1. Introduction 2. Concepts 3. Realisation
share|improve this question

migrated from stackoverflow.com Aug 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

1 Answer 1

up vote 6 down vote accepted

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 head/foot}{\hfill\insertsectionheadnumber.~\insertsectionhead}
\setbeamertemplate{section in head/foot shaded}{\color{structure!50}\hfill\insertsectionheadnumber.~\insertsectionhead}
\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:

enter image description here

share|improve this answer
    
Thanks, that worked perfectly! –  Serban Sep 3 '12 at 7:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.