## LaTeX forum ⇒ Presentations and Posters ⇒ How to get Section Number in each Section Slide on LaTeX Beamer? Topic is solved

Beamer, Powerdot and KOMA-Script presentations, Conference posters (a0poster, baposter, tikzposter)
CMP
Posts: 12
Joined: Thu Aug 22, 2019 8:33 pm

### How to get Section Number in each Section Slide on LaTeX Beamer?

Greetings there,

I've been trying to create Section Number with Section Title in each Section Title Slide Page on Beamer class but was not able to create it.

1 Introduction

I wanted to get

1 Introduction

on page 3, too.

But how could we accomplish this?

I would appreciate for any help in this regard.

Thanks!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Solution can be found at this link

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[xcolor=dvipsnames]{beamer}
\usepackage[T1]{fontenc}
\usetheme{AnnArbor}
\usecolortheme{whale}
\setbeamercolor{title}{bg=RoyalPurple}
\setbeamercolor{frametitle}{fg=white,bg=RoyalPurple}

\usepackage{amsmath}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% To generate generate section title slides automatically in Beamer!
% Taken from this web page:
% https://tex.stackexchange.com/questions/178800/creating-sections-each-with-title-pages-in-beamers-slides
\AtBeginSection[]{
\begin{frame}
\vfill
\centering
\end{beamercolorbox}
\vfill
\end{frame}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Question!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title[\sc Getting Section Number]
{Getting Section Number on \LaTeX \ Beamer Slides}

\begin{frame}
\titlepage
\end{frame}

\tableofcontents
}

\section{Introduction}

\frame{\frametitle{Who is David Hilbert?}

David Hilbert is a great Mathematician!

}

\section{Mathematics}

\frame{{How do you define Mathematics?}

Mathematics is a language of sciences. Moreover, $\cdots$

}

\section{Examples}

\frame{\frametitle{Some Examples}

This is the first example.

}

\end{document}

Attachments
Section Number.pdf

Bartman
Posts: 229
Joined: Fri Jan 03, 2020 2:39 pm
You can put \insertsectionnumber before the section title command.

CMP
Posts: 12
Joined: Thu Aug 22, 2019 8:33 pm
That's exactly what I was looking for.

Thank you very much, Bartman!

Here is a complete example now.

\documentclass[xcolor=dvipsnames]{beamer}
\usepackage[T1]{fontenc}
\usetheme{AnnArbor}
\usecolortheme{whale}
\setbeamercolor{title}{bg=RoyalPurple}
\setbeamercolor{frametitle}{fg=white,bg=RoyalPurple}

\usepackage{amsmath}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% To generate generate section title slides automatically in Beamer!
% Taken from this web page:
% https://tex.stackexchange.com/questions/178800/creating-sections-each-with-title-pages-in-beamers-slides
\AtBeginSection[]{
\begin{frame}
\vfill
\centering
\end{beamercolorbox}
\vfill
\end{frame}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Question!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\title[\sc Getting Section Number]
{Getting Section Number on \LaTeX \ Beamer Slides}

\begin{frame}
\titlepage
\end{frame}

\tableofcontents
}

\section{Introduction}

\frame{\frametitle{Who is David Hilbert?}

David Hilbert is a great Mathematician!

}

\section{Mathematics}

\frame{{How do you define Mathematics?}

Mathematics is a language of sciences. Moreover, $\cdots$

}

\section{Examples}

\frame{\frametitle{Some Examples}

This is the first example.

}

\end{document}

Stefan Kottwitz
Posts: 9768
Joined: Mon Mar 10, 2008 9:44 pm
Hi CMP,

very good complete example!

Btw. I noticed that \sc may not work here:

\title[\sc Getting Section Number]
{Getting Section Number on \LaTeX \ Beamer Slides}

On the one hand, it's an obsolete command, on the other hand, even \scshape or \textsc wouldn't work. I did not check why though, since it's currently not really on topic, only if one is curious.

Stefan

rais
Posts: 293
Joined: Sun Nov 16, 2014 8:51 pm
IIRC, computer modern sans serif font doesn't ship with small caps.
LaTeX Font Warning: Font shape T1/cmss/m/sc' undefined
(Font)              using T1/cmss/m/n' instead on input line 38.


(from the log file) appears to agree with my memory

KR
Rainer