0

In Beamer I can change the color used for alerted text using the \setbeamercolor command. Changing the color, however, does not change the color used for tikz nodes to which I pass the alert option.

The following is a MWE:

\documentclass{beamer}
\usepackage{tikz}
\setbeamercolor{alerted text}{fg=green}

\begin{document}

\begin{frame}

Some \alert{text}

\begin{tikzpicture}
\node (A) {Node A};
\node[alert, below of=A] {Node B};
\end{tikzpicture}

\end{frame}    

\end{document}

The result is this:

Node has wrong color

Note that the color is correctly changed to green in the normal text, but that the tikz node ignores the color I chose and uses the default red.

How do I change the color used for nodes to which I pass the alert option? That is, how do I ensure that passing the alert option to node B makes it green?

3
  • @TeXnician Doesn't seem to work. I added the lines \usepackage{xcolor} and \definecolor{alert}{rgb}{1,0,0} and node B is still red.
    – davitenio
    Jun 5, 2017 at 17:53
  • Your version with {rgb}{1,0,0} defines red as r in rgb stands for red ;)
    – TeXnician
    Jun 5, 2017 at 17:56
  • Oops! Yeah, I made a silly mistake there.
    – davitenio
    Jun 5, 2017 at 17:59

1 Answer 1

2

You can adjust it as every other color. In this case f.i. using \colorlet.

alert color

\documentclass{beamer}
\usepackage{tikz}
\setbeamercolor{alerted text}{fg=green}
\colorlet{alert}{green}

\begin{document}

\begin{frame}
Some \alert{text}

\begin{tikzpicture}
\node (A) {Node A};
\node[alert, below of=A] {Node B};
\end{tikzpicture}
\end{frame}    

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .