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 @@ ...@@ -213,7 +213,7 @@
%------------------------------------------------ %------------------------------------------------
\defbeamertemplate{progressbar}{visible} \defbeamertemplate{progressbar}{visible}
{% {%
\tlap{\progressbar@progressbar} \usebeamertemplate*{progress bar footer}
} }
\defbeamertemplate*{progressbar}{invisible}{} \defbeamertemplate*{progressbar}{invisible}{}
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
\RequirePackage{calc} \RequirePackage{calc}
\RequirePackage{textcase} \RequirePackage{textcase}
\usetikzlibrary{calc} \usetikzlibrary{calc}
\usetikzlibrary{external}
\ifluatex \ifluatex
\RequirePackage{microtype} \RequirePackage{microtype}
...@@ -91,27 +92,26 @@ ...@@ -91,27 +92,26 @@
% define progressbar % define progressbar
\makeatletter \makeatletter
\def\progressbar@progressbar{} % the progress bar
\newcount\progressbar@tmpcounta% auxiliary counter \newlength{\fzj@progressinheadfoot}
\newcount\progressbar@tmpcountb% auxiliary counter \newlength{\fzj@progressinheadfoot@linewidth}
\newdimen\progressbar@pbht %progressbar height \setlength{\fzj@progressinheadfoot@linewidth}{0.4pt}
\newdimen\progressbar@pbwd %progressbar width \setbeamertemplate{progress bar footer}{
\newdimen\progressbar@tmpdim % auxiliary dimension \nointerlineskip
\setlength{\fzj@progressinheadfoot}{%
\progressbar@pbwd=\paperwidth \paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
\progressbar@pbht=0.2ex }%
\begin{beamercolorbox}[wd=\paperwidth]{progress bar footer}
\def\progressbar@progressbar{% \tikzset{external/export next=false}%
\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} \begin{tikzpicture}
\draw[draw=none,fill=fzjblue] % \fill[fg] (0,0) rectangle (\fzj@progressinheadfoot, \fzj@progressinheadfoot@linewidth);
(0pt, 0pt) rectangle ++ (\progressbar@tmpdim, \progressbar@pbht);
\end{tikzpicture}% \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 \makeatother
\documentclass[t]{beamer} \documentclass[t]{beamer}
\usetheme{Juelich} \usetheme{Juelich}
\usepackage{calc}
\title{Test for Very Long Documents} \title{Test for Very Long Documents}
\subtitle{Large numbers might break computation} \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