# Tikz: Using an already defined \node label in \draw

I am using tikz to draw a mathematical structure. I have labelled all my nodes in my code and I want to use them as arguments in the \draw command but I keep getting this error "! Missing \endcsname inserted." Below is a minimum working example. Kindly help me with this.

\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
Putting node and clipping them to their respective positions
\foreach \x in {2,3,4,...,14}
\foreach \y in {2,3,4}
{
\node [circle,draw=white,fill=white,inner sep=0pt,minimum size=1.8mm] (u\x\y) at (\x,\y)  {};
}
%Drawing arrows
\foreach \x in {3,5,...,11}
{
\v = \x + 1;
\draw[->>] (u\x3) -- (u\v2) ;
}
\end{tikzpicture}
\end{document}

-
Where did you find this code: \v = \x + 1; ? – Sigur May 3 '14 at 14:13
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Heiko Oberdiek May 3 '14 at 14:22
Also, was the "Putting node..." supposed to be a comment? Anyway, the fact that the first loop didn't generate any errors indicates that \x and \y are macros (text). Therefore to compute \x+1 you must convert \x from text to a number, add one, then convert back to text again. I tried using \pgfmathparse and \pgfmathresult, but got 4.0 instead of 4. – John Kormylo May 3 '14 at 14:37
BTW, you can place an * between \x and \y. It is a legal name character, but not a legal macro name character. – John Kormylo May 4 '14 at 14:26

Here's another option without extra variables:

\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
%Putting node and clipping them to their respective positions
\foreach \x in {2,3,4,...,14}
\foreach \y in {2,3,4}
{
\node [circle,draw=white,fill=white,inner sep=0pt,minimum size=1.8mm] (u\x\y) at (\x,\y)  {};
}
%Drawing arrows
\foreach \x  in {3,5,...,11}
{
\draw[->>] (u\x3) -- (u\number\numexpr\x+1\relax2) ;
}
\end{tikzpicture}
\end{document}


-
\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
%Putting node and clipping them to their respective positions
\foreach \x in {2,3,4,...,14}
\foreach \y in {2,3,4}
{
\node [circle,draw=white,fill=white,inner sep=0pt,minimum size=1.8mm] (u\x\y) at (\x,\y)  {};
}
%Drawing arrows
\foreach \x in {3,5,...,11}
{
\pgfmathparse{\x+1}
\pgfmathtruncatemacro{\v}{\pgfmathresult}
\draw[->>] (u\x3) -- (u\v2) ;
}
\end{tikzpicture}
\end{document}


-