I'm attempting to do exactly the same thing as this question, namely adding edges between scopes. However, I'm working on a Beamer presentation using the \documentclass{beamer}, and the exact same code as the answers given there don't work. They work just fine when I use the article class. For example, I can't compile the following:
\documentclass{beamer}
\usepackage{tikz}
\begin{document}
\begin{frame}
\tikzstyle{vertex}=[circle,draw,fill=black!20]
\makeatletter
\tikzset{%
prefix node name/.code={%
\tikzset{%
name/.code={\edef\tikz@fig@name{#1 ##1}}
}%
}%
}
\makeatother
\begin{tikzpicture}
% ---- Copy 1
\begin{scope}[yshift=-32pt,prefix node name=G1]
\node[vertex] (u) at (0, 0) {u};
\node[vertex] (v) at (0, 0) {v};
\end{scope}
% ---- Copy 2
\begin{scope}[yshift=32pt,prefix node name=G2]
\node[vertex] (u) at (0, 0) {u};
\node[vertex] (v) at (0, 0) {v};
\end{scope}
\draw (G1 u) -- (G2 v);
\end{tikzpicture}
\end{frame}
\end{document}
I get the following error "! Package pgf Error: No shape named `G1' is known." and also "! Illegal parameter number in definition of \iterate."
Does anyone know of a workaround that works in Beamer?
\begin{frame}
with\begin{frame}[fragile]
.