http://bjoernstechblog.rueffer.info/posts/latex/beamer/2009/12/21/How-to-generate-a-tartclock-shaped-progress-meter-for-latex-beamer/
last updated on 25 May 2018

21 December 2009

How to generate a tart/clock shaped progress meter for latex-beamer

_Update:__ Here is a rewrite of the previously published version. This new version is a bit more elegant and uses the pgfmath package for computations. So, to have a tart diagram inform your listeners about the progress made in your presentation, include the following TeX code into the preamble of your document. It will redefine the current frametitle template so that after the frame title the tart will appear. I’ve only tested this in the absence of any other templates, so it might not work straight out of the box for your setup. Feel free to modify this, though.

\usepackage{pgfmath}
\usepackage{tikz,ifthen}%


%% frametitle with tart-like progress meter
\setbeamertemplate{frametitle}{%
  \vskip-2pt%
  \begin{beamercolorbox}[rightskip=2cm,leftskip=1em,dp=1ex,wd=12.8cm]{frametitle}%
	\vskip2pt%
	\usebeamercolor{frametitle}%
	\begin{tikzpicture}[scale=1]% 
	  \useasboundingbox (0,0) rectangle (0,0); %(-1,-1) rectangle (1,1);%
	  \ifthenelse{\insertframenumber<\inserttotalframenumber}{%
		%% uncomplete tart          
		\pgfmathsetmacro{\aimangle}{90-(\insertframenumber*360/\inserttotalframenumber)}
		\fill [fill=frametitle.fg,thin] (11.8,.1) -- (11.8,0.4) arc
		(90:\aimangle:0.3) -- cycle;%
	  }{
		%% the full tart
		\fill[fill=frametitle.fg,thin] (11.8,.1) circle (.3);%
	  }%
	\end{tikzpicture}
	\insertframetitle%
	\vskip2pt%
  \end{beamercolorbox}% 
}

Documentation on the commands used here can be found in your local pgfuserguide.pdf and ifthen.pdf which should come with any recent TeX distribution.

Björn Rüffer — Copyright © 2009–2018 — bjoern.rueffer.info