如何在 Beamer 中使用 LaTeX 构建瀑布模型图?

如何在 Beamer 中使用 LaTeX 构建瀑布模型图?

我需要构建瀑布模型图像这些

瀑布1

瀑布2

答案1

替代方案格诺特很好的答案,其中使用了chainsTikZ 库并且在循环中建立节点之间的连接:

\documentclass[tikz, margin=3mm]{standalone}
\usepackage{}
\usetikzlibrary{chains,positioning,shadows}

\begin{document}
    \begin{tikzpicture}[>=stealth,
    node distance = 3mm and 3mm,
      start chain = A going below right,
every node/.style = {draw, text width=24mm, minimum height=12mm, align=center,
                     inner sep=1mm, fill=white, drop shadow={fill=black},  on chain=A},
                        ]
\node {Requirements}; % A-1
\node {Design};
\node {Coding and unit test};
\node {System integration};
\node {Operation and maintenance};
%
\foreach \i [count=\j] in {2,...,5}
{
  \draw[->, thick] (A-\i) -| (A-\j);
  \draw[->, thick] (A-\j) -| (A-\i);
}
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

在此处输入图片描述

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\tikzset
  {phase/.style={draw,minimum width=2cm,minimum height=1.3cm,align=center}
  ,previous/.style={below right=0.5cm of #1}
  }
\newcommand\connect[2]%
  {\draw[->,thick] (#1) -| (#2);
   \draw[->,thick] (#2) -| (#1);
  }
\begin{tikzpicture}[>=stealth]
  \node[phase]                       (requirements) {Requirements};
  \node[phase,previous=requirements] (design)       {Design};
  \node[phase,previous=design]       (coding)       {Coding and\\unit test};
  \node[phase,previous=coding]       (integration)  {System\\integration};
  \node[phase,previous=integration]  (operation)    {Operation and\\maintenance};
  \connect{requirements}{design};
  \connect{design}{coding};
  \connect{coding}{integration};
  \connect{integration}{operation};
\end{tikzpicture}
\end{document}

在此处输入图片描述

\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\tikzset
  {phase/.style={draw,minimum width=2cm,minimum height=1.3cm,align=center}
  ,previous/.style={below right=0.5cm of #1}
  }
\newcommand\connect[2]%
  {\draw[->,thick] (#1.east) to[out=0,in=90] (#2.north);
   \draw[->,thick] (#2.west) to[out=180,in=270] (#1.south);
  }
\begin{tikzpicture}[>=stealth]
  \node[phase]                       (requirements) {Requirements};
  \node[phase,previous=requirements] (design)       {Design};
  \node[phase,previous=design]       (coding)       {Coding and\\unit test};
  \node[phase,previous=coding]       (integration)  {System\\integration};
  \node[phase,previous=integration]  (operation)    {Operation and\\maintenance};
  \connect{requirements}{design};
  \connect{design}{coding};
  \connect{coding}{integration};
  \connect{integration}{operation};
\end{tikzpicture}
\end{document}

相关内容