Everyone who's hung around Irreal for a while knows that I'm a big fan of Org mode and that I use it to, among other things, write all my blog posts. One of the really nice things about it is the way it handles the embedding of code snippets in the text.
Matthew Keeler has posted an excellent video on embedding code snippets in Org mode. He starts with a simple document and exports it to PDF through LaTex. Then he adds a bit of Python to the document and demonstrates the Org features that support embedding code in documents. Even this short video serves to demonstrate what you can do in Org mode.
If you write documents that include code you really should watch this video. It will make your work much easier. It's just a little over 6 minutes long so you can watch it while you're waiting for the coffee to brew.