Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

What is the best way to have blocks of code between my paragraphs? My document is about programming and I need to make a clear distinction between text paragraphs and code samples.

The first line shouldn't be indented for code samples and I need a fixed width font such as Courier New.

Any idea how to get this done?

share|improve this question
2  
have a look at the listings package there are lots of examples on this site. By default in latex you could use \begin{verbatim} in latex but listings gives (lots) more options. – David Carlisle Aug 23 '12 at 15:53

closed as too localized by Marco Daniel, percusse, lockstep, diabonas, Mark S. Everitt Sep 2 '12 at 15:50

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

Browse other questions tagged or ask your own question.