I'm creating (beamer) slides explaining the basics of using LaTeX. For this purpose I would like to illustrate how some source code
\documentclass{article}
\title{My first paper}
\begin{document}
...
looks like. That is, I'd like to compile some LaTeX code using the article document class and display it on my slide (without manually compiling a separate document and then including the produced pdf). What's the best/easiest way of achieving this?
At first look the showexpl package or similar look like they might work, but it breaks beamer when including things like \section in the sample code, and things like \title display beamer-style.

tcolorboxhas such a functionality. – samcarter_is_at_topanswers.xyz Apr 24 '17 at 22:04Package pgfkeys Error: I do not know the key '/tcb/sharp corners'and a bunch of similar errors. – Henning Koehler Apr 24 '17 at 22:41enhancedoption as well – Apr 25 '17 at 00:08pdfpagespackage to include output from a separate document, compiled under a different document class. – Steven B. Segletes Apr 25 '17 at 00:19