4

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.

Edit: Example added:

\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
  • 3
    @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
3

There's really no way to typeset "correctly" that paragraph. Sending the equals sign on the new line is not an option, in my opinion. Such problematic paragraphs can be typeset only modifying the text. Sorry if this is not an answer.

You can say

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

but don't tell anybody that I've advised you to do so. :-)

  • Ok, I guess I'll just have to learn to live with it. – user4522 Mar 30 '11 at 10:16

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.