# How to create a progress bar in beamer with TikZ?

I want to create my own progress bar in my beamer presentation. This is my preamble code:

\documentclass[9pt, hyperref={pdfpagemode=FullScreen}]{beamer}

\usepackage[utf8]{inputenc}

\definecolor{whitesmoke}{rgb}{0.96, 0.96, 0.96}

\definecolor{ghostwhite}{rgb}{0.97, 0.97, 1.0}

\definecolor{columbiablue}{rgb}{0.61, 0.87, 1.0}

\usefonttheme{serif}

\usepackage{lewis}

\usepackage{tikz}

\usetikzlibrary{calc}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PROGRESS BAR

\newcommand{\progressbar}{

\begin{tikzpicture}

\fill [gray] (10,0) rectangle (13.0,0.5) ;

\fill [blue] (0,0) rectangle (10,0.5);

\end{tikzpicture}

}

....

\begin{document}

.....
\end{document}


All the slides contain the same rectangles at the top:

I would like that in all slides the gray rectangle fills up with any color until the presentation ends, containing the frame number below.

• Sorry for the typo. Is A progress bar with TIKZ – Aldo MorteraC Oct 17 '20 at 23:51
• Welcome to TeX.SE! Feel free to edit your question to fix typos and formatting :) For the code, you can select it and hit the icon that lookes like {} so that it's properly formatted in the questions with proper indentation. – Alenanno Oct 17 '20 at 23:58
• I did it for you. :) – Alenanno Oct 18 '20 at 0:01

I made this before for myself.

% !TEX encoding = UTF-8 Unicode
% !TEX TS-program = pdflatex
% !TEX spellcheck = English
% !TEX pdfSinglePage

\documentclass[14pt]{beamer}

\usepackage{tikz}

\title[Math of Communication]{A Mathematical Theory of Communication}
\author[C.~E.~Shannon]{Claude E.~Shannon}
\institute{University of Informatics}
\date[2020-10]{2020-10-10}

\begin{document}

\frame\maketitle

\makeatletter\defbeamertemplate*{sidebar right}{pro-bar}{
\tikz[remember picture,overlay,x=3mm,y=\paperheight]{\footnotesize
\pgfmathsetmacro\overlaytotal{\insertframeendpage+1-\insertframestartpage}
\pgfmathsetmacro\overlayfraction{\insertoverlaynumber/\overlaytotal}
\tikzset{bar/.pic={\node at(-.55,-.5)[rotate=-90]
{\beamer@shorttitle~\beamer@shortdate~\beamer@shortauthor};}}
\fill[use path=\stare,gray]pic[blue]{bar};
\clip[use path=\stare]pic[green]{bar};
}
}\makeatother

\frame{{Doe, a deer, a female deer}
Beamer is a LaTeX document class for creating presentation slides,
\pause\vfill
with a wide range of templates and a set of features for making slideshow effects.
}

\frame{{Ray, a drop of golden sun}
It supports pdfLaTeX, LaTeX + dvips, LuaLaTeX and XeLaTeX.[1]
\pause\vfill
The name is taken from the German word "Beamer"
\pause\vfill
as a pseudo-anglicism for "video projector".
}

\frame{{Me, a name I call myself}
The Beamer class is not the first LaTeX class for creating presentations,
\pause\vfill
and like many of its predecessors
\pause\vfill
(such as slides, seminar, prosper, powerdot),[2]
\pause\vfill
it has special syntax for defining "slides"
\pause\vfill
(known in Beamer as "frames").
}

\frame{{Far, a long, long way to run}
Slides can be built up on-screen in stages
as if by revealing text that was previously hidden or covered.
\pause\vfill
This is handled with PDF output by creating successive pages
that preserve the layout but add new elements,
\pause\vfill
so that advancing to the next page in the PDF file
appears to add something to the displayed page,
\pause\vfill
when in fact it has merely redrawn the page.
}

The list of features supported by Beamer is quite long.
\pause\vfill
The most important features, according to the user guide[1] are:
}

\frame{{La, a note to follow Sew}
\begin{itemize}[<+->]
\item   Beamer can be used with pdfLaTeX, LaTeX+dvips, LuaLaTeX and XeLaTeX.
LaTeX+dvipdfm isn’t supported.
\item   The standard commands of LaTeX still work.
section is still used to create structure,
and itemize still creates a list.
\item   Overlays and dynamic effects can be easily created.
\item   The appearance of presentations can be modified using themes.
\end{itemize}
}

\frame{{Tea, a drink with jam and bread}
\begin{itemize}[<+->]
\item   The layout, the colors, and the fonts
used in a presentation can easily be changed globally,
while preserving control over the most minute detail.
\item   A special style file allows for the use the LaTeX source of
a presentation directly in other LaTeX classes such as article or book.
This makes it easy to create presentations out of
lecture notes or lecture notes out of presentations.
\item   The final output is typically a PDF file, making it highly portable
and worry-free, in the sense that a given presentation
will always look the same no matter the machine it is opened on.
\end{itemize}
}

\end{document}