是否可以在 Latex 中创建这个流程图?

是否可以在 Latex 中创建这个流程图?

是否可以在 Latex 中创建以下流程图? 在此处输入图片描述

您能提供一个代码示例吗?提前致谢。

答案1

使用 TikZ 及其库的起点positioning

在此处输入图片描述

代码:

\documentclass{article}    
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}

\begin{tikzpicture}[
  mynode/.style={
    draw,
    rounded corners,
    font=\sffamily,
    text width=1.5cm,
    align=center
  },
  ar/.style={
  ->,
  >=latex,
  }
]
\node[mynode] (c1) {data};
\node[mynode,below=of c1] (c2) {data};
\node[mynode,below=of c2] (c3) {data};
\node[mynode,below=of c3] (c4) {data};
\coordinate[below=20pt of c4] (aux);

\node[mynode,left=of c2] (l1) {data};
\node[mynode,below=of l1] (l2) {data};

\node[mynode,right=of c2] (r1) {data};
\node[mynode,right=of r1] (rr1) {data};

\foreach \Valor in {1,2,3}
{
  \draw[ar] (c\Valor) -- (c\the\numexpr\Valor+1\relax);
}
\draw[ar] (c4.south) -- ++(0,-8pt) -| ([xshift=-6pt]r1.south);
\draw[ar] ([xshift=-6pt]c1.south) -- ++(0,-15pt) -| (l1);
\draw[ar] ([xshift=6pt]c1.south) -- ++(0,-15pt) -| (r1);
\draw[ar] ([xshift=6pt]l1.south) -- ([xshift=6pt]l1.south|-l2.north);
\draw[ar] 
  ([xshift=-6pt]l1.south) --
  ++(0,-15pt) --
  ++(-25pt,0) |-
  (aux) -|
  ([xshift=6pt]r1.south);
\draw[ar] (r1) -- (rr1);
\end{tikzpicture}

\end{document}

相关内容