Ads by Google

Thursday, April 17, 2008

LaTeX tip: Always use small fonts for Verbatim environment

On the TeX newsgroup, this was a nice tip to use. Indented code tends to move off the paper with normal fonts and the only way was to wrap the verbatim environment under \small.

But you'd have to do that for every verbatim listing.

Making the change in the document preamble makes the code listing simple.

For those interested in more sophisticated LaTeX pretty printing, the listings package is pretty good and comes with support for a number of languages. For anything fancier than the normal verbatim environment, that is a very good package to use.