3

This MWE

\documentclass{article}
\usepackage{MnSymbol}

\begin{document}
\begin{equation}
v\left(C\right) = \left\{ 
\begin{array}{l l}
\!\!k\left(C\right), &\text{if $C\cap\mathcal{D}=\emptyset$}\\
\!\!\underbrace{t(P^*_C) + c\left(P^*_C\right) + f\left(P^*_C\right) + \theta_C\left(P^*_C,\tau^*_C\right)}_{cost(P^*_C,\tau^*_C)}, &\text{otherwise}.
\end{array}\right.
\end{equation}
\end{document}

produces this output

enter image description here

How can I achieve something like this instead?

enter image description here

1 Answers1

2

Smash the underbrace, but add some vertical space below it:

\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum}

\begin{document}
\lipsum*[2]
\begin{gather}
v(C) =
\begin{cases}
\,k(C) & \text{if $C\cap\mathcal{D}=\emptyset$,}\\[1ex]
\,\vphantom{t(P^*_C)}% set the depth
\smash[b]{%
  \underbrace{
    t(P^*_C) + c(P^*_C) + f(P^*_C) + \theta_C(P^*_C,\tau^*_C)
  }_{\mathit{cost}(P^*_C,\tau^*_C)}
} &\text{otherwise.}
\end{cases}
\\\nonumber
\end{gather}
\lipsum*[2]
\end{document}

enter image description here

Note: I have removed all useless \left and \right (in this case all of them). Also I have several doubts about MnSymbol that outputs math symbols that don't match Computer Modern.

egreg
  • 1,121,712