当我将枚举放入 Beamer 上的逐项环境中时,我得到了里面有白色数字的小蓝色项目符号。
但当我尝试引用它们时,它只显示数字。如何重现里面有白色数字的蓝色项目符号?
代码如下:
\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}
答案1
\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}