3

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?

output

1 Answer 1

2

How about simply adding a \vspace*{-20pt} to you progress bar?

\addtobeamertemplate{frametitle}{}
{%
  \vspace*{-20pt}
  \begin{beamercolorbox}[wd=\paperwidth,ht=1pt,dp=1pt]{}%
    \progressbar@progressbar%
  \end{beamercolorbox}%
}%

enter image description here

1
  • Of course - thanks! I got lost in the options of the beamercolorbox itself, thinking there was an error there.
    – Karl
    Commented Jan 24, 2015 at 13:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .