3

Consider the following minimal example:

\documentclass{minimal}
\usepackage{tikz}
  \usetikzlibrary{graphs,graphdrawing,shapes.multipart}
    \usegdlibrary{trees}

\begin{document}
\tikz[every node/.style={rectangle split,rectangle split parts=2,draw}]{
  \graph[tree layout,grow=0] {
    a/a\nodepart{two}1;
    b/b\nodepart{two}2;
    c/c\nodepart{two}3;
    a -- {b, c};
  };
}
\end{document}

The result (with PGF 3.0.1) is:

graph with multipart nodes and wrong connections

There is an incorrect edge in the sense that the line corresponding to a -- c does not stop at the edge of node a. Is this a bug or intended? How could I work around it?

equaeghe
  • 5,976
  • 4
  • 30
  • 36
  • Same problem pops up in http://tex.stackexchange.com/questions/302393/necklace-layout-stringnode-text-insertion/302794#302794 I think, I'd be interested in seeing a solution myself. – Torbjørn T. Apr 22 '16 at 12:24
  • It looks like a bug to me, but I don't seem to have permission anymore to add tickets to the PGF sourceforge bug tracker :-(. – equaeghe Apr 22 '16 at 13:04
  • Not related but you could be interested in: http://tex.stackexchange.com/questions/42114/why-should-the-minimal-class-be-avoided and standalone – Ignasi Apr 22 '16 at 14:53
  • If you could specify an undrawn edge with a tree layout, you could work around it, but it seems you can't.... – cfr Apr 23 '16 at 03:01

1 Answers1

2

It seems to be, because the boxes are transparent. I tried this:

\documentclass{minimal}
\usepackage{tikz}
  \usetikzlibrary{graphs,graphdrawing,shapes.multipart}
    \usegdlibrary{trees}

\begin{document}
\tikz[every node/.style={rectangle split,rectangle split parts=2,draw, fill=white}]{
  \graph[tree layout,grow=0] {
    a/a\nodepart{two}1;
    b/b\nodepart{two}2;
    c/c\nodepart{two}3;
    a -- {b, c};
  };
}
\end{document}

enter image description here