Commit 16c6b958 authored by Ivo Kabadshow's avatar Ivo Kabadshow

fix progress bar computation

parent 356d7253
Pipeline #11693 failed with stage
......@@ -213,7 +213,7 @@
%------------------------------------------------
\defbeamertemplate{progressbar}{visible}
{%
\tlap{\progressbar@progressbar}
\usebeamertemplate*{progress bar footer}
}
\defbeamertemplate*{progressbar}{invisible}{}
......
......@@ -10,6 +10,7 @@
\RequirePackage{calc}
\RequirePackage{textcase}
\usetikzlibrary{calc}
\usetikzlibrary{external}
\ifluatex
\RequirePackage{microtype}
......@@ -91,27 +92,26 @@
% define progressbar
\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=0.2ex
\def\progressbar@progressbar{%
\progressbar@tmpcounta=\insertframenumber
\progressbar@tmpcountb=\inserttotalframenumber
\progressbar@tmpdim=\progressbar@pbwd
\divide\progressbar@tmpdim by 128
\multiply\progressbar@tmpdim by \progressbar@tmpcounta
\divide\progressbar@tmpdim by \progressbar@tmpcountb
\multiply\progressbar@tmpdim by 128
\begin{tikzpicture}
\draw[draw=none,fill=fzjblue] %
(0pt, 0pt) rectangle ++ (\progressbar@tmpdim, \progressbar@pbht);
\end{tikzpicture}%
\newlength{\fzj@progressinheadfoot}
\newlength{\fzj@progressinheadfoot@linewidth}
\setlength{\fzj@progressinheadfoot@linewidth}{0.4pt}
\setbeamertemplate{progress bar footer}{
\nointerlineskip
\setlength{\fzj@progressinheadfoot}{%
\paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
}%
\begin{beamercolorbox}[wd=\paperwidth]{progress bar footer}
\tikzset{external/export next=false}%
\begin{tikzpicture}
\fill[fg] (0,0) rectangle (\fzj@progressinheadfoot, \fzj@progressinheadfoot@linewidth);
\end{tikzpicture}%
\end{beamercolorbox}
}
% make sure we have a large number of total slided before the first run to keep the frame/total frame ratio below 1
% if your slide deck has more than 300 slides, you might increase the number below
% after the second latex run the totalframenumber will be read correctly from the .aux file
\def\inserttotalframenumber{300}
\makeatother
\documentclass[t]{beamer}
\usetheme{Juelich}
\usepackage{calc}
\title{Test for Very Long Documents}
\subtitle{Large numbers might break computation}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment