1

I want to add a visual counter in the header of each slide using beamer, I attached a photo which indicates what I want to happen. Also, I want to add a number inside the circle, indicating the section number. Unfortunately, i don't know how to do it. Can someone help me on this.

enter image description here

Kindly disregard the white background in the visual counter, I just pasted it using Microsoft PowerPoint. I attached my code below:

\documentclass{beamer}

\mode<presentation> {
\usetheme{Madrid}
}

\usepackage{graphicx} 
\usepackage{booktabs} 
\usepackage{ragged2e}
\usepackage{braket}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{array}
\usepackage{graphicx}
\setbeamertemplate{caption}[numbered]
\usepackage[caption=false]{subfig}
\usepackage{amssymb}
\usepackage{tikz}
\usetikzlibrary{calc,shapes}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

% Footnote Font
\setbeamertemplate{footnote}{%
  \tiny%
  \parindent 1em\noindent%
  \raggedright
  \hbox to 1.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
}%
\setlength\footnotesep{0pt}
\usefonttheme[onlymath]{serif}


\begin{document}
%------------------------------------------------
\section{Objectives} 
%------------------------------------------------

\begin{frame}
\frametitle{\textbf{Objectives}}
\justifying 
\begin{itemize}
\item{We study nonequilibrium physics using the simplest way of taking an 
isolated quantum system out of equilibrium: a \textit{quantum quench}.}
\end{itemize}
\end{frame}
\end{document}

1 Answers1

2

DISCLAIMER: I am not a beamer expert, all solutions that would add the number left of the title that I could find were very complicated, essentially rewriting parts of the theme. But it is straightforward to put the number somewhere where it does not interfere with the frame title's default position, as also explained in this answer.

\documentclass{beamer}

\mode<presentation> {
\usetheme{Madrid}
}

\usepackage{booktabs} 
\usepackage{ragged2e}
\usepackage{braket}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{array}
\setbeamertemplate{caption}[numbered]
\setbeamertemplate{section}[numbered]
\usepackage[caption=false]{subfig}
\usepackage{amssymb}
\usepackage{tikz} % loads graphicx
\usetikzlibrary{calc,shapes}
\newcommand{\tikzmark}[1]{\tikz[overlay,remember picture] \node (#1) {};}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

% Footnote Font
\setbeamertemplate{footnote}{%
  \tiny%
  \parindent 1em\noindent%
  \raggedright
  \hbox to 1.8em{\hfil\insertfootnotemark}\insertfootnotetext\par%
}%

\setbeamerfont{frametitle}{series=\bfseries}
\addtobeamertemplate{frametitle}{}{\begin{tikzpicture}[remember picture,overlay]
\node[circle,ultra thick,draw,anchor=north east] at ([xshift=-4pt,yshift=-4pt]current page.north east)
{\thesection};
\end{tikzpicture}}

\setlength\footnotesep{0pt}
\usefonttheme[onlymath]{serif}


\begin{document}
%------------------------------------------------
\section{Objectives} 
%------------------------------------------------

\begin{frame}
\frametitle{Objectives}
\justifying 
\begin{itemize}
\item{We study nonequilibrium physics using the simplest way of taking an 
isolated quantum system out of equilibrium: a \textit{quantum quench}.}
\end{itemize}
\end{frame}
\end{document}

enter image description here

If you use a different theme, this will of course change. BTW, you are loading a lot of packages that are not directly related to the problem.