My problem is that I want to draw several horizontal "layers" of nodes (implemented as chains), with connections between them. When I try to position a node absolutely, it is additionally offset in the chain's direction:
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{chains}
\begin{document}
\begin{tikzpicture}[
node distance=1,
block/.style={
on chain,
inner sep=0pt,outer sep=0pt,
draw,minimum height=10,minimum width=2}
]
\path[start chain=layer1]
node[block] {}
node[block,join] {}
node[block,join] {}
;
\path[start chain=layer2]
node[block,join=with layer1-3,below=of layer1-end] {}
node[block,join] {}
node[block,join] {}
;
%\path[start chain=layer1right] % WORKS
\path[continue chain=layer1] % DOES NOT WORK, BUT WHY?
node[block,join=with layer2-end,anchor=center] at (layer2-end |- layer1-end) {}
node[block,join] {}
node[block,join] {}
;
\end{tikzpicture}
\end{document}
I also tried variants like
node[block,join=with layer2-end placed {at=(layer2-end |- layer1-end)},anchor=center] {}
and I don't understand why I get the additional offset (I did find a workaround, see below). According to the pgfmanual, I think this should've worked:
Independently of which form is used, the ⟨text⟩ inside ⟨direction⟩ that follows going or placed (separated by a compulsory space) can have two different effects:
(a) If it contains an equal sign, then this ⟨text⟩ is used as the placement rule, that is, it is simply executed.
(b) If it does not contain an equal sign, then ⟨text⟩=of \tikzchainprevious is used as the placement rule.
Note that in the first case, inside the ⟨text⟩ you have access to \tikzchainprevious and \tikzchaincount for doing your positioning calculations.
My workaround (see commented out code) is to start a new chain (which has the additional advantage that I could remove the anchor=center). I cannot use above=of ..., because in my real code, the blocks have different heights, and the nodes on layer1 will not be aligned anymore.



\documentclassand the appropriate packages so that those trying to help don't have to recreate it.This is especially important for
– Peter Grill May 31 '16 at 07:23tikzas there are numerous libraries.layer1chain? Above end oflayer2? Or on an arbitrary place? – Zarko May 31 '16 at 09:44at (...). If you uncomment the "WORKS" line, and comment out the "DOES NOT WORK" line, you can also see the intended result. – hans_meine May 31 '16 at 09:49\path[continue chain=layer1] [block,join=with layer2-end,above=of layer2-end] {} node[block,join] {} node[block,join] {};– Zarko May 31 '16 at 10:06