如何修复流程图中相同的框大小

如何修复流程图中相同的框大小

我正在按照给出的教程这里了解如何创建流程图

例如,

\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=orange!30]

定义了矩形的尺寸和文本宽度。

这将使我们能够创建以下类型的节点,

\node (pro2a) [process, below of=dec1, yshift=-0.5cm] {Process 2a text text text text text text text text text text};

但是如果我们创建另一个具有不同文本长度的节点

\node (pro2b) [process, below of=dec1, yshift=-0.5cm] {Process 2a text text text};

pro2a为和创建的框的大小pro2b将不同。我想知道如何为pro2a和都创建相同大小的矩形pro2b

编辑:我会查看下面分享的链接中提供的示例。但是,我不确定如何应用于我的情况,因为其中存在不同的节点类型

\begin{tikzpicture}
\end{tikzpicture}

环境。

完整示例:

\tikzstyle{steps} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=gray!50]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, text width=4cm, draw=black, fill=white]
\definecolor{arrowblue}{RGB}{98,145,224}

\newcommand\ImageNode[3][]{
\node[draw=arrowblue!80!black,linewidth=1pt,#1](#2){\includegraphics[width=1.5cm,height=1.5cm]{#3}};
}

\begin{tikzpicture}[node distance=2cm]
\node (step1) [steps] {Step 1};
\node (step2) [steps, right of=step1, xshift=3cm]{Step 2};
\node (step3) [steps, right of=step2, xshift=3cm]{Step 3};
\node (process1) [process, below of=step1] {text text};
\node (process2) [process, right of=process1, xshift=3cm] {text text
text text text text text text text text text text text text text text text text};
\node (process3) [process, right of=process2, xshift=3cm] {text text text};
\end{tikzpicture}

steps这里,我认为和的框大小process会有所不同。我只想为process1process2、分配相同的框大小。process3

答案1

将高度改为 2 厘米即可——您可能希望增加分离度

在此处输入图片描述

\tikzstyle{steps} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, text width=3cm, draw=black, fill=gray!50]
    \tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=2cm, text centered, text width=4cm, draw=black, fill=white]
    \definecolor{arrowblue}{RGB}{98,145,224}



\newcommand\ImageNode[3][]{
    \node[draw=arrowblue!80!black,linewidth=1pt,#1](#2){\includegraphics[width=1.5cm,height=1.5cm]{#3}};
}

\begin{tikzpicture}[node distance=2cm]
\node (step1) [steps] {Step 1};
\node (step2) [steps, right of=step1, xshift=3cm]{Step 2};
\node (step3) [steps, right of=step2, xshift=3cm]{Step 3};
\node (process1) [process, below of=step1] {text text};
\node (process2) [process, right of=process1, xshift=3cm] {text text
    text text text text text text text text text text text text text text text text};
\node (process3) [process, right of=process2, xshift=3cm] {text text text};
\end{tikzpicture}

相关内容