latexlong-lines

Long lines in LaTeX


I have some code I write inside the verbatim environment. Sometimes, the lines are too long and the generated pdf looks ugly - the text row passes over the right margin. What can I do to automatically break these long lines? Is there anything better than the verbatim env?

Thanks, Lucian


Solution

  • Can you just use a fixed-width font, e.g. \texttt{}? If you require something more sophisticated, try the moreverb, listings, or algorithmicx packages.