Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In the following formula, I would like to change the rendering such that the lower end of the "cases" brace looks as if there were no underbraces. Is that possible? I already tried \smash and negative \vspaces to no avail.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\newcommand\terma{\left( 1\!-\!e^{\frac{-\lambda_2^2}{2\alpha^2\lambda_3^2}}\right)}
\newcommand\termb{e^{\frac{-\lambda_1^2}{2\beta^2|\lambda_2\lambda_3|}}}
\newcommand\termc{\left( 1-e^{\frac{-\sum_i\lambda_i^2}{2c^2}}\right)}

\[
\mathcal V(\sigma)=
 \begin{cases}
     0    & \text{if $\lambda_2>0$ or $\lambda_3>0$,}\\
     \underbrace{\terma}_{A}
     \underbrace{\termb\vphantom{\terma}}_{B}
     \underbrace{\termc\vphantom{\terma}}_{C}
     &\text{else}.
 \end{cases}
\]
\end{document}
share|improve this question

1 Answer 1

up vote 6 down vote accepted

You can use a combination of \smash and \vphantom to get the desired effect. First we need to use a \smash to "flatten out" the contents. Then we use a \vphantom to get the brace to the correct height fir just the terms and not the underbraces. Finally we need to add an additional \vphantom in order to give the entire expression the correct height, such that following text will not be superimposed on it. In all the code would look like this:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\newcommand\terma{\left( 1\!-\!e^{\frac{-\lambda_2^2}{2\alpha^2\lambda_3^2}}\right)}
\newcommand\termb{e^{\frac{-\lambda_1^2}{2\beta^2|\lambda_2\lambda_3|}}}
\newcommand\termc{\left( 1-e^{\frac{-\sum_i\lambda_i^2}{2c^2}}\right)}
\[
\mathcal V(\sigma)=
 \begin{cases}
     0    & \text{if $\lambda_2>0$ or $\lambda_3>0$,}\\
     \vphantom{\terma}
     \smash{\underbrace{\terma}_{A}}
     \smash{\underbrace{\termb\vphantom{\terma}}_{B}}
     \smash{\underbrace{\termc\vphantom{\terma}}_{C}}
     &\text{else}.
 \end{cases}
 \vphantom{\begin{cases}
     0    & \text{if $\lambda_2>0$ or $\lambda_3>0$,}\\
     \underbrace{\terma}_{A}
     \underbrace{\termb\vphantom{\terma}}_{B}
     \underbrace{\termc\vphantom{\terma}}_{C}
     &\text{else}.
 \end{cases}}
\]
\end{document}

And the result:

case braces

share|improve this answer
    
works neatly, thanks a lot! –  hannes Dec 20 '11 at 16:38
    
you could reduce the "empty" space at the bottom a bit by using an explicit pair of "big" parentheses for \terma rather than \left and \right. using \exp notation would also make those expressions more linear, but at the expense of making the line too wide; too bad -- that's some pretty nasty math to try to read without a magnifying glass. –  barbara beeton Dec 20 '11 at 18:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.