3

Is it possible to put curly braces around a set of nodes with some text near the bottom right of the brace.

\documentclass[a4paper]{scrartcl}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{tikz}
\usepackage{tikz-uml}
\usetikzlibrary{shapes.multipart,positioning,fit}
\usepackage{pgf-umlsd}
\usetikzlibrary{arrows}

\begin{document}
\begin{tikzpicture}
    \node[text width=3cm]                       (A)  at (0,0)               {\tiny AAA};
    
    \node[anchor=north west , text width=1cm]   (A1) at (A.south west)      {\tiny BBB};
    \node[anchor=west       , text width=1cm]   (A2) at (A1.east)           {\tiny CCC};
    \node[anchor=west       , text width=1cm]   (A3) at (A2.east)           {\tiny DDD};
    
    \node[anchor=north west , text width=1cm]   (A4) at (A1.south west)     {\tiny EEE};
    \node[anchor=west       , text width=1cm]   (A5) at (A4.east)           {\tiny FFF};
    \node[anchor=west       , text width=1cm]   (A6) at (A5.east)           {\tiny };
    
    \node [inner sep=0pt,
            draw,
            rounded corners,
            fit = (A)(A1)(A2)(A3)(A4)(A5)(A6)
            ] (A13) {}; 
    
    \draw   (A1.north west) -- (A3.north east)
    (A1.south west) -- (A3.south east);    
    
\end{tikzpicture}
\end{document} 

enter image description here

3

braces around nodes

\documentclass[a4paper]{scrartcl}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{tikz}
%\usepackage{tikz-uml}
\usetikzlibrary{shapes.multipart,positioning,fit}
\usepackage{pgf-umlsd}
\usetikzlibrary{arrows}

\usetikzlibrary{decorations.pathreplacing} % <--- add this

\begin{document}
\begin{tikzpicture}
    \node[text width=3cm]                       (A)  at (0,0)               {\tiny AAA};
    
    \node[anchor=north west , text width=1cm]   (A1) at (A.south west)      {\tiny BBB};
    \node[anchor=west       , text width=1cm]   (A2) at (A1.east)           {\tiny CCC};
    \node[anchor=west       , text width=1cm]   (A3) at (A2.east)           {\tiny DDD};
    
    \node[anchor=north west , text width=1cm]   (A4) at (A1.south west)     {\tiny EEE};
    \node[anchor=west       , text width=1cm]   (A5) at (A4.east)           {\tiny FFF};
    \node[anchor=west       , text width=1cm]   (A6) at (A5.east)           {\tiny };
    
    \node [inner sep=0pt,
            draw,
            rounded corners,
            fit = (A)(A1)(A2)(A3)(A4)(A5)(A6)
            ] (A13) {}; 
    
    \draw   (A1.north west) -- (A3.north east)
    (A1.south west) -- (A3.south east);    
    
    \draw [red,thick,decorate,decoration={brace,amplitude=5pt,mirror,raise=1ex}]
  (A13.north west) -- (A13.south west) ;
  
    \draw [red,thick,decorate,decoration={brace,amplitude=5pt,raise=1ex}]
  (A13.north east) -- (A13.south east) node[right,xshift=0.5em]{your text};
\end{tikzpicture}
\end{document} 
3

You could also just use a matrix, which offers these curly brackets as delimiters, and is a perhaps more natural way of arranging the texts "AAA", "BBB" and so on.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
 \matrix[matrix of nodes,column sep=1.5em,draw,rounded corners=4pt,
    left delimiter=\{,right delimiter=\}](m){
  AAA & & \\
  BBB & CCC & DDD\\
  EEE & FFF & \\
 };
 \path (m-1-1) -- coordinate (aux1) (m-2-1) -- coordinate (aux2) (m-3-1)
  foreach \x in {1,2}{(aux\x-|m.west) edge (aux\x-|m.east)};
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.