\documentclass{tmr} %include polycode.fmt \title{Editorial} \author{Wouter Swierstra\email{wouter@@chalmers.se}} \begin{document} \begin{code} import Data.List main = do let authors = ["Heinrich Apfelmus", "Jeff Heard", "Leon Smith"] let articles = [ "Fun with Morse Code" , "Hieroglyph 2" , "Lloyd Allison's Corecursive Queues"] let issueNumber = 14 let editorial = makeEditorial issueNumber authors articles let texheader = "\\documentclass{tmr}\n\\begin{document}\n" let texfooter = "\n\\end{document}" writeFile "Editorial.tex" (texheader ++ editorial ++ texfooter) makeEditorial :: Int -> [String] -> [String] -> String makeEditorial issueNumber authors articles = let intro = "I'm pleased to announce Issue " ++ show issueNumber ++ " of the Monad.Reader." ++ " This issue consists of the following " ++ show (length articles) ++ " awesome articles: " text = concat (intersperse "; " (zipWith announce authors articles)) outro = ". Please consider writing something for the next issue!" in intro ++ text ++ outro announce :: String -> String -> String announce author article = author ++ " has written an awesome article about " ++ article \end{code} \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End: