I have a problem: I have some listings in my document inserted with \lstinputlisting. this works fine, but at some of the listings the last line doesn't fit the page and is cut and put on the next page. This looks ugly. Is there any way to prevent page break in the listing if it's only one line? How can i tell LaTeX to break a page only if there are 3 or more lines to break? Haven't found anything on the net except to put the listings on a single page, but i need them exactly in the text.
any ideas?
greetz
schilf
ps: sorry for my english
