I am using beamer and TikZ and would like to change the color and thickness of an edge in the second slide of the same frame. Here is what I tried:
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{shapes,shapes.geometric,arrows,fit,calc,positioning,automata}
\begin{document}
\frame{
\newcommand*\properties{}
\only<2>{\renewcommand*{\properties}{orange, ultra thick}}
\begin{figure}
\begin{tikzpicture}[node distance = 1.5cm, scale=0.8]
\node (1) {1};
\node[right = of 1] (2) {2};
\path[->]
(1) edge[\properties] (2);
\end{tikzpicture}
\end{figure}
}
\end{document}
The strange thing is that when I put only orange or only ultra thick in the definition of \properties, everything works as expected. In addition, if I just put orange, ultra thick together in the bracket that follows edge, it is still fine (and of course in this case the edge has the same look on both slides). But when I have both of them there, an error occurs:
Package pgfkeys Error: I do not know the key '/tikz/orange, ultra thick' and I am going to ignore it. Perhaps you misspelled it.
May I know why this is the case? How should I correct it to achieve the desired result (i.e., the edge turning both orange and thicker on the second slide)? Thank you!