auto adjust listing frame size in latex code example Example: lstinputlisting excluse lines \lstinputlisting[linerange={1-4,7-9}]{file.cc}