\documentclass[xcolor=dvipsnames]{beamer} \usepackage[T1]{fontenc} \usetheme{AnnArbor} \usecolortheme{whale} \setbeamercolor{title}{bg=RoyalPurple} \setbeamercolor{frametitle}{fg=white,bg=RoyalPurple} \usepackage{amsmath} \newcounter{exm} \makeatletter \newcommand*{\ExmT}[1]{% \refstepcounter{exm}% \protected@edef\@currentlabelname{Example\protect~\theexm: #1}% \frametitle{% Example~\theexm: #1}% } \makeatother \resetcounteronoverlays{exm} \begin{document} \frame{% \frametitle{Testframe} To avoid that exmaples and frames have the same number. } \frame{ \ExmT{Who is Hilbert}\label{ex:hilbert}% David Hilbert is a great Mathematician! } \frame{ \ExmT{Who is Riemann}\label{ex:riemann}% Bernhard Riemann is another greatest mathematician in the history! } \frame{{How do you define Mathematics?} Mathematics is a language of sciences. Moreover, $\cdots$ } \frame{{Rmarks on \nameref{ex:hilbert}} {\color{red}\textbf{I am writing Remarks on Example~\ref{ex:hilbert} on page~\pageref{ex:hilbert} (on the title of this frame) manually but is there a way to reference \nameref{ex:hilbert} automatically?}} Not the frame number. } \end{document}