18

Is it possible to align node c vertical to node a and horizontal to node b. If I combine the "below=of" and "right=of" parameter, Tikz ignores the first one.

\begin{tikzpicture}
  \node[draw, circle, xshift=2cm](a){A};
  \node[draw, circle, minimum width=2cm, yshift=-2cm](b){B};
  \node[draw, below=of a, right=of b](c){C};
\end{tikzpicture}
user4811
  • 4,185

1 Answers1

16

You can use the orthogonal identifiers |- and -| for intersections of different coordinates. A quick reading hint is go vertical | and then horizontal - or vice versa.

\begin{tikzpicture}
  \node[draw, circle, xshift=2cm](a){A};
  \node[draw, circle, minimum width=2cm, yshift=-2cm](b){B};
  \node[draw](c) at (a|- b){C};
\end{tikzpicture}

enter image description here

percusse
  • 157,807
  • Thanks! It can also be helpful to assign an anchor, like \node[anchor=south] (c) at (a -| b.south) {C}; to get control over further specifics of positioning relative to the existing nodes. – Joe Corneli Oct 26 '16 at 19:25