5

The following gives an output where the second eqaution writes over the equation number

\documentclass{report}
\usepackage{amssymb,amsmath}
\usepackage{breqn}

\begin{document}

\begin{dgroup}
  \begin{dmath}
    a = a
  \end{dmath}
  \begin{dmath}
    a = a +a+a+a+ b+b+b+b+b+b+b+b+b+b+b+b+b+a+a+a
 \end{dmath}
\end{dgroup}

\end{document}

Using just

  \begin{dmath}
    a = a +a+a+a+ b+b+b+b+b+b+b+b+b+b+b+b+b+a+a+a
 \end{dmath}

without the dgroup environment leads to correct output.

It looks like this ((1a) and (1.b) are in the dgroup environment whereas (2) is not): enter image description here

Did I make a mistake or is this a bug? What is the correct way to handle this situation?

ungerade
  • 151
  • 3
    I'm not sure what the problem is but breqn is quite unfinished so I wouldn't use it if I was you. Neither Michael Downes (before he passsed away) or Morten Høgholm (before we left the LaTeX community) got breqn fully working. – Svend Tveskæg Oct 28 '13 at 01:43
  • @SvendTveskæg Thx for the comment. Is there any better alternative for automatic line breaks (with brackets)? – ungerade Oct 28 '13 at 01:47
  • See http://tex.stackexchange.com/questions/139669/looking-for-a-smarter-left-right/140005#140005 – Steven B. Segletes Oct 28 '13 at 01:55
  • @StevenB.Segletes Thx for the hint.As far as i understand it does your option not provied automatic breaking (which would be one of my main motivations to use breqn). – ungerade Oct 30 '13 at 19:21
  • @ungerade You are correct. The referenced page does not provide automatic breaking, one must use some sort of tabbing arrangement. However, what it does provide is a possible approach to the "with brackets" part of your comment. That is, it offers the possibility of preserving bracket height when breaking a term across two lines of an equation. – Steven B. Segletes Oct 30 '13 at 19:29

1 Answers1

3

The bregn package is alpha software and this unlikely to change. See the package's documentation for a number of open issues. So to answer your first question, yes this is a bug.

There are a number of internal variables you can adjust, either globally or internally in a given group, to work around your problem. The most relevant choice seems to be

  • \eqnumsep a dimension specifying the minimum space between the body and the equation number, default 10pt

In your example \eqnumsep=4em resolves the problem causing the line to break by moving the equation number to the next line. A larger value will cause the equation itself to break over two lines.

Sample output

\documentclass{report}
\usepackage{amssymb,amsmath}
\usepackage{breqn}

\begin{document}

\noindent
\verb+\eqnumsep=4em+
\begin{dgroup}\eqnumsep=4em
  \begin{dmath}
    a = a
  \end{dmath}
  \begin{dmath}
    a = a +a+a+a+ b+b+b+b+b+b+b+b+b+b+b+b+b+a+a+a
 \end{dmath}
\end{dgroup}

\noindent
\verb+\eqnumsep=5em+
\begin{dgroup}\eqnumsep=5em
  \begin{dmath}
    a = a
  \end{dmath}
  \begin{dmath}
    a = a +a+a+a+ b+b+b+b+b+b+b+b+b+b+b+b+b+a+a+a
 \end{dmath}
\end{dgroup}

\noindent
Default \verb+\eqnumsep+
\begin{dgroup}
  \begin{dmath}
    a = a
  \end{dmath}
  \begin{dmath}
    a = a +a+a+a+ b+b+b+b+b+b+b+b+b+b+b+b+b+a+a+a
 \end{dmath}
\end{dgroup}

\end{document}
Andrew Swann
  • 95,762