How can I fix this problem? The text of the second paragraph overwrites the figure and doesn't contain line breaks.
\documentclass[parskip=half]{scrbook}
\usepackage[english]{babel}
\usepackage{graphicx,lipsum,wrapfig}
\begin{document}
\begingroup
\setlength{\columnsep}{30pt}%
\begin{wrapfigure}{r}{0.5\textwidth}
\centering\includegraphics[width=\linewidth]{example-image-a}
\caption{A very very very very very very very very long long long caption}
\end{wrapfigure}
foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo
foo foo foo foo foo foo foofoo foo foo foo foo foo foofoo foo foo foo foo foo foo
\endgroup
\end{document}
wrapfigmanual:If you put a wrapfigure in a parbox or a minipage , or any other type of grouping, the text wrapping should end before the group does.Only way is to add some more text inside the group. – Sep 24 '13 at 00:45foos ;-). Alternatively, you can fix more width for wrap figure less width for `\includegraphics and such. – Sep 24 '13 at 01:01