4

This question already has an answer here:

I want to make a tikz-picture of a Hasse diagram and by problem is that the lines between nodes stop a bit short of the border of the node and I can't figure out how to fix this. Here is my code:

\begin{tikzpicture}[scale=\tikzscale,
source/.style={draw,thick,rounded corners,inner sep=2pt}]
\node[source] (min) at (0,0) {$\emptyset$};
\node[source] (A1) at (-2,1) {$a$};
\node[source] (A2) at (-1,1) {$b$};
\node[source] (A3) at (0,1) {$h$};
\node[source] (A4) at (1,1) {$c$};
\node[source] (A5) at (2,1) {$d$};
\node[source] (B1) at (-3.5,3) {$ab$};
\node[source] (B2) at (-2.5,3) {$ah$};
\node[source] (B3) at (-1.5,3) {$bh$};
\node[source] (B4) at (-0.5,3) {$ad$};
\node[source] (B5) at (0.5,3) {$bc$};
\node[source] (B6) at (1.5,3) {$ch$};
\node[source] (B7) at (2.5,3) {$dh$};
\node[source] (B8) at (3.5,3) {$cd$};
\node[source] (C1) at (-3,5) {$abh$};
\node[source] (C2) at (-1.5,5) {$adh$};
\node[source] (C3) at (0,5) {$abcd$};
\node[source] (C4) at (1.5,5) {$bch$};
\node[source] (C5) at (3,5) {$cdh$};
\node[source] (max) at (0,6.5) {$abcdh$};
\draw[thick] (min) -- (A1);
\draw[thick] (min) -- (A2);
\draw[thick] (min) -- (A3);
\draw[thick] (min) -- (A4);
\draw[thick] (min) -- (A5);
\draw[thick] (A1) -- (B1);
\draw[thick] (A1) -- (B2);
\draw[thick] (A1) -- (B4);
\draw[thick] (A2) -- (B1);
\draw[thick] (A2) -- (B3);
\draw[thick] (A2) -- (B4);
\draw[thick] (A3) -- (B2);
\draw[thick] (A3) -- (B3);
\draw[thick] (A3) -- (B6);
\draw[thick] (A3) -- (B7);
\draw[thick] (A4) -- (B5);
\draw[thick] (A4) -- (B6);
\draw[thick] (A4) -- (B8);
\draw[thick] (A5) -- (B4);
\draw[thick] (A5) -- (B7);
\draw[thick] (A5) -- (B8);
\draw[thick] (B1) -- (C1);
\draw[thick] (B1) -- (C3);
\draw[thick] (B2) -- (C1);
\draw[thick] (B2) -- (C2);
\draw[thick] (B3) -- (C1);
\draw[thick] (B3) -- (C4);
\draw[thick] (B4) -- (C2);
\draw[thick] (B4) -- (C3);
\draw[thick] (B5) -- (C3);
\draw[thick] (B5) -- (C4);
\draw[thick] (B6) -- (C4);
\draw[thick] (B6) -- (C5);
\draw[thick] (B7) -- (C2);
\draw[thick] (B7) -- (C5);
\draw[thick] (B8) -- (C3);
\draw[thick] (B8) -- (C5);
\draw[thick] (C1) -- (max);
\draw[thick] (C2) -- (max);
\draw[thick] (C3) -- (max);
\draw[thick] (C4) -- (max);
\draw[thick] (C5) -- (max);
\end{tikzpicture}

Output

Can anybody help me? Thanks!

marked as duplicate by Torbjørn T. tikz-pgf Oct 5 '16 at 21:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 5
    Welcome to TeX.SX! The problem is caused by the rounded corners. Try the suggestion in Rounded corners in TikZ trees. (add the shapes.misc library and use rounded rectangle instead of rounded corners in your style). – Torbjørn T. Jun 15 '16 at 11:37
  • Please make your code compilable as this is much more helpful than a code fragment which people have to figure out how to complete. – cfr Jun 15 '16 at 12:40
  • \draw[thick] (A2) -- (B5); is missing ;-) – Ignasi Jun 15 '16 at 13:46

Browse other questions tagged or ask your own question.