4

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?

enter image description here

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}
8
  • 2
    Can you provide a minimal example of a nonworking document?
    – egreg
    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
  • 2
    Perhaps you should edit your question and question title to reflect this new bit of information. Jun 4, 2015 at 11:01
  • 3
    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

2 Answers 2

3

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}

enter image description here

2
  • 1
    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
  • 1
    @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
2

Another solution:

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

enter image description here

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

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.