# LaTeX: Dealing with overfull badboxes

Writing a PhD thesis and with well over 250 pages and 40+ high resolution images, LaTex is far more efficient than other word processors:

There are some issues to deal with once the document becomes more complex. Currently I’m dealing with overfull badboxes. Luckily there are guides on dealing with this, one of them here.
Several things can get you out of trouble. One is the \sloppy command, which makes things less stringent when LaTeX tries to justify the problematic line:

\sloppy
problematic text
\fussy


Or you can use sloppypar environment

\begin{sloppypar}
problematic text
\end{sloppypar}


Another way is to alter \emergencystretch which is the assumed stretchability of every line when badness and demerits are computed, in cases where overfull boxes are otherwise unavoidable. More on this here. So altering this parameter may help in some cases, eg:

\emergencystretch=.5em