答案1
这是使用 的解决方案chains
。您可以随意调整间距。正确放置的关键是使用\tikzchainprevious
和 ,anchor=
如下面的代码所示。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary {chains}
\tikzset{long node/.style={draw, rounded corners, minimum width=7.5cm, minimum height=1cm},
short node/.style={draw, rounded corners, minimum width=2cm, minimum height=1cm},
square node/.style={draw, rounded corners, minimum width=2.5cm, minimum height=2.5cm}
}
\begin{document}
\begin{tikzpicture}[start chain, node distance=5mm]
\node[on chain, long node]{};
\node[on chain=going below, long node]{};
\node[on chain=going {below=of \tikzchainprevious.south west, anchor=north west}, short node]{};
\node[on chain=going below, short node, ]{};
\node[on chain=going right, short node]{};
\node[on chain=going above, short node]{};
\node[on chain=going {right=of \tikzchainprevious.north east, anchor=north west}, square node]{};
\node[on chain=going {below=of \tikzchainprevious.south east, anchor=north east}, long node]{};
\end{tikzpicture}
\end{document}
如果你添加every node/.style=join, every join/.style={red,->}
到tikzpicture
选项中,你会看到链式序列: