I want to test if a given page is a section page in beamer.
The idea is to draw a progress bar, and 'mark' the positions of the next section. However, for that I need to know if a given page is a section page, and if it is then do something.
This is how I draw the progressbar:
\setbeamertemplate{background}{%
\progressbar@tmpcounta=\insertframenumber
\progressbar@tmpcountb=\inserttotalframenumber
\progressbar@tmpdim=\progressbar@progresswidth
\multiply\progressbar@tmpdim by \progressbar@tmpcounta
\divide\progressbar@tmpdim by \progressbar@tmpcountb
\begin{tikzpicture}
\useasboundingbox (0,0) rectangle (\the\paperwidth, \the\paperheight);
\fill[color=FuwaWhite] (0,0) rectangle (12.8cm, 9.6cm);
\ifnum\thepage=1\relax\else
\draw[fill=FuwaGreen,draw=none] (0cm, 0cm) rectangle (\progressbar@tmpdim,0.05cm);
\node[anchor=south] at(6.4cm, 0.1cm) {\color{FuwaAnthrazit}\tiny\insertdate};
\node[anchor=south east] at(12.8cm, 0.1cm) {\color{FuwaAnthrazit}\tiny\insertframenumber/%
\inserttotalframenumber};
\fi
\foreach \x in {1,...,\inserttotalframenumber} {%
\progressbar@tmpdim=\progressbar@progresswidth
\divide\progressbar@tmpdim by \totvalue{section}
\draw[fill=FuwaGreen!50!FuwaBlack,draw=none] (\x*\progressbar@tmpdim, 0) rectangle (\x*\progressbar@tmpdim+0.05cm, 0.05cm);
}
\end{tikzpicture}
}
However they are evenly spaced, I want them to be spaced to be like the sections. So I would instead iterate over each page and check if that page is a section page (i.e., what beamer considers a section page) and then draw something.
a section page
? Are you looking for\AtBeginSection[]
?\documentclass{...}
, the required\usepackage
's,\begin{document}
, and\end{document}
. Right now pasting your code in an otherwise empty beamer document, just gives me tons of errors...