beamer add tag
Dave (imported from SE)
Many presentations include some kind of a visualizer where the listeners can easily see how far the presentation has gone.

A great option to do so is adding a `progress bar` into the slide layout.

----------

**Minimum Working Example (MWE):**

The user [Gonzalo Medina][2] has posted a nice approach on how to display a triangle above a line:

[![Screenshot of the code from user Gonzalo Medina][3]][3]

    \documentclass{beamer}
    \usepackage{tikz}
    \usetikzlibrary{calc}
    
    \definecolor{pbgray}{HTML}{575757}% background color for the progress bar
    
    \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=\linewidth
    \progressbar@pbht=1pt
    
    % 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}[very thin]
        \draw[pbgray!30,line width=\progressbar@pbht]
          (0pt, 0pt) -- ++ (\progressbar@pbwd,0pt);
        \draw[draw=none]  (\progressbar@pbwd,0pt) -- ++ (2pt,0pt);
    
        \draw[fill=pbgray!30,draw=pbgray] %
           ( $ (\progressbar@tmpdim, \progressbar@pbht) + (0,1.5pt) $ ) -- ++(60:3pt) -- ++(180:3pt) ;
    
        \node[draw=pbgray!30,text width=3.5em,align=center,inner sep=1pt,
          text=pbgray!70,anchor=east] at (0,0) {\insertframenumber/\inserttotalframenumber};
      \end{tikzpicture}%
    }
    
    \addtobeamertemplate{headline}{}
    {%
      \begin{beamercolorbox}[wd=\paperwidth,ht=5ex,center,dp=1ex]{white}%
        \progressbar@progressbar%
      \end{beamercolorbox}%
    }
    \makeatother
    
    \begin{document}
    
    	\section{Introduction}
    		
    		\begin{frame}
    			\frametitle{Introduction}
    			test
    		\end{frame}
    
    	\section{Motivation}
    
    		\begin{frame}
    			\frametitle{Motivation}
    			test
    		\end{frame}
    
    	\section{Methodology}
    
    		\begin{frame}
    			\frametitle{Experiments}
    			test
    		\end{frame}
    		
    		\begin{frame}
    			\frametitle{Statistics}
    			test
    		\end{frame}
    
    	\section{Results}
    		
    		\begin{frame}
    			\frametitle{Results 1}
    			test
    		\end{frame}
    		
    		\begin{frame}
    			\frametitle{Results 2}
    			test
    		\end{frame}
    
    	\section{Conclusion}
    
    		\begin{frame}
    			\frametitle{Conclusion}
    			test
    		\end{frame}
    
    \end{document}

----------

**Question:**

This looks nice indeed, but I would prefer to add the `section titles` into the timeline as well.

[![Screenshot of the desired progres bar][1]][1]

Hereby you can see:

 - *Introduction* and *Motivation* has already been presented
 - *Methodology* is currently presented
 - *Results* and *Conclusion* will be presented afterwards

Would it be possible to extend the code so the section titles will appear in the timeline as well?



  [1]: https://i.stack.imgur.com/PF7Wt.png
  [2]: https://tex.stackexchange.com/a/59749/78784
  [3]: https://i.stack.imgur.com/nkSSU.png
Top Answer
samcarter
One can modify https://topanswers.xyz/tex?q=587#a640 a bit to add the section names and numbers:


```
\documentclass[xcolor={rgb}]{beamer}

\usepackage{totcount}
\newtotcounter{mysec}
\AtBeginSection{\addtocounter{mysec}{1}\label{mysec:\themysec}}
\newcounter{foo}
\usepackage{refcount}
\usepackage{tikz}
\usetikzlibrary{patterns.meta}

\setbeamertemplate{headline}{%
	\vskip4pt
	\begin{tikzpicture}
		\path[preaction={fill, lightgray},pattern={Lines[angle=45,line width=3pt,distance=6pt]},pattern color=lightgray!50] (0,0) rectangle (\paperwidth,0.3);
		\path[preaction={fill, green!50!teal},pattern={Lines[angle=45,line width=3pt,distance=6pt]},pattern color=green!50!teal!50] (0,0) rectangle ({(\thepage-1)/(\insertdocumentendpage-1)*\paperwidth},0.3);
		\ifnum\thesection>0
			\path[preaction={fill, cyan!50!blue},pattern={Lines[angle=45,line width=3pt,distance=6pt]},pattern color=cyan!50!blue!50] (0,0) rectangle ({(\insertsectionstartpage-1)/(\insertdocumentendpage-1)*\paperwidth},0.3);
		\fi
		\foreach \x in {1,...,\totvalue{mysec}}{%
			\setcounterpageref{foo}{mysec:\x}
			\colorlet{seccol}{green!50!teal}
			\ifnum\thesection=\x
				\colorlet{seccol}{green!50!teal}
			\else
				\ifnum\thesection<\x
					\colorlet{seccol}{lightgray}
				\else
					\colorlet{seccol}{cyan!50!blue}
				\fi
			\fi		
			\node[circle,fill=seccol,draw=white,line width=1.5pt,minimum size=15pt] at ({(\thefoo-1)/(\insertdocumentendpage-1)*\paperwidth},0.15) {\x};
			\node[seccol] at ({(\thefoo-1)/(\insertdocumentendpage-1)*\paperwidth},-0.35) {\nameref{mysec:\x}};
		}
	\end{tikzpicture}%
}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section{Introduction}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}

\section{Motivation}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}

\section{Methodology}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}


\section{Results}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}

\end{document}
```

![document.gif](/image?hash=323c6c62a3fa8226c5c7ed0a009a25db375c7e24cdc8917108fb6ae9b14a7060)

### Second version with rounded corners

```
\documentclass[xcolor={rgb}]{beamer}

\usepackage{totcount}
\newtotcounter{mysec}
\AtBeginSection{\addtocounter{mysec}{1}\label{mysec:\themysec}}
\newcounter{foo}
\usepackage{refcount}
\usepackage{tikz}
\usetikzlibrary{patterns.meta}
\usetikzlibrary{fadings,patterns,shadows}

\setbeamertemplate{headline}{%
	\vskip6pt
	\centering
	\begin{tikzpicture}
		\path[draw=gray,rounded corners,preaction={fill, lightgray},pattern={Lines[angle=45,line width=3pt,distance=6pt]},pattern color=lightgray!50] (0,0) rectangle (.9\paperwidth,0.3);
		\path[rounded corners,preaction={fill, green!50!teal},pattern={Lines[angle=45,line width=3pt,distance=6pt]},pattern color=green!50!teal!50] (0,0) rectangle ({(\thepage-1)/(\insertdocumentendpage-1)*.9\paperwidth},0.3);
		\ifnum\thesection>0
			\path[rounded corners,preaction={fill, cyan!50!blue},pattern={Lines[angle=45,line width=3pt,distance=6pt]},pattern color=cyan!50!blue!50] (0,0) rectangle ({(\insertsectionstartpage-1)/(\insertdocumentendpage-1)*.9\paperwidth},0.3);
		\fi
		\foreach \x in {1,...,\totvalue{mysec}}{%
			\setcounterpageref{foo}{mysec:\x}
			\colorlet{seccol}{green!50!teal}
			\ifnum\thesection=\x
				\colorlet{seccol}{green!50!teal}
			\else
				\ifnum\thesection<\x
					\colorlet{seccol}{lightgray}
				\else
					\colorlet{seccol}{cyan!50!blue}
				\fi
			\fi		
			\node[circle,fill=seccol,draw=white,line width=1.5pt,minimum size=15pt] at ({(\thefoo-1)/(\insertdocumentendpage-1)*.9\paperwidth},0.15) {\x};
			\node[seccol] at ({(\thefoo-1)/(\insertdocumentendpage-1)*.9\paperwidth},-0.35) {\nameref{mysec:\x}};
		}
	\end{tikzpicture}%
	\par%
}

\begin{document}

\begin{frame}
\titlepage
\end{frame}

\section{Introduction}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}

\section{Motivation}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}

\section{Methodology}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}


\section{Results}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}
\begin{frame}
\end{frame}

\end{document}
```

![document.gif](/image?hash=8054d6b3fed1ec6f7b48fcd8c2d69e0e7d5cb5a56b39a22b06f510d8c016f1e2)

This room is for discussion about this question.

Once logged in you can direct comments to any contributor here.

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.