tikzpicture のノードの上に積み重ねられた括弧注釈を追加する

tikzpicture のノードの上に積み重ねられた括弧注釈を追加する

tikzpicture のノードの上に積み重ねられた括弧注釈を追加したいと思います。

以下は私の TEX ドキュメントです:

\documentclass[10pt]{article}
\ExpandArgs{c}\newcommand{new@fontshape}{anything}

\usepackage[russian,indonesian]{babel}
\usepackage{newtx}
\usepackage{linguex}
\usepackage[none]{hyphenat}
\usepackage{geometry}
\usepackage{setspace}
\usepackage{booktabs}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{gb4e}
\usepackage{adjustbox}

\usetikzlibrary{shapes.geometric, arrows, chains, decorations.pathreplacing, positioning}

\AtBeginDocument{%
  \DeclareFontFamilySubstitution{T2A}{\familydefault}{Tempora-TLF}%
}

\primebars
\let\emptyset\varnothing

\geometry{
 a4paper,
 margin=3cm
 }

\newcommand{\?}[1]{\foreignlanguage{russian}{#1}}
\noautomath

\begin{document}
\section*{Bagan alir riset}
\vspace{5mm}

\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=2.5cm, text centered, draw=black, text width=3cm]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
\tikzstyle{arrow} = [thick,->,>=stealth]

\def\layersep{2.5cm}
\begin{adjustbox}{width=\textwidth}
\begin{tikzpicture}[node distance=4cm]
  \node (pd) [startstop] {test};
  \node (ed) [startstop, right of=pd] {test};
  \node (ak) [startstop, right of=ed] {test};
  \node (k) [startstop, right of=ak] {test};
  \node (awk) [startstop, right of=k] {test};
  \node (s) [startstop, right of=awk] {test};

  \draw [arrow] (pd) -- (ed);
  \draw [arrow] (ed) -- (ak);
  \draw [arrow] (ak) -- (k);
  \draw [arrow] (k) -- (awk);
  \draw [arrow] (awk) -- (s);

\end{tikzpicture}
\end{adjustbox}

\end{document}

結果的にこのタイプセットになります: ここに画像の説明を入力してください

そして、このフローチャートから、次のような括弧注釈を付けたいと思います。 ここに画像の説明を入力してください

ここで、a、b、c はテキストの文字列です。

既存の TEX ドキュメントを通じて注釈を実装するにはどうすればよいですか?

答え1

decorations.pathreplacingすでにロードされているライブラリを使用します。

例

\documentclass[10pt]{article}
\ExpandArgs{c}\newcommand{new@fontshape}{anything}

\usepackage[russian,indonesian]{babel}
\usepackage{newtx}
\usepackage{linguex}
\usepackage[none]{hyphenat}
\usepackage{geometry}
\usepackage{setspace}
\usepackage{booktabs}
\usepackage{tikz}
\usepackage{tikz-qtree}
\usepackage{gb4e}
\usepackage{adjustbox}

\usetikzlibrary{shapes.geometric, arrows, chains, decorations.pathreplacing, positioning}

\AtBeginDocument{%
  \DeclareFontFamilySubstitution{T2A}{\familydefault}{Tempora-TLF}%
}

\primebars
\let\emptyset\varnothing

\geometry{
 a4paper,
 margin=3cm
 }

\newcommand{\?}[1]{\foreignlanguage{russian}{#1}}
\noautomath

\begin{document}
\section*{Bagan alir riset}
\vspace{5mm}

\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=2.5cm, text centered, draw=black, text width=3cm]
\tikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=blue!30]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=orange!30]
\tikzstyle{decision} = [diamond, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=green!30]
\tikzstyle{arrow} = [thick,->,>=stealth]

\def\layersep{2.5cm}
\begin{adjustbox}{width=\textwidth}
\begin{tikzpicture}[node distance=4cm]
  \node (pd) [startstop] {test};
  \node (ed) [startstop, right of=pd] {test};
  \node (ak) [startstop, right of=ed] {test};
  \node (k) [startstop, right of=ak] {test};
  \node (awk) [startstop, right of=k] {test};
  \node (s) [startstop, right of=awk] {test};

  \draw [arrow] (pd) -- (ed);
  \draw [arrow] (ed) -- (ak);
  \draw [arrow] (ak) -- (k);
  \draw [arrow] (k) -- (awk);
  \draw [arrow] (awk) -- (s);

  \draw [decorate,decoration={brace,amplitude=8pt,raise=1em}] (ak.north west) -- (k.north east) node[midway,yshift=2.5em] {a};
  \draw [decorate,decoration={brace,amplitude=8pt,raise=1em}] (awk.north west) -- (awk.north east) node[midway,yshift=2.5em] {b};
  \draw [decorate,decoration={brace,amplitude=8pt,raise=4em}] (ak.north west) -- (awk.north east) node[midway,yshift=5.5em] {c};

\end{tikzpicture}
\end{adjustbox}

\end{document}

関連情報