Adicionando anotação de colchetes empilhados acima dos nós no tikzpicture

Adicionando anotação de colchetes empilhados acima dos nós no tikzpicture

Quero adicionar anotação de colchetes empilhados acima dos nós do tikzpicture.

O seguinte é o meu 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 nesta composição: insira a descrição da imagem aqui

E a partir deste fluxograma, quero colocar anotações entre colchetes, como: insira a descrição da imagem aqui

Onde a, b e c são sequências de texto.

Como posso implementar as anotações através do meu documento tex existente?

Responder1

Use decorations.pathreplacinga biblioteca que você já carregou.

exemplo

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

informação relacionada