Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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|improve this question

closed as unclear what you're asking by Joseph Wright Aug 5 '13 at 19:43

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
I didn't check it but maybe on grid option of positioning library play nicely with chains. –  percusse Jan 30 '13 at 13:38
    
You can look at placed chain instead of going chain (cf. p.286 of pgfmanual v2.10). –  Paul Gaborit Jan 30 '13 at 15:39
    
Could you clarify your question? What do you mean automatic placement on a regular grid? Have you tried @percusse’s on grid suggestion? That actually does place the nodes on a grid as it only uses the center anchors, as opposed to the west and the east anchors in the default going right option. The below right option uses the south east and north west anchors which can be attributed for the placement of the circular nodes. –  Qrrbrbirlbel Jun 26 '13 at 3:48