I'm writing my own beamer theme, I had some fancy idea to layout my header in beamer class: I progress bar on top and below the sections corresponding to the slides where they start, namely:

----------
Section 1


The progress bar is designed as follows:

\progressbar{\footerBarHeight}
\dimen0=\textwidth
\edef\progressbarwidth{\the\dimen0}
\leavevmode%
\begin{beamercolorbox}[wd=\textwidth,ht=.1ex,dp=.1ex]{progress bar}
\begin{beamercolorbox}[wd=\progressbarwidth,ht=.1ex,dp=.1ex]{progress bar progress}
\end{beamercolorbox}%
\end{beamercolorbox}%


So, my idea was to use the data in the .toc-file

\beamer@sectionintoc {1}{Section 1}{2}{0}{1}
\defcounter {refsection}{0}\relax
\beamer@subsectionintoc {1}{1}{Subsection 1.1}{7}{0}{1}
\defcounter {refsection}{0}\relax
\beamer@subsectionintoc {1}{2}{Subsection 1.2}{10}{0}{1}
\defcounter {refsection}{0}\relax
\beamer@sectionintoc {2}{Section 2}{13}{0}{2}
\defcounter {refsection}{0}\relax
\beamer@sectionintoc {3}{Section 3}{22}{0}{3}

that provides the page number where the section starts and compare this with (e.g. \insertframenumber) to align & print the three section title by \insertsection.

My questions:

(1) Can I use this data? Is there any variable already defined in beamer to get the page number of the @sectionintoc?

(2) Is there an easier way just to print all three section titles? (Maybe iterate modulo something).

• I think it is easier to work with labels, e.g. exploiting \getrefnumber from the refcount package (which is loaded most likely anyways, since beamer uses hyperref by default) – user31729 Dec 30 '16 at 23:27
• maybe you can get something useful from tex.stackexchange.com/questions/338241/… – samcarter_is_at_topanswers.xyz Dec 31 '16 at 13:46

(1) Yes, \insertsectionstartpage. See the manual page 65.

(2) Yes,

\documentclass{beamer}

\begin{document}

\section{title of section 1}
\section{title of section 2}
\section{title of section 3}
\section{title of section 4}
\section{title of section 5}
\subsection{title of subsection 5-1}

\makeatletter
\def\beamer@endinputifotherversion#1{}
\def\beamer@sectionintoc#1#2#3#4#5{#2;}
\def\beamer@subsectionintoc#1#2#3#4#5#6{}
%\def\beamer@subsubsectionintoc#1#2#3#4#5#6#7{}

\frame{
\@input{\jobname.toc}
}

\end{document}