I have the following code (stripped down from a much larger one).
(I understand that there are numerous questions (and answers including this excellent one) on relative positioning of nodes, but they do not seem to solve my problem. Before you mark my question as duplicate, please make it sure that it really addresses my issue ie. use relative positioning and not absolute positioning.)
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{automata,positioning}
\begin{document}
\begin{tikzpicture}[node distance=40.0mm, auto]
\node[state] (3) {3};
\node[state] (1) [above left=of 3] {1};
\node[state] (2) [above right=of 3] {2};
\end{tikzpicture}
\end{document}
The output looks like this.
I would like to move node 3 somewhat below its current position. I have tried many ways of doing this using relative positioning (and without using absolute positioning), without success. How do I do this?
\node (1) [above left=5cm and 1cm of 3] {1};
satisfying your problem? This way you can set theabove
and theleft
|right
individually from each other.\begin{tikzpicture}[node distance=40.0mm]
, would it be a solution to different to horizontal and vertical node spacing using\begin{tikzpicture}[node distance=40.0mm and 2cm]
? (2nd value is vertical spacing)tikz
matrix
approach is more suitable where you can declare row separation and column separation in the beginning itself.