In the MWE below, the 3.65" x 2" figure is placed roughly in the middle of the document. However when the caption is shortened by commenting out \lipsum[1][1-2] and commenting in \lipsum[1][1], the figure is pushed to the end of the document. Why is this and how can the latter behavior be prevented?
\documentclass[550paper]{kdp}
\usepackage{lipsum}
\usepackage{graphicx}
\begin{document}
\lipsum[1-3]
\begin{figure}[!p]
\includegraphics{TestFig.pdf}
\caption{
\lipsum[1][1-2]
%\lipsum[1][1]
}
\end{figure}
\lipsum[1-3]
\end{document}
\floatpagefrractionor you could allow the figure to be t note that if floatpagefraction is small latex will issue the float page as soon as it can so after the first small one it will ship a nearly empty page without waiting to see if another one coming later would fit. – David Carlisle Aug 21 '21 at 08:11article? kdp.cls is not in texlive – David Carlisle Aug 21 '21 at 08:12pis mandatory? That way, any possible good position at top, bottom or within the text in pages of text is lost. BTW, we cannot reproduce your problem only because of the unknown class, but also because of the unknown example image. Themwepackage provides several examples images, use one of these, setting the width or height of the image to match the size of your own image, and test that the example still show the problem. – Fran Aug 21 '21 at 14:11\renewcommand{\floatpagefraction}{0.4}before\begin{document}worked for my MWE. A smaller value than 0.4 can also be used, but do see David's comment. – SapereAude Aug 21 '21 at 19:51\usepackage{afterpage}to the preamble and\afterpage{\clearpage}just before\begin{figure}[!p]also works for my MWE. Thanks. – SapereAude Aug 21 '21 at 20:24