I'm wanting to align/position a node relative to 2 others. Basically I'd like everything to be in rows and columns (whose is determined by the largest member). In this specific instance, I'd like node j
to be centered on the intersection of the red and blue lines in the picture below. This would cause the 2 decision diamonds to be evenly spaced like f
and g
.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\pagestyle{empty}
\usetikzlibrary{shapes, arrows, calc, positioning}
% Define block styles
\tikzstyle{state} = [ rounded rectangle, draw,
text centered,
minimum height=3em
]
\tikzstyle{test} = [ diamond,
draw,
shape aspect=2,
inner sep = 0pt,
text width = 7em,
text centered
]
\tikzstyle{action} = [ rectangle, draw,
text width=8em,
inner sep = 5pt,
minimum height=5em
]
\begin{tikzpicture}[node distance = 1.25em, align = flush center, font = \small]
% Place nodes
\node [test] (f) {fLorem ipsum dolor sit amet};
\node [test, right=of f] (g) {gLorem ipsum dolor};
\node [test, below=of f] (h) {hLorem ipsum dolo};
\node [action, below=of h] (i) {iLorem ipsum dolor sit amet, consectetur adipiscing elit.};
\node [action, right=of i, fill=gray] (j) {jLorem ipsum dolor sit amet, consectetur adipiscing elit.};
\node [test, below=of i] (l) {lLorem ipsum dolor};
\node [test, below=of j, fill=gray] (m) {mLorem ipsum dolor};
\draw [red] (g) -- +(0,-10);
\draw [blue] (i) -- +(10,0);
\end{tikzpicture}
\end{document}
I've read some promising things about chains
but think it might be over kill for my use.