I want to include the listing of my program code in my paper. In the beginning I used \verbatiminput for this. However, I want to use the listings package instead, particularly because of the line numbering. Now there's a particular property of my code: Many lines have about equal length. With \verbatiminput, most program lines fit on one line in the pdf document. With \lstinputlisting, most lines are breaked because there's more space between each character. The question is: I want to use \lstinputlisting but in such a way that the same number of characters fit on one line as with \verbatiminput.
The listings are between \begin{tiny} and \end{tiny}. I tried to use \lstset but I cannot find an option that solves it. I even tried to use the microtype package, but that doesn't seem to do anything.
Start Free Trial