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?

alan
  • 153

1 Answers1

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}
Werner
  • 603,163
  • 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 02 '18 at 05: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 02 '18 at 05:35