6

I have created the following picture using the cases environment. For this picture I have two questions.

enter image description here

1) I would like to limit the size of the braces created by the cases environment to approximately the red lines. To be precise, I want the two formulas to fall within the braces, but not the under/over braces and their texts.

2) the over- and underbraces with the text user definition seem to add spacing between the symbol \diamond and the formula. How can I remove/prevent this whitespace, such that the spacing is equal between all parts of the formula?

The code to generate the picture is:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{figure}
\centering
\[
\text{description}
\begin{cases}
\overbrace{@_{\mu_{1}}(\phi_{1}) \diamond {\overbrace{@_{\mu_{1}}(\phi_{1})}^\text{user definition}} \diamond @_{\mu_{1}}(\phi_{1}) \diamond @_{\mu_{1}}(\phi_{1})}^\text{positive} \\
\underbrace{@_{\mu_{1}}(\phi_{1}) \diamond @_{\mu_{1}}(\phi_{1}) \diamond {\underbrace{@_{\mu_{1}}(\phi_{1})}_\text{user definition}} \diamond @_{\mu_{1}}(\phi_{1})}_\text{negative}
\end{cases}
\]
\end{figure}
\end{document}
  • The second issue arises because the text in the over/underbrace is longer than the material it's associated with. If you shorten the text string to, say, user def. this issue should be fixed. By the way, is the diamond symbol some kind of (possibly binary?) math operator? – Mico Aug 6 '13 at 1:39
  • Are you aware that this is technically not a case for cases as you never use the second column? Although not helping in the context of the question, an array or the aligned environment might be better. – Qrrbrbirlbel Aug 6 '13 at 3:04
  • Yes, but I didn't know of a better way. Thank you though, the answers u provided are awesome. – Mythio Aug 6 '13 at 11:12
5

While \smashing the contents does help the left brace, it will create problems if this is used as a usual displayed math equation as your text will protrude into the braces.

In this example I used a dummy array consisting of two rows that is \vphantomed so that it is used to measure the height for the brace, the actual content is typeset as it is using the fact that both rows have equal height (otherwise the vertical centering would be off).

For asymmetric contens you could go the opposite way: \smashing the content so that the brace is measured correctly but adding a \vphantom with dummy braces as in Code B.

Code A

\documentclass{article}
\usepackage{mathtools}
\usepackage{lipsum}
\begin{document}
\lipsum
\[
\text{description}
\left\{\vphantom{\begin{array}{@{}c@{}} \strut \\ \strut\end{array}}\right.\kern-\nulldelimiterspace
\begin{array}{@{}c@{}}
\overbrace{@_{\mu_{1}}(\phi_{1}) \diamond {\overbrace{@_{\mu_{1}}(\phi_{1})}^{\mathclap{\text{user definition}}}} \diamond @_{\mu_{1}}(\phi_{1}) \diamond @_{\mu_{1}}(\phi_{1})}^\text{positive} \\
\underbrace{@_{\mu_{1}}(\phi_{1}) \diamond @_{\mu_{1}}(\phi_{1}) \diamond {\underbrace{@_{\mu_{1}}(\phi_{1})}_{\mathclap{\text{user definition}}}} \diamond @_{\mu_{1}}(\phi_{1})}_\text{negative}
\end{array}
\]
\lipsum
\end{document}

Code B

\documentclass{article}
\usepackage{mathtools}
\usepackage{lipsum}
\begin{document}
\lipsum
\[
\text{description}
\left\{
\begin{array}{@{}c@{}}
\smash[t]{\overbrace{@_{\mu_{1}}(\phi_{1}) \diamond {\overbrace{@_{\mu_{1}}(\phi_{1})}^{\mathclap{\text{user definition}}}} \diamond @_{\mu_{1}}(\phi_{1}) \diamond @_{\mu_{1}}(\phi_{1})}^\text{positive}} \\
\smash[b]{\underbrace{@_{\mu_{1}}(\phi_{1}) \diamond @_{\mu_{1}}(\phi_{1}) \diamond {@_{\mu_{1}}(\phi_{1})} \diamond @_{\mu_{1}}(\phi_{1})}_\text{negative}}
\end{array}\right.
\vphantom{
\begin{array}{@{}c@{}}
\overbrace{\overbrace{\strut}^\text{user definition}}^\text{positive} \\
\underbrace{\strut}_\text{negative}
\end{array}
}
\]
\lipsum
\end{document}

Output A

enter image description here

Output B

enter image description here

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.