Some time ago I did a progress bar, so I changed it to be used in beamer via the \logo
command. The bar overlaps with the navigation symbols, you might want to change it if it is an issue for you:
Code
\documentclass{beamer}
\usetheme{Darmstadt}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{xifthen}
\makeatletter
\newcommand{\Progressbar@LabelColor}{black}
\newcommand{\Progressbar@LabelText}{Label}
\newcommand{\Progressbar@LabelWidth}{5}
% Farbe, Text, Breite des Labels
\newcommand{\Progressbar@BarWidth}{10}
\newcommand{\Progressbar@BarHeight}{1}
\newcommand{\Progressbar@BarColor}{yellow}
\newcommand{\Progressbar@BarBorder}{black}
% Breite, Höhe, Schriftfarbe des Prozentsatzes, Rahmenfarbe des Fortschrittbalkens
\newcommand{\Progressbar@TodoA}{gray}
\newcommand{\Progressbar@TodoB}{black}
% Farbe 1 und 2 für den unerledigten Teil
\newcommand{\Progressbar@DoneA}{red}
\newcommand{\Progressbar@DoneB}{blue}
% Farbe 1 und 2 für den erledigten Teil
\newcommand{\Progressbar@Direction}{LTR}
% Modus links nach rechts oder umgekehrt; umgekehrt ist buggy (no support yet)
\newcommand{\Progressbar@Completion}{50}
% Fertigstellung in Prozent
\define@key{Progressbar}{LabelColor}[\Progressbar@LabelColor]{\renewcommand{\Progressbar@LabelColor}{#1}}
\define@key{Progressbar}{LabelText}[\Progressbar@LabelText]{\renewcommand{\Progressbar@LabelText}{#1}}
\define@key{Progressbar}{LabelWidth}[\Progressbar@LabelWidth]{\renewcommand{\Progressbar@LabelWidth}{#1}}
\define@key{Progressbar}{BarWidth}[\Progressbar@BarWidth]{\renewcommand{\Progressbar@BarWidth}{#1}}
\define@key{Progressbar}{BarHeight}[\Progressbar@BarHeight]{\renewcommand{\Progressbar@BarHeight}{#1}}
\define@key{Progressbar}{BarColor}[\Progressbar@BarColor]{\renewcommand{\Progressbar@BarColor}{#1}}
\define@key{Progressbar}{BarBorder}[\Progressbar@BarBorder]{\renewcommand{\Progressbar@BarBorder}{#1}}
\define@key{Progressbar}{TodoA}[\Progressbar@TodoA]{\renewcommand{\Progressbar@TodoA}{#1}}
\define@key{Progressbar}{TodoB}[\Progressbar@TodoB]{\renewcommand{\Progressbar@TodoB}{#1}}
\define@key{Progressbar}{DoneA}[\Progressbar@DoneA]{\renewcommand{\Progressbar@DoneA}{#1}}
\define@key{Progressbar}{DoneB}[\Progressbar@DoneB]{\renewcommand{\Progressbar@DoneB}{#1}}
\define@key{Progressbar}{Direction}[\Progressbar@Direction]{\renewcommand{\Progressbar@Direction}{#1}}
\define@key{Progressbar}{Completion}[\Progressbar@Completion]{\renewcommand{\Progressbar@Completion}{#1}}
\newcommand{\Progressbar}[1]%
{ \setkeys{Progressbar}{#1}
% Progress Bars --------------------------------------------------
\begin{tikzpicture}[overlay, remember picture,shift={($(current page.south west)+(0.1,0.1)$)}]
\ifthenelse{ \( \Progressbar@Completion = 0 \) \or \( \Progressbar@Completion = 100 \) }
{ \newcommand{\TCA}{\Progressbar@TodoA}
\newcommand{\TCB}{\Progressbar@TodoB}
\newcommand{\DCA}{\Progressbar@DoneA}
\newcommand{\DCB}{\Progressbar@DoneB}
}
{ \newcommand{\TCA}{\Progressbar@TodoB !\Progressbar@Completion !\Progressbar@TodoA}
\newcommand{\TCB}{\Progressbar@TodoB}
\newcommand{\DCA}{\Progressbar@DoneA}
\newcommand{\DCB}{\Progressbar@DoneB !\Progressbar@Completion !\Progressbar@DoneA}
}
\ifthenelse{\equal{\Progressbar@Direction}{LTR}}
{ \shade[left color=\DCA,right color=\DCB]%
(0,0) rectangle (\Progressbar@Completion * \Progressbar@BarWidth / 100,\Progressbar@BarHeight);
\shade[left color=\TCA,right color=\TCB]%
(\Progressbar@Completion * \Progressbar@BarWidth / 100,0)%
rectangle (\Progressbar@BarWidth,\Progressbar@BarHeight);
}
{ \shade[left color=\TCB,right color=\TCA]%
(0,0) rectangle (\Progressbar@Completion * \Progressbar@BarWidth / 100,\Progressbar@BarHeight);
\shade[left color=\DCB,right color=\DCA]%
(\Progressbar@Completion * \Progressbar@BarWidth / 100,0)%
rectangle (\Progressbar@BarWidth,\Progressbar@BarHeight);
}
\draw (0,0) rectangle (\Progressbar@BarWidth,\Progressbar@BarHeight);
\node[color=\Progressbar@BarColor] at%
(\Progressbar@BarWidth / 10,\Progressbar@BarHeight / 2) {\Progressbar@Completion \%};
\draw[color=white] (- \Progressbar@LabelWidth,0) -- %
node[anchor=west,color=\Progressbar@LabelColor,text width=\Progressbar@LabelWidth]%
{\Progressbar@LabelText} (- \Progressbar@LabelWidth,\Progressbar@BarHeight) ;
% \typeout{todo c1 = \TCA}
% \typeout{todo c2 = \TCB}
% \typeout{done c1 = \DCA}
% \typeout{done c2 = \DCB}
\end{tikzpicture}
}
\makeatother
\logo { \pgfmathsetmacro{\wid}{\the\paperwidth/28.45276-0.2}
\pgfmathtruncatemacro{\prog}{100*\insertpagenumber/\insertdocumentendpage}
\Progressbar{ LabelColor=yellow,%
LabelText=,%
LabelWidth=0,%
BarWidth=\wid,%
BarHeight=0.3,%
BarColor=green,%
BarBorder=black,%
TodoA=orange!20!gray,%
TodoB=orange!80!gray,%
DoneA=blue!80!cyan,%
DoneB=blue!20!cyan,%
Completion=\prog%
}
}
\begin{document}
\begin{frame}
\only<1>{Sha la la.}
\only<2>{Shu bi du.}
\only<3>{Tri Tra.}
\only<4>{Trullala.}
page - frame - totalpages : \insertpagenumber\ - \insertframenumber\ - \insertdocumentendpage
\end{frame}
\begin{frame}
\only<1>{One.}
\only<2>{Zwei.}
\only<3>{Tri.}
\only<4>{Quattro.}
\only<5>{Cinq.}
\only<6>{Seis.}
\only<7>{Siedem.}
\only<8>{Kahdeksan.}
page - frame - totalpages : \insertpagenumber\ - \insertframenumber\ - \insertdocumentendpage
\end{frame}
\end{document}
Output
Edit 1
On popular demand by a single person, I reworked this as it was only "some kind of working". Instead of doing complicated computations with colors now I just use clipping.
RTL progression of the bar now works, furthermore you can influence the position of the percentage label.
Code
\documentclass{beamer}
\usetheme{Darmstadt}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{xifthen}
\makeatletter
\newcommand{\Progressbar@BarWidth}{10}
\newcommand{\Progressbar@BarHeight}{1}
\newcommand{\Progressbar@BarColor}{yellow}
\newcommand{\Progressbar@BarBorder}{black}
\newcommand{\Progressbar@BarPosition}{10}
% Breite, Höhe, Schriftfarbe des Prozentsatzes, Rahmenfarbe, Bechriftungsposition des Fortschrittbalkens
\newcommand{\Progressbar@TodoA}{gray}
\newcommand{\Progressbar@TodoB}{black}
% Farbe 1 und 2 für den unerledigten Teil
\newcommand{\Progressbar@DoneA}{red}
\newcommand{\Progressbar@DoneB}{blue}
% Farbe 1 und 2 für den erledigten Teil
\newcommand{\Progressbar@Direction}{LTR}
% Modus links nach rechts oder umgekehrt; umgekehrt ist buggy (no support yet)
\newcommand{\Progressbar@Completion}{50}
% Fertigstellung in Prozent
\define@key{Progressbar}{BarWidth}[\Progressbar@BarWidth]{\renewcommand{\Progressbar@BarWidth}{#1}}
\define@key{Progressbar}{BarHeight}[\Progressbar@BarHeight]{\renewcommand{\Progressbar@BarHeight}{#1}}
\define@key{Progressbar}{BarColor}[\Progressbar@BarColor]{\renewcommand{\Progressbar@BarColor}{#1}}
\define@key{Progressbar}{BarBorder}[\Progressbar@BarBorder]{\renewcommand{\Progressbar@BarBorder}{#1}}
\define@key{Progressbar}{BarPosition}[\Progressbar@BarPosition]{\renewcommand{\Progressbar@BarPosition}{#1}}
\define@key{Progressbar}{TodoA}[\Progressbar@TodoA]{\renewcommand{\Progressbar@TodoA}{#1}}
\define@key{Progressbar}{TodoB}[\Progressbar@TodoB]{\renewcommand{\Progressbar@TodoB}{#1}}
\define@key{Progressbar}{DoneA}[\Progressbar@DoneA]{\renewcommand{\Progressbar@DoneA}{#1}}
\define@key{Progressbar}{DoneB}[\Progressbar@DoneB]{\renewcommand{\Progressbar@DoneB}{#1}}
\define@key{Progressbar}{Direction}[\Progressbar@Direction]{\renewcommand{\Progressbar@Direction}{#1}}
\define@key{Progressbar}{Completion}[\Progressbar@Completion]{\renewcommand{\Progressbar@Completion}{#1}}
\newcommand{\Progressbar}[1]%
{ \setkeys{Progressbar}{#1}
% Progress Bars --------------------------------------------------
\begin{tikzpicture}[overlay, remember picture,shift={($(current page.south west)+(0.1,0.1)$)}]
\draw[draw=\Progressbar@BarBorder,ultra thick] (0,0) rectangle (\Progressbar@BarWidth,\Progressbar@BarHeight);
\ifthenelse{\equal{\Progressbar@Direction}{LTR}}
{ \shade[left color=\Progressbar@TodoA,right color=\Progressbar@TodoB]%
(0,0) rectangle (\Progressbar@BarWidth,\Progressbar@BarHeight);
\begin{scope}
\clip (0,0) rectangle (\Progressbar@Completion * \Progressbar@BarWidth / 100,\Progressbar@BarHeight);
\shade[left color=\Progressbar@DoneA,right color=\Progressbar@DoneB]%
(0,0) rectangle (\Progressbar@BarWidth,\Progressbar@BarHeight);
\end{scope}
}
{ \shade[left color=\Progressbar@TodoB,right color=\Progressbar@TodoA]%
(0,0) rectangle (\Progressbar@BarWidth,\Progressbar@BarHeight);
\begin{scope}
\clip ({(100-\Progressbar@Completion) * \Progressbar@BarWidth / 100},0)%
rectangle (\Progressbar@BarWidth,\Progressbar@BarHeight);
\shade[left color=\Progressbar@DoneB,right color=\Progressbar@DoneA]%
(0,0) rectangle (\Progressbar@BarWidth,\Progressbar@BarHeight);
\end{scope}
}
\node[color=\Progressbar@BarColor] at%
(\Progressbar@BarWidth / 100 * \Progressbar@BarPosition,\Progressbar@BarHeight / 2) {\Progressbar@Completion \%};
\end{tikzpicture}
}
\makeatother
\logo { \pgfmathsetmacro{\wid}{\the\paperwidth/28.45276-0.2}
\pgfmathtruncatemacro{\prog}{100*\insertpagenumber/\insertdocumentendpage}
\pgfmathtruncatemacro{\mybarpos}{104-\prog}
\Progressbar{ BarWidth=\wid,%
BarHeight=0.3,%
BarColor=green,%
BarBorder=none,%
BarPosition=\mybarpos,%
TodoA=orange!20!gray,%
TodoB=orange!80!gray,%
DoneA=blue!80!cyan,%
DoneB=blue!20!cyan,%
Completion=\prog,%
Direction=RTL,%
}
}
\begin{document}
\begin{frame}
\only<1>{Sha la la.}
\only<2>{Shu bi du.}
\only<3>{Tri Tra.}
\only<4>{Trullala.}
page - frame - totalpages : \insertpagenumber\ - \insertframenumber\ - \insertdocumentendpage
\end{frame}
\begin{frame}
\only<1>{One.}
\only<2>{Zwei.}
\only<3>{Tri.}
\only<4>{Quattro.}
\only<5>{Cinq.}
\only<6>{Seis.}
\only<7>{Siedem.}
\only<8>{Kahdeksan.}
page - frame - totalpages : \insertpagenumber\ - \insertframenumber\ - \insertdocumentendpage
\end{frame}
\end{document}
Output
progressbar=foot|head|frametitle|none
package option. It doesn't seem to work for me, though.