I have used the listings package for including a program into a LaTeX document. But the program splits into two when a page is finished. I want to make the listing behaved like an image, so that it will not split and the whole program stays on the same page.
Code I used is:
\lstinputlisting[caption={Hello},label={pgm1}]{main.c}

\documentclass{...}and ending with\end{document}– JMP Apr 27 '16 at 20:44