\documentclass{article} %include polycode.fmt \newenvironment{figurehscode} {\(\parray} {\endparray\)} \newenvironment{codefigure} {\begin{figure}\sethscode{figurehscode}} {\end{figure}} \begin{document} %Some text before. \input tufte \begin{figure}[h] \texths > map :: (a -> b) -> [a] -> [b] > map [] = [] \caption{Foobar} \label{foobar} \end{figure} %Some text after. \input tufte \begin{codefigure} > map :: (a -> b) -> [a] -> [b] > map [] = [] \caption{Foobar} \label{foobar2} \end{codefigure} \input tufte \end{document}