I'm trying to reproduce the enumerate enviorment of this post (A fancy and beautiful type of enumerate) in Beamer. My MWE, adapted from there, is the following:
\documentclass{beamer}
\usepackage{tikz}
\newcommand{\Colorlist}{red,blue,green,yellow}
\newcommand{\SebastianoItem}[1]{\foreach \X[count=\Y] in \Colorlist
{\ifnum\Y=#1\relax
\xdef\SebastianoColor{\X}
\fi
}
\tikz[baseline=(SebastianoItem.base),remember
picture]{%
\node[fill=\SebastianoColor,inner sep=4pt,font=\sffamily,fill opacity=0.5] (SebastianoItem){#1)};}
}
\newcommand{\SebastianoHighlight}{\tikz[overlay,remember picture]{%
\fill[\SebastianoColor,fill opacity=0.5] ([yshift=4pt,xshift=-\pgflinewidth]SebastianoItem.east) -- ++(4pt,-4pt)
-- ++(-4pt,-4pt) -- cycle;
}}
\begin{document}
\begin{frame}
\renewcommand{\labelenumi}{\SebastianoItem{\arabic{enumi}}}
Some general advices.
\begin{enumerate}
\item No fast food.
\item Don't drink to much alcohol.
\item No pineapple on pizza. \SebastianoHighlight
\item Don't use onions in food.
\end{enumerate}
\end{frame}
\end{document}
When I uncomment the \renewcommand and the \SebastianoHighlight lines, the code compiles, so I guess the errors are there. I know that renewing commands in Beamer are trickier than in the Article documentclass. However, I can't find a solution. Any ideas?
