# Multiple overlapping overbraces and underbraces

I've been working on an assignment in which I would like to have the following equation (representing some bit vector)

However, I edited the image above to get to that result, the last overbrace (R40) is my problem. Until now I've been able to generate the following euqation

using this latex code:

\lefteqn{\underbrace{\phantom{b_7b_6b_5}}_{R4_2}}b_7b_6\overbrace{b_5b_4\lefteqn{\underbrace{\phantom{b_3b_2b_1}}_{R16_0}}b_3}^{R4_1}b_2b_1b_0b_{\text{-}1}


The problem is that until now I have not succeeded in adding the last overbrace, even after studying this post for a while: How can I get an underbrace and an overbrace to partially overlap in an equation?

Could somebody help me out?

• (1) welcome, (2) please post a full minimal example others can work with without having to guess the rest of the doc. For example where does \lefteqn{...} come from? – daleif Jun 19 '18 at 11:51
• Thanks for commenting, but I don't really understand the problem. It's a pretty straightforward question which does not require further information about the rest of the doc. The '\lefteqn{...}' comes from this example: How can I get an underbrace and an overbrace to partially overlap in an equation? which I had already mentioned in the original post. What would you like to change aout the post? – Habbus Jun 19 '18 at 12:24
• Generally the less time other have to spend creating something they can copy and test as is, the more likely is it that you are going to get help. The question you refer to only has one true MWE, the test others have to spend time in order to get to a document then can compile and test. Remember everyone here are volunteers, they do not like to waste time, especially when users a withholding important information (not saying you are in this case, but we have often seen users neglecting to mention they are using some obscure non standard class that in if self is causing a lot of problems) – daleif Jun 19 '18 at 12:34
• Thanks for your comment. I am fully aware of everybody being a volunteer and not wanting to waste time. I was under the impression that all the important information was there, but apparently you disagree. This is why I asked what you would like to be changed about the post. As far as I understand you would like to go to a more general problem, stepping away from the original document content. Correct? I can do that for future questions. For this specific question I already found (and posted) an answer through a friend. – Habbus Jun 19 '18 at 12:45

\lefteqn{\underbrace{\phantom{b_7b_6b_5}}_{R4_2}}b_7b_6\overbrace{b_5b_4\lefteqn{\underbrace{\phantom{b_3b_2b_1}}_{R4_1}}b_3}^{R4_1}b_2\overbrace{b_1b_0b_{\text{-}1}}^{R4_0}