# mathabx + mathtools -> extremely odd underbrace behaviour… how to fix?

This following code produce very strange result:

\documentclass[12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{amssymb}
\usepackage{amsmath}

\usepackage{mathabx}
\usepackage{mathtools}

\begin{document}
$$W_n(\underbrace{\mbox{\textvisiblespace}, \mbox{\textvisiblespace}, \dots, \mbox{\textvisiblespace} }_n )$$
\end{document}


If I just remove one of mathabx or mathtools the brace is displayed normally. Any ideas?

P.S. I use some symbols from mathabx and some commands from mathtools in the book, so I probably need both packages...

• mathabx has wider effects that aren't always predicted. maybe using just the particular symbols you need, and not loading the entire package, would get rid of this problem (not tried). good advice at the question Importing a Single Symbol From a Different Font – barbara beeton Jun 4 '13 at 15:30
• @barbarabeeton Sure, I see, probably it would be the best way. – Nick Jun 4 '13 at 15:39
• On a side note, no need to load both amsmath and mathtools. Former is loaded by latter. – user11232 Jun 4 '13 at 22:12

mathabx has wider effects that aren't always predicted. maybe using just the particular symbols you need, and not loading the entire package, would get rid of this problem (not tried).

good advice can be found at the question Importing a Single Symbol From a Different Font

• I'd prefer this way since mathabx produces some more strange behaviour if loaded later too, looks like relsize doesn't work as expected. Extracting required fonts and symbols was easy and works perfect. – Nick Jun 5 '13 at 9:59

use it the other way round:

\usepackage{mathtools}
\usepackage{mathabx}

• @Nick Note that it's not mathtools, but amsmath that redefines \underbrace. You'd get the same with loading mathabx before amsmath. – egreg Jun 4 '13 at 15:39

Mathtools redefines \underbrace and \overbrace, which leads to problems with some fonts. To access the original definitions, use \LaTeXunderbrace and \LaTeXoverbrace, respectively.