Very High Level 2-dimensional Graphics with T E X and XY-pic
Kristoffer H. Rose · 1997
A problem with using pictures in TE Xa ndL ATEX documents is that there is no natural universal notation encompassing all possible diagrams, flow-charts, etc.In this paper we argue why one should not attempt such generality but rather design custom embedded graphic languages for classes of similar pictures. The main argument is the usual one for markup languages: using a specialised high-level notation means that the source captures the essential properties of the picture. Not only does this make it easier for the user, who can concentrate on contents rather than form, but it also makes it easier to abstract out inessential style issues such that the “picture style” can be varied without changing the source. The main concern is that implementing a large number of such languages is only feasible with access to a versatile and powerful drawing library such that the amount of hacking required for each language is minimal. As an example we survey how one can include a small “directory tree” in a paper, and we design and implement an embedded tree drawing language useful for this purpose. We illustrate the generality of the notation by showing how the same source can be used to generate the tree and even to grow it (by animating it) following the structure information. We finally present the implementation in TEX using XY-pic to produce the actual graphics.