I wanted to tidy up a TeX document and was curious if you can use \lstinputlisting or a similar function to include a certain part of a source-code file.
Example, I have a 500 or so line source file and I want to include just lines 300-400.
Is there a way to do this?
linerangeis more succinct – Robert Martin Nov 15 '11 at 18:37matlab-prettifierpackage works also pretty well. It is intended for Matlab (and compatible) language only, but the command\lstinputlisting[label={code:label},caption={Caption},firstline=100, lastline=300]{Matlab_Code/file.m}works greatly – Erik Pillon Mar 14 '18 at 15:35firstnumber=100is really nice; it allows you to keep track of the code you cutted. – Erik Pillon Mar 14 '18 at 15:45