3

I was attempting to get a brace to show up on lines 2 and 3 in an enumerate environment. The solution given here is used in the first enumerate environment, but the brace did not look as appealing as the brace in the second solution.

Is there a way to get the thick brace given in the second enumerate environment to display in the first enumerate environment?

Here is the code:

\documentclass{article}
\pagestyle{empty}% for cropping
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc}
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\begin{document}
\newcommand{\tikzmark}[2]{\tikz[remember picture,baseline=(#1.base)]{\node[inner sep=0pt] (#1) {#2};}}
\begin{enumerate}
    \item First item
    \item \tikzmark{L}{Second is a much longer item}
    \item \tikzmark{I}{Third item}
    \item Fourth item
    \item Fifth item
\end{enumerate}
\begin{tikzpicture}[remember picture,overlay]
    \draw[decorate,decoration={brace}] (L.north east) -- node[right] {Noise} (L.north east |- I.south east);
\end{tikzpicture}

$\left.\begin{minipage}{5.5cm}
\begin{enumerate}
\item First item
\item Second is a much longer item
\item Third item
\end{enumerate}
\end{minipage}\right\rbrace$ Some comment

\end{document}
  • The first brace is drawn using tikz so you can change the line width with options ultra thick, or thick, or specify line width=2pt, etc. – Peter Grill Mar 3 '16 at 2:32
3

As the first brace is drawn using tikz you can apply options to the \draw to control the line width. Below I used line width=1.25pt, draw=red:

enter image description here

Code:

\documentclass{article}
\pagestyle{empty}% for cropping
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,calc}
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\begin{document}
\newcommand{\tikzmark}[2]{\tikz[remember picture,baseline=(#1.base)]{\node[inner sep=0pt] (#1) {#2};}}
\begin{enumerate}
    \item First item
    \item \tikzmark{L}{Second is a much longer item}
    \item \tikzmark{I}{Third item}
    \item Fourth item
    \item Fifth item
\end{enumerate}
\begin{tikzpicture}[remember picture,overlay]
    \draw[decorate,decoration={brace}, line width=1.25pt, draw=red] (L.north east) -- node[right] {Noise} (L.north east |- I.south east);
\end{tikzpicture}

$\left.\begin{minipage}{5.5cm}
\begin{enumerate}
\item First item
\item Second is a much longer item
\item Third item
\end{enumerate}
\end{minipage}\right\rbrace$ Some comment

\end{document}
  • Thanks for your solution. Is it possible to add the same \rbrace to the first example? I tried placing \rbrace in the \draw[decorate,decoration={$\rbrace$}, but that did not work. Thanks again! – Joe Mar 3 '16 at 15:51
  • 1
    @Joe: I don't think you can simply use decoration={$\rbrace$}. What exactly is the output that you are trying to achieve? it is much easier to customize the brace options than it is to apply the same technique as was done to the minipage to a few of the list items. I think it would require splitting up the list. – Peter Grill Mar 4 '16 at 2:16

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.