# LyX: listings over multiple pages

I am trying to use LyX to insert child document-listing-program. The program imports OK but it is too long to fit on a single page. At the bottom of the page it outputs over the margin, sometimes cutting characters in half, on the page it continues into it leaves the correct header gap. I have tried using LaTeX code \lstinputlisting[language=Python]{file.py} with the same result. Please help On a side note if you could let me know how to color format the code that would be great. From my reading it seems to imply that by using language = Python a keywords list will have been generated with some keyword styles predefined, but I don't know how to access these and use them to set further styles.

Can't even begin to explain how frustrating this has been trying to find out so any help would be massively appreciated.

-

I just tried this with this minimal example:

\documentclass{article}

\usepackage{listings}

\begin{document}
\lstinputlisting[language=Python]{/usr/bin/apt-mark}
\end{document}


(The given file was just the first longer python file I found on my system.)

This writes over the side margin, but not over the lower one, instead it does a proper page-break.

It could be that your page size settings are wrong, but without a minimal example of your problem this is difficult to diagnose.

-