J...S
In beamer, is there a way to change an attribute of a tikz node with a `\pause`?
I got a node which is initially a circle.
I wish to change this to a rectangle after a `\pause`.
This was the example that I had in mind:
```
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}{Hi}
\begin{tikzpicture}
\only<1>{
\node[circle, fill] (hi) {Hi};
}
\only<2>{
\node[rectangle, fill] (hi2) {Hi};
}
\end{tikzpicture}
\end{frame}
\end{document}
```
How can this be done? Preferably without too much code duplication.
Can aobs-tikz package be of help here?
The above snippet is what I thought was a minimal example.
What I really wanted involved the automata tikz library, where I wanted to remove `accepting` attribute from a node.
Edit: an example with automata library
```
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{automata}
\usetikzlibrary{overlay-beamer-styles}
\begin{document}
\begin{frame}{Hi}
\begin{tikzpicture}
\node[alt=<2,3>{}{accepting}, state] (a) {A};
\end{tikzpicture}
\end{frame}
\end{document}
```
Top Answer
samcarter
You can use the `alt` key from the `overlay-beamer-styles` library:
```
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{overlay-beamer-styles}
\begin{document}
\begin{frame}
\frametitle{Hi}
\begin{tikzpicture}
\node[alt=<2>{rectangle}{circle}, fill] (hi) {Hi};
\end{tikzpicture}
\end{frame}
\end{document}
```
