[Tex/LaTex] Braces around both sides of cases (with text)

bracescases

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}

Best Answer

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

Related Question