I'm experiencing some weirdness in making a simple TikZ diagram (a comb-shaped graph with variable number of nodes). The weirdness comes from the style applied to the edge paths. Here's the (minimal) example:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}
\begin{tikzpicture}[auto,scale=1.0,%
block/.style = {draw,circle,very thick,minimum size=0.5cm},%
directed/.style ={draw,-triangle 45, shorten >= 0pt, very thick}]
% Parameters
\pgfmathsetmacro{\numXnodes}{int(3)}
\pgfmathsetmacro{\strch}{2}
\foreach \i in {1,...,\numXnodes}{
\path (\strch*\i-\strch, 0) node[block] (x\i) {\i};
\path (x\i) ++(0,-\strch) node[block] (z\i) {\pgfmathparse{int(\numXnodes+\i)}\pgfmathresult};
\path (x\i) [directed] -- (z\i);
}
\pgfmathsetmacro{\nnmo}{{int(\numXnodes-1)}}
\foreach \i in {1,...,\nnmo} {
\pgfmathparse{int(\i+1)}
\draw (x\i) [draw,-triangle 45,thick] -- (x\pgfmathresult);
}
\end{tikzpicture}
\end{document}
The above code draws a graph with the right structure/directionality. However, the edges between "x" nodes are very thin.
The issue is that if I change the style on the line
\draw (x\i) [draw,-triangle 45] -- (x\pgfmathresult);
to \draw (x\i) [draw,-triangle 45,thick] -- (x\pgfmathresult);
I get an error that says Package pgf Error: No shape named x0 is known. } (followed by: )
Any thoughts on why this error would be occurring here and not in the first set of edges drawn with the defined directed
style (i.e., in the first loop)?
Thanks in advance!