New answers tagged preview
Here's a proposition with tcblisting stuff, which is very powerful, but I restricted to the basic usage -- it can be easily extended with a lot of options. Be sure to use the listing only option to the environment, otherwise tcolorbox tries to typeset both code and its LaTeX output. This must fail with of course with things like \documentclass, ...
Top 50 recent answers are included