[Tex/LaTex] Allowing figures to break paragraphs

floatsparagraphspositioning

As it seems, the placement option [!htb] only allows the figure to be placed between paragraphs. But what if the best placement is "inside" a paragraph? See, for instance:

\documentclass{article}
\usepackage{graphicx}
\usepackage{lipsum}

\begin{document}

\lipsum[1]

\begin{figure}[!htb]
    \includegraphics[width=\textwidth,height=0.8\textheight]{example-image-a}
    \caption{Some caption}
\end{figure}

\end{document}

On the left side of the figure above I show the output of the minimal example above. As you can see, I'm left with an undesirable blank space. In my view, the optimal placement would be the one on the right side, but currently my code don't see breaking the text as an option. Why not? Is there a way to make it happen? Of course it'd work if I manually broke the paragraph, but I want LaTeX to automatically recognize this placement situation.

enter image description here

PS: I tried to use the wrapfig package, but apparently it only works for cases where the figure "coexists" with the text on the same line.

Best Answer

In your example you had placed the figure after the first paragraph had been set.

enter image description here

\documentclass{article}
\usepackage{graphicx}
\usepackage{lipsum}

\begin{document}

\begin{figure}[bp!]
    \includegraphics[width=\textwidth,height=0.8\textheight]{example-image-a}
    \caption{Some caption}
\end{figure}

\lipsum[1]


\end{document}

Note I used ! here as the figure takes up more space than normally allowed on text pages. You had omitted p which makes it much harder to place the figure.

Related Question