[Tex/LaTex] Set color of \emph{} in beamer

beamercoloremphasis

How can I set the color of the \emph{}-tag in beamer? I tried something like

\setbeamercolor{emph}{fg=red}

inside of beamercolortheme.sty but it had no effect.

Best Answer

You posted a “solution“ in the comments. I cannot recommend changing beamercolortheme.sty though, because it might be overwritten once you update your system. Also the document is no longer portable. If you edit it on another PC or send it to a friend you'd have to include instructions on which files to edit.

Such changes usually go in the preamble of your document. I also used the beamer color approach. You can read more in the manual.

\documentclass{beamer}
\pagestyle{empty}
\setbeamercolor{emph}{fg=red}
\renewcommand<>{\emph}[1]{%
  {\usebeamercolor[fg]{emph}\only#2{\itshape}#1}%
}
\begin{document}
\begin{frame}
  ABC \emph{DEG} GHI
\end{frame}
\end{document}

enter image description here