autoadjust listing frame size in latex code example Example: lstinputlisting line range \lstinputlisting[firstline=300,lastline=500]{file.cc}