I have the following problem with breqn
package: I want to write a long equation and automatically split it with dmath
environment. It is splitting equation perfectly, but placing the equation number one line below. I want to have a result such that last part of the equation and equation number are in the same line.
Here is the code I'm trying to fix:
\documentclass{article}
\usepackage{breqn}
\begin{document}
\begin{dmath}
{{E}_{0}}\sum\limits_{t=0}^{\infty }\beta _{B}^{t}\left({{D}_{t+1}}+\left( 1+r_{f,t-1} \right)L_{f,t}+\left( 1+r_{g,t-1} \right)L_{g,t}+\left( 1+r_{i,t-1} \right)L_{i,t}-L_{f,t+1}-L_{g,t+1}-L_{i,t+1}-\left( 1+r_{p,t-1} \right){{D}_{t}} -\frac{{{\phi }_{f}}}{2} L_{f,t+1}^{2}-\frac{{{\phi }_{g}}}{2}L_{g,t+1}^{2}-\frac{\phi_{i}}{2}L_{i,t+1}^{2} \right)
\end{dmath}
\end{document}
EDIT: I was told that the space in the second line is not enough to place the equation number. How about following case where I have exactly the same equation given in 3 line with more than enough space to place equation number in the same row:
\documentclass{beamer}
\usetheme{Madrid}
\usepackage{breqn}
\begin{document}
\begin{frame}
\frametitle{Problem}
\begin{dmath}
{{E}_{0}}\sum\limits_{t=0}^{\infty }\beta _{B}^{t}\left({{D}_{t+1}}+\left( 1+r_{f,t-1} \right)L_{f,t}+\left( 1+r_{g,t-1} \right)L_{g,t}+\left( 1+r_{i,t-1} \right)L_{i,t}-L_{f,t+1}-L_{g,t+1}-L_{i,t+1}-\left( 1+r_{p,t-1} \right){{D}_{t}} -\frac{{{\phi }_{f}}}{2} L_{f,t+1}^{2}-\frac{{{\phi }_{g}}}{2}L_{g,t+1}^{2}-\frac{\phi_{i}}{2}L_{i,t+1}^{2} \right)
\end{dmath}
\end{frame}\end{document}
breqn
isn't willing to split the equation in three lines.breqn
, as shown in the documentation (texdoc breqn
).breqn
will not by itself set the final line so that it ends to the left of the next-to-last line unless there is a clear "preferable" breakpoint (sucn as an = sign) that mandates a more leftward placement.breqn
(which has many).