Para evitar muitas cores, utilizo as cores do beamer para enfatizar itens do meu texto. Parece algo assim:
\documentclass[xcolor=dvipsnames]{beamer}
\usetheme{Madrid}
\newcommand{\gn}[1]{\textcolor{block title example.bg}{{}#1{}}}
\begin{document}
\begin{frame}{Green text}
\gn{This isn't working.}
\begin{example}[boring example]
nothing to see here.
\end{example}
\gn{This is green.}
This is black.
\end{frame}
\end{document}
Agora, se eu tentar usar a cor antes do beamer usá-la pela primeira vez (como em "Isso não está funcionando"), recebo o erro:
Package xcolor Error: Undefined color `block title example.bg'.
Existe uma maneira de resolver isso?
Responder1
\usebeamercolor[bg]{block title example}
vou usar a cor
\documentclass[xcolor=dvipsnames]{beamer}
\usetheme{Madrid}
\newcommand{\gn}[1]{{\usebeamercolor[bg]{block title example}#1}}
\begin{document}
\begin{frame}{Green text}
\gn{This isn't working.}
\begin{example}[boring example]
nothing to see here.
\end{example}
\gn{This is green.}
This is black.
\end{frame}
\end{document}