12:33 - Friday, 18 April 2014

How To Make Nodes On Branchy TikZ Chain Lay On Regular Grid (trangular Or Square) Automatically?

How to ensure that nodes on chain with branches (generated using chains library) are laid out on regular grid, regardless of node shape?

I am interested in automatic placement on triangular or rectangular grid, if possible without use of matrices.

Example: in the following diagram nodes are laid out on rectangular grid:

usepackage{tikz}usetikzlibrary{chains}usetikzlibrary{scopes}begin{tikzpicture}[start chain,    every node/.style={on chain, join, draw},    every join/.style=<-]  node {A};  node {B};  begin{scope}[start branch=foo]    node [on chain=going below right] {E};    node (F) {F};  end{scope}  node {C};  node {D};  node [join=with F] {G};end{tikzpicture}

But if I change node style to circle or rounded rectangle with a minimum size of 6mm the layout changes to almost on triangular grid.

Share

Advertisement

Comment