# Wrapping relational operators

If an expression $A = B$ (or say, $A \leq B$) occurs in a sentence and there is only enough space in the current line to accommodate $A$, LaTeX will place the equals sign beyond the margin and cause an overfull hbox, rather than wrapping it into the next line along with B. Is there any way to change this behavior?

Edit: Happens with other operators as well.

\documentclass[american,12pt]{book}
\setlength{\parindent}{0pt}
\usepackage{babel}
\usepackage{amsmath,amssymb,amsthm}

\begin{document}

For each $n$, $\sum_{l(x) = n} \lambda(x) = 1$ and hence $\sum_{x \in \{0,1\}^{*}} \lambda(x) = \infty$ but
$\sum_{l(x) = n} L(x) = 2^{-n-1}$ and hence $\sum_{x \in \mathbb{N}} L(x) = 1$.
Blah Blah Blah Blah Blah Blah Blah Blah Blah

\end{document}

• Are you using the microtype package? Adding a minimal example that illustrates your problem would be very helpful. – Martin Scharrer Mar 29 '11 at 10:37
• @Martin -- the microtype package shouldn't make any difference. the expression described is treated by TeX as an ordinary horizontal list (rules 20 and 21, TeXbook appendix G), where there are lenient penalties after relations and binary operators, but nowhere else. so a break before such an operator would have to be forced. – barbara beeton Mar 29 '11 at 12:31
• @barbara beeton: Thanks for explaining that. An influence of the microtype package was just a guess. – Martin Scharrer Mar 29 '11 at 12:35
• The microtype package could help, as it gives TeX more flexibility with spacing letters and breaking lines, but since in this case there is very little non-math text on the line in question, and the line is close to the start of the paragraph, I don't think it will make much difference. – Jan Hlavacek Mar 30 '11 at 0:38

... $\sum_{l(x) = n} L(x)\break = 2^{-n-1}$ ...