1

Note:

Please note that I already viewed a solution provided to the question asked on the post:

Put braces in itemize list

and this does not solve my issue since I have a nested structure for the variables and I also found the solution provided to be messy.

Question and My Incomplete Solution

I have a set of variables that are in a hierarchical structure. I would like to display them in a bulleted list with braces to show this hierarchical structure.

I am partially able to obtain the desired outcome with the following code

\begin{equation*}
\left.
\begin{array}{@{}l}
    \left.
    \begin{array}{@{}l}
        \left.
        \begin{array}{@{}l }
        \text{Variable A}\\
        \text{Variable B}
        \end{array}\right\} \text{Level 1}\\
    \text{Variable C}\\
    \text{Variable D}\\
    \text{Variable E}\\
    \end{array}\right\} \text{Level 2}\\
\text{Variable F}\\
\text{Variable G}\\
\text{Variable H}\\
\end{array}
\right\}    \text{Level 3}
\end{equation*}

The output looks as follows:

enter image description here

The issue is that I would like to have a bulleted list so that a bullet appear. Furthermore, I have to place text inside \text{} since I am working with arrays.

Is it possible to achieve the desired outcome with the itemize environment so that bullets appear and the braces also appear?

NM_
  • 357

1 Answers1

2

You could just annotate a list with TikZ. Using styles allows one to reduce unnecessary repetition. This will continue to work if you create your lists using the, say, enumitem package.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calligraphy,tikzmark,fit}
\tikzset{bracenode/.style 2 args={fit=#1,inner sep=0pt,alias=tmp,append after command={
  ([yshift=0.5ex]tmp.north east) edge[thick,decorate,decoration={calligraphic brace,raise=0.5ex}]
  ([yshift=-0.5ex]tmp.south east)
   -- #2
  ([yshift=-0.5ex]tmp.south east)
    }}}
\begin{document}
\begin{itemize}
 \item \tikzmarknode{A}{Variable A}
 \item \tikzmarknode{B}{Variable B}
 \item Variable C
 \item Variable D
 \item \tikzmarknode{E}{Variable E}
 \item Variable F
 \item Variable G
 \item \tikzmarknode{H}{Variable H}
 \begin{tikzpicture}[overlay,remember picture]
  \path node[bracenode={(A)(B)}{node[right=1ex](L1){Level 1}}]{}
   node[bracenode={(A)(E)(L1)}{node[right=1ex](L2){Level 2}}]{}
   node[bracenode={(A)(H)(L2)}{node[right=1ex](L3){Level 3}}]{};
 \end{tikzpicture}
\end{itemize}
\end{document}

enter image description here