10

I need to put curly braces in front of even number of bullets. The following post works perfectly for odd number of bullets.

Bullet points and curly braces

how can we modify it to for even number of bullets?

Update:

  • Is is possible to have a general solution that adjusts automatically for the number of bullets that we have.

  • I am using a \documentclass{beamer}. But this should not matter. I ma putting this piece of information since all posted solutions had \documentclass{article}

Snapshot of my editor(left pannel) and PDF(right panel)

enter image description here

  • 1
    provided each one of the bullet points occupies only one line, i'd attach the brace construction to the item just above the middle, and move it lower by .5\baselineskip + .5\itemsep + .5\parsep. probably a bit more complicated, because it has to be put in a box, but that should give a starting point for experimentation. – barbara beeton Aug 6 '15 at 19:57
8

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{itemize}
  \item Riemann Sum
  \item Trapezoidal Rule 
  \item Simpson's 1/3 Rule
  \item Simpson's 3/8 Rule % 
  \smash{\raisebox{.5\dimexpr3\baselineskip+4\itemsep+2\parskip}{$\left.\rule{0pt}{.5\dimexpr4\baselineskip+3\itemsep+3\parskip}\right\}\text{Newton Cotes formulae of different degrees}$}}
\end{itemize}

\end{document}

For beamer class, \linewidth is much smaller and you need to put the text into a \parbox to allow text wrap. Note also that itemize environment in beamer is totally different from that in normal classes, so, you may need some manual adjustments:

enter image description here

\documentclass{beamer}
\usepackage{amsmath,lmodern}
\begin{document}

\newcommand{\insm}{%
\smash{\raisebox{.5\dimexpr3\baselineskip+4\itemsep+2\parskip}{$\left.\rule{0pt}{.5\dimexpr4\baselineskip+3\itemsep+3\parskip}\right\}$\ \parbox{5.5cm}{Newton Cotes formulae of different degrees}}}
}

\begin{frame}
\begin{itemize}
  \item Riemann Sum 
  \item Trapezoidal Rule 
  \item Simpson's 1/3 Rule
  \item Simpson's 3/8 Rule \insm
\end{itemize}
\end{frame}

\end{document}

Finally, a flexible tikz solution (since I'm personally fond of tikz, I decided to post an alternative beautiful solution with tikz):

enter image description here

\documentclass{beamer}
\usepackage{amsmath,lmodern,calc,tikz,textcomp}
\usetikzlibrary{tikzmark,calc}
\begin{document}

\newcommand\insm{%
$\left.\rule{0pt}{2.5\baselineskip}\right\}$\parbox{\textwidth-2ex}{%
\begin{itemize}
\item[\textbullet] Newton Cotes formulae ...
\item[\textbullet] Newton Cotes formulae ...
\end{itemize}}
}    
\begin{frame}
\begin{itemize}
  \item Riemann Sum 
  \item Trapezoidal Rule\tikzmark{S}
  \item Simpson's 1/3 Rule\tikzmark{E}
  \item Simpson's 3/8 Rule 
\end{itemize}    
\tikz[remember picture, overlay]{%
\node [shift={(1ex,.6ex)},text width=6.5cm,anchor=west] at ($(pic cs:S)!.5!(pic cs:E)$){\insm};}
\end{frame}

\end{document}
  • I tried your solution but it is putting the bracket right next to bullets i-e before the text – NAASI Aug 6 '15 at 20:48
  • @NAASI Make sure you didn't insert an extra \item before \smash{.... Try first my solution as is, does that error appear? – AboAmmar Aug 6 '15 at 20:52
  • I am using a \documentclass{beamer}. Can this be the reason because I just copied your solution in my frame and am getting the same results – NAASI Aug 6 '15 at 20:57
  • @NAASI That is because the text is longer than the \textwidth in beamer. – AboAmmar Aug 6 '15 at 21:04
  • how can we fix this?I have added a snapshot of whats going on in my original question – NAASI Aug 6 '15 at 21:06
9

One option that would work for any kind of elements (\item bullets (even or odd number) or whatever), would be to use TikZ and its tikzmark library. Place some marks at the desired locations and then use those marks to draw the brace with its accompanying text:

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{tikzmark,decorations.pathreplacing}

\begin{document}

\begin{itemize}
  \item Riemann Sum\tikzmark{start}
  \item
  Trapezoidal Rule
  \item
  Simpson's 1/3 Rule
  \item
  Simpson's 3/8 Rule\tikzmark{end}
\end{itemize}

\begin{tikzpicture}[remember picture,overlay]
\draw[decorate,decoration={brace,raise=12pt}]
  ([yshift=2ex]{{pic cs:end}|-{pic cs:start}}) --
    node[xshift=15pt,anchor=west] {some test text} 
  ([yshift=-0.5ex]pic cs:end);
\end{tikzpicture}

\end{document}

enter image description here

  • I am getting a compiler error related to \usetikzlibrary{tikzmark,decorations.pathreplacing}. ! I can't find file tikzlibrarytikzmark.code.tex'.<argument> ...nput tikzlibrary\pgf@temp .code.tex\catcode \@ =\csname tikz... ...ibrary{tikzmark,decorations.pathreplacing} – NAASI Aug 6 '15 at 21:01
  • I think your solution is more flexible but I dont understand why I am getting this error – NAASI Aug 6 '15 at 21:42
  • 1
    @NAASI The error message indicates that your LaTeX system is outdated. Update it and the problem will disappear. – Gonzalo Medina Aug 6 '15 at 22:30
  • @NAASI Or search the site for \tikzmark implementations; IIRC, it was conceived here. – Raphael Aug 7 '15 at 10:30
2

I propose an environment, braceditemize that simulates an itemize environment, within a blockarray environment. It has an optional argument, the text that will be to the right of the brace:

\documentclass{article}
\usepackage{mathtools, etoolbox}
\usepackage{blkarray}
\usepackage[showframe, nomarginpar]{geometry}

\newcommand\tabitem{\ifbool{firstrow}{\relax}{\\[\itemsep]}\boolfalse{firstrow}\makebox[\labelwidth][r]{\textbullet}\hspace*{\labelsep}}
\newbool{firstrow}
\newenvironment{braceditemize}[1][]{%
\booltrue{firstrow}
\vspace*{\topsep}\par\noindent
\setlength\BAextrarowheight{\parsep}\begin{blockarray}{@{}l <{\enspace}\Right{\}}{#1}}}
{\rule[-\itemsep-\parsep]{0pt}{\itemsep + \parsep}\end{blockarray}}

\begin{document}

Text text text text text text text text text text text text text

\begin{braceditemize}[Newton-Cotes formulae of different degrees]
  \tabitem Riemann Sum
  \tabitem Trapezoidal Rule
  \tabitem Simpson's 1/3 Rule
  \tabitem Simpson's 3/8 Rule
\end{braceditemize}

\end{document}

enter image description here

1

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}


\begin{itemize}
  \item Riemann Sum

  \item
  Trapezoidal Rule

  \item
  Simpson's 1/3 Rule
    $\smash{\left.\rule{0pt}{.5\dimexpr3\baselineskip+2\itemsep+2\parskip}\right\}
      \text{Newton Cotes formulae of different degrees}}$

  \item
  Simpson's 3/8 Rule
\end{itemize}


\begin{itemize}
  \item Riemann Sum

  \item
  Trapezoidal Rule

  \item
  Simpson's 1/3 Rule
    \smash{\raisebox{.5\dimexpr\baselineskip+\itemsep+\parskip}{%
    $\left.\rule{0pt}{.5\dimexpr4\baselineskip+3\itemsep+3\parskip}\right\}$
      Newton Cotes formulae of different degrees}}

  \item
  Simpson's 3/8 Rule
\end{itemize}

\end{document}

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.