Agregar anotaciones de corchetes apilados sobre los nodos en tikzpicture

Agregar anotaciones de corchetes apilados sobre los nodos en tikzpicture

Quiero agregar una anotación de corchetes apilados sobre los nodos de tikzpicture.

El siguiente es mi documento 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}

Resultando en esta composición tipográfica: ingrese la descripción de la imagen aquí

Y a partir de este diagrama de flujo, quiero poner anotaciones entre corchetes, de modo que: ingrese la descripción de la imagen aquí

Donde a, byc son cadenas de texto.

¿Cómo puedo implementar las anotaciones a través de mi documento tex existente?

Respuesta1

Utilice decorations.pathreplacingla biblioteca que ya ha cargado.

ejemplo

\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}

información relacionada