I would like to write a short guidelines of LaTeX for my students. In the spirit of some LaTeX manuals, I'd like to present the code and the result as follows,

This example illustrate more or less what I'd like to do.
QUESTION(S)
Is the two-columns style realize with
minipage?How could I insert the code in a way it shows highlighted?
Any help is welcome. Cheers.
tex-dist/sourceand you cams just Find the text associated with the example, tracing back to the macro that makes it and viola! Perfect duplication. – Sean Allred Jul 16 '13 at 12:20