1

When I put enumerate inside an itemize environment on Beamer, I get little blue bullet points with white numbers inside.

But when I try to refer to them, it just appears as the number. How do I reproduce the blue bullet point with the white number inside?

Here's the code:

\begin{frame}
\frametitle{Enumerated things}
\begin{itemize}
\item We have two enumerated things:
\begin{enumerate}
\item\label{item:r<g} enumerated thing 1
\item\label{item:more_zeroes} enumerated thing 2
\end{enumerate}
\end{itemize}
\end{frame}
\begin{frame}{Trying to refer}
\begin{itemize}
\item We we refer to it, it just says ``\ref{item:r<g}''. But I want to produce the blue circle with the number inside it.
\end{itemize}
\end{frame}
  • Do you want to get the circle just by using \ref{item} (which would be difficult) or would something like \mycircle{\ref{item}} be ok (somewhat easier)? – Marijn Aug 18 '21 at 14:39
  • That could work, but then how can I make it a blue circle and a white number? I want it to clearly refer to what appeared on the previous slide. – David Corwin Aug 18 '21 at 14:55
  • In that case it's a duplicate I think. – Marijn Aug 18 '21 at 15:04
  • I'd like to point to the following excellent answer: https://tex.stackexchange.com/a/558288/88262 – jpb Sep 18 '22 at 14:39

1 Answers1

3

Just a quick hack: enter image description here

\documentclass{beamer}
\usetheme{Madrid}
\usepackage{tikz}
\newcommand{\circled}[1]{%
  \scalebox{0.6}{\tikz\node%
    [outer sep=0pt, inner sep=2pt,
      line width=0pt,text=white,fill=blue!50,draw,circle,shading=ball]{#1};%
  }%
}
\newcommand{\bref}[1]{\circled{\ref{#1}}}
\begin{document}
\begin{frame}
\frametitle{Enumerated things}
\begin{itemize}
\item We have two enumerated things:
\begin{enumerate}
\item\label{item:r<g} enumerated thing 1
\item\label{item:more_zeroes} enumerated thing 2
\end{enumerate}
\end{itemize}
Try to refer:
\begin{itemize}
\item When we refer to it, it just says ``\ref{item:r<g}''. But I want
  to produce the blue circle with the number inside it.
\item Try \bref{item:r<g} and \bref{item:more_zeroes}.
\end{itemize}
\end{frame}
\end{document}
citsahcots
  • 7,992
  • 1
    This is indeed similar to the approach in the duplicate. However, I would advise against calling the new command \cref, because this name is already in use by the popular cleveref package. Something like \circleref or \enumref would be better. – Marijn Aug 18 '21 at 15:19
  • Also the shade of blue is not fully the same color as in the original enumerate list. – Marijn Aug 18 '21 at 15:21
  • @Marijn, you are absolutely right. I saw your comment under the question after posting my quick hack. – citsahcots Aug 18 '21 at 15:23