I have a diagram of 4 nodes in my beamer slide.
\begin{figure}[h]
\begin{centering}
\begin{tikzpicture}[system/.style={draw,rectangle,rounded corners=3,minimum width=2cm,text width=1.8cm,text centered}]
\node [system] (fe) {Feature Extraction};
\node [system] (am) [right=of fe] {Acoustic Model};
\node [system] (lm) [right=of am] {Language Model};
\node [system] (d) [below=of lm] {Decoder};
\draw[->] (fe) |- (am);
\draw[->] (am) |- (d);
\draw[->] (lm) -- (d.north);
\end{tikzpicture}
\end{centering}
\end{figure}
How can I in a second slide "highlight" one of the nodes, like I can do with <alert@n>
for a item in a list?
With highlighting I mean for example giving a color and thickening the lines.
Best Answer
I used to do this according to Andrew's solution until I read his note #2, and it reminded me that PGF's keys can do pretty much anything. The key (excuse the pun) is to create a key that processes other keys conditional on the slide number:
Using
\pgfkeysalso
doesn't reset the current key path, whereas\pgfkeys
or\tikzset
would. The.code args
key handler means thatcauses the the following code to be expanded:
Then you can use the key
onslide=<overlay specification>{keys}
to set keys only on specific slides. The slightly inelegant twist is that if your overlay specification contains commas the entire pair of overlay spec and keys has to be embraced.Here is a complete example:
You will be disappointed about the jiggling of your picture when the line thickness keys are applied. You might have to avoid relative positioning to make that go away.
For more on key handlers like
.code args
, see thepgfkeys
section of the TikZ-PGF manual.