# Breqn package is causing \mathcal to not work when used along with \overset

I am trying to place \mathcal{U} over and under the symbol \gtrless using the following code:

$\overset{\mathcal{U}_0}{\underset{\overline{\mathcal{U}_0}}{\gtrless}}$


However, what I am seeing is that the \mathcal command is ignored when I use it along with the breqn package. Without the breqn package, the code works fine. The command works fine elsewhere in the document. The situation remains same for both latex and pdflatex. Can anyone give suggestions on what has to be done?

This is a toy example of my document. I need the breqn package for other equations. Without it, the \mathcal command works fine.

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{breqn}
\begin{document}
$\overset{\mathcal{U}_0}{\underset{\overline{\mathcal{U}_0}}{\gtrless}}$
\end{document}

• Can you provide a minimal example of a nonworking document? Jun 4, 2015 at 10:47
• Works fine for me, with amssymb and amsmath.
– user49901
Jun 4, 2015 at 10:54
• When making the toy example, I found that mathcal stops working when using the breqn package. Without it, it works fine. Anyone know a workaround? I need the breqn package for other equations Jun 4, 2015 at 10:59
• Perhaps you should edit your question and question title to reflect this new bit of information. Jun 4, 2015 at 11:01
• Friendly advice: Don't use breqn; even thorugh it has some very nice features, it is far from finished and now that neither Michael Downes (R.I.P.) or (thereafter) Morten Høgholm are developing it anymore, the package is not likely to improve greatly anytime soon since the code is very complex. Jun 4, 2015 at 11:30

This is a bug in breqn that doesn't honor the math font choice in the first argument to \overset and \underset.

Fixing the bug would require deep digging into the very complicated code of breqn, which I'm not going to do as I consider breqn a nice proof of concept, but nothing really usable at document level.

Here's a workaround:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{breqn}

\newcommand{\Ugtrless}{%
\mathrel{\kern0pt\mathop{\gtrless}\limits^{\mathcal{U}_0}_{\overline{\mathcal{U}_0}}}%
}

\begin{document}

This works $X \Ugtrless Y$

\bigskip

This shows the bug in \texttt{breqn}: $\overset{\mathbf{A}}{=}$

\end{document}


• FWIW I've added this to the breqn bug tracker in my repo of breqn in Github. I'm not 100% sure that's where development is occurring these days, but it's better than nothing :) Jun 4, 2015 at 13:12
• @egreg why do you consider breqn to be just a proof of concept? I use that package for my thesis and apart from its bugs I quite like it.
– VaNa
Jul 21, 2017 at 16:40

Another solution:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{breqn}
\begin{document}
$\substack{\mathcal{U}_0\\{\textstyle\gtrless}\\{\overline{\mathcal{U}_0}} }$
\end{document}


• With line breaks? Jun 4, 2015 at 12:26
• @egreg Yes, with line breaks Jun 5, 2015 at 5:51