I have a text, where pictures are interleaved with descriptions for them. And since pictures are quite big, sometimes picture moves to next page, but the description for it stays on the previous page, which is ugly.
The code:
Some description for the following image:
\begin{center}
\includegraphics[width=\textwidth]{../path/to/image.png}
\end{center}
I tried using \nopagebreak, but LaTeX just ignored me. And using samepage also did not help - it started to pull the text from under the previous image down the page.
What can I do to keep the description and the image on the same page?