2
\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:

Wrong arrow labels

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))

1
  • 1
    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.
    – egreg
    Nov 26 '14 at 15:32
2

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}
    Your commutative diagramm goes here:
    \[\begin{tikzcd}A\ar{r}{f}&B\end{tikzcd}\]
    And your super long formula here:
    \begin{dmath}a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+w+x+y+z\end{dmath}
\end{document}

enter image description here

If you cannot live without those two packages, you might generate your commutative diagrams externally (standalone class) and include them as PDF. Or you tell us, what features of breqn you actually do need. Maybe, one can take out that feature manually from the package implementation.

1
  • Thanks! I wasn't aware of the github page. I only recently discovered breqn, so many equations are `hand-broken'. And I already have a dozen or so diagrams in xy, so i'll drop breqn for now.
    – Jaxan
    Nov 27 '14 at 9:53

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.