Consider the following code:
\documentclass[]{scrartcl} \usepackage[demo]{graphicx} \setlength{\parindent}{0cm} \begin{document} \includegraphics[width=3.5cm]{} \includegraphics[width=3.5cm]{} \includegraphics[width=3.5cm]{} \includegraphics[width=3.5cm]{} \includegraphics[width=3.5cm]{} \includegraphics[width=3.5cm]{} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus molestie nunc non lectus convallis auctor. Cras nisl arcu, placerat et pretium at, blandit ut nunc. Proin ut est ac dolor porttitor pellentesque. Donec commodo ornare nisi. Nam non elit in arcu placerat rhoncus nec sed erat. Donec non mi velit, quis malesuada ante. \end{document} which produces this output:

Why is it that LaTeX does not break the line when there is no more space left for an entire figure? How can I ensure LaTeX breaks the lines correctly?

\raggedrightas justification is probably not important.