Math & ScienceUnderbraces

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
avp3000
Posts: 49
Joined: Thu Nov 15, 2007 4:22 pm

Underbraces

Post by avp3000 »

Hello,

I want to start an equation with align* and than have the following (I don't use the equal sign, I just use the environment because of \underbrace)

first row

Code: Select all

\text{SMP}+\text{Capacity payment}
second row

Code: Select all

\text{PPP}+Uplift
!!!HOWEVER!!! I want an underbrace under SMP+Capacity payment that is concentrated ONLY above PPP. This means I want to show that SMP+Capacity Payment=PPP

third row

Code: Select all

\text{PSP}
with an underbrace under PPP+Uplift, concentrated on PSP.

That's an approximation, but still the underbraces are missing:

Code: Select all

begin{tabular}{ccc}
SMP & CP & \\
\multicolumn{2}{c}{PPP} & Uplift\\
\multicolumn{3}{c}{PSP}
\end{tabular}
Can anyone help me? Thank you very much (bow)

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Underbraces

Post by frabjous »

My inclination would be to try to this with some kind of upside down tree.

For example, the following gives you something kind of close to what you want, though I think it should probably be tweaked somewhat:

Code: Select all

\documentclass{article}
\usepackage{tikz}
\begin{document}
      \begin{tikzpicture}[level distance=2\baselineskip, edge from parent path=
                {(\tikzparentnode.north) .. controls +(0,.3) and +(0,-.3)
                   .. (\tikzchildnode.south)}]
                     \node {PSP} [grow=up]
                       child {node {Uplift}} 
                       child {node {PPP}        
			     child {node {CP}}
                             child {node {SMP}}
                             };
       \end{tikzpicture}        
\end{document}
Then again, simpler solutions may well exist!
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Underbraces

Post by frabjous »

Actually, I found a solution I like better, just using amsmath:

Code: Select all

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\[	\newlength{\ppplen}\settowidth{\ppplen}{$\overset{\underbrace{\text{SMP} \qquad \text{CP}}}{\text{PPP}}\text{PPP}$}
	\overset{\underbrace{\text{SMP} \qquad \text{CP}}}{\text{PPP}}\hspace{-.5\ppplen}
	\underbrace{\phantom{\text{PPP}} \qquad \text{Uplift}}_{\text{\normalsize PSP}}
\]
\end{document}
Don't ask me to explain that. It's kind of convoluted.

But actually, I bet there are even better solutions, and someone more knowledgeable will be along any minute to explain what and why.
avp3000
Posts: 49
Joined: Thu Nov 15, 2007 4:22 pm

Re: Underbraces

Post by avp3000 »

Hello frabjous,

This was EXACTLY what I wanted. Thank you very much! Both solutions are very good, but I think I prefer tha second one. Thanky you very much.

Cheers
Post Reply