I am writing a very simple how-to document with several screenshots. The document flow goes something like this:
A few sentences explaining action 1
\begin{center}
\includegraphics{action_1_screenshot}
\end{center}
A few sentences explaining action 2
\begin{center}
\includegraphics{action_2_screenshot}
\end{center}
However since the screenshots are often large, I sometimes get page breaks between the paragraph and the corresponding screenshot. I want the paragraph to always be on the same page as a screenshot.
I have used \clearpage after each screenshot, but that doesn't quite get what I want. \clearpage would make sure that there is a page break after each screenshot, but I still want multiple screenshots on the same page if they fit. Ideally, I would have something like this to guarantee that two items were on the same page, though wouldn't necessarily always cause a page break:
\begin{samepage}
A few sentences explaining action 2
\begin{center}
\includegraphics{action_2_screenshot}
\end{center}
\end{samepage}
Is something like this possible? I'm not really looking for figures, because those don't tend to work well with longer descriptive paragraphs. Figures seem to be more optimized for a short sentence or sidenote.
samepage
, I just thought such an environment was wishful thinking on my part. Turns out that it actually exists...