一个节点的南边和另一个节点的北边之间的距离相等

一个节点的南边和另一个节点的北边之间的距离相等

我是 TikZ 的新手,正在尝试让这三个框之间的间距相等外框框的宽度使得两个箭头的长度相同。我将制作一个包含许多框的流程图,并希望所有箭头的长度相同。如果有人能告诉我如何做到这一点,我将不胜感激!这是我的代码:

\tikzstyle{block} = [rectangle, draw, text width=8cm, text centered, rounded corners, minimum height=4em]

\begin{tikzpicture}[node distance = 4cm]

\node [block] (1) {There is a lot of writing in this node, There is a lot of writing in this node, There is a lot of writing in this node, There is a lot of writing in this nodeThere is a lot of writing in this node, There is a lot of writing in this node,};
\node [block, below of=1] (2) {not in this};
\node [block, below of=2] (3) {nor in this};

\end{tikzpicture}

答案1

这可能不是最好的做到这一点的方法,但有一件事可以要做的就是用 等替换node distance。如果要使用该语法,则below=4cm of 1需要加载库。positioningbelow=<distance> of <node>

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\tikzstyle{block} = [rectangle, draw, text width=8cm, text centered, rounded corners, minimum height=4em]

\begin{tikzpicture}
\node [block] (1) {There is a lot of writing in this node, There is a lot of writing in this node, There is a lot of writing in this node, There is a lot of writing in this nodeThere is a lot of writing in this node, There is a lot of writing in this node,};
\node [block, below=2cm of 1] (2) {not in this};
\node [block, below=2cm of 2] (3) {nor in this};
\end{tikzpicture}
\end{document}

相关内容