I would like to change a property, say the color, of a forest node between overlays in beamer. It is proposed elsewhere to use PGF's keys for this in the general case. However, this approach doesn't seem to be compatible with . The following MWE does forest, at least this is what I experiencenot compile:
\documentclass{beamer}
\usepackage{forest}
\tikzset{onslide/.code args={<#1>#2}{%
\only<#1>{\pgfkeysalso{#2}}
}}
\begin{document}
\begin{frame}
\begin{forest}
[A,name=a [B,name=b,onslide=<2>{red}] [C,name=c] ]
\end{forest}
\end{frame}
\end{document}
I could equally well live with a solution along the following lines:
\documentclass{beamer}
\usepackage{forest}
\begin{document}
\begin{frame}
\begin{forest}
[A,name=a [B,name=b] [C,name=c] ]
\only<2>{
%add parameter red to node b
}
\end{forest}
\end{frame}
\end{document}
Any idea how to achieve this?
Edit: Thanks to @cfr for making me aware of the stupid bug in my MWE. \tikzset was located inside the forest environment.

\tikzsetcan usually come after\begin{document}and not only in the preamble, although there are some exceptions to this.) – cfr Jul 02 '15 at 20:19\tiksetpopped up when putting it inside theforestenvironment (contrary to what I said first). That's probably not so unexpected. – Timm Jul 02 '15 at 21:00/tikz/whatever/.style={...}etc. after\begin{forest}but it is already primed to set forest keys at that point, so a\tikzset(or a\forestset) is not likely to go down well ;). – cfr Jul 02 '15 at 21:19