2

I have the following design-problem (there's probably a solution, unfortunately I just can't remember anymore):

\[ a^2 b^2 + c \overbrace{r \cdot \Underbrace{\eta}_{\equiv 1} \cdot x}^{\shortstack{ \text{variable costs} \rightarrow K = \eta} } a^2 + b^2 + c \]

enter image description here

It should do the following:

  • make the brace-text ignore the size of the brace and the underlying formula
  • if possible, don't center the brace-text, but left-align it right above the first element of the brace-formula (here r)

enter image description here

Thanks for any suggestions :)

How about even longer brace-text-formulas?

Do I have to use tables or tikzpictures?

enter image description here

The solution (by paint) is very easy to achieve. And there has to be a way within latex. But of course in case there's no easy way to modifty the braces, I rather will rewrite my entire text and formulas.

2
  • The \shortstack instruction doesn't seem to be doing anything. Can it be omitted?
    – Mico
    Feb 28, 2016 at 8:29
  • Oh yes, I think it can. It's a a relict of another code.
    – Mac
    Feb 28, 2016 at 8:53

2 Answers 2

3

Here is a solution aligned on one line as you want. It relies on the eqparbox package. I define an \eqmathbox command, which stores the width of the ‘over/underbraced’ formula with a system of tags, and I use it for another \eqmakebox which contains the text, combined with \rlap and \mathclap at appropriate places. Note the spacing aroud the \cdots is now correct.

For small formulae to be overbracketed, I suggest to use the \over/underbracket commands from mathtools, as they look nicer, in my opinion.

\documentclass{article}
\usepackage{mathtools} % for \mathclap macro; calls 'amsmath' automatically
\usepackage{eqparbox}
\newcommand\eqmathbox[1]{\eqmakebox[M]{$\displaystyle #1$}}
\begin{document}

\[
a^2 b^2 + c
\overbracket[0.5pt]{\eqmathbox{\mathstrut r \cdot\! {\underbracket[0.5pt]{\,\eta\,}_{\mathclap{\equiv 1}}}\! \cdot x}}^{
\eqmakebox[M][l]{\rlap{variable costs $ \rightarrow K = \eta $}}}
a^2 + b^2 + c
\]

\end{document} 

enter image description here

4

Rather than let the material above the overbrace dangle out to the right, I'd introduce a line break in the overbrace material, and I'd enclose the two-line material in a \mathclap wrapper so that it's allowed to stick out to both the left and the right, if necessary.

enter image description here

\documentclass{article}
\usepackage{mathtools} % for \mathclap macro; calls 'amsmath' automatically
\begin{document}

\[ 
a^2 b^2 + c 
\overbrace{r \cdot {\underbrace{\eta}_{\equiv 1}} \cdot x}^{
\mathclap{\substack{\text{variable costs }\\[0.75ex] 
                    \rightarrow K = \eta}}} 
a^2 + b^2 + c 
\]
\end{document}
1
  • For my special purpose, a two-line solution isn't that suitable. I often need to deal with even longer issues.
    – Mac
    Feb 28, 2016 at 8:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .