[Tex/LaTex] Basic layout of flow chart in LateX

flow chartstikz-arrowstikz-pgf

I created the follow (basic) flow chart:

enter image description here

with the following code:

\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows,chains,shapes.geometric,  decorations.pathreplacing,decorations.pathmorphing,shapes,  matrix,shapes.symbols}

\begin{document}
\tikzstyle{block} = [rectangle, draw, text width=10em, text centered, rounded      corners, minimum height=3em]
\begin{tikzpicture}
 [node distance=1.35cm,
 start chain=going below,]
\node (n1) at (0,0) [block]  {General framwork};
\node (n2) [block, below of=n1] {Literature study};
\node (n3) [block, below of=n2] {Data-analysis};
\node (n4) [block, below of=n3] {Model set-up (SB \& NH)};
\node (n5) [block, below of=n4] {Simulations};
\node (n6) [block, below of=n5] {Sensitivity analysis};
\node (n7) [block, below of=n6] {Model update};
\node (n8) [block, below of=n7] {Conclusions and recommendations};
% Connectors
\draw [->] (n1) -- (n2);
\draw [->] (n2) -- (n3);
\draw [->] (n3) -- (n4);
\draw [->] (n4) -- (n5);
\draw [->] (n5) -- (n6);
\draw [->] (n6) -- (n7);
\draw [->] (n6) -- (n7);
\draw [->] (n7) -- (n8);
\draw [->] (n7.east) -| ++(1,0) |- (n6.east);
\draw [->] (n7.west) -| ++(-1,0) |- (n5.west);
\end{tikzpicture}
\end{document}

I want the following:

  1. Center the flow chart. The flow chart is positioned exactly at the centre of the page (something like \centering?).
  2. A box around the flow chart (something like \fbox?).
  3. The arrow a little bit thicker such that it becomes more visible.
  4. Place a caption and label (\caption{} and \label{}).

Best Answer

Placing the tikzpicture inside a figure-environment will fix problem 1 and 4. Remember that \label needs to be placed after \caption. For the arrows, you could have a look at Ignasi's answer inIs it possible to change the size of an arrowhead in TikZ/PGF? using the tikz-library arrows.meta.

You can set a style for all >-arrows in the following way:

\tikzset{>={Latex[width=2mm, length=1.2mm]}}

This was taken from Torbjørn T.´s answer in How to set default style for arrow tips in TikZ?

Output

enter image description here

Code

\documentclass[11pt]{article}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{calc,trees,positioning,arrows.meta,chains,shapes.geometric,  decorations.pathreplacing,decorations.pathmorphing,shapes,  matrix,shapes.symbols}
\tikzset{>={Latex[width=2mm, length=1.2mm]}}

\begin{document}
\lipsum[2]
\begin{figure}[hbt]
    \centering
    \tikzstyle{block} = [rectangle, draw, text width=10em, text centered, rounded      corners, minimum height=3em]
    %/pgf/arrow keys/length=2mm
    \fbox{%
        \begin{tikzpicture}
             [node distance=1.35cm,
             start chain=going below,]
            \node (n1) at (0,0) [block]  {General framwork};
            \node (n2) [block, below of=n1] {Literature study};
            \node (n3) [block, below of=n2] {Data-analysis};
            \node (n4) [block, below of=n3] {Model set-up (SB \& NH)};
            \node (n5) [block, below of=n4] {Simulations};
            \node (n6) [block, below of=n5] {Sensitivity analysis};
            \node (n7) [block, below of=n6] {Model update};
            \node (n8) [block, below of=n7] {Conclusions and recommendations};
            % Connectors
            \draw [->] (n1) -- (n2);
            \draw [->] (n2) -- (n3);
            \draw [->] (n3) -- (n4);
            \draw [->] (n4) -- (n5);
            \draw [->] (n5) -- (n6);
            \draw [->] (n6) -- (n7);
            \draw [->] (n6) -- (n7);
            \draw [->] (n7) -- (n8);
            \draw [->] (n7.east) -| ++(1,0) |- (n6.east);
            \draw [->] (n7.west) -| ++(-1,0) |- (n5.west);
        \end{tikzpicture}
    }
    \caption{Some title}
    \label{fig:title}
\end{figure}
\lipsum[1]
\end{document}
Related Question