My problem is to define blocks (mainly rectangles) that has labels in them in terms of matrices (mostly block diagonal) such that the n-many arrows that goes in this rectangle visually is at the same height as the corresponding element on the diagonal of the label. Consider the following example
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[>=stealth]
\node[draw,rectangle,inner sep=0.5cm] (y) at (0,0) {$A$};
\node[draw,rectangle,inner sep=0.3cm] (d) at (0,2) {$\begin{array}{cc}B&\\&C \end{array}$};
\draw[->] (y.west) -| ++(-1,1) |- (d.west);
\draw[->] (d.east) -| ++(1,-1) |- (y.east);
\end{tikzpicture}
\end{document}
Now, let me start by creating two subproblems:
- When I create this label, the
inner sep
option of node shape (the visible rectangle around B and C) is kind of annoying to adjust. So I don't think it would survive in a better solution. So this question would be obsolete if the following problem is solved. - I would like to get a handle of the node height resulting from the matrix label that I have put in and then somehow obtain a subdivision of n+1 of this height creating n nodes to connect to and from on the west and east sides. such that in the minimal example above I would connect to two arrows going out from A (not from the same location but separate and equally dividing the height of A) and connecting to B and C respectively (and vice versa).