Drawing Trees Nicely with TeX
暂无分享,去创建一个
Various algorithms have been proposed for the difficult problem of producing aesthetically pleasing drawings of trees, see Reingold and Tilford (1981), Wetherell and Shannon (1979) but implementations only exist as ``special purpose software", designed for special environments. Therefore, many users resort to the drawing facilites available on most personal computers, but the figures obtained in this way still look ``hand-drawn"; their quality is inferior to the quality of the surrounding text that can be realized by today''s high quality text processing systems. In this paper we present an entirely new solution that integrates a tree drawing algorithm into one of the best text processing systems available. More precisely, we present a TeX macro package TreeTeX that produces a drawing of a tree from a purely logical description. Our approach has three advantages. First, labels for nodes can be handled in a reasonable way. On the one hand, the tree drawing algorithm can compute the widths of the labels and take them into account for the positioning of the nodes; on the other hand, all the textual parts of the document can be treated uniformly. Second, TreeTeX can be trivially ported to any site running TeX. Finally, modularity in the description of a tree and TeX''s macro capabilities allow for libraries of subtrees and tree classes. In addition, we have implemented an option that produces drawing which make the {\em structure\/} of the trees more obvious to the human eye, even though they may not be as aesthetically pleasing.