Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Overlapping underbraces?

126 views
Skip to first unread message

Minko Markov

unread,
Feb 26, 2002, 5:24:17 PM2/26/02
to
Hello,

I just came upon this. Say that I have \[a \, b \, c \, d\]
Is it possible to put one underbrace from a to c,
and another one from b to d?

The examples in the user's guide are only of nested,
non-overlapping multiple underbraces. Overlapping ones
seem impossible, because the ranges are determined by
the curly brackets. There is no way to say that the
correspondence has to be

\underbrace{ ... \underbrace{ ... } ... }
1 2 1 2

Is there any other way to do it?

Thank you very much,
Minko Markov

PS It seems a good to be able to give names, i.e.
kind of labels, to objects? Like \lab{x, y}, where x is
anything valid that can occur at this place of the source,
and y is some internal ID of x. Then,

\[ \lab{a, obj1} \, \lab{b, obj2} \, \lab{c, obj3} \, \lab{d, obj4} \]

and then

\underbraceObjects{obj1, obj3} \underbraceObjects{obj2, obj4}

Donald Arseneau

unread,
Feb 26, 2002, 11:03:23 PM2/26/02
to
Minko Markov <mma...@shaw.ca> writes:

> I just came upon this. Say that I have \[a \, b \, c \, d\]
> Is it possible to put one underbrace from a to c,
> and another one from b to d?

How about an underbrace across one range and an overbrace over
the other? I put oubraces.sty on ctan many years ago.

Someone else came up with a neat solution using \rlap/\llap and
\phantom, shich you should probably search for using google/groups.

You could get two underbraces, if you insist, by putting \strut in
one sub-formula.

Donald Arseneau as...@triumf.ca

Minko Markov

unread,
Feb 27, 2002, 1:38:44 AM2/27/02
to
Donald Arseneau <as...@triumf.ca> writes:

> Minko Markov <mma...@shaw.ca> writes:
>
> > I just came upon this. Say that I have \[a \, b \, c \, d\]
> > Is it possible to put one underbrace from a to c,
> > and another one from b to d?
>
> How about an underbrace across one range and an overbrace over
> the other? I put oubraces.sty on ctan many years ago.

Thanks! Actually, it is better than my idea of overlapping
underbraces, that would be messy.

Regards,
Minko Markov

Chan Tai Man

unread,
Feb 27, 2002, 7:58:26 AM2/27/02
to
Donald Arseneau <as...@triumf.ca> wrote:

> How about an underbrace across one range and an overbrace over
> the other? I put oubraces.sty on ctan many years ago.

Thanks you. It solves my problem too. I then can turn my [recent] stupid
hack:

$\overbrace{y + x}^{c_j}
\negthickspace \negthickspace \negmedspace
\underbrace{
\thickspace \thickspace \medspace
+ v}_{b_i}$

into something a lot nicer:

$\overunderbraces{&\br{2}{c_j}&}{&y +&x&+ v&}{& &\br{2}{b_i}}$

However, I've a trivial question. How can I turn my c_j and b_i into the
usual superscript/subscript font size. I could have forced them in my
formula, but I think it is neater to do within the .sty file. My problem
is that I've zero experience in hacking a .sty file. Could you please shed
some light?

Cheers

陳大文
Chan Tai Man

Pavlin Entchev

unread,
Feb 27, 2002, 1:35:39 PM2/27/02
to
Hello,

Take a look at the package "oubraces" - it may give you some good ideas how
to accomplish what you need.

Regards,

Pavlin

"Minko Markov" <mma...@shaw.ca> wrote in message
news:2zo1v6...@shaw.ca...

Minko Markov

unread,
Feb 27, 2002, 6:51:24 PM2/27/02
to
"Pavlin Entchev" <pav...@aero.tamu.edu> writes:

> Hello,
>
> Take a look at the package "oubraces" - it may give you some good ideas how
> to accomplish what you need.

Hey,

Indeed, works well. Two porblems with it: the math font *of the index*
of the under/overbrace is too large. I'm not sure I am using the
correct terms: the letters are visibly larger than the ones that

\underbrace{..}_{<index>}

produces. This may have a trivial solution, I dunno. Second, since
oubraces uses ampersands for delimiters, it seems that you cannot
do vertical aignment of those equations, because "align" and "alignat"
also use ampersands.

Regards,
Minko

Donald Arseneau

unread,
Feb 27, 2002, 7:23:23 PM2/27/02
to
Chan Tai Man <iota...@yahoo.com> writes:

> Donald Arseneau <as...@triumf.ca> wrote:
>
> > How about an underbrace across one range and an overbrace over
> > the other? I put oubraces.sty on ctan many years ago.
>
> Thanks you. It solves my problem too. I then can turn my [recent] stupid
> hack:
>
> $\overbrace{y + x}^{c_j}
> \negthickspace \negthickspace \negmedspace
> \underbrace{
> \thickspace \thickspace \medspace
> + v}_{b_i}$

I checked on Google, and it was Heiko Oberdeik who suggested
using \rlap and \phantom:

$\rlap{\overbrace{\phantom{y + x}}^{c_j}}
y + \underbrace{x + v}_{b_i}$


> $\overunderbraces{&\br{2}{c_j}&}{&y +&x&+ v&}{& &\br{2}{b_i}}$
>
> However, I've a trivial question. How can I turn my c_j and b_i into the
> usual superscript/subscript font size.

I guess that is a bug in oubraces.sty. You can use
\br{2}{\scriptstyle b_i}
or fix the line in oubraces.sty:

\def\br@label#1#2{\multispan{#1}\hidewidth $\scriptstyle {#2}$\hidewidth}

Donald Arseneau as...@triumf.ca


Chan Tai Man

unread,
Feb 28, 2002, 8:07:49 AM2/28/02
to
Dear Donald

You've a great help to me. Thanks.

Donald Arseneau <as...@triumf.ca> wrote:

> I checked on Google, and it was Heiko Oberdeik who suggested
> using \rlap and \phantom:

> $\rlap{\overbrace{\phantom{y + x}}^{c_j}}
> y + \underbrace{x + v}_{b_i}$

On my LaTeX installation, it was happy until this:

$\overbrace{\phantom{y + x}}^{c_j}


y + \underbrace{x + v}_{b_i}$

Once \rlap{...} is added, it says

! Missing $ inserted.

which I do not comprehends. I tried more $ in two groups and/or \rlap{...}
to embrace different thingy, but yet to get the same result as from
overunderbraces.

> I guess that is a bug in oubraces.sty. You can use
> \br{2}{\scriptstyle b_i}
> or fix the line in oubraces.sty:

> \def\br@label#1#2{\multispan{#1}\hidewidth $\scriptstyle {#2}$\hidewidth}

Both of these works great. Thank you.

Robin Fairbairns

unread,
Feb 28, 2002, 9:39:24 AM2/28/02
to
Chan Tai Man <iota...@yahoo.com> wrote:
>Donald Arseneau <as...@triumf.ca> wrote:
>> I checked on Google, and it was Heiko Oberdeik who suggested
>> using \rlap and \phantom:
>
>> $\rlap{\overbrace{\phantom{y + x}}^{c_j}}
>> y + \underbrace{x + v}_{b_i}$
>
>On my LaTeX installation, it was happy until this:
>
> $\overbrace{\phantom{y + x}}^{c_j}
> y + \underbrace{x + v}_{b_i}$
>
>Once \rlap{...} is added, it says
>
> ! Missing $ inserted.

\rlap creates an \hbox, and that starts back in text mode; so the
contents of the \rlap need to be surrounded in braces.
--
Robin Fairbairns, Cambridge -- rf10 at cam dot ac dot uk

Donald Arseneau

unread,
Feb 28, 2002, 6:09:11 PM2/28/02
to
Chan Tai Man <iota...@yahoo.com> writes:

> > $\rlap{\overbrace{\phantom{y + x}}^{c_j}}

Oops. I meant \rlap{$...$}.

Robin answered too, but with his country's and continent's
currency debates, he is obviously confused, and thinks
"$" is a "brace" -- an ancient monetary unit, enough to
purchase enough pheasant for a banquet.

Donald Arseneau as...@triumf.ca

Chan Tai Man

unread,
Mar 1, 2002, 5:17:29 AM3/1/02
to
Donald Arseneau <as...@triumf.ca> wrote:

> Oops. I meant \rlap{$...$}.

Thanks a lot. It took me some head scratching to comprehend the idea that
a formula which contains a hbox which contains a formula. The nice thing
is that the result is very pleasing and has the same vertical spacing
(between the braces and the main expression) as simple overbrace/
underbrace. I've left an ugly looking formula in my paper draft for two
months, and glad that it was now over. Hurray!

0 new messages