How can I make an overbrace on powers without it being buggy. Example:


    (x^{m+1})^n &=& \underbrace{x^{m+1} \cdots x^{m+1}}_{n} \\[.8cm]
    &=& x^{\overbrace{(m+1)+\cdots+(m+1)}^{n}} \\[.8cm]
    &=& x^{\overbrace{(m+\cdots+m)}^{n}+\overbrace{(1+\cdots+1)}^{n}}

The image below ilustrate the code above.

Output for the code above

Anyone knows how to solve this issue?

Thanks in advance.

Edit: I've included all the packages used in my document as well as made it "ctrl+c ctrl+v"-able.

  • Please, make a complete example from \documentclass up to \end{document} that reproduces the issue.
    – egreg
    Jul 29, 2021 at 16:36
  • Ok, I've made the corrections, thanks. Jul 29, 2021 at 17:42
  • What PDF viewer are you using? Does the vertical alignment change when you zoom in/out? I'm of the opinion that this is browser/viewer based, not (La)TeX based. The two answers provided suggested that as well as the problem can't be replicated.
    – Werner
    Jul 29, 2021 at 17:48
  • Oh, the problem is certainly with \usepackage{MnSymbol} Don't use it.
    – egreg
    Jul 29, 2021 at 18:38
  • Werner, I'm using overleaf, it does not change with zooming. egreg, it was!!!! Thank you! Jul 30, 2021 at 18:23

2 Answers 2


I cannot reproduce your issue, but the commands \underbrace and \overbrace cannot really be used in subscripts or superscripts, because they force the material to be in display style.




  &=\ubrace{x^{m+1} \cdots x^{m+1}}{n} \\
  &= x^{\obrace{(m+1)+\cdots+(m+1)}{n}} \\
  &= x^{\obrace{(m+\cdots+m)}{n}+\obrace{(1+\cdots+1)}{n}}


enter image description here

  • Hello egreg. Can you explain a little your code? Why do two extra macros have to be used?
    – projetmbc
    Jul 29, 2021 at 17:23
  • 1
    @projetmbc I need to pass three arguments to \mathpalette, but it only accepts two: \mathpalette wants as arguments a two-argument macro and the material to be processed. The first argument to the two-argument macro is automatically supplied and is \displaystyle and so on. So I delegate the job to a three-argument macro. See tex.stackexchange.com/a/34412/4427
    – egreg
    Jul 29, 2021 at 17:27
  • I'll try this solution here and I'll give you the feedback. Jul 29, 2021 at 17:45
  • Unfortunately, it didn't work. I'll leave it like that because it is just a solutions file I'm making for myself. Thank you very much for the time spent trying to help me, the effort is greatly apreciated! Jul 29, 2021 at 17:49

I cannot reproduce your picture. Below is my picture generated from your example: enter image description here

  • To be fair, on close examination, I do see a discontinuity between the linear portion and the curved part of the brace also in your example (although consistent in all three cases). But that may just be dependent on the pdf-reader. Jul 29, 2021 at 16:46
  • 1
    But the output is very wrong, don't you agree?
    – egreg
    Jul 29, 2021 at 16:46
  • Thank you very much for the feedback! I don't know why it is so broken in my compilation. Jul 29, 2021 at 17:39
  • @MatthiasArras, Sharp eyes!! The discontinuity is probably caused by my pdf-reader. It disappeared when I further magnified the picture.
    – citsahcots
    Jul 29, 2021 at 21:14
  • @egreg, Indeed. Your answer is much better.
    – citsahcots
    Jul 29, 2021 at 21:14

You must log in to answer this question.

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