6

Why aren't my overbraces displaying correctly?

The code for this segment is as follows

\documentclass[12pt]{amsart}
\usepackage{amsfonts}
\usepackage{verbatim}
\usepackage{amsbsy}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{latexsym}
\usepackage{mathabx}
\usepackage{setspace}
\usepackage{mathtools}
\usepackage{xcolor}
\usepackage{pifont}
\begin{document}
...
\begin{align*}
  g^{(e)}(x) &= \overbrace{(1 + \frac{x^2}{2!} + \frac{x^4}{4!} + \ldots)}^{\text{red}}\overbrace{(1 + \frac{x}{1} + \frac{x^2}{2!} + \ldots)}^{\text{green}}\overbrace{(1 + \frac{x}{1} + \frac{x^2}{2!} + \ldots)}^{\text{white}}\\
  ...
\end{align*}
...
\end{document}

And it gets typeset like in the image below. Misaligned overbrace

I'm honestly not sure what packages are required to build this bit of code (there's a lot more stuff in the document, as you might imagine) so I left all of them in there—maybe there's a conflict between them?

  • 1
    not relevant to question, but if you're using amsart, amsmath and amsfonts are already loaded. – barbara beeton Mar 1 '18 at 14:14
6

The issue here is the load order of mathtools and mathabx. Use this order:

enter image description here

\documentclass{amsart}

\usepackage{mathtools}
\usepackage{mathabx}

\begin{document}

\[
  g^{(e)}(x) = \overbrace{\bigl( 1 + \tfrac{x^2}{2!} + \tfrac{x^4}{4!} + \dots \bigr)}^{\text{red}}
    \overbrace{\bigl( 1 + \tfrac{x}{1} + \tfrac{x^2}{2!} + \dots \bigr)}^{\text{green}}
    \overbrace{\bigl( 1 + \tfrac{x}{1} + \tfrac{x^2}{2!} + \dots \bigr)}^{\text{white}}
\]

\end{document}
  • Wow, thank you! I definitely wouldn't have thought that the order of package loading would matter. Care to shed some light on the details? – alan Mar 2 '18 at 5:30
  • 1
    @alan: General details: Some packages take care to see what other packages have been loaded and/or load their macros at different times (not just all at package load/\usepackage using \AtBeginDocument, say). However, in general, there are too may combinations of load orders to consider and therefore the onus rests with the end-user. hyperref is a typical example of a package that should typically be loaded last, because it makes changes to many fundamental document elements. – Werner Mar 2 '18 at 5:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.