I'd like to add a progress bar to my presentation (I got the idea from this question) but I believe something is preventing it from showing up in output and I can't seem to figure it out.
Here is my MWE:
\documentclass[xcolor=dvipsnames]{beamer}
\usepackage[danish]{babel}
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{url}
\usepackage{graphics,epsfig, subfigure}
\usepackage{fancybox}
\usepackage{extarrows}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{mathtools}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{picture}
\usepackage{fancybox}
\usepackage{xcolor}
\mode<presentation> {
\usetheme{CambridgeUS}
\setbeamertemplate{headline}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,center]{section in head/foot}%
\usebeamerfont{section in head/foot}\insertsectionhead\hspace*{2ex}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.65ex,dp=1.5ex,center]{subsection in head/foot}%
\usebeamerfont{subsection in head/foot}\hspace*{2ex}\insertsubsectionhead
\end{beamercolorbox}}%
\vskip0pt%
}
}
\useinnertheme{circles}
\usefonttheme[onlymath]{serif}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{pbblue}{HTML}{0A75A8}% color for the progress bar and the circle
\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@rcircle % radius for the circle
\newdimen\progressbar@tmpdim % auxiliary dimension
\progressbar@pbwd=\linewidth
\progressbar@pbht=1pt
\progressbar@rcircle=2.5pt
% the progress bar
\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}
\draw[pbblue!30,line width=\progressbar@pbht]
(0pt, 0pt) -- ++ (\progressbar@pbwd,0pt);
\filldraw[pbblue!30] %
(\the\dimexpr\progressbar@tmpdim-\progressbar@rcircle\relax, .5\progressbar@pbht) circle (\progressbar@rcircle);
\node[draw=pbblue!30,text width=3.5em,align=center,inner sep=1pt,
text=pbblue!70,anchor=east] at (0,0) {\insertframenumber/\inserttotalframenumber};
\end{tikzpicture}%
}
\addtobeamertemplate{headline}{}
{%
\begin{beamercolorbox}[wd=\paperwidth,ht=4ex,center,dp=1ex]{white}%
\progressbar@progressbar%
\end{beamercolorbox}%
}
\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\setbeamertemplate{blocks}[rounded][shadow=true]
\setbeamertemplate{frametitle}[default][right]% align the frametitle to the right
\setdefaultlanguage{english}
\setotherlanguage[calendar=gregorian,numerals=maghrib]{arabic}
\setbeamercolor{block title}{bg=green,fg=black}
\AtBeginEnvironment{exampleblock}{\setbeamercolor{item projected}{bg=gray}}
\newfontfamily\arabicfont[Script=Arabic,Scale=0.8]{IRNazli}
\newfontfamily\latinfontsf[Script=Latin,Scale=0.3]{Calibri}
\newfontfamily\arabicfontsf[Script=Arabic,Scale=0.8]{IRNazli}
\newfontfamily\digitfont[Script=Arabic,Scale=0.8]{IRNazli}
\newfontfamily{\F}{IRNazli} % Farsi
\newfontfamily{\I}{IranNastaliq} % Farsi
\newfontfamily{\C}{Calibri}
\setbeamercovered{transparent}
%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\newcommand{\myitemII}{\par\vspace{3pt}\hspace{5mm}\LR{\hspace*{3pt}%
\begin{pgfpicture}{-1ex}{-0.65ex}{1ex}{1ex}
\usebeamercolor[fg]{item projected}
{\pgftransformscale{2}\pgftext{\normalsize\pgfuseshading{\setbeamertemplate{enumerate items}[circle]}}}
\end{pgfpicture}%
\hspace{1pt}%
}}
% ======================================================
\makeatletter
\DeclareMathSizes{\f@size}{10}{7}{7}
\makeatother
\makeatletter
\defbeamertemplate*{headline}{arabic split theme}
{
\leavevmode%
\@tempdimb=2.4375ex%
\ifnum\beamer@subsectionmax<\beamer@sectionmax%
\multiply\@tempdimb by\beamer@sectionmax%
\else%
\multiply\@tempdimb by\beamer@subsectionmax%
\fi%
\ifdim\@tempdimb>0pt%
\advance\@tempdimb by 1.825ex%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
\vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.5\paperwidth}\vfil}%
\usebeamerfont{subsection in head/foot}\hspace*{4ex}\insertsubsectionhead
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
\vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
\usebeamerfont{section in head/foot}\insertsectionhead\vfil%
\end{beamercolorbox}%
\fi%
}
\makeatother
%----------------------------------------------------------------------------------------
% TITLE PAGE
%----------------------------------------------------------------------------------------
\title{\F \RL{\textbf{مسئله یادگیری دیکشنری }}}
\author{{\setRTL \F \RL{\textbf{فلان الدین فلانی}}} }
\institute[]
{
\F \RL{\textbf{\normalsize{ دانشگاه فلان}}}
\medskip
}
\date{\F \RL{شهریور ۱۲۹۱}}
\begin{document}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\end{document}
But nothing shows up in the output as a progress bar. I'd like to know what is preventing it from showing up.
EDIT: I think I found the cause; when I remove this part from the code, the progress bar appears in the ouptput document.
\makeatletter
\DeclareMathSizes{\f@size}{10}{7}{7}
\makeatother
\makeatletter
\defbeamertemplate*{headline}{arabic split theme}
{
\leavevmode%
\@tempdimb=2.4375ex%
\ifnum\beamer@subsectionmax<\beamer@sectionmax%
\multiply\@tempdimb by\beamer@sectionmax%
\else%
\multiply\@tempdimb by\beamer@subsectionmax%
\fi%
\ifdim\@tempdimb>0pt%
\advance\@tempdimb by 1.825ex%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
\vbox to\@tempdimb{\vfil\insertsubsectionnavigation{.5\paperwidth}\vfil}%
\usebeamerfont{subsection in head/foot}\hspace*{4ex}\insertsubsectionhead
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
\vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
\usebeamerfont{section in head/foot}\insertsectionhead\vfil%
\end{beamercolorbox}%
\fi%
}
\makeatother
But I really don't have a clue what this part of the code is doing because the template was a ready-to-use beamer presentation template that the university recommends to use. So what do you suggest to do?
graphicx
are not needed in beamer, as beamer already provides these functionalities.\F
command? Single letter commands can be very troublesome.