TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In a document I write, I use the following for setting the page proportions:


However, sometimes I want certain blocks of text not to be broken into several lines. In math mode, I use simply


that is, composed brackets around the block. In normal text, I use


However, in both cases, when the block comes inconveniently at the end of the line, it is often compiled so that the block exceeds the prescribed line width. I would like to force Latex somehow to put the block on the next line instead and stretch the preceding text to the whole line. In particular, I would rather not use \newline, because then the text on the upper line ends before the prescribed line width.

(Moreover, I would like to do it in a way that dos not change the above setting of the page proportions, if possible.)

I am sorry if this is a duplicate of some sort, I was not able to find anything related here (maybe because of my poor terminology concerning typing).

Thanks in advance for any tips.

share|improve this question
That has to do with the penalties defined in LaTeX. Their values tell the system what is preferable if no optimum can be achieved, i.e. in your case whether it is better to leave a line 'underfull' or just let something hang into the margin a bit. Of course you can manually set these values to 'force' the type of behavior you're after (to be used with caution). You can find more info in TeX by Topic for instance. – Count Zero Jul 22 '13 at 11:22
\sloppy does this, more or less. – David Carlisle Jul 22 '13 at 11:33
Thanks for both suggestions. I am afraid to mess with the penalties, but so far the sloppypar works fine. – PavelC Jul 22 '13 at 11:51
up vote 4 down vote accepted

As noted in comments, using \sloppy or the sloppypar environment (or as an alternative setting \setlength\emergencystretch\textwidth) allow TeX to favour stretching white space to keep text within margins where possible.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.