Commit 56fbdaa3 authored by Andreas Herten's avatar Andreas Herten

[WIP] Commit with old implementation artifacts

parent 5c8b1099
......@@ -12,6 +12,7 @@
\RequirePackage{tikz}
\RequirePackage{calc}
\RequirePackage{textcase}
\RequirePackage{ifthen}
\usetikzlibrary{calc}
\usetikzlibrary{external}
......@@ -98,18 +99,150 @@
% define progressbar
\makeatletter
\newlength{\fzj@progressinheadfoot}
\newlength{\fzj@progressinheadfoot@linewidth}
\setlength{\fzj@progressinheadfoot@linewidth}{0.4pt}
\newif\iffzj@progressbar@countoverlays
\newif\iffzj@progressbar@countappendix
\newif\iffzj@progressbar@counttitlepage
\newif\iffzj@progressbar@invertappendix
\pgfkeys{/beamerfzj/progress bar/.cd,
%
height/.default=0.4pt,
height/.code={%
\setlength{\fzj@progressbar@height}{#1}%
},
%
% count overlays/.is choice,
% count overlays/.default=no,
% count overlays/no/.code={%
% \renewcommand\fzj@progressbar@end\inserttotalframenumber%
% \renewcommand\fzj@progressbar@current\insertframenumber%
% \fzj@progressbar@countoverlaysfalse%
% },
% count overlays/yes/.code={%
% \renewcommand\fzj@progressbar@end\insertdocumentendpage%
% \renewcommand\fzj@progressbar@current\insertpagenumber%
% \fzj@progressbar@countoverlaystrue%
% },
count overlays/.is if=fzj@progressbar@countoverlays,
%
% count appendix/.is choice,
% count appendix/.default=no,
% count appendix/no/.code={%
% \fzj@progressbar@countappendixfalse},
% count appendix/yes/.code={%
% \iffzj@progressbar@countoverlays
% \renewcommand\fzj@progressbar@end{\beamer@startpageofappendix - 1}%
% \fzj@progressbar@countappendixtrue
% \else
% % not implemented
% \fi
% },
count appendix/.is if=fzj@progressbar@countappendix,
%
% count titlepage/.is choice,
% count titlepage/.default=no,
% count titlepage/no/.code={%
% \renewcommand{\fzj@progressbar@titlepagereduction}{0}%
% \fzj@progressbar@counttitlepagefalse
% },
% count titlepage/yes/.code={%
% \renewcommand{\fzj@progressbar@titlepagereduction}{1}%
% \fzj@progressbar@counttitlepagetrue
% },
count titlepage/.is if=fzj@progressbar@counttitlepage,
%
invert appendix/.is choice,
invert appendix/.default=no,
invert appendix/no/.code={},
invert appendix/yes/.code={%
% % \ifnum\insertpagenumber>\beamer@startpageofappendix
% \renewcommand{\fzj@progressbar@titlepagereduction}{\ifnum\insertpagenumber>\beamer@startpageofappendix 0\else\fi}
% \renewcommand{\fzj@progressbar@end}{\ifnum\insertpagenumber>\beamer@startpageofappendix \insertdocumentendpage\else\fi}
% \pgfmathsetmacro{\fzj@progressbar@current}{\ifnum\insertpagenumber>\beamer@startpageofappendix \insertpagenumber-\beamer@startpageofappendix\else\fi}
% \else
% \fi
},
invert appendix/.is if=fzj@progressbar@invertappendix
}
\newcommand\fzj@progressbar@end\inserttotalframenumber%
\newcommand\fzj@progressbar@current\insertframenumber%
\newlength{\fzj@progressbar@width}%
\newlength{\fzj@progressbar@height}%
\newcommand\fzj@progressbar@titlepagereduction@current{0}%
\newcommand\fzj@progressbar@titlepagereduction@end{0}%
\pgfkeys{/beamerfzj/progress bar/height}%
% % \pgfkeys{/beamerfzj/progress bar/count overlays}
% \pgfkeys{/beamerfzj/progress bar/count appendix}
% \pgfkeys{/beamerfzj/progress bar/count titlepage}
% \pgfkeys{/beamerfzj/progress bar/invert appendix}
\setbeamertemplate{progress bar footer}{
\nointerlineskip
\setlength{\fzj@progressinheadfoot}{%
\paperwidth * \ratio{\insertframenumber pt}{\inserttotalframenumber pt}%
%%
%% CHECK OPTIONS
%%
%% Count pages (overlays) or frames?
\iffzj@progressbar@countoverlays%
\renewcommand\fzj@progressbar@end\insertdocumentendpage%
\renewcommand\fzj@progressbar@current\insertpagenumber%
\else%
\renewcommand\fzj@progressbar@end\inserttotalframenumber%
\renewcommand\fzj@progressbar@current\insertframenumber%
\fi%
%% Stop at end of appendix or before appendix?
\iffzj@progressbar@countappendix%
% Don't change anything
\else%
%% This works only if we count pages and not frames
\iffzj@progressbar@countoverlays%
\renewcommand\fzj@progressbar@end{\beamer@startpageofappendix - 1}%
\else%
% not implemented, one would need \beamer@startpageofappendix but for frame number and not page number
\fi%
\fi%
%% Include the title page in progress bar or not
%% There are so many ifs because frame count for title page is 0, bud slide count for title page is 1
\iffzj@progressbar@counttitlepage%
\iffzj@progressbar@countoverlays%
\renewcommand{\fzj@progressbar@titlepagereduction@current}{0}%
\renewcommand{\fzj@progressbar@titlepagereduction@end}{0}%
\else%
\renewcommand{\fzj@progressbar@titlepagereduction@current}{1}%
\renewcommand{\fzj@progressbar@titlepagereduction@end}{1}%
\fi%
\else%
\iffzj@progressbar@countoverlays%
\renewcommand{\fzj@progressbar@titlepagereduction@current}{-1}%
\renewcommand{\fzj@progressbar@titlepagereduction@end}{+1}%
\else%
\renewcommand{\fzj@progressbar@titlepagereduction@current}{0}%
\renewcommand{\fzj@progressbar@titlepagereduction@end}{2}%
\fi%
\fi%
%% Invert appendix progress bar
%%% Only supported for frames
%%% Makes only sense if count appendix=true
\iffzj@progressbar@invertappendix%
\ifthenelse{\not\(\insertpagenumber<\beamer@startpageofappendix\)}{%
\pgfmathsetmacro{\fzj@progressbar@current}{1+\insertdocumentendpage-\insertpagenumber}
\pgfmathsetmacro{\fzj@progressbar@end}{2+\insertdocumentendpage-(\beamer@startpageofappendix)}
}%
{}%
\else%
% Nothing to do here
\fi%
%%
%%
%%
\nointerlineskip%
\pgfmathsetlength{%
\fzj@progressbar@width%
}{%
\paperwidth * divide(\fzj@progressbar@current + \fzj@progressbar@titlepagereduction@current,\fzj@progressbar@end - \fzj@progressbar@titlepagereduction@end)%
}%
\begin{beamercolorbox}[wd=\paperwidth]{progress bar footer}
\tikzset{external/export next=false}%
\begin{tikzpicture}
\fill[fg] (0,0) rectangle (\fzj@progressinheadfoot, \fzj@progressinheadfoot@linewidth);
\fill[fg] (0,0) rectangle (\fzj@progressbar@width, \fzj@progressbar@height);
\end{tikzpicture}%
\end{beamercolorbox}
}
......
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