tikz を使用して矢印付きのインフォグラフィック ボックスを作成する方法

tikz を使用して矢印付きのインフォグラフィック ボックスを作成する方法

Infographic Box with Arrow次のように定義される矢印を含むボックスを描きたいのですがこのリンク次の図を更新して、上から下への図を生成したいと思います。

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{shapes.geometric, arrows}

\begin{document}
\begin{tikzpicture}[font=\small, node distance=2cm]
\tikzstyle{block} = [rectangle, draw, text width=12cm, text centered, rounded corners, minimum height=4em]
\tikzstyle{line} = [draw, -latex']

\node [block] (step1) {Alpha process};
\node [block, below of=step1] (step2) {Beta analysis};
\node [block, below of=step2] (step3) {Gamma results};

\path [line] (step1) -- (step2);
\path [line] (step2) -- (step3);
\end{tikzpicture}
\end{document}

ここに画像の説明を入力してください

ボックスを更新して、下の図のようにする方法はありますか。

ここに画像の説明を入力してください

答え1

shapes.arrowsTiに付属するライブラリZにはarrow box試してみるとよいかもしれません:

\documentclass[tikz, border=10pt]{standalone}
\usetikzlibrary{shapes.arrows}

\begin{document}
\begin{tikzpicture}
\tikzset{
    font=\small, 
    node distance=2cm,
    block/.style={
        arrow box, 
        draw, 
        text width=12cm, 
        text centered, 
        minimum height=4em,
        arrow box arrows={south:0.5cm}
    },
    last block/.style={
        block,
        arrow box arrows={south:0cm}
    }
}

\node[block] (step1) {Alpha process};
\node[block, below of=step1] (step2) {Beta analysis};
\node[last block, below of=step2] (step3) {Gamma results};

\end{tikzpicture}
\end{document}

ここに画像の説明を入力してください

\tikzsetの代わりにを使用する必要があることに注意してください\tikzstyle


あるいは、ノードの境界線を手動で描画したり、コード内の繰り返しを避けるために、以下を作成することもできます\pic

\documentclass[tikz, border=10pt]{standalone}
\usetikzlibrary{shapes.arrows}

\begin{document}
\begin{tikzpicture}
\tikzset{
    font=\small, 
    node distance=2cm,
    pics/box with arrow/.style={
        code={
            \node[pic actions, text centered] (-node) {#1};
            \draw[rounded corners] 
                ([xshift=-0.25em]-node.south) -| (-node.north west) -| 
                (-node.south east) -- ([xshift=0.25em]-node.south);
            \draw ([xshift=-0.25em]-node.south) |- ++(-0.25em,-0.5em) --
                ++(0.5em,-0.5em) -- ++(0.5em,0.5em) -| ++(-0.25em,0.5em);
        }
    },
    pics/box without arrow/.style={
        code={
            \node[pic actions, text centered] (-node) {#1};
            \draw[rounded corners] 
                (-node.south east) rectangle (-node.north west);
        }
    }
}

\pic[text width=12cm, minimum height=4em] 
    (step1) {box with arrow={Alpha process}};

\pic[below of=step1-node, text width=12cm, minimum height=4em] 
    (step2) {box with arrow={Beta analysis}};

\pic[below of=step2-node, text width=12cm, minimum height=4em] 
    (step3) {box without arrow={Gamma results}};

\end{tikzpicture}
\end{document}

ここに画像の説明を入力してください

関連情報