Is there an way to avoid this behavior of the pictures
This is have is wrap the picture:
\begin{wrapfigure}{r}{0.5\textwidth}
\vspace{-20pt}
\begin{center}
\includegraphics[width=0.4\textwidth]{./pictures/DBuserTabel.png}%{./Pictures/mainscreen1.png}
\caption{Uklip af User tablen i Databasen}
\label{fig:databaseUserTable}
\end{center}
\vspace{-20pt}
\vspace{1pt}
\end{wrapfigure}
Best Answer
The behaviour you describe is caused by using the
wrapfig
environment too close to a page break, as the following example demonstrates:The
wrapfig
package documentation explicitly warns about this:so, you need to move your
wrapfig
environment to guarantee that it won't run over a page break. However, usingR
(orL
) instead ofr
(orl
) your figure will float, so simply changingr
toR
in the above code, as innow yields: