0

Possible Duplicate:
How can I ensure that a listing is not going to be split?

My listing goes at the bottom of a page and fits good. But the header is separated and moved to another page. Is it possible to keep them together?

damluar
  • 679

1 Answers1

2

Using the float option to your lstinputlisting will make your code to float and floats never break across the pages. Hence the solution will be to use

\lstinputlisting[float,caption=My code here]{your file that has code}