Both in questions as well as in answers I frequently see code (for example an MWE) followed by the printed output that code produces, something I have never managed to achieve. How is this done?

marked as duplicate by Werner, barbara beeton, Marijn, Andrew Swann, Sebastiano Nov 25 '18 at 9:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Browse other questions tagged .