
Ich versuche, die Aufzählungsumgebung dieses Beitrags zu reproduzieren (Eine ausgefallene und schöne Art der Aufzählung) InProjektor. Mein von dort angepasster MWE ist der folgende:
\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}
Wenn ich die Zeilen \renewcommand und \SebastianoHighlight auskommentiere, wird der Code kompiliert, daher gehe ich davon aus, dass die Fehler vorhanden sind. Ich weiß, dass das Erneuern von Befehlen in Beamer schwieriger ist als in der Dokumentklasse Article. Ich kann jedoch keine Lösung finden. Irgendwelche Ideen?
Antwort1
Im Beamer:
\setbeamertemplate{enumerate item}{\SebastianoItem{\arabic{enumi}}}
Gleiches gilt fürUnterelement aufzählen,Unterelement aufzählen, und Minivorlage aufzählen.
Datei bearbeiten:
\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;
}}
\setbeamertemplate{enumerate item}{\SebastianoItem{\arabic{enumi}}}
\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}