with TEX and LATEX

Alan Hoenig 17 Bay Avenue Huntington, NY 11743 [email protected]

(This presentation appears in a considerably ex- TEX in the public domain. The logo ‘TEX’ is related panded form as chapter 1 of my book TEX Unbound: to the Greek root ‘τχ’ from whence come words LATEXandTEX Strategies for Fonts, Graphics, and like ‘technology’. If pronounced properly, the face More published just this year by the Oxford of your listener may become slightly moist (but no University Press.) one complains if you say ‘tek’). By typesetting, we mean the ability to place el- The purpose of this survey is to acquaint read- ements of a document on a page according to gen- ers with the aspects of the TEX cycle necessary to erally accepted principles which most people seem produce handsome papers and books. This presen- to agree look best and make it easiest to read and tation should not be regarded as a be-all-and-end- comprehend the document. It’s surprisingly diffi- all tutorial, since (like many other mature and so- cult to do that — a typesetter has to decide how phisticated software systems) lengthy books are not best to break paragraphs into lines, how to hyphen- enough to do full justice to it. ate words, how to leave space for footnotes, how to prepare indexes and the other detritus of scholarly The TEX production cycle publishing, and provide the optimum space between Why is ‘typesetting’ not the same thing as ‘word elements on the page (among many other things). processing’? Typically, a word processor allows edit- The spacing issue is particularly critical for techni- ing of the document, but in its impatience to display cal documents. Formulas make extensive use of ar- the results immediately onscreen (most word proces- cane symbols which have different appearances and sors are aggressively wysiwyg in behavior), certain spacing depending on context. Consider, for exam- niceties are sacrificed. These niceties — fine control ple, how the placement and spacing of the ordinary of spacing, word placement, hyphenation, and so numeral ‘2’ changes in forth — are never ignored in TEX. 2 x2 2xx e− It’s useful to consider the TEX production cycle and how the spacing surrounding minus sign changes by comparing it with that of word processors. In a in word processor, the program assists you in preparing x y and x + y the document, after which it is printed. TEX relies − − on three steps. Other symbols may change depending upon whether the equation appears in text ‘ xdx’ or display 1. We use a text editor to prepare the source docu- mode: ment — the document file which consists of the R text and data of your document together with xdx. the TEX formatting commands. Let’s suppose Furthermore, if a computerZ system is going to con- this file is called myfile.. trol the typesetting, we expect more of it than from 2. We run myfile.tex through the T X program. a mere human. We may expect, for example, to be E If all goes well, this generates a file in which the able to label an equation in some logical way and typesetting commands are made explicit using then refer to it later by this label in our source doc- a generic printer description language indepen- ument. It would be up to the typesetter to resolve dent of any particular printer; it is device inde- these labels and references and replace the labels by pendent.TX names this file myfile.dvi.Just properly formatted label numbers. E like a computer program source file with syn- The T X system has been freely available since E tax errors, if there are any errors, we return to the mid-80s or so and accomplishes all of the above step 1 and correct them before continuing. tasks (and more) in a particularly effective manner. TEX is the creation of Donald E. Knuth of Stanford 3. Finally, we need the assistance of a special de- University, who has placed all the source code for vice driver customized to the printer. It’s the

TEXNorthEast Conference, March 22 – 24, 1998 168 TUGboat, Volume 19 (1998), No. 2 169

driver’s task to translate the generic dvi com- see, LATEXisthesameasTEX, so these procedures mands into the form the printer understands. follow for a LATEX document as well. The advantages of creating a .dvi file are that 1. Use a text editor to create the source document we can print the document on any printer (at least, for subsequent processing by TEX. The source any printer for which device drivers exist) and rest document is the document file — text and type- assured that the output is identical on each device setting commands. Take care not to use a word (except for raster resolution). processor. These programs aim to do the for- matting themselves, and tend to do so by insert- Macros; logical document design ing non-Ascii characters into the document file. TEX has been called an assembly language for type- Quite apart from the fact that TEX(orLATEX) setting. This means that there are plenty of primi- needs no help with the typesetting, these binary tive commands to control fine points, but these com- characters will only confuse TEX. (If it is neces- mands may not be entirely appropriate for creating sary to use a word processor, make sure to save a new section head or aligned equation. As a re- the document in some way so as not to include sult, TEX has a rich and powerful macro creation the word processing formatting information.) facility. It’s possible (as we will see later) to string 2. Run this source file through the TEX program. primitive commands and pre-existing macro com- the simplest form of the command to do that is mands together to create new, custom typesetting commands. tex myfile Remember that the T X production cycle E where the source file has the name myfile.tex. means that we prepare a source file which is fed LATEX users will use the command into TEX at a later . This plus the nature of the macros means that TEX supports the notion of tex &lplain myfile logical document design. We can embed components (Unix users may have to enter the ampersand of the document by means of tags which can be as \&.) defined or redefined depending upon context. One example suffices. Here’s a theorem. As in any compilation process, TEX may un- Theorem There is no royal road to typesetting. cover errors. (Warnings may be ignored, at Computer typesetting is a surprisingly least at this stage.) Return to step 1 to cor- complex task. rect these errors, and re-run it through TEX. This was typeset by means of inserting Repeat this process until all errors have been dealt with (or until there is enough of a docu- \theorem There ... ment to print.) in the source document. It may happen that it is The result of a successful T X compilation is more appropriate to display that theorem as E a new file with a dvi extension. In this example, Theorem There is no royal road we would have a new file myfile.dvi. to typesetting. Computer typeset- ting is a surprisingly complex task. 3. With the document in hand, it can be printed or The same command string will accomplish this pro- previewed on screen. In each case, appropriate vided that only the macro definition of \theorem device drivers are necessary to properly render needs be changed. The implications are enormous — the document on screen or on paper. we can design our document so that it will properly As we see, the TEX process is actually a con- printed for any set of particular formatting require- certed action between several programs in addition ments provided only that we change the particular to TEX — a text editor, a device driver, and a definitions of the macros. Many strategies exist for screen previewer. Many implementations of TEX facilitating this use of definitions. may merge several or all of these into one integrated module. AfirstTEX document The TEX document: input conventions The “steps” for generating a TEX document are well- defined, but there are sufficiently idiosyncratic im- Although it is not practical or possible to deal with plementations of TEX floating around so that it may all or even a completely useful subset of all TEX(or be necessary to adapt these procedures to a local LATEX) commands in this article, it is possible to adaptation. By the way, some readers may be inter- summarize the keyboard conventions that any TEX estedintheTEX dialect called ‘LATEX’; as we will typesetting must adhere to.

TEXNorthEast Conference, March 22 – 24, 1998 170 TUGboat, Volume 19 (1998), No. 2

White space. TEX normally regards all white ‘‘Oh, the selfish shell-fish---that space as equivalent, where we include carriage re- lobster mobster---tasted turns, tabs, and of course spaces in this category. best when basted west,’’ quoth Aaron Furthermore, multiple spaces are generally equiva- while reading lent to a single space. Important exception: we pages~12--33 of his cookbook. signal the end of one paragraph and the beginning of to typeset another by skipping a line in the source file; that is, we enter two hard carriage returns in a row. (But “Oh, the selfish shell-fish — that lobster mob- three or more consecutive carriage returns is still ster — tasted best when basted west,” quoth equivalent to a pair of carriage returns.) Aaron while reading pages 12 – 33 of his cookbook. Once in a while, spaces are special in that we TEX formatting instructions and commands. don’t want a line broken between two words or TEX is very good about applying default typesetting word groups. For example, in a discussion of World parameters to text, but there will be many times War I, it would look silly if a line broke between when you wish to actively control the printed ap- ‘World War’ and ‘I’; it would be too confusing to pearance of your document by issuing commands to the reader. To guarantee that the line break won’t TEX. Since the entire file must contain Ascii charac- happen at that point, we replace the space with ters only, TEX has decided to reserve the meanings the tilde character ~. If this conditional space is of certain characters to itself. The tilde ~ is one such typeset in the middle of a line, it appears as a special character. To typeset an actual tilde ˜ in the regular space. Aspiring TEX typists should develop document, you must enter a short command to do the habit of typing things like King Henry~VIII, so. Dr.~Knuth,andpages~44--55 to protect the These characters manuscript from unwarranted line breaks. Note that whereas Henry~VIII will work as advertised, \#$%^&~{} Henry ~ VIII will not. Here is one instance where have special meanings to TEX. The backslash \ users need to be careful. is TEX’s escape character — it escapes the normal meaning of the following bit of text. This character Characters. We generate most characters by sim- generally begins all of T X’s commands. For exam- ply entering the character in the source document. E ple, to typeset an ampersand &, you would type . That is, we type \& Typesetting commands for some of these symbols Oh! What a beautiful morning. are formed in the same way. (All the symbols can to get be typeset, but for some, addtional TEXexpertiseis needed.) Oh! What a beautiful morning. TEXcando`a¸c¨c´e˜nts˙. as well. If you need them, See below for exceptions to this; certain special char- check your main manual. We can get the Spanish acters need be entered in a special way. punctuation marks ¿ and ¡ by typing ?‘ and !‘. But TEX is smarter than that. Certain charac- We will discuss the special TEX characters bit ter pairs are replaced by special glyphs. For exam- by bit, but commands generally begin with the es- ple, if we type ‘‘ or ’’ we get true “quotes.” With cape character. The escape character can be fol- its special attention to details, TEX will replace cer- lowed one single non-letter, or by an arbitrary se- tain character combinations such as fi, fl,andff quence of letters, terminated by a space. Exam- by the ligatures fi, fl, and ff (provided these ligatures ples of commands from the first category include are present in the current font). \&, \1, \$,and\". Examples of the second cat- TEX does a similar thing with hyphens and egory include \TeX, \L, \noindent, \vskip,and dashes. We can type -, --,or--- to put -, –, \futurelet.NotethatTEXiscasesensitive,so or — in our documents. (And we will see later the command \TeX (which typesets the TEX logo) is that the mathematical minus sign — yet a different different from the (nonsense) commands \tex and dash — can be gotten using the hyphen character in \TEX. mathematics mode.) These rules lead to our first piece of TEXarcana. By the way, no user should ever put an explicit As part of TEX’s digestive process, it is smart line-break hyphen in a word which has to be split enough to know that when a non-letter follows an at the end of a line. TEX’s hyphenation algorithm escape character (the backslash), the command takes care of such should a word break be necessary. name consists only of a single letter. Hence, any- In summary, we type thing following that command, such as a space, is

TEXNorthEast Conference, March 22 – 24, 1998 TUGboat, Volume 19 (1998), No. 2 171

typeset as you expect. To get the sequence, ‘& &’, piler to compile TEX.) TEX was originally written type \& \&. in Pascal, and depending on how you “pretty print” The situation is subtly different when a com- the listing, it amounts to between 20,000 and 30,000 mand name follows the backslash. For now, TEX lines of code. TEX exercises all the dark corners of has no way a priori to know the length of the com- any compiler, so you need a compiler that has it- mand name. It reads your file, and terminates the self been thoroughly debugged. (There is a white command name when it encounters a space or a new lie of omission in this account. All this source code command. Consequently the space following a com- is written in WEB, so some mastery of this WEB mand is ‘eaten up’ by TEX — it serves not introduce system must be acquired.) a space into the document but rather to delimit the Do we need a special version of LATEXtomatch command. But since at other times, spaces typed in our hardware? The core LATEX files, which “sit” the document file do generate a space, it’s easy to on top of TEX, are ASCII files, and we can easily see why newcomers are easily confused. transfer ASCII files from one computer to another. Anyway, to illustrate the point, suppose you However, proper behavior of LATEX will require us to wanted to typeset ‘TEXTEX’. The way not to do it install LATEX and in that process to create a special would be by entering \TeX \TeX into the source, for binary format file for use by our computer. In gen- the interior space terminates the initial \TeX com- eral, binary files may not be transferred from one mand and is therefore eaten alive. (\TeX \TeX type- type of hardware to another (but format files are sets as TEXTEX.) Since multiple spaces count as a easy to construct). single space to TEX, the solution is not to insert ad- Next is a text editor. This was discussed earlier dtional spaces. The following list, which suggests and is necessary for preparing the document source several ways out of the impasse, also hones your be- file. ginning TEX skills. Finally there are the device driver and screen previewer.TX’s output is a file containing com- 1. Use the TEX command which explicitly gener- E ates an interword gobber of space. This control mands to typeset all the letters, rules, and special space command is \ , and so your source should symbols in the document. Unfortunately, differ- like \TeX\ \TeX if you use this method. ent printers obey distinctly different sets of such commands. Therefore, TEX employs a generic, 2. Terminate the command by inserting some no-frills, device-independent language in which to command which does not print anything. The express these commands. That’s why the output empty group {} is one such; thus, we could file from TEX has the extension dvi, to suggest type \TeX{} \TeX. device-independence. In this way, the TEX program 3. Simply surround the command in its own is relevant to virtually any hardware setup, but it group: {\TeX} \TeX is one appropriate way to does mean that we need yet another program, a do this. so-called device driver. The purpose of this pro- gram is simply to translate TEX’s generic, device A working TEXsystem independent typesetting commands into commands A complete TEX system is actually a concert be- that our particular printer understands. tween several different component pieces of hard- Everybody will want to arm themselves with ware and software. There are at least three different a screen previewer, a special-purpose device driver. but necessary pieces of software. Remember, TEXisnotwysiwyg, and we frequently First is a version of TEX for a particular com- want to see what the TEX document will look like puter and operating system. At this time, there are without going to the bother of printing it out. (This versions of TEX available for every reasonable com- may be because we share printing facilities in some puter. In the unlikely event that there isn’t, it’s computer center, or because your printer takes a possible to customize TEX by doing a reasonable long time to deliver a single page. Anyone who has amount of spade work yourself. The TEX program tried generating TEX output on a dot matrix printer is in the public domain (and in electronic form), and knows that feeling.) A video monitor is just a special all you need to do is make whatever changes (if any) purpose printing device, and it is usually a straight- are called for and recompile the TEX source code in a forward matter to write a device driver to paint the robust Pascal compiler that works on your system. image of the page on a monitor screen. (Most likely, you will translate the original Pascal It makes sense to choose hardware on the WEB source to a C source program using the freely basis of TEX software. For example, you’ll want to available web2c utility, and then use a robust C com- make really sure that the printer is one for which

TEXNorthEast Conference, March 22 – 24, 1998 172 TUGboat, Volume 19 (1998), No. 2

a device driver exists. (Or else make sure that portant macro packages, we must make sure ad- the printer is one that will emulate — imitate — a ditional utilities are part of the suite even if your supported printer. For example, there are many current plans don’t include using them. I have in laser printers for sale, each with its own protocol for mind here the Metafont program (and the MP generating printed images. There are relatively few program if possible), various TEXware utilities (of laser printer device drivers available. Among these which tftopl, vftovp and their inverses pltotf and few with support are the Hewlett-Packard laser vptovf are probably the most important), and the printers, which many other laser printers emulate Metafontware utilities. The TEX program should well. Since there are several Hewlett-Packard laser be version 3.1415 or higher, and the Metafont pro- printer drivers available, an HP-like laser printer gram should be version 2.71 or higher. may be a safe bet.) TEX also runs well on printers that understand the PostScript page description language. This Unique TEXs. Although each implementation of PostScript language is another means for creating TEX is typographically equivalent to any other, a device-independent files, because the mechanism few are worthy of special notice by virtue of some for rendering the PostScript document resides in distinguishing feature. A few of these special TEXs the printer itself. Consequently, we need a special are worthy of mention here. PostScript printer in order to take advantage of the The em-TEX software collection is especially in- PostScript technology. (That there are hundreds of teresting — it’s a complete implementation of TEX, beautiful digital PostScript fonts is another induce- Metafont,allTEXware and MFware programs, ment to use PostScript.) Special dvi-to-PostScript printer drivers, previewers, and documentation (in postprocessors translate a dvi file to a PostScript English and German) for PC-DOS and OS/2 oper- equivalent. Many such programs are available from ating systems, and it’s all free. Several executables any number of vendors. Fortunately, one of the of TEXandMetafont are provided, from “small” best, dvips by Tomas Rokicki, is freely available. to “huge” versions. (These designations refer to the speed and/or the amount of material these Getting TEX TEXs and Metafonts can process.) Eberhard Although the TEX software is “free” — within the Mattes is the man behind this prodigious effort, but public domain — it often takes work to port it to there are those who wonder if “Eberhard Mattes” a particular computer. This is true of implemen- doesn’t refer, like the fictional “Nicolas Bourbaki,” tations for the original IBM PC and for the Apple to a dedicated group of workers. In any case, Macintosh, for example. In any case, device drivers this material is all available free for downloading and screen previewers were never part of the origi- from any CTAN site, and some user groups make nal TEX package. Consequently, some firms sell their it available to their members for a nominal fee. implementations for TEX. Furthermore, there is a special em-TEXInternet An interesting recent phenomenon is the avail- list, so this is one important instance where public ability of several public domain TEX implementa- domain software does have some support. Over tions for microcomputers. One or more such im- the last several years, Mattes has proven to be a plementations exist for all kinds of personal com- conscientious developer, providing bug fixes in a puter, including IBM-type computers, Apple Mac- timely way and keeping up with the latest master intosh, Amiga, Atari, and Acorn. Some of them may source files of TEX, Metafont, and their friends. even be as good or better than commercial products. Tom Rokicki is well-known in TEX circles for Of course, when we use a public domain version, we his dvips post-processor (it converts dvi output to a are on our own. Companies have “helplines” for form suitable for rendering on a PostScript printer). users who find themselves in trouble. With rare ex- Less well known but just as impressive is TEXView, ceptions, no such lifelines exist for users of public his version of TEX for the NextStep operating sys- domain TEXs. Public domain implementations are tem. NextStep, which runs on the Intel-486 archi- available from user groups (TUG, Dante, GUT, and tecture among others, is a flavor of Unix (BSD 4.2) so on), from Internet archives, and from special TEX onto which has been grafted a very convenient win- CDROMs. dowing system. NextStep contains a version of Dis- When acquiring a TEX “package,” make sure play PostScript, which means that TEXdocuments it’s complete. In addition to the TEX executable, that incorporate PostScript graphics and PostScript the associated ancillary files TEX needs, various im- fonts may be previewed effortlessly (including color). portant input files, and the latest version of im- Because Unix is a multitasking system, an author

TEXNorthEast Conference, March 22 – 24, 1998 TUGboat, Volume 19 (1998), No. 2 173

can run a document through TEX, begin the pre- Bitmap fonts. How does the driver know these viewing process, and continue editing. One odd fea- shapes? One way to store shape information is ture has proven invaluable — the ability to measure within a collection of pixel files. Computer printers actual distances on a page with clicks of a mouse. generate their shapes by putting lots of tiny dots It’s surprising how often it is possible to fix a bug next to each other in such a way that they form in a TEX file by simply knowing how much extra patterns which our eyes resolve into letters and or missing space there is. Most of the TEXView graphs. Office laser printers, for example, are enhancements can be found incorporated into the capable of placing as many as 600 dots per inch (or web2c TEX kits for Unix platforms. (As a result more) to the left or right and up or down. Only of various corporate acquisitions, NextStep is now the dots needed to create a character are printed, called OpenStep.) and the human eye smoothes out any jaggedness as Lightning Textures, by Blue Sky Research, is a it perceives the image. Pixel files, or bitmap fonts, version of TEX for the Macintosh. Its distinguish- provide instructions as to which dots to blacken ing feature is its ability to show TEX output pro- and which to leave blank. duced simultaneously as text is keyed in. (And look There are lots of pixel files because TEX needs for its newly-arrived sibling “Synchronicity.”) The a different file for each font of “type” at each size freely available InstantTEX for NextStep (originally and at each magnification. What’s the difference by Dmitri Linde and now maintained by Gregor Hof- between the size of a font and the magnification of fleit) provides the same functionality — it’s great for a font? Type designers of old took care to slightly debugging macros. InstantTEX is freely available redesign each font of type at different sizes. Subtle from the ftp site peanuts.leo.org and others, in issues of spacing require that the proportions be- the area tween thick and thin strokes, the size of the white pub/comp/platforms/next/Text/tex/apps areas within some letters, and so on be readjusted at each size. The T Xbook makes this point early and its mirrors. The file will have a name like E on, on page 16, which shows the difference between InstantTeX.3.11d.NIHS.b.tar and there is an 10-point type and 5-point type magnified two hun- accompanying “readme” file as well. dred percent. That and the following demonstra- AucT X is not an implementation, but an E tions have members from the Computer Modern Ro- editing enhancement available to Unix users of man families. Computer Modern Roman type at a the Emacs editor. With it, Emacs becomes highly 10-pt design size (type size or just size) is referred T X-aware, making available a large number of E to as cmr10. shortcuts, command completion, automatic inden- Although T X has been designed to appreci- tation, special outlining, online documentation, the E ate this subtle difference in type sizing, many com- ability to customize (provided you can program puter typesetting systems do not. Therefore, pre- in Lisp, the language in which it is programmed), vailing electronic fonts of type construct different and a good bit more. Kresten Krab Thorup is its type sizes by taking a single font and magnifying it author, and it is available from any CTAN site. by whatever amount necessary to get the size you Inking the page want. That is, there is generally no difference be- tween type size and magnification unless you work A Neither TEXnorLTEX (nor any other macro pack- with Computer Modern types. (Recently, there are age) actually paints the page. T X simply creates a E some indications that the non-TEX world may be be- file, the dvi file, which precisely records the position ginning to perceive the importance of this distinc- of each character, rule, and other graphic element in tion. Adobe’s Multiple Master technology is one the document. Other programs take responsibility sign of this trend.) for using this information to place ink on the page. The many different font files that normally Remember, the T X program needs only to know E come with TEX often confuse users, but now we how much space is required for each character, rule, know why they are necessary. TEX does distinguish and typographic element on the page. between size and magnification, and TEX’s ability The characters of a font. It’s the province of to make this distinction calls this diversity into the device driver (or previewer, just another type of being. device driver) to deal with the characters of a digital On DOS systems (and any others that impose font. Information in the dvi file tells it where to rigid lengths on possible file names), the necessity position each character, and then the driver paints for having many different fonts at different sizes and each character where it is supposed to be. magnifications calls an intricate directory structure

TEXNorthEast Conference, March 22 – 24, 1998 174 TUGboat, Volume 19 (1998), No. 2

into being. All cmr10 fonts at any magnification a PostScript printer. Only now the file has be- have the name cmr10.pk. The magnification is dis- come device-dependent — it will print properly only tinguished by creating different directories to hold on the printer for which the bitmaps were created. pixel files with like magnifications. For fonts ren- PostScript does try to scale the bitmap image, but dered to print on a 300 dpi printer, fonts at mag- an inevitable loss of quality accompanies this oper- nification 1000 (normal size) appear in directories ation. Thus, if you plan to print the document later named something like via phototypesetter, you’ll have to regenerate the \tex\fonts\dpi300 .dvi and .ps files with the proper bitmaps. while for 120% magnification, since 360 = 1.2 300, Document files the directory will be × What do T X commands look like? T Xre- \tex\fonts\dpi360 E E serve ten characters for their own use. Otherwise, Scalable fonts and a PostScript postscript. when TEX encounters a letter or symbol such as an PostScript technology has come to dominate “A” or “9” it interprets the symbol as a command the world of computer typesetting and desktop to typeset that symbol (to typeset an uppercase A publishing. Files fully (and carefully) prepared in or the numeral 9). We call the character that alerts PostScript are device-independent and are generally TEX to an immediately following command the es- ASCII (so they can be freely transferred across com- cape character, but this character bears no relation puter platforms). “Device independence” means to the key marked “escape” or “esc” on many key- any PostScript device. (With the Level 2 enhance- boards. ment, PostScript supports some binary encoding, We issue explicit commands to TEXbymeans so such files may no longer be pure ASCII. Such of one of several hundred commands beginning with files may still be moved across platforms as Adobe the backslash, the usual escape character for TEX. took great care to ensure this.) Immediately following the backslash are one or more Since PostScript files are independent of the characters, which may be followed by additional in- printer resolution, fonts for PostScript cannot rely formation that the command needs. For example, on bitmap descriptions, which are inherently tied the command to a printer’s resolution. Each character in a Post- \noindent Script font is given by a mathematical description of the outline of that character (hence, the appel- suppresses indentation at the beginning of a para- lation ‘outline font’); this description is not depen- graph while dent on any printer resolution. Nevertheless, any \vspace{1in} raster printing device is, in the final analysis, a set of bitmap images, but it’s the job of the special Post- instructs LATEX to skip one inch of vertical space. Script printer to resolve the outline descriptions to It’s important that special reserved characters their bitmap equivalents. begin or introduce special formatting instructions, PostScript fonts are called scalable fonts be- because you never know when you might want to cause the technology scales these outline descrip- include the word “noindent” or “vspace” within the tions up or down to get different sizes. document. By the way, there are special commands TEX and PostScript technology coexist quite to typeset any of the reserved symbols, so it is pos- companionably. To render a dvi file on a Post- sible (and easy) to typeset a backslash or a dollar Script printer, the dvi file must be translated to the sign within the document. PostScript language. A variety of dvi-to-PostScript TEX contains a rich set of several hundred or converters exist for this purpose; one such, and one so commands. Although by themselves they do just of the most highly regarded, is the freely available about anything we might wish, their real strength dvips by Tomas Rokicki. (It has been compiled for flows from the ability to string commands together virtually every computer platform.) The end prod- to form new commands for special typesetting pur- uct of the translation is a series of statements in the poses. PostScript language, which are either transmitted We might create our own personal \newchapter immediately to the printer or saved to a special file command to begin a new page, skip down a third of with a ps extension. the page, center the chapter title, skip a quarter of Beware — these dvi postprocessors are savvy an inch, suppress indentation on the first paragraph, enough to embed bitmap descriptions into the out- and set the first two words of the chapter in a small put .ps file in the proper format for printing on caps font. These new commands are called macros.

TEXNorthEast Conference, March 22 – 24, 1998 TUGboat, Volume 19 (1998), No. 2 175

Creating a macro is a lot like writing a com- TEX has been able to perform certain nice things puter program. TEX possesses several commands from the beginning that some famous commercial to test conditions and perform action on the basis programs are still struggling over, and this has won of the test, to perform looping, and to handle in- the hearts of several mainstream publishers. Scien- put/output operations. Tricky macros can take a tists the world over will never relinquish TEX—how long time to write and test, but more often than else will they unambiguously capture on the page not, it’s possible to write simple macros on the fly their technical expressions? Furthermore, the many that make typesetting much easier. millions of pages of LATEXandTEX electronic man- TEX lets us place all our personal macro defini- uscript already in existence require TEX’s continued tions into a separate style file. The document would presence. contain special instructions for T Xtoreadand E Joining the T X community. T X, Meta- assimilate those macros before typesetting. Pub- E E font, and their friends form a rich set of tools. lishers, for example, could exploit this by making Many workers have spent many happy hours adapt- generic style files available to their authors while ing T X to various specialized tasks or to creating commissioning a designer to prepare a style file to E special front ends that might be just what you were implement a specialized book layout. The typeset looking for. Although the many computer networks document file remains the same, and only the macro form a platform for the communication of this news, definitions change. LAT X exploits this philosophy E the various user groups provide a more formal forum to the hilt. for the exchange of important news. Not only do the larger of these groups publish their own newsletters, Learning and joining but they often sponsor annual meetings. Although the numbers of users of TEX are (as of The TEX Users Group — TUG — is the original yet) dwarfed in magnitude by users of famous com- user group organization. Originally an offshoot of mercial products, the growth in use of TEXisas- the American Mathematical Society, it is now an tonishing. For consider this: an idiosyncratic prod- independent organization. TUG serves as a clear- uct, passed along by word of mouth, has no public- inghouse for all information on TEX, and members relations dollars behind it. The reaction of users receive the journal TUGboat, the transactions of the learning it was “free” was often the same — if it is TEX User Group. so good, why isn’t anyone selling it? Other user group organizations have since But as these words are written, it has become arisen. New user groups, particularly behind the clear that there will always be a prominent place for former Iron Curtain, are constantly being formed. TEX. Although there is widespread perception that (The attention of English-speaking readers must TEX may be difficult to use well, no desktop pub- certainly be drawn to UK TUG, whose journal lishing package is particularly easy. Furthermore, Baskerville is well worthwhile.)

TEXNorthEast Conference, March 22 – 24, 1998