is there a simple idiom (one not using the calc
library) to specify a Tikz coordinate relative to a node?
Something like \coordinate (x) [right=of A];
instead of \node (x) [draw=none, right=of A]{};
?
Thanks
\documentclass{article}
\usepackage {tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\node (A){A};
\coordinate (x) [right=of A]; % <-- this does *not* work expected
\coordinate[right=of A] (y) ; % <-- this *works* as expected
\draw (x) -- ++(1,1);
\draw[red] (y) -- ++(1,1);
\end{tikzpicture}
\end{document}
remark the problem is similar with
\node (x) {} [right= of A];
instead of
\node[right= of A] (x) {} ;
but
\node (x) [right= of A] {} ;
is valable
(A.east)
seems a reasonable one in this case.\coordinate[right=of A] (x) ;
is fine but not\coordinate (x) [right=of A];
[right=of A]
instead of(A.east)
, as you suggest, is that I can change the node distance and have the coordinate repositioned, or I can say directly things like[right=30mm of A]
. Also a coordinate has no space, that's why I had to put[draw=none ...
above.