I have a few MATLAB files with over 100 lines of code but when I use \lstinputlisting, I only get about the first 50 lines or so and it doesn't show up on the next page. Presumably, it's floating away somewhere on the same page. I've tried using \afterpage, \clearpage, \cleardoublepage, \pagebreak, and \newpage, but none of them help.
I'm a beginner with LaTeX and would appreciate any help that I can get.
Thanks!!
\lstset {language=Matlab,%
%basicstyle=\color{red},
breaklines=true,%
morekeywords={matlab2tikz},
keywordstyle=\color{blue},%
morekeywords=[2]{1}, keywordstyle=[2]{\color{black}},
identifierstyle=\color{black},%
stringstyle=\color{mylilas},
commentstyle=\color{mygreen},%
showstringspaces=false,
numbers=left,%
numberstyle={\tiny \color{black}},% size of the numbers
numbersep=9pt,
emph=[1]{for,end,break},emphstyle=[1]\color{red},
%emph=[2]{word1,word2}, emphstyle=[2]{style},
}
\lstinputlisting? Are you using it in atableenvironment? – egreg Feb 25 '14 at 21:04floatas an option to the listings? – Torbjørn T. Feb 25 '14 at 21:19\lstsetthat would prevent page-breaking in a listing, so we need more information. Can you show us an example of how you add the\lstinputlistingas well? Ideally, create a complete, minimal example, starting with\documentclassending with\end{document}, that demonstrates the problem. Remove everything that doesn't have any influence. – Torbjørn T. Feb 25 '14 at 22:11matlab-prettifierpackage; see this answer. – jub0bs Apr 28 '14 at 16:28