Hinzufügen einer gestapelten Klammeranmerkung über Knoten in TikzPicture

Hinzufügen einer gestapelten Klammeranmerkung über Knoten in TikzPicture

Ich möchte über den Knoten von Tikzpicture eine gestapelte Klammeranmerkung hinzufügen.

Das Folgende ist mein Tex-Dokument:

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

Das Ergebnis ist dieser Schriftsatz: Bildbeschreibung hier eingeben

Und in diesem Flussdiagramm möchte ich Klammern als Anmerkungen einfügen, sodass: Bildbeschreibung hier eingeben

Wobei a, b und c Textzeichenfolgen sind.

Wie kann ich die Anmerkungen in mein vorhandenes Tex-Dokument implementieren?

Antwort1

Verwenden Sie decorations.pathreplacingdie Bibliothek, die Sie bereits geladen haben.

Beispiel

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

verwandte Informationen