1
\documentclass[a4paper]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{mathtools}
\begin{document}
 \begin{enumerate}
  \item text
  \item text
  \item[-] text
  \item[-] text
  \item text
 \end{enumerate}
\end{document}

I would like to add a curly bracket next to the two items with the minus symbol. Something like the curly bracket of the rcases environment, or a square bracket, if possible (I'd like to see which one looks better). I'd like to put some text next to the bracket, too. Thanks.

3

enter image description here

with use of tikzmark library:

\documentclass[a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,
                tikzmark}

\begin{document}
 \begin{enumerate}
  \item text
  \item text
  \item[-] \tikzmarknode{a}{text}
  \item[-] \tikzmarknode{b}{text}
  \item text
 \end{enumerate}
\tikz[overlay,remember picture]\draw (a.east) -- ++ (0.2,0) |- (b)
                                node[pos=0.25, right] {some text};
 \begin{enumerate}
  \item text
  \item text
  \item[-] \tikzmarknode{c}{text}
  \item[-] \tikzmarknode{d}{text}
  \item text
 \end{enumerate}
\tikz[overlay,remember picture,
      decoration=brace]\draw[decorate]  (c.north east) --
                                node[right=1mm] {some text}
                                        (d.south east);
\end{document}

if text in items is not equal length, than you need to adopt coordinates accordingly to the longest one. for example

\tikz[overlay,remember picture,
      decoration=brace]\draw[decorate]  (c.north-| d.east) --
                                node[right=1mm] {some text}
                                        (d.south east);

if the text in tikzmarknode{d}{...} is longer than in tikzmarknode{c}{...}.

| improve this answer | |

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.