[Tex/LaTex] How to “force” LaTeX to respect the page width


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.

Best Answer

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.

Related Question