Icons for TEX and by Donald E. Knuth, Stanford University

Macintosh users have long been accustomed to seeing their files displayed graphically in “iconic” form. I recently acquired a workstation with a window system and file management software that gave me a similar opportunity to visualize my own UNIX files; so naturally I wanted my TEX-related material to be represented by suitable icons. The purpose of this note is to present the icons I came up with, in hopes that other users might enjoy working with them and/or enhancing them.

The file manager on my new machine invokes a “classing engine,” which looks at each file’s name and/or contents to decide what kind of file it is. Every file type is then represented by a 32×32 bitmap called its icon, together with another 32×32 bitmap called its icon mask. In bit positions where the icon mask is 1, the file manager displays one of two pixel colors, called the foreground and background colors, depending on whether the icon has 1 or 0 in that position. (The foreground and background colors may be different for each file type.) In other positions of the bitmap, where the icon mask is 0, the file manager displays its own background color.

Thus, I was able to fit my TEX and files into the file manager’s scheme as soon as I designed appropriate icons and masks, once I had told the classing engine how to identify particular types of files.

For example, I decided that each file whose name ends with .tex or .mf should be iconified with the bitmaps

or ,

respectively; these are compatible with the existing scheme in which C program source and header files, identified by suffixes .c and .h, have

and

as icons. Similarly, a file named *.ltx will get the icon

.

In each case the corresponding icon mask is one that the file manager already has built in as the

Generic_Doc_glyph_mask, namely

.

The transcript files output by TEX and - provided me with a more interesting design problem. They’re both named *.log on my system, so they can’t be distinguished by file name. I decided that any file whose first 12 bytes are the ASCII characters ‘This␣is␣TeX,’ should be considered a TEX transcript, and any file that begins with ‘This␣is␣METAFONT,’ should be considered a transcript. The corresponding icons were fun to make; I based them on the illustrations Duane Bibby had drawn for the user manuals:

and .

The icon masks for transcript files are then

and , respectively.

TEX’s main output is, of course, a deviceindependent (.dvi) file, and produces generic font (gf) files. I decided to represent such files by

and ,

because they are analogous to photographic “negatives” that need to be “developed” by other software. When a gf file has been packed into a pk file, its icon will change to

.

Virtual font files are represented by an analogous

.

These file types are identifiable by the respective names *.dvi, *gf, *pk, *.vf, and they can also be identified by content: The first byte always has the numerical value 247 (octal 367 ), then the next byte is respectively 2, 131, 89, 202 (octal 002, 203, 131, 312 ) for dvi, gf, pk, or vf.

The other principal output of is a font metric file, which can be identified by the suffix .tfm in its name. I assigned the following icon and mask to such files:

and .

I do all my programming nowadays in the CWEB language [1, 2, 3, 4], hence I also accumulate lots of files of two additional types. CWEB source files are identified by the suffix .w, and CWEB change files have the suffix .ch; the corresponding icons

and

are intended to blend with the system’s existing conventions for .c and .h files, mentioned above.

What foreground colors and background colors should be assigned to these icons? I’m not sure. At the moment I have a grayscale monitor, not color, so I don’t have enough experience to recommend particular choices. Setting all the foreground colors equal to basic black (RGB values ⟨0, 0, 0⟩) has worked fine; but I don’t want all the background colors to be pure white (RGB ⟨255, 255, 255⟩). I’m tentatively using pure white for the background color of the “negative” icons (dvi, gf, pk, and vf), and off-white (RGB ⟨230, 230, 230⟩) for the background of transcript icons. The TEX and - source file icons currently have background RGB values ⟨200, 200, 255⟩, corresponding to light blue; font metric icons and L^{A}TEX source icons have background RGB values ⟨255, 200, 200⟩, light red. (I should perhaps have given source files an orange hue, more in keeping with the cover of The book.) On my grayscale monitor I had to lighten the background color assigned by the system software to C object files and to coredump files (*.o and core*); otherwise it was impossible for me to see the detail of the system icons

and .

I expect other users will need to adjust foreground and background colors to go with the decor of their own desktops.

In 1989 I had my first opportunity to work with a personal graphic workstation, and I immediately decided to make 64×64-bit icons for TEX and - —for the programs, not for the files. But I’ve always found it more convenient to run TEX and from UNIX shells, so I never have used those early icons. Here they are, still waiting for their proper raison d’être:

All of the icons shown above, except for those already present in directory /usr/openwin/share/ include/images of Sun Microsystem’s OpenWindows distribution, can be obtained via anonymous ftp from directory ~ftp/pub/tex/icons at labrea.stanford.edu on the Internet. That directory also contains a file called cetex.ascii, which can be used to install the icons into OpenWin-

dows by saying ‘ce_db_mergesystem-from_ascii
cetex.ascii’.

References

[1] CWEB public distribution, available by anonymous ftp from directory ~ftp/pub/cweb at

    labrea.stanford.edu.

[2] Silvio Levy and Donald E. Knuth, The CWEB System of Structured Documentation, Stanford Computer Science report STAN-CS-1336 (Stanford, California, October 1990), 200 pp. An up-to-date version is available online in [1].

[3] Donald E. Knuth, Literate Programming (Stanford, California: Center for the Study of Language and Information, 1992), xvi+368 pp. (CSLI Lecture Notes, no. 27.) Distributed by the University of Chicago Press.

[4] Donald E. Knuth, The Stanford GraphBase: A Platform for Combinatorial Computing (New York: ACM Press, 1993).