# Text becomes justified with wrapfig

Here is my documnet:

My text is being justified and it's leaving large spaces - how do I get rid of it. Here is my code:

\documentclass{article}
\begin{document}
\begin{wrapfigure}{h!}{0.4\textwidth}
\includegraphics[width=0.4\textwidth]{epsilon-delta.jpg}
\label{fig:example_graph}
\caption{this graph shows possible values of  $\delta$ for various choices of $\varepsilon>0$  for a given function $f(x$), a number $a$, and a limit $L$ at $a$. Note: $\delta \pm a$ does not need to map onto $L \pm \varepsilon$ through $f$.}
\end{wrapfigure} %figure wrapping problem

which means the limit of the function  $f$, as  $x$  approaches  $c$, is $L$ iff for all distances away from $L$, $\varepsilon$, there exist a distance from $c$, $\delta$, such that if $x$ is within $\delta$ of $c$ (but not at $c$) $f(x)$ is within $\varepsilon$ of $L$.\\

It also states that  for all $x \in (c-\delta,c+\delta) \cap \text{dom}_{f}$ there exist a $y \in (L-\varepsilon,L+\varepsilon)$ such that $y=f(x)$. %evaluate usefulness

Remember:\\
$0 < |x-c| < \delta$ is equivalent to $c - \delta < x < c + \delta \text{, } x \neq c$ and $|f(x) - L| < \varepsilon$ is equivalent to $L - \varepsilon < f(x) < L + \varepsilon$\\
\end{document}

• There is also \fussy vs \sloppy. For very narrow columns, \fussy tends to create an irregular edge, so \sloppy is preferred in spite of the large gaps. Jul 24 '20 at 12:50
• This has nothing to do with wrapfig. And even the narrow text while wrapping is a red herring. There is something not shown that is preventing optimal line breaks. Do you have some setting that prevents paragraphs ending with a full iine? I think so! I couldn't test because the MWE does not match the image. Also, don't end paragraphs with \\  -- use \parskip instead. Also h! is not valid placement for wrapfig Jul 25 '20 at 9:01
• My previous comment was wrong -- the effect comes from TeX's paragraph breaking algorithm, not from a funny setting of \parfillskip, which I suspected. Jul 25 '20 at 9:52

Your stretched-out text is entirely due to your ending paragraphs with \\. Don't do that. If you want a blank line between paragraphs, do

\setlength\parskip\baselineskip


or use the parskip package (which suppresses the large parskip in some places).

For the detailed explanation, putting \\ at the end of a paragraph creates a forced line break with nothing on the line after the break, so that empty line is terribly stretched-out. LaTeX will warn you about it (Underfull \hbox (badness 10000) in paragraph). The trick is that TeX tries to keep the lines of the paragraph "even" so it makes the other lines in the paragraph terribly stretched out to match!

Have you tried \raggedright? it seems likely to fit with your needs. If you only want it to apply partially, you should do something like this:

{\raggedright
which means the limit of....

}


For more control, you might want to try setting \rightskip yourself, e.g.:

\rightskip=0pt plus 10em


Which would allow up to 10em (roughly, 10 times your font-height) of space on the right (probably too much).