Changing the out-degree value in the code below doesn't seem to be working. The figure I get always has an out-degree equal to 0. Any ideas why?
\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{arrows, positioning}
\begin{document}
\begin{frame}
\begin{figure}
\centering
\begin{tikzpicture}
[
state/.style={fill=blue!30, circle, minimum size=0.5cm},
transition/.style={>=stealth'},
]
\node[state, label={-120:$q_1$}] (q1) {};
\def\n{4}
\foreach \q in {2,...,\n} {
\pgfmathsetmacro\pq{\q-1} % previous node index
\node[state, label={-120:$q_\q$}, right=of q\pq] (q\q) {}; % node
\draw[transition, ->] (q\pq) to (q\q); % transition level 1
% transition level 2
\edef\tempa{\q}
\edef\tempb{2}
\ifx\tempa\tempb
\else
\pgfmathsetmacro\ppq{\q-2}; % 2nd previous node
\edef\new{q\ppq};
%%%% THIS OUT-DEGREE doesn't work
\draw[transition, ->] (q\ppq) to[out=45, in=135] (q\q);
\fi
}
\end{tikzpicture}
\end{figure}
\end{frame}
\end{document}
At the moment, the code generates this figure:

However, I expect to get something like this:


(q\ppq)tikz isn't understanding what you're referencing because it knowsq2. I don't know how to do this drawing dynamically; is that a requirement? – Paul Stiverson Jun 28 '15 at 05:35