2

enter image description here

I have drawn the boxes A to F and the arrows. What I do not know is how to draw the two outer blocks - block1 covering blocks A to D and block2 covering E and F. I would really appreciate some help.

1 Answers1

8

Use the TikZ fit library.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fit}
\begin{document}
\begin{tikzpicture}[
  every node/.style = {
    draw,rounded corners,
    minimum width=3cm
  }]
  \node             (A) {A};
  \node[below of=A] (B) {B};
  \node[below of=B] (C) {C};
  \node[below of=C] (D) {D};
  \node[below of=D] (E) {E};
  \node[below of=E] (F) {F};

  \draw (A) edge[->] (B);
  \draw (B) edge[->] (C);
  \draw (C) edge[->] (D);
  \draw (D) edge[->] (E);
  \draw (E) edge[->] (F);

  \node[fit=(A) (B) (C) (D)] {};
  \node[fit=(E) (F)] {};
\end{tikzpicture}
\end{document}

enter image description here

Henri Menke
  • 109,596
  • For the record, you don't need to specify the middle nodes (B and C) in the fit command. The "extremes" are enough, so the first one can be reduced to: \node[fit=(A) (D)] {}; :) – Alenanno Jan 01 '16 at 14:33