\documentclass{article} %include polycode.fmt %options ghci \begin{document} \section{Test} > test = putStrLn "\\section{Result}\n\nIt works!" \perform{test} \end{document}