An algebraic approach to address the problem of generating prettyprinters is described. An algebraic prettyprint generator is deened which produces an algebraic prettyprinter for a language given its context-free grammar. Adaptation of the generated prettyprinter is possible by customizing the generated prettyprint rules. The prettyprinter transforms the abstract syntax tree of the text to be prettyprinted into a box-language expression. This expression, the so-called box-term, is processed by a generic formatter (also algebraically speciied). The generated prettyprinter is able to deal with various forms of comments. The context-free grammar may be split into modules and, instead of generating one big pret-typrinter for such a context-free grammar, a corresponding prettyprint module is generated for each syntax module. The collection of generated modules form the prettyprinter for the speciied language. Prettyprinters for various languages have been generated. Among these are PASCAL, a simpliied version of LISP, and Action Semantics.