I used TikZ to create some awesome flow charts, but I still have a hard time to understand how to apply a background to my flow charts. In detail, I would like to have a boarder line around some of the nodes and a text attached on bottom or on top according to the figure below. Currently, my flow chart looks like the following example and related MWE:
Current state:
MWE:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,matrix,intersections,positioning,chains}
\begin{document}
\begin{tikzpicture}[node distance = 1.5cm]
% Styles
\tikzstyle{start} = [rectangle, rounded corners, text width=3cm, minimum height=1cm,text centered, draw=black]
\tikzstyle{process} = [rectangle, text width=3cm, minimum height=1cm, text centered, draw=black]
\tikzstyle{arrow} = [thick,->,>=latex]
% Nodes
\node (P1) [process] {Part 1A};
\node (start) [start,left of=P1,xshift=-2.8cm] {Start};
\node (P2) [process,below of=P1] {Part 2A};
\node (P3) [process,below of=P2] {Part 3A};
\node (P4) [process,below of=P3] {Part 1B};
\node (P5) [process,below of=P4] {Part 2B};
\node (P6) [process,below of=P5] {Part 3B};
\node (stop) [start,right of=P6,xshift=2.8cm] {End};
% Arrows
\draw [arrow] (start) -- (P1);
\draw [arrow] (P1) -- (P2);
\draw [arrow] (P2) -- (P3);
\draw [arrow] (P3) -- (P4);
\draw [arrow] (P4) -- (P5);
\draw [arrow] (P5) -- (P6);
\draw [arrow] (P6) -- (stop);
\end{tikzpicture}
\end{document}
Desired state: (I created the boarders with paint. If possibile, I would prefer a dashed border line with correct alignment)



fitTikz library... – Paul Gaborit May 18 '18 at 07:50fitlibrary that might help: How to draw a container box in latex around automata?. – Peter Grill May 18 '18 at 08:06