# Breqn and xypic

\documentclass[a4paper,12pt]{scrbook}

\usepackage[all,cmtip]{xy}
\usepackage{breqn}

\begin{document}
\begin{displaymath}
\xymatrix{
A \ar[r]^f & B
}
\end{displaymath}
\end{document}

generates the following output:

As you can see, the label is not attached to the arrow, but rather to A. Is there a fix, or is breqn and xy simply not compatible.

Compiled with xelatex (XeTeX 3.1415926-2.5-0.9999.3-2014012222 (TeX Live 2013/Debian))

• I don't think there is any sensible way for making breqn compatible with Xy-pic. The breqn package, besides breaking equations, has the habit of breaking also other packages. You may try tikz-cd instead of Xy-pic. Nov 26 '14 at 15:32

The package breqn is not yet stable (at least it does not have a version 1 yet). You might want to report that problem to https://github.com/wspr/breqn/issues

Here some quote from their documentation:

As it pushes the envelope of what is possible within the context of LaTeX2ε, the breqn package will tend to break other packages when used in combination with them, or to fail itself, when there are any areas of internal overlap; successful use may in some cases depend on package loading order.

The last statement is not true for your case. In the meanwhile, you should not use this package or switch from xy to tikz-cd which I would recommend in general.

This could look like the following:

% arara: xelatex

\documentclass[12pt]{scrbook}
\usepackage{tikz-cd}
\usepackage{breqn}

\begin{document}
$\begin{tikzcd}A\ar{r}{f}&B\end{tikzcd}$