You can force a line break with \\
I think breqn
by default gives the same breaking penalty to all binary relations, with no user-level customisation of that.
On the other hand I think that it is safe to do this
\let\oldcdot\cdot
\usepackage{breqn}
\let\cdot\oldcdot
which restores \cdot
to its normal non-breqn definition so breaking won't occur at the dot. On your example, this causes the break to happen before the + \frac{9\pi}
As David Carlisle has already pointed out in a comment, you can't have a line break inside an array
environment (at least not in a column of type l
). The only possible break point in the equation you describe is right after the L_{\lambda}(\phi, \omega)
part.
If the equation you've posted is really what you need to typeset -- I somehow doubt it, but that is what you've posted... -- your best bet may be to (i) replace all \times
symbols with \cdot
symbols and (ii) reduce the font size by 1 pt (by issuing the instruction \small
) for the equation in question. (Note that I've also gotten rid of the array
stuff in favor of a cases*
environment.)
\documentclass[11pt,twocolumn]{article}
\usepackage{mathtools,breqn}
\usepackage{mathtools,breqn}
\def\filler{Nam dui ligula, fringilla a, euismod sodales,
sollicitudin vel, wisi. Morbi auctor lorem non justo.
Nam lacus libero, pretium at, lobortis vitae, ultricies
et, tellus.}
\begin{document}
{\small
\begin{dmath*}
L_{\lambda}(\phi, \omega) =
\begin{cases*}
a\cdot b\cdot c\cdot d\cdot e\cdot f\cdot g\cdot h\cdot i\cdot j\cdot
k\cdot l & for $\phi$ even, \\
a\cdot b\cdot c\cdot d\cdot e\cdot f\cdot g\cdot h\cdot i\cdot j\cdot
k\cdot l & for $\phi$ odd.
\end{cases*}
\end{dmath*}
} % end of scope of \small statement
\filler % filler text, to show width of text column
\end{document}
![enter image description here](https://i.stack.imgur.com/dJM2b.png)
However, it would seem to be the case that you would rather have the line break (or breaks) occur somewhere to the right of the big curly brace. Here's a suggested solution which uses the split
environment:
\documentclass[11pt,twocolumn]{article}
\usepackage{mathtools}
\def\filler{Nam dui ligula, fringilla a, euismod sodales,
sollicitudin vel, wisi. Morbi auctor lorem non justo.
Nam lacus libero, pretium at, lobortis vitae, ultricies
et, tellus.}
\begin{document}
\begin{equation*}
L_{\lambda}(\phi, \omega) =
\begin{dcases}
\begin{split}
a\cdot b\cdot c\cdot d\cdot e\cdot f\cdot g \\
{}\cdot h\cdot i\cdot j\cdot k\cdot l
\end{split}
& \text{for $\phi$ even,} \\
\begin{split}
a\cdot b\cdot c\cdot d\cdot e\cdot f\cdot g \\
{}\cdot h\cdot i\cdot j\cdot k\cdot l
\end{split}
& \text{for $\phi$ odd.}
\end{dcases}
\end{equation*}
\noindent\filler
\end{document}
![enter image description here](https://i.stack.imgur.com/juXn5.png)
Addendum: I just noticed that you posted the actual math expression you're trying to typeset. Here's how I would try to get the job done: building on the two previous examples, I'd allow a line break both after L_{\lambda}(\phi, \omega)
-- fully automatic, courtesy of breqn
and the dmath*
environment -- and within each of the longish expressions to the right of the large curly brace. I would also use explicit \biggl
and \biggr
sizing instructions for the "fences" -- and not use \left
and \right
.
\documentclass[11pt,twocolumn]{article}
\usepackage{mathtools,breqn}
\def\filler{Nam dui ligula, fringilla a, euismod
sodales, sollicitudin vel, wisi. Morbi auctor lorem
non justo. Nam lacus libero, pretium at, lobortis
vitae, ultricies et, tellus.}
\begin{document}
\begin{dmath*}
L_{\lambda}(\phi, \omega) =
\begin{dcases}
\begin{aligned}[b]
2 \cos \biggl[ \tanh\biggl(\frac{L_{\lambda-1}
(\psi, \omega)}{2}\biggr) \ \ \ \ \ \\
% need to "shove" the first line to the left
\times \tanh\biggl(\frac{L_{\lambda-1}
(\psi, \omega+1)}{2}\biggr) \biggr]
\end{aligned}
& \text{for $\phi$ even,}\\
\begin{aligned}[b]
2 \sin\biggl[ \tanh\biggl( \frac{B_{\lambda-1}
(\psi, \omega+1)}{2} \biggr) \\
\times \tanh\biggl( \frac{L_{\lambda-1}
(\psi, \omega)}{2} \biggr) \biggr]
\end{aligned}
& \text{for $\phi$ odd.}
\end{dcases}
\end{dmath*}
\filler %% filler text (show width of text block)
\end{document}
![enter image description here](https://i.stack.imgur.com/on6Z0.png)
Best Answer
To understand what is happening here, I cleaned the code a bit and used colored rules than fboxes. I have also used a loop to typeset the various boxes. This way it was easier to modify the widths and see what is happening at the transition points.
Firstly, we view a typeset box that has an adequate width to handle the equations. We see that it correctly typesets these, aligning them at the equal sign and centering them.
Now what happens when we change the width of the box? TeX starts squeezing the first equation to fit within the width constraints. For the second equation though, since it fits it will keep the width of the box constant. Oops! the two equations do not align anymore, but have small differences until about 185pt when the first equation is stretched to what TeX thinks is a good equation display.
Next we view the logical issues in the
breqn
algorithm by forcing a break at a160pt
width and typesetting the following boxes to have some visual clues:It is obvious that the original good position marked to break the equation and at which the second equation is aligned is based on the unstretched first equation. This should have gone through another iteration and be checked against the new position of the equal sign or a trigger should have been switched to let TeX take over and position the second equation at its natural position. A bad combination of
hsize
and the type of equations entered can also create a problem that is intractable and will just produce a badly typeset box Q.E.D?Here is a new MWE:
To fix it, requires manual intervention (just for the problematic ones), modify as follows:
to left align or
\hbox to 91pt {\hfill $a=0$}
to align, the 91pt was found by trial and error.You can use Patrick's
\usepackage{lua-visual-debug}
to see the final boxing:Note the box has been drawn with the corrected parameters, as explained above.