9

How can I add curly braces around both sides of a cases environment which contains text?

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{equation*}
\hat{C}(\hat{S},1) = \frac{1}{E} C(S,T) =
\begin{cases}
0 &\text{ if } S<E,\\[1ex]
\frac{S}{2E} &\text{ if } S=E,\\[1ex]
\frac{S}{E} &\text{ if } S>E.
\end{cases}
\end{equation*}
\end{document}
6

Here, I replace the cases environment with a \left\{\!\begin{aligned}...\end{aligned}\right\}. The \! seems necessary to overcome a small space introduced, I think by the leading &.

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{equation*}
\hat{C}(\hat{S},1) = \frac{1}{E} C(S,T) =
\left\{\!\begin{aligned}
&0 &\text{ if } S<E,\\[1ex]
&\frac{S}{2E} &\text{ if } S=E,\\[1ex]
&\frac{S}{E} &\text{ if } S>E.
\end{aligned}\right\}
\end{equation*}
\end{document}

enter image description here

If one wanted to preserve the \textstyle of the cases environment,

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{equation*}
\hat{C}(\hat{S},1) = \frac{1}{E} C(S,T) =
\left\{\!\begin{aligned}
&0 &\text{ if } S<E,\\[1ex]
&\textstyle\frac{S}{2E} &\text{ if } S=E,\\[1ex]
&\textstyle\frac{S}{E} &\text{ if } S>E.
\end{aligned}\right\}
\end{equation*}
\end{document}

enter image description here

3

You can simply use the (d)rcases environment from mathtools.

Also, I think it's better to use \widehat with capital letters.

\documentclass[12pt]{article}
\usepackage{mathtools}
\usepackage{amssymb}

\begin{document}

\begin{equation*}
  \widehat{C}(\widehat{S},1) = \frac{1}{E} C(S,T) =
  \begin{rcases}
    \begin{dcases}
      0 & \text{ if } S<E, \\
      \frac{S}{2E} & \text{ if } S=E, \\
      \frac{S}{E} & \text{ if } S>E.
    \end{dcases}
  \end{rcases}
\end{equation*}

\end{document} 

enter image description here

  • Note that this does not always result in the left and right braces having the same height. – jmd_dk Jun 5 '17 at 15:19
  • @jmd_dk: I never met the case. This isn't statistically significant, though… – Bernard Jun 5 '17 at 15:30
3

You can exploit the \newcases feature in mathtools:

\documentclass[12pt]{article}
\usepackage{amsmath,mathtools}
\usepackage{amssymb}

\makeatletter
\newcases{lrdcases}
  {\quad}
  {$\m@th\displaystyle{##}$\hfil}
  {$\m@th\displaystyle{##}$\hfil}
  {\lbrace}
  {\rbrace}
\newcases{lrdcases*}
  {\quad}
  {$\m@th\displaystyle{##}$\hfil}
  {{##}\hfil}
  {\lbrace}
  {\rbrace}
\makeatother


\begin{document}

\begin{equation*}
\hat{C}(\hat{S},1) = \frac{1}{E} C(S,T) =
\begin{lrdcases}
0            &\text{if $S<E$,}\\[1ex]
\frac{S}{2E} &\text{if $S=E$,}\\[1ex]
\frac{S}{E}  &\text{if $S>E$.}
\end{lrdcases}
\end{equation*}

\begin{equation*}
\hat{C}(\hat{S},1) = \frac{1}{E} C(S,T) =
\begin{lrdcases*}
0            & if $S<E$,\\[1ex]
\frac{S}{2E} & if $S=E$,\\[1ex]
\frac{S}{E}  & if $S>E$.
\end{lrdcases*}
\end{equation*}

\end{document}

According to the conventions of mathtools, the *-variant has the second column typeset in text mode.

enter image description here

However, I'd use the left brace only.

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.