I’m trying to position a minimal progress bar just beneath the frame title and frame title + framesubtitle bar of the Warsaw theme:
\documentclass[compress]{beamer}
\mode<presentation>
{
\usetheme{Warsaw}
}
\usepackage[latin1]{inputenc}
\usepackage{times}
\usepackage[T1]{fontenc}
% Progressbar
\usepackage{tikz}
\usetikzlibrary{calc}
\makeatletter
\def\progressbar@progressbar{} % the progress bar
\newcount\progressbar@tmpcounta% auxiliary counter
\newcount\progressbar@tmpcountb% auxiliary counter
\newdimen\progressbar@pbht %progressbar height
\newdimen\progressbar@pbwd %progressbar width
\newdimen\progressbar@tmpdim % auxiliary dimension
\progressbar@pbwd=\paperwidth
\progressbar@pbht=1pt
\def\progressbar@progressbar{%
\progressbar@tmpcounta=\insertframenumber
\progressbar@tmpcountb=\inserttotalframenumber
\progressbar@tmpdim=\progressbar@pbwd
\multiply\progressbar@tmpdim by \progressbar@tmpcounta
\divide\progressbar@tmpdim by \progressbar@tmpcountb
\begin{tikzpicture}[very thin]
\shade[draw=red,top color=red!10,bottom color=red!10,middle color=red] %
(0pt, 0pt) rectangle ++ (\progressbar@tmpdim, \progressbar@pbht);
\end{tikzpicture}%
}
\addtobeamertemplate{frametitle}{}
{%
\begin{beamercolorbox}[wd=\paperwidth,ht=1pt,dp=1pt]{}%
\progressbar@progressbar%
\end{beamercolorbox}%
}%
\makeatother
\begin{document}
\section{Section}
\subsection{Subsection}
\begin{frame}{Frametitle}{Framesubtitle}
\end{frame}
\begin{frame}{Frametitle}
\end{frame}
\end{document}
However, this positions the progress bar about 20pt below the frame titles on all frames (see below). How can this be solved?