Conventional document preparation involving noninteractive processors is usually carried out in an unintegrated fashion. In this paper we describe an integrated environment based on a host of TEX-related processors, using the interactive text editor EMACS as its backbone. The major focus of our design is to derive a class of simple and clean abstractions which result in a generic document structure that applies across various TEX dialects. From the user's point of view, the notion of "dialects" is hidden. There are only few object types to deal with. All external programs are controlled at the editor top level and the user interface is coherent and straightforward. The resulting environment has been widely used and has proved very effective in improving user productivity.