The Communications of the Users Group

Volume 13, Number 4, December 1992 Users Group Board of Directors Memberships and Subscriptions , Grand Wizard of m-arcanat TUGboat (ISSN 0896-3207) is published four times Malcolm Clark, President* a year plus one supplement by the rn Users Ken Dreyhaupt*, Vice President Group. As of December 1, 1992, the TUG office is Bill Woolf * , Treasurer moving from 653 North Main Street, P. 0.Box 9506, Peter Flynn*, Secretary Providence, RI 02940, U.S. A., to Balboa Building, Peter Abbott, Vice-president for UKWUG Room 307, 735 State Street, Santa Barbara, CA Bernard Gaulle, Vice-president for GUTenberg 93101, U.S.A. Roswitha Graham, Vice-President for the Nordic countries 1993 dues for individual members are as follows: Kees van der Laan, Vice-president for NTG Ordinary members: $60 Joachim Lammarsch, Vice-President for DANTE rn Students: $30 Barbara Beeton Membership in the TfjX Users Group is for the cal- Luzia Dietsche endar year, and includes all issues of TUGboat and Michael Ferguson and TUG News for the year in which member- Raymond Goucher, Founding Executive Director' ship begins or is renewed. Individual membership Yannis Haralambous is open only to named individuals, and carries with Doug Henderson it such rights and responsibilities as voting in the Alan Hoenig annual election. A membership form is provided on Anita Hoover page 000. Mimi Jett TUGboat subscriptions are available to organi- David Kellerman zations and others wishing to receive TUGboat in a Nico Poppelier name other than that of an individual. Subscription Jon Radel rates: North America $60 a year; all other countries, Christina Thiele delivery by surface mail $60, by air mail $80. , Wizard of Fontst Second-class postage paid at Providence, RI, and additional mailing offices. Postmaster: Send *member of executive committee t honorary address changes to the rn Users Group, P. 0. Box 9506, Providence, RI 02940, U.S. A. Addresses Telephone General correspondence: 805-899-4673 Institutional Membership 7&X Users Group Institutional Membership is a means of showing P. 0. Box 869 Fax continuing interest in and support for both Santa Barbara, CA 93102 [not known at press time] and the TEX Users Group. For further information, contact the TUG office. Payments: rn Users Group Electronic Mail P. 0. Box 21041 (Internet) TUGboat @ Copyright 1992, Users Group Santa Barbara, General correspondence: Permission is granted to make and distribute verbatim CA 93121-1041 TUGQMath.AMS.com copies of this publication or of individual items from this publication provided the copyright notice and this permission Parcel post, Submissions to TUGboat: notice are preserved on al! copies. delivery services: TUGboatQMath. AMS. com Permission is granted to copy and distribute modified l&X Users Group versions of this publication or of individual items from Balboa Building this publication under the conditions for verbatim copying, provided that the entire resulting derived work is distributed Room 307 under the terms of a permission notice identical to this one. 735 State Street Permission is granted to copy and distribute transla- Santa Barbara. CA 93101 tions of this publication or of individual items from this publication into another language, under the above condi- tions for modified versions, except that this permission notice !l&X is a trademark of the American Mathematical may be included in translations approved by the 7$X Users Group instead of in the original English. Society. Some individual authors may wish to retain traditional copyright rights to their own articles. Such articles can be identified by the presence of a copyright notice thereon. I do not know when the term "fine art" was invented and the breach between it and craftsmanship began to widen, but I have come to believe that it was a sorry day for both. T. M. Cleland "Progress" in the Graphic Arts (1949)

COMMUNICATIONS OF THE USERS GROUP EDITORBARBARA BEETON

VOLUME13, NUMBER4 DECEMBER1992 PROVIDENCE RHODEISLAND . U.S.A. TUGboat TUGboat Editorial Board During 1993, the communications of the 'I)$ Users Barbara Beeton, Editor Group will be published in four issues. One issue Victor Eijkhout, Associate Editor, Macros (Vol. 14, No. 3) will contain the Proceedings of the Jackie Darnrau, Associate Editor, iYm 1993 TUG Annual Meeting. Alan Hoenig, Associate Editor, Typesetting on TUGboat is distributed as a benefit of mem- Personal Computers bership to all members. See page 415 for addresses. Submissions to TUGboat are reviewed by vol- unteers and checked by the Editor before publica- tion. However, the authors are still assumed to be Other TUG Publications the experts. Questions regarding content or accu- TUG publishes the series mniques, in which have racy should therefore be directed to the authors, appeared reference materials and user manuals for with an information copy to the Editor. macro packages and w-related , as well as the Proceedings of the 1987 and 1988 Annual Submitting Items for Publication Meetings. Other publications on mnical subjects The next regular issue will be Vol. 14, No. 1; also appear from time to time. TUG is interested in considering additional deadlines for that issue will have passed by the manuscripts for publication. These might include time this issue is mailed. Deadlines for Vol. 14, manuals, instructional materials, documentation, or No. 2 are February 16, 1993, for technical items, works on any other topic that might bguseful to and March 16, 1993, for reports and similar items. the 'I)$ community in general. Provision can be Mailing dates for these two issues are scheduled for March and May. Deadlines for future issues are made for including macro packages or software in listed in the Calendar, page 530. computer-readable form. If you have any such items Manuscripts should be submitted to a member or know of any that you would like considered for of the TUGboat Editorial Board. Articles of general publication, send the information to the attention interest, those not covered by any of the editorial of the Publications Committee in care of the TUG departments listed, and all items submitted on office. magnetic media or as camera-ready copy should TUGboat Advertising and Mailing Lists be addressed to the Editor, Barbara Beeton (see address on p. 415). For information about advertising rates, publication Contributions in electronic form are encour- schedules or the purchase of TUG mailing lists, aged, via electronic mail, on magnetic tape or write or call the TUG office. diskette, or transferred directly to the American Mathematical Society's computer; contributions in Trademarks the form of camera copy are also accepted. The Many trademarked names appear in the pages of TUGboat "style files", for use with either plain TUGboat. If there is any question about whether QX or Urn, are available "on all good archives". For authors have no access to a network, they 3, name is or is not a trademark, prudence dictates that it should be treated as if it is. The following will be sent on request; please specify which is preferred. For instructions, write or call the TUG list of trademarks which appear in this issue may office. not be complete. APS p5 is a trademark of Autologic, Inc. An address has been set up on the AMS com- puter for receipt of contributions sent via electronic DOS and MS/DOS are trademarks of Corporation mail: TUGboatQMath.AMS. corn on the Internet. METAFONT is a trademark of Addison-Wesley Inc. Reviewers PC 'I)$ is a registered trademark of Personal w. Inc. Additional reviewers are needed, to assist in check- PostScript is a trademark of Adobe Systems, Inc. ing new articles for completeness, accuracy, and 'I)$ and AMS-~are trademarks of the American presentation. Volunteers are invited to submit Mathematical Society. their names and interests for consideration; write to Textures is a trademark of Blue Sky Research. TUGboatQMath.AMS .corn or to the Editor, Barbara is a registered trademark of UNIX Systems Beeton (see address on p. 415). Laboratories, Inc. TUGboat, Volume 13 (1992), No. 4

decisions which develop. It has been an essential General Delivery part of the UTm3 project to inform the rest of the world of their progress and current thinking. This places an additional burden on the key personnel The back benches beckon in the project, but since Urn users will be among the beneficiaries of the project, they must be kept Malcolm Clark informed. The same sort of argument must be true It might be appropriate to use this last opportunity for any other projects which may have far reaching to write as the President of the group to review the effects on the w using community. past year and produce a 'state of the nation' report. Each year brings a few new user groups: the Rather than do this, I will simply present a brief national and language-based groups tend to attract mosaic of themes which reflect some of my current most interest and attention, but we should not concerns. forget the many small 'local' groups which are I have always held the view that the TEX Users around. This summer I had the pleasure of Group is an international group. A cursory glance meeting many of the Santa Barbara User Group. at the membership list reveals many members in Stimulated by meeting these enthusiastic and able many countries. And this is not just because people, Chris Rowley and I are seeking to initiate of the use of english as the lingua franca of the the West Hampstead 7&X group here in London. scientific and scholarly world. It is also because There is surely scope for many more! At a rather TUG is at the heart of a wide range of m-related larger scale, I recently attended a conference in activities (as usual, I use Tl-jX as a shorthand L'viv in Ukraine which ended by recommending for all the other bits and pieces which cluster that a Ukrainian User Group be founded. TUG is round m). Therefore to site the next annual commited to assisting groups at all scales, but it is meeting in Britain (a small European offshore clear that there is no one model of assistance: it island between continental America and continental may range from the purely symbolic to the practical Europe) seems most appropriate. It simultaneously and substantial. reflects the international nature of TEX and TUG, By the time this is published, the new Executive while acknowledging the great strides made within Director will have been appointed, and my successor Europe in the formation of a large number of user will be known. On these two people hinges a great groups, whose combined membership might rival deal. But not on them solely. An individual TUG'S international membership. has only a small influence on TUG. All the But there is more. It is especially noticeable membership influences the way and direction in that a sizeable amount of w activity revolves which we are headed. Don't expect either of these around electronic communication. True, the major- two to be a magic bullet which will solve all ills ity of TUG members and w users do not have (nor will future successes be theirs alone). We straightforward (far less 'free') electronic access, but all have a part to play. I am acutely conscious the activity generated by the privileged minority that the stability and smooth(er) development over probably represents the bulk of development work the last year or so has been aided conspicuously going on at present. Aston University will be the by a number of people. While it is invidious to host of the TUG meeting. Aston provides the single out individuals, I will do so nevertheless. I largest repository of w material: it aggressively was ably supported by the other members of the tracks down and installs style files, macro packages, Executive Committee, Bill Woolf, Ken Dreyhaupt public domain implementations for a wide variety and Peter Flynn; I am keenly aware of the support of platforms, and all the other paraphernalia of the given myself, the Executive Committee, the Board, m-wise. Its recent announcement of a gopher and the membership by Ron Whitney, the retiring service should simplify use of the archive. Just Business Manager. These four people helped to another good reason for choosing Aston. make my TUG life so much easier and productive. I The ease and facility of listservers and other am confident that a similar relationship will develop forms of electronic communication sometimes fools in the future. And naturally there are many us into believing that it is enough to create a other individuals, some on the Board, some who list and subscribe to it. Since this ignores the I have met at conferences, and some with whom majority of TUG members (and users) we I have corresponded by email, who have all gone must be very wary of the conclusions and any on to make my life as President of TUG rather interesting. I'm reminded of an announcement in 418 TUGboat, Volume 13 (1992), No. 4

The Times where someone wished all of his friends in-house computer at AMS. The next piece of Don's and colleagues a Merry Christmas, 'except one'. writing published by the AMS was "Mathematical But I could hardly be so uncharitable, or wish to Typography",* the lecture that introduced to be. the world at large. Some more glimpses of the past appear on the o Malcolm Clark following pages, in the transcription of a conversa- Information Resource Services tion between Don and Roswitha Graham, president Polytechnic of Central London 115 New Cavendish Street of the Nordic rn Users Group. London W1M 8JS, England UK . and the future Janet: malcolmc@uk. ac .pcl. sun Although Don announced in these pages that his work on is complete, many users are concerned that there are things that cannot do, that are nonetheless desirable and consistent with the prac- tice of fine typography. Discussions are proceeding in several electronic discussion lists and at meetings of W users whenever they occur. The importance Editorial Comments of this topic is such that the column dedicated to Barbara Beeton "future" topics, Dreamboat, has been moved from its former location near the end of TUGboat issues '&X: the past . . . to a more prominent location immediately following From time to time, bits of trivia related to W's this introductory section. history come to light. The most recent is a copy Two articles in this column deal with the state of a letter that Don Knuth found in his files and of m and possibilities for the future. The first, forwarded to me with the comment that it was by Dick Palais (whom old-timers will remember as "written 2.5 years before I began working on m!!" the founding chairman of TUG), gives a perspective Dated November 7, 1974, it is addressed to colored by tradition and personal acquaintance with Dr. Daniel Shanks of the Naval Ship Research and Don and the Stanford 'l&X project. The other is Development Center, Bethesda, Maryland; Shanks by Phil Taylor, who, while by no means a !QX was at that time a member of the editorial board newcomer, was introduced to 'I)$ far from its point of the journal Mathematics of Computation. The of origin and approaches the matter from quite a letter states, in part, different direction. Both Dick and Phil are faithful to Don's exhor- I would like to record my great disappointment in tation to create "masterpieces of the publishing art'! the quality of the new typography in Mathematics If their methods differ, it is because their experience of Computation. I know that the change was caused differs; I have never met two users who have by economic concerns, but I don't understand why learned it in the same way, or even the same parts we can't achieve in the 1970's what was routinely done in the 1870's. The type is unattractive; of it, and it has long since ceased to surprise me the spacing between letters of a word is jerky and when I learn something new about rn from even a not conducive to smooth reading; a lot of the letters new practitioner. The discussion is interesting, and look slightly too large or too small. Although the Phil's article includes instructions on how to listen right margin is ragged (and I don't mind this in or join it. especially), many of the words are noticeably Another article (p. 510) solicits volunteers for crowded together as if some margin alignment is tasks associated with the implementation of IPW3. being done anyway. This unattractive appearance This important project, when complete, should will certainly discourage me from submitting any provide a W environment even more attractive to further papers to MOC, at least until all the other new users than the present IPW, as well as flexible journals have deteriorated to the same level. methods for implementing the requirements of book The October 1974 issue of Math. of Comp. was and journal designers, features much desired by the fist set in "cold type" -by a sophisticated typewriter. That method continued in use up to the first issue of 1981, when a switch was made to a composition system (not yet 7&X) running on an * Bulletin Amer. Math. Soc. (N.S.) 1 (March 1979), 337-372 TUGboat, Volume 13 (1992), No. 4 419 anyone working in a production environment. Your it depends) -which optimizes text in such a way participation is encouraged. as to achieve nearly equal word spacing throughout each paragraph, using several interesting techniques TUG: the present that I believe are of interest to readers of TUGboat. The first technique should be familiar already: TUG is going through some changes. paragraph-wide line breaking; this is, of course, the Sometime very soon after I write this, the technique used in and though Karow didn't TUG office will be moving from Providence to m, mention it during his talk, when I asked if the Santa Barbara. A new Executive Director, Pat source were Knuth's algorithm his answer was "Of Monohon, will be taking charge. For much of the course!" past year, Pat has been in charge of a group of The second technique depends on specially volunteers who have been copying and distributing designed to lengthen or shorten lines to the public domain TEX packages that are available approach the target measure. For selected letters from TUG. So she has already begun to become multiple shapes of differing widths are provided; familiar with some of the functions that are part of typically these are letters that occur relatively the TUG office duties. We wish her well. frequently (e.g. "en) or have shapes that can by a I would also like to take this opportunity to small change have a significant effect on line length recognize everyone who has worked so diligently (e.g. "m"). in the Providence TUG office: Karen Butler, Cliff A third technique can be called "intelligent Alper, Teresa Pires, Kathy Sheely. They have been "; this consists in applying only positive unstintingly helpful whenever I've had questions, kerning to lines that are shorter than the target and I shall miss working with them. And I'm length, and only negative kerning to lines that are not forgetting Ron Whitney -his contribution to longer. making my job easier has been greater than I can There are two more components to the package. say; in addition to managing the office, he has The typographic quality of the resulting text is most continued to respond to my requests for assistance impressive. The paper will be published elsewhere, with the TUGboat styles, and the credit for their but I have asked, and expect to receive permission, reliability and ease of use in production is mainly to reprint it here in a future issue. his. Thank you all! Not only is the office undergoing a transition- o Barbara Beeton the elected management will be changing too. As American Mathematical Society already announced in and TUG News, no one P. 0. Box 6248 stepped forward to stand for election as TUG Providence, RI 02940 president, so the Executive Committee has studied USA the Bylaws for guidance in this situation. There bnbQMath.AMS.com will be a new president for a term beginning on January 1; the specifics will be announced in the next issue of TTN. Please remember that this is your organization, and its success depends on you. Let's all of us, every TUG member, pull together and give our new representatives the support they deserve. An Interview with Donald Knuth

New ideas in typography In November 1991, Donald Knuth was one of a select group honored by appointments to Honorary Earlier this fall I attended the Goudy Award Sympo- Doctorates by the Royal Institute of Technology sium at the Rochester Institute of Technology. This (KTH), Stockholm (see TUGboat 13, no. 2, p. 134). annual event, named for the esteemed American ty- After his installation, he participated in a meeting pographer, honors an outstanding type practitioner of the Nordic Users Group, where he responded with an award and a program of talks about type to questions from the audience. He also spent some and typographers. time talking informally with Roswitha Graham, the One of the speakers this year was Peter Karow, president of the Nordic group. These discussions of URW, . His talk described a new were recorded, and edited transcriptions appear typesetting program-the hz-Programm (named here with the permission of the participants. for Hermann Zapf, who designed the fonts on which 420 TUGboat, Volume 13 (1992), No. 4

Don also spent some time relaxing at the Gra- remember the name of it now, but I remember hams' country house on an island in the archipelago it had a green cover and it was a nice booklet outside the Stockholm harbor. A helpful spider about 40 pages long-a mathematical report. [It provided an appropriate setting for the author of was Non-linear Inverse Problems by Gerd Ericksson WEB. (1983), 46 pp.; see "wincunabula," TUGboat 5, no. 1 (May 1984), 4-11. -.] So some of the very first extensive uses of w happened right at this institution. That makes me especially pleased to be here. At the end of my courses at Stanford, I usually reserve the last day of class for a session we call "All questions answered," and I volunteer to answer questions on any subject whatsoever except religion or politics. And in recent years I've also excluded questions about Volume 4 of The Art of Computer Programming. [laughter] But today this looks like a very friendly audience, and I don't even mind if you have questions about Volume 4 of The Art of Computer Programming. So ask any questions whatsoever, go ahead. (Including politics.) Question: I have a question about Chinese char- acters used with 'l&X. DEK: Well, I don't know too much, but 1'11 tell you what I do know. One of the first scientific visitors from the People's Republic of China to the United States was Dong YunMei, who came to work with me and designed a system called Question and answer session at the Nordic LCCD, Language for Chinese Character Definition; group meeting he wrote a Stanford Computer Science report about Donald Knuth (DEK): I would like to say a big that work. It was inspired by METAFONT, but "Thank you" to Roswitha, and to the School of he had special graphical primitives in there so Computer Science and Department of Mathematics, that LCCD could do things that were especially for making my visit here possible and arranging important in Chinese for positioning radicals and everything. Also, I'm glad to be back here-I so on. It was a language that wasn't based on, wanted to say that rn owes a lot to the Nordic but was similar to METAFONT; he implemented it countries and to Sweden in particular. entirely himself. In the second edition of Volume 2 I guess I never mentioned this in print, but of The Art of Computer Programming (which was when I designed W,I chose three examples published in 1981, and was the first real use of of mathematical typesetting that I considered as 'l&X78), we used LCCD to typeset the Chinese standards of excellence, and I studied those three names in the index. Then Dong went back to very carefully. I scanned them digitally -in those China, and now he heads a group at the Institute days we used a TV camera-and made a lot of for Software Technology in Beijing. That group careful measurements. One of the three was a has, of course, done a lot toward extending his work volume of Acta Mathematica, printed in Stockholm since those early days. They now have a language about 1910. The second, in case you're wondering, called SP for typesetting Chinese and arbitrary was from the Netherlands in 1950, the mathematical Western texts; it was mentioned in the proceedings section of their Academy of Science proceedings; the of the IFIP Congress, 1989, held in San Francisco; third was Addison-Wesley's house style as used in there's a brief, 5-6 page report about what is The Art of Computer Programming, when math going on in computer research in China, and this composition was still done by hand. is one of the projects mentioned. When he was at Also, here at KTH you had one of the first four Stanford, he spelled his name "Tung"; now he spells Alphatype machines running my original software. it "Dong", but it's still pronounced "Doong" . He's I received a copy of an early publication-I don't a very fine man. The most exciting thing for me is TUGboat, Volume 13 (1992), No. 4 421 that he's now directing a big project to use literate also had what they call a "Long" style or something programming for Chinese, so they have a good way like that. So they were getting three styles, and the to document their programs, like the WEB system design was a true meta-font in that sense. Their for documentation. This system, called CDP, work was quite exciting to me, but as far as I know combines the C programming language with the SP no one has pursued it; it was done by university typesetting language. They also have an ongoing researchers, who assume that when they're done, project for drawing Chinese characters electronically industry will march in and take over, but that with a kind of metalanguage. However, I don't think didn't happen. I don't think there were any flaws in they're anywhere near doing all the characters that the research; I think it's just a matter of somebody way. That part of his group's activity seems to be picking up the idea and matched it with the right more of a research project than a real production group. project. On the other hand, Gu is now working for There was another visitor from China at the Ikarus, and is about to finish a massive conversion same time, 1980-Mr. Ma, who worked at the of Chinese characters into Ikarus format, then into Mathematics Department of the University of Bei- Postscript with "hints"; this represents the entire jing. He had some pretty good Chinese fonts at set of all known Chinese characters -more than that time, which we could use on our laser printers. 50,000 but less than 60,000. He was visiting Adobe, But that's all old stuff. so I happened to meet him a month ago when he Just three weeks ago, I had a chance to meet came to California. His Ikarus descriptions won't Mr. Gu Guoan again. He's from Shanghai and now be a meta-font, since they represent only one style. working for Ikarus, so he is affiliated with Peter But he has access to the very best fonts, because Karow in Hamburg. Gu is the head of the Ikarus the Shanghai Printing Company has these in the bureau in Shanghai. He originally came to Stanford form of photographic masters. from the Shanghai Printing Company, which is the largest printing company in China, shortly after Dong and Ma had returned to China. Gu wrote Conversation with Roswitha Graham a paper with John Hobby that is mentioned in The METRFONTbook, describing about a META- Roswitha Graham (RG): Was anything new FONT system for Chinese characters. That paper brought to you at the Nordic meeting, anything [TUGboat 5, no. 2 (1984), 119-136-ed.] was that you didn't expect to be there, as you listened published as a Stanford Report and has lots of to Frank [Mittelbach] and Yannis [Haralambous]? illustrations. They designed a system that did DEK: As I said earlier, I was very impressed by about a hundred test characters, all programmed in the quality of the work that they're doing. I knew terms of 19 basic strokes. One of the basic strokes, Frank's work before, because I'd talked to him at for instance, is [draws on blackboard]. But they length when he came to Stanford. He had very add a lot of parameters to it, so that it can appear penetrating insights into the whole program and in many different proportions. Then they have has found many of the most subtle bugs in another basic stroke that looks something like this m. Also I know that he has this great commitment [more drawing]; you can have it tipped in different to quality publishing where he really wants to go ways, and you can control exactly how much of a a level beyond what I had ever conceived that I teardrop you have, and so on. So you have nineteen could do. So the proposals that he's made for of these basic strokes, all done with parameters. going into even finer-than-fine quality printing, I Then you design the hundred Chinese characters by know he comes from the right spirit. He might saying "do stroke number 1 in this position, and discover, as I did, that when you make some things stroke number 2 in another position." The almost better, other things get worse, and so finally you incredible thing about their system was that you have to find a balance. But he might find a way could redesign the nineteen primitive subroutines to make everything better. So it's very inspiring and get completely different styles, still looking to me to see the time that he puts into this and like real typefaces; so you could get Chinese in the vision that he has for making further advances. bold style, and you could get Chinese in the Ming Also, an international perspective is important - Dynasty style, from the exact same descriptions people with different backgrounds from my own can of the hundred characters, just by changing the obviously contribute things to that I couldn't nineteen subroutines. Their article presented a kind do myself; I'm only one person. of sans as well as a seriffed version, and they 422 TUGboat, Volume 13 (1992)' No. 4

Then I met Yannis for the first time. His DEK: Well, as far as I know it's the best existing work.. . , that was the biggest surprise for me, to system to control things like paragraphing while see how much he has achieved singlehandedly, doing dealing with many languages with respect to hy- things that I thought would need half a dozen or phenation and so on. But certainly I never thought ten people to do, because of his background in that W would be the last word. In fact, one thing many languages. Again, he has this great love hasn't happened that I was expecting: When people for quality and love for preserving the beauty of were faced with special kinds of publishing projects, "the good old days" in printing (where sometimes I was assuming that they would just make their modern progress has taken steps backward). It was own version of instead of trying to use rn certainly exciting for me to see the care that he is as it is. For example, if someone wanted to come taking to make keyboarding of so many kinds of up with a new edition of the Bible, I was really text reasonable. When I was working on TEX, I expecting them to use some WEB change files, hiring wouldn't have dared to dream that it would become a programmer who would be able to give them new so easy to use the system in connection with Hebrew features adapted to their project. You know, if with vowel points, as well as Greek with all the you are going to produce an ArabicjEnglish dic- breathings, and Ethiopian and Urdu and Arabic tionary, or something like that, you'll want special and many of these other things. capabilities. I never expected TEX itself to be a general tool for all these purposes. Now I find that RG: Will you try this when you come home? people are close enough to being able to do most DEK: Well no, my life is too short. There are so of these things, that hardly anybody is actually many things that I could love very much spending changing the WEB code. Instead, they've found that my life doing-I could spend a lifetime doing fonts; they could do almost everything they want with I could spend a lifetime playing with color; I could standard 'I&$.Yannis found a way.. . I said, are spend a lifetime doing many languages. But I've you worried that I have only 256 characters in the already decided that the rest of my life is going to font when you're dealing with Greek? (The first be The Art of Computer Programming. That's at fonts of Greek that were developed in Europe, in least a twenty-year job, so I can't take any time off the Netherlands, had some six hundred characters to do anything else from now on. including a huge number of ligatures.) But he RG: I meant actually if you are going to try, not if assured me that he's not at all worried about this you are going to work with it.. .just play with it? restriction. He doesn't find the existing system problematical. DEK: I usually allow myself one or two days a Now I see here the report from Chinese m, year to play with some toy, so it's quite possible and it's got chemical formulas as well as Chinese that I'll do that, one of these years. and mathematics, done with a preprocessor. Of RG: Did you get some mail from Beijing? We just course, to do some of these things you can't expect got mail from Beijing, what this Chinese fellow had macros would handle everything the easiest way. done. He had done some preprocessing. My goal was to build an engine that would be versatile, that would be very good at balancing DEK: Yes, that's thrilling for me too. People all texts and able to do hyphenation in a variety of around the world feel the same need for quality languages, and so on, and I was hoping that it publishing that I had for mathematics publishing. would facilitate printing the languages of people all So when I see people putting a lot of spare time over the world -and now here it is! into the work, I know that this is rewarding to Since Professor Romanovskii is with us today, them, and to many people afterwards having the I'm reminded also of recent developments in Russia. fruit of their work. That's why it's exciting to me, We all know that when people do some work of course, to have helped make this possible. I now they're proud of, they also want to make it look see many publications where the authors were just like something they're proud of. In America, I inspired to create a fine book that they would never couldn't write a book that I thought was going have begun if they hadn't had the power to do it to be produced by a printer who wouldn't do it themselves, and they needed something like W or well. In the Soviet Union, when it was government METAFONT in order to be able to do it at all. policy not to have easy access to Xerox machines RG: Could 'TpX be an ideal program to communi- or laser printers, the policy was holding everybody cate between different languages? Do you think it back from being able to communicate their best could be used in that way as well? work. So it's also a big hope of mine th& a new TUGboat, Volume 13 (1992), No. 4 423

. . . freedom isn't the right word for it, I guess pages of it, a beautiful job. They claim they are I mean an ability to communicate to the world enjoying their prison life because of m. What community in mathematics . . . will lead to a great could be nicer? flourishing of new Russian books. So much Soviet RG: That's a point of view I never thought of, mathematics I've seen had to be condensed into a actually. I find it great that you have given to the few pages. I'm sure the authors were just as proud world something that is free of charge and it's a of their results as we are-deservedly even more challenge for everyone who wants to communicate. proud-but just had no way to let it out. It's the If the possibility is given, I think it's wonderful same with computer programs as with mathematics. there is something like this. I find it amazing that Computer programs need to be communicated, to so many people have put in so many working hours be read by people. without ever asking any labor union about it. The communication factor is the real, to me the most important reason why so many changes DEK: It was part of my original thinking that began to happen in the Soviet Union. The rest should not be competing with a labor union, or even of the world was improving its communications with other people's egos. In other words, I knew rapidly, while in the Soviet Union, computers were that if I had been working at Bell Laboratories, used mostly for numerical calculations and couldn't for example, I could never do anything that would be used extensively for word processing; it was compete with , because that would be not too much against the policy of the government. respectful to the other people there who had put So this need for communication, also for beautiful years and years into it. To me, troff had proved communication, is something that I had long wished that the whole idea of something like TEX was for in every part of the world, but especially in the possible, and therefore it was a good idea to start Soviet Union. Jill can tell you about times when over from scratch and think over how to do it if I would play Tchaikovsky on the piano, with tears you were starting over. Well, it's impossible to do in my eyes because I was thinking how beautiful such things in an existing organization. Similarly, this music is, but how I wished that my friends in if I hadn't done m for mathematics, if I had had Russia could be doing some of the other things that as my first goal to do newspapers, or the yellow I was doing. pages, or something that counts for the majority Communication between machines has become of publications in the world, then (if successful) I the real reason for computers in most of the world. would have been putting a lot of other people out of China faces the same problem; they can never reach work and making them angry at me. I didn't want modern levels of technology until all limitations are to do that. So I was happy to be creating a tool for removed fiom their communication networks. mathematics; it seemed to me that nobody in the world enjoyed typesetting mathematics. Good -I RG: What difference is there between the Japanese wasn't going to offend anybody. This was 2 strong way of doing TEX and the Chinese way? component of my thinking as I wrote W. Well, it DEK: I'm not familiar with it, but in both cases turned out there was one person who was offended, they seem to be getting quality. So I'm happy, as and he complained at one of the TUG meetings; long as the output looks great. this man from Science Typographers had spent a lot I get completely unexpected mail every once in of his time making a commercial system, which is a while. Did I tell you the story about Italy? I still used. He keeps improving it, and it's excellent. guess not. The mbook has been translated not There's absolutely no reason to question the quality only into Japanese, but also into Italian (though of the journals his company typesets, in any way. not yet published in Italian). The people who But he did complain, and that made me feel bad, did the translation are actually prisoners, political because I didn't think I was going to make anybody prisoners thrown into jail in the '70's because they unhappy by doing m. were liberal activists. But they're in a minimum Another thrill at this Nordic meeting was to security prison, so they're supposed to work for learn that TEX will soon be used to typeset the their living. This one group decided that their job journal Acta Mathernatica. The main reason it's was going to be to typeset mathematics with exciting to me is that a circle is being closed: Acta for the Italian Mathematical Society; so they did Mathernatica was one of my first models for quality this. They sent me a letter explaining how they're when I designed m. As I said at the meeting, prisoners, and they enclosed a laser-printed copy I had selected three standards of excellence that I of the entire mbook translated into Italian, 500 did a lot of measurements on, hoping to be able to 424 TUGboat, Volume 13 (1992), No. 4 match their quality. Acta Mathematica, in 1910, But you still need, if you are to get the highest was the mathematics journal that had the best quality, to have copy editors review everything and budget in the world at the time, and they did a make sure you have the right style of quotation very good job; so I had looked at it very closely marks, for example. Every academic discipline has in 1977. Now comes the surprise: Right after the its own problems and every standard reference work TFJ meeting, I ran into Jan Michael [Rynning] at can use typography in ways that make the reference the Institute talking to people about how to do work more effective but also is specific to that book. Acta Mathematica with m! The decision has So every book is a new challenge. The advantage of apparently been made now. Not only that, but 7&X is that it's able to be adapted to these different Leif Andersson showed at the Nordic TUG meeting challenges; it doesn't put everything into a single that he understood all the intricacies of making new format. On the other hand you could also consider mathematics fonts for TFJ. So it should be possible that a disadvantage. to do Acta Mathematica in the fonts that you had Suppose you were allowed to rewrite all the in 1910 as well. world's literature; should you try to put it all into the same format? I doubt it. I tend to think such RG: Did they agree to? unification is a dream that's not going to work. DEK: Who knows, but he could certainly do it. Authors have adapted themselves to the medium The expertise exists in Sweden to make this possible. that they are using at the time, and if we're going I tried to design TFJ so that people who to understand the authors' intentions, we should see would be spending a lot of time working with it something close to that medium. The medium of would still find their job pleasurable. Suppose they the future may be some other sort of standard for have to deal with 7&X many hours of every day international communication; whatever the future for years and years. I tried to make it so that brings, people can use that method. Authors will they would still find this a pleasant job, because express themselves best in the medium they are they could keep discovering new constructions that using for creation. Authors using TFJ now can. would be somehow fun or beautiful or satisfying, for example, write a different kind of mathematical in amongst all the other things they have to fight paper than they did ten years ago, because they in order to cope with unusual constructions that know they can choose a notation that isn't going always come up in printing. My hope was that to be misunderstood by a typesetter who knows no people could continue to find yet more elegant ways mathematics. So I can write a more effective tech- to solve certain problems, and enjoy the process. nical paper if I know that I can make the diagrams The number of people around the world who are correct -I can put in different kinds of diagrams putting in this extra effort seems to indicate that and tables than I would have dared to if I was the language is working in this respect as I had going through other people who didn't understand hoped. my intentions. Things that were written 20 years ago were written in a style that was optimized for RG: Just being interested in people communicating older technology. Movies are analogous: People . . . , because I am visualizing that it will be possible who made silent films chose different scenes than to have this text in a mail and it could even be they would in a sound film, but their work was translated by the language. effective as a silent movie. And you can't just take DEK: Oh yes, we could build it into fax machines a movie that's black and white and colorize it and and so on. I hope that in January I will see the get the same effect. It's the same thing with older absolute last bug in m, and somebody can make texts as well as texts for special purposes and other a chip so that it will be easy to have 7&X inside any languages. So this idea of a standard format is only machine! something for the future, not for the past. The American Math Society is making RG: You can't leave the field! You'll follow up in source available now; the Math Reviews are avail- some way what's happening with 7&X, even if you able in 'QjX form going back fifteen years or so, and now are going to devote your time to something they continue to extend this so that mathematicians else, you cannot let it go. You have spent so much can look for an article on a certain topic and can see time.. . Is it a hate/love, or is it only love? it typeset on the screen. And this is something that could certainly work for all sorts of complicated DEK: Well, it's hate when I learn that I made yet applications. another error. I just got a message in the mail saying that if somebody sets the math unit to a TUGboat, Volume 13 (1992), No. 4 negative value-which nobody in their right mind decided to append a short addendum, mentioning a few would ever do, but if they do-apparently 'IjjX of the more important points made in these replies. goes crazy. So I have to fix that, Ugh. What I love is when excellent new publications come out that I know wouldn't have been done at This is going to be more a "position paper" than all without w, and also when I see people - as I a simple message. I have been following the NTS-L said, Frank and Yannis-spending a considerable mail list discussion with considerable interest and part of their lives doing work that has very high finally felt that there were so many issues that quality. They are excited just by the chance of I wanted to address and remarks that I wanted improving the quality of publication. Those are the either to agree with or to dispute, that only a things that make me happy. fairly extensive reply would do. Here is a table of contents: RG: Thank you very much. Section 1: Introduction Section 2: The Many Faces of l&X Section 3: A "Standards" Approach to Solving Portability Problems Section 4: The Matter of Compatibility Section 5: TjjX as a Front End Dreamboat Section 6: m as a Programming Language Section 7: Changing the Fixed Point Section 8: Summary Moving a Fixed Point Section 9: Postscript Richard Palais Introduction Abstract First a short personal introduction. The oldtimers In the past few years there has been increasing discus- of the T@ world will perhaps remember me-I sion of the question LLHasthe time has come to make was the founding chairman of TUG, worked closely basic changes to the inner workings of w?".In late with Don Knuth during the early years of w,and May of 1992, Rainer Schoepf set up a mailing list on I wrote a column on mathematical typesetting in the Internet, called LLNTS-L1l,to discuss the matter. I started out being completely opposed to the idea of the Notices of the AMS for three years, with the even the slightest changes to the m code, feeling goal of easing the transition in the mathematical that whatever failings 'QX might have, they are best community from the typewriter, along WYSIWYG approached by pre and post processing ("front and road, and into the bright new Promised Land of back ends"), and anyway are negligible compared to m. But my name may well be unfamiliar to more the danger of losing the remarkable coherence and in- recent arrivals in the w world, for lately I have terchangeability of 7JiJ software, everywhere and on all been only a "lurker" on comp.text.tex, and while I platforms that is enforced by the discipline of having a read TUGboat and use w daily for writing my single, universally accepted underlying piece of software letters, papers, and books, and in connection with (INITEX). However, after following the discussion care- my duties as an editor of the Bulletin of the AMS, fully for nearly two months, I was convinced by evidence I have not recently been contributing either to the that, for certain purposes, 7JiJ was no longer fulfilling its promise of providing typesetting of uncompromising development or to the public discussion of m. high quality, and probably only careful and limited Next a disclaimer. While I know my way changes and additions to m primitives could correct around in The mbook and have been writing my this. What follows is a long message I posted to NTS- own macros and formats since 1978, I consider my- L, outlining a minimalist approach to changing m, self an amateur, not at all in the same league with and also a suggested method for implementing changes mperts like Barbara Beeton, Michael Downes, to 7$X code that would insure documents written for Victor Eijkhout, Karl Berry, Larry Siebenmann, standard could still run under the new system. A Tim Murphy, and others who have been contribut- number of replies to my message were posted to NTS-L ing to this discussion. So I will happily defer to and others were addressed to me personally via email. them on technical matters and hope that they will Rather than incorporate these comments by making correct any of my misstatements. What I would appropriate changes to the version I posted, I have like to do is take the point of view of a devoted TUGboat, Volume 13 (1992), No. 4 user; one not so enamoured of rn as to be unable that they cannot be addressed simply by creat- to see its warts, but one who appreciates what a ing new and better front and back ends for the unique software miracle TEX is, and is willing to system? try to fix things only if assured that it will not If so, can these "intractible" problems be solved subvert that miracle. One more fact about me by changes to that will leave it compatible bears emphasizing; as a mathematician I do have a with the current version (and in particular able somewhat biased view of m. For me m is not to pass Knuth's "trip-test"). just a typesetting system, it is the mathematical and "mnical" typesetting system. The Many Faces of TEX I would like to begin with a quotation from Don Knuth's "Remarks to Celebrate the Publication TEX is a complex system that can appear as many of Computers & Typesetting" at the Computer things to different people (or even to one person Museum, Boston, Massachusetts, May 21, 1986, as at different times). In fact it is a little like the printed in TUGboat, vol. 7 (1986) no. 2, pp. 95-98: proverbial elephant that the blind men perceived in so many ways depending on how they "interfaced" Ever since these beginnings in 1977, the with it. research project that I embarked on was driven I think that this many-faceted nature of TFJ by two major goals. The first goal was quality: may account, at least in part, for some of the un- we wanted to produce documents that were not just nice, but actually the best.. .My goal was to focused and chaotic discourse that has been taking take the last step and go all the way to the finest place on this mailing list. Someone will comment quality that had ever been achieved in printed either critically or in praise of one aspect of the TkJ documents.. . system and someone else will contradict that com- The second major design goal was to be ment, but really in reference to some other aspect of archival: to create systems that would be inde- the system. As anyone scanning comp.text.tex real- pendent of changes in printing technology as much izes, Urn users face a whole different set of prob- as possible. When the next generation of printing lems than plain TEX users, and likewise AM-W devices came along, I wanted to be able to retain and Itp~S-wprovide still other environments, the same quality already achieved, instead of hav- with differing attendant strengths, problems, and ing to solve all the problems anew. I wanted to difficulties. The complaint, repeated several times design something that would still be usable in 100 years. In other words, my goal was to arrange in the recent discussions, that is incompetent things so that, if book specifications are saved to do commutative diagrams, may seem obvious to now, our descendants should be able to produce a frustrated user of plain TpjX, but it would perplex an equivalent book in the year 2086. Although I a user of VMS-T~Xwho will tell you that it is expect that there will be a continual development an absolute snap using "m"to make beautiful of "front ends" to 'Ij$ and METAFONT, as well as commutative diagrams, even very complicated ones a continual develo~mentof "back ends" or device with arrows set at almost arbitrary slopes and with drivers that operate on the output of the systems, I all kinds of decorations on them. Likewise, it is designed and METAFONT themselves so they well-known that designing tables can be a painful will not have to change at all: They should be fixed chore with (plain) m.But there are a number points in the middle, solid enough to build and rely on. of excellent macro packages around that automate this problem away. Even that most serious problem Perhaps it is because I was in the audience when of integrating graphics into l&X can be consid- Don made those remarks that they seem particularly ered solved in the right TEX environment. In the important to me, but in any case, as my contribution hands of a competent artist, a Macintosh equipped to the NTS discussion, let me attempt to analyse the with Textures, Adobe Illustrator, and a Postscript TEX system and some of its purported shortcomings printer can create strikingly professional integrated in the light of Knuth's quotation. More specifically, graphics and text. Yes, I know that this solu- I would like to address the following: tion gives up the portability of TFJ documents- QUESTIONS. bad things can sometimes even happen between the proofing device and the high resolution camera copy 1) Are Knuth's two goals consistent, or has the typesetter-but the point is that many apparent continual quest for ultimate quality in typeset- problems with TjjX can be solved by coupling Qj?X to ting exposed problems with TEX so intractible suitable front and back ends, with no reprogramming at all of itself. Someone suggested that Tj$ TUGboat, Volume 13 (1992), No. 4 427 needs BCzier curves as a new primitive. I will argue Modern fonts available. However even this quite that the BCzier curves belong in an Illustrator-like simple new back end leads to portability problems program, not in 'IJjX. Solving the problem of between systems. I have never tried it, but I suspect portability is trivial in comparison with the night- strongly that if I sent a colleague with an IBM clone marish difficulties that I foresee as virtually certain one of my Textures source files that used Times to follow from trying to add anything so foreign as Roman, it would not work under PCWor emT@ BCzier curves to m'sdata structures! without modification. The problems here are quite trivial, involving little more than differences in font A "Standards" Approach to Solving T' naming conventions. All that would be necessary Portability Problems to regain complete cross-platform portability when using PostScript fonts is some standardized naming As just suggested above, I believe that at least conventions. I have made a point of this not some of the major defects currently perceived in the because it is a difficult problem that has worried system are not so much problems with 'IQX w people much; rather because it is a simple problem itself, but rather arise from the vital requirement with an easy solution-but one that I think can that T&X documents should be completely portable be generalized to solve many other 'IJjX problems between various hardware platforms. As long as without in any way tampering with TJT'J itself. we are dealing with itself, this portability is w For a hard example, let's consider a problem assured by the minimal requirement that all true that has been the subject of a great deal of systems will produce the same DVI file from a m discussion in the community and in TUGboat, given source file. But of course a DVI file is only part namely specifying graphics within a source file. of the way to a printed page, so TEX without some W Of course one possibility that has been mentioned sort of back end is virtually useless. We sometimes would be to add a number of graphics primitives forget that even the software combinations formed to 'IJjX: lines, circles, BCzier curves, colors, fills, by a set of font glyphs (either bitmaps or outlines) bitmaps, etc. To my mind this would be absolute and a screen previewer or printer driver is already madness, and I find it hard to believe any one a back end to If we are willing to stick w. would seriously consider it. The obvious reason with the Computer Modern family of fonts in the to reject this approach is that it would lead to bitmapped format provided by METAFONT, then a program infinitely more complex than TEX that virtually all screen previewers and printer drivers could never be made bug free or portable. Moreover will work faultlessly and provide "identical" output in a few years, when BCzier curves are perhaps to a tolerance limited only by resolution. The out of fashion, and some new graphics goodies are reason of course is that these fonts are a carefully all the rage, there will be a call for yet another specifled standard, on which the writer of a device "upgrade" of 'IJjX. But a better reason to reject it driver can completely rely. But of course Knuth is that one should not attempt to brush one's teeth never intended TEX to be limited to the CM family with a paintbrush or try to paint a picture with a of fonts, or even to METAFONT designed fonts. toothbrush-use the correct tool for each job. And Currently, Adobe's Postscript Type 1 fonts are the while Swiss Army knives may make fine souvenirs world's favorite, and it has become increasingly the and conversation pieces, they are not high quality case that a typesetting system, if it is to remain tools. acceptable, must be able to deal at the very least The simple and straightforward solution is to with the basic thirty-five fonts built into PostScript consider a graphic as just another box (a "bounding printers. Of course was easily up to the w box"), just like any other TFJ box, and let some challenge. All that is necessary is to build a TFM appropriate back end worry about what is inside file for each Type 1 font (or better yet an AFM the box and render it appropriately on a screen to TFM conversion program), and add the basic or sheet of paper. Then one can always create code to the device driver to handle a Type 1 font. graphics with the very best front end graphics On any given system this is an easy task, since tools currently available on a given platform, save again the Type 1 format is a completely specified it in an appropriate ASCII-based file format, such standard. I know this was done several years as encapsulated PostScript, tell T@X about its ago on the Macintosh, and I believe it has also bounding box and its format, and let the back been done for most of the other major hardware end take over from there. "But wait a minute," platforms. There are now even a number of well you say, "isn't that exactly the old "\specialn hinted Type 1 versions of the basic Computer approach?" Of course it is, and I claim that 428 TUGboat, Volume 13 (1992), No. 4 the \special mechanism has worked very well update comes out. In general, even with systems as except for the problems with portability that it close in spirit as the Mac OS, Windows, and NeXT, has introduced. Now experience has taught that it is extremely difficult to write a uniform GUI for the correct approach to portability problems is a program meant to run on several platforms, and not to create complex do-it-all programs and then porting a GUI from one of these to say X-Windows struggle to make them work on dozens of different on UNIX would be even harder. Moreover, each platforms. Rather, one should have single purpose platform has certain User Interface Guidelines for its modules with simple data structures and well- own GUI, and users get quite upset when a program defined interfaces, and use these to build up more deviates from them. Since these guidelines differ complex systems. So, I maintain that what is from one platform to the next, some users, and most required to solve the portability difficulties caused likely all, would be upset by any uniform choice. by graphic elements in TjjX is to make a serious Finally, what is the point? All this would do is effort to set up cross-platform TEX standards for stifle creativity and progress. Let the implementors various officially recognized graphics formats and of NTS on each platform design and construct the a standard syntax for \specials to go along with user interface most suitable for that platform. them. It would have to be understood that as technology advances, older formats will probably die The Matter of Compatibility out and be replaced by newer ones, so there should There has been a lot of discussion on NTS-L probably be a standing committee, perhaps of concerning the question of whether NTS should TUG, to oversee the promulgation and maintenance necessarily be compatible with the current version of these graphics standards. In the same way of TEX. Until this point I have tried to be calmly there could be another standing committee for analytical, but this is a crucial issue, and one I feel setting Tj$ standards for font formats and naming very strongly about, so I am going to drop into a conventions for fonts. more polemical mode at this point (though I will By the way, while we are on the matter of try to keep my arguments rational). In a word I fonts and standards, let me complain about what feel that backwards compatibility is an absolute sine I feel is a serious failing of the TEX community. qua non for any system that aspires to be accepted The Grand Wizard, as a sort of parting gift, gave as a L'successor77to l&Y. us a potentially very valuable tool to handle all Of course, if a group wants to break off to sorts of font problems. This was in the form of design a completely new typesetting system from a well-defined standard -I'm referring of course to scratch that is fine with me-just as long as they virtual fonts (VF). I'm a little over my head here don't use l&X in the name or pretend it is some technically, but I believe that as well as solving sort of "successor" to As for me, I would the more obvious problems for which they were m. like to see NTS be an improved version of introduced, virtual fonts could be used to handle m, and for this, it should either be 100% compatible some more esoteric tricks like adding color and other with or if not it should at least default to a attributes to fonts. But my feeling is that we have m, "compatibility mode" which is 100% compatible. I dropped the ball. Not enough TF$ systems have will suggest later a method by which major internal implemented VF to make it a dependable way to changes could be made to Tf?J and still satisfy this solve cross-platform TEX problems -even Blue Sky essential requirement, but now let me be precise Research, which prides itself in providing a state of about what I mean by compatibility and say why I the art TEX environment for their Textures system feel that this a no-compromise issue. on the Macintosh, has yet to implement it. INITEX is the core program, the basic Let me end this part of the discussion with a m compiled version of the Tj$ code that knows only mention of one thing that I feel should neither be W'Sprimitives. In a certain sense INITEX is m. a part of NTS nor even a standardized front end It is the implementation of INITEX that determines for it, and that is the user interface. I would not whether a system is authentic, i.e., passes have brought this up except that there has been "w Knuth's trip-test, and I think there is little doubt discussion on this list giving favorable mention to that INITEX is one of the "fixed points" that Don creating a standardized graphical user interface as was referring to in the above quotation. Let me part of NTS. But the hardest part of programming argue as strongly as I can that whatever NTS is, these days, and the most system dependent, is its core typesetting function should be based on building a GUI. Even on a single platform, like INITEX - a version that will pass the trip-test. The the Macintosh, these can break when a new system TUGboat, Volume 13 (1992), No. 4 reason has nothing to do with "keeping the faith". and other ASCII documents, even if they are Rather it is purely practical. If the new system is not meant for typesetting. compatible with 7&X, it will find ready acceptance. 0 The two largest mathematical publishers, the But if it is not, then the immense installed base of American Mathematical Society and Springer- 'l&X users will almost certainly shun it, and it will Verlag (and many others besides), now accept consequently be stillborn. papers in TEX format, either on disc or over Let me provide some details about the part the Internet. Papers submitted this way often of this "user base" that I know something about, get published more rapidly and of course final the mathematical community, since I have seen proofreading is minimal. comments on the mailing list that indicate a serious In any case, the mathematical community now lack of comprehension of how sizable this group is has become so dependent on and has such a (relative to the TEX community) and how dependent substantial investment in software, personal macro it has become on m. This in turn may have led files, and source files for the current version of m, to what I consider a very unfair comment, namely that I believe it is virtually certain to reject any that TFJ is a "toy for mathematicians". By the purported successor system that does not protect way, while my firsthand knowledge is restricted to that investment. mathematics, I know by hearsay that much of the Since I seem to be at odds with Mike Dowling following holds true for theoretical physics and also on this matter, let me quote some of his remarks in many other scientific and technical disciplines in and point out an important issue he seems to have which mathematical text makes up a substantial overlooked: part of papers written in that discipline. First, virtually all mathematics graduate stu- (1) Upwards compatibility is a very minor issue for the user. Theses are written only once; there is dents now write their dissertations in TEX, and little or no need to recompile under the successor from then on write all their papers in m.Sec- to after the thesis has been submitted. The ondly, nearly all mathematicians below age forty same comment goes for publications. It is easy to have learned m, and an increasing number of dream up exceptions to this, but I contend that the older generation are either switching to T)$, they are just that, exceptions. (A good counter if they write their own papers, or else are having example is a script accompanying a course. This their secretaries and technical typists learn T)$ script will be modified and recompiled every time and write their papers in it. A couple of years ago the course is offered.) many mathematicians were still using WYSIWYG Well, let me dream up another minor exception for mathematical word processors, but now one sees you! If you take a look in your local science library very few preprints prepared in any format except you will find several feet of shelf space occupied by m.There are of course lots of reasons for this the issues of Mathematical Reviews (MR) from just rapid, wholesale switching to m, and probably the past year. In fact, every year the American different reasons have been important for different Mathematical Society not only publishes many people. Here are a few: tens of thousands of pages of books and primary Mathematics set by TEX looks much more mathematical journals in m, it also publishes professional. more tens of thousands of pages of MR. The cost Setting mathematics with TFJ is faster and of producing just one year of MR is well in excess easier (after a painful, but short, learning of five million dollars, and all of MR going back curve). to 1959 (about one million records) is stored online Mathematical text in TFJ format can be sent in Qj$format in the MathSci database. People over the Internet and works on all machines. all over the world download bibliographic data and This makes 7&X an ideal medium for joint reviews from MathSci and use software to authors to use in their collaboration. WYSI- preview or print it. Many others spend hundreds WYG formats are machine dependent and need of dollars per year to lease two CD-ROMs with the special coding and decoding when sent over the last ten years of MathSci. Obviously the AMS is net. unlikely to agree with the above assessment of the As a result of the above, the m mathematical importance of compatibility. In fact they are certain input language is becoming a lingua franca for to protect their investment in MathSci by making the linearization of mathematical text in email sure that the retrieval system they have invested in so heavily does not break. And they have a 430 TUGboat, Volume 13 (1992), No. 4

powerful means to protect that investment -with Pascal -and it is the programmability provided by Knuth's blessing, they own the trademark on the this macro language that gives TEX its remarkable TEX name and logo, and will not let it be used for flexibility and survivability. However, there is no a system that does not pass the trip-test. denying that, while TEX macros may indeed always behave exactly the way (a careful reading of) the w as a Front End mbook says they will, it often takes a lot of study for a non-wizard to find the features responsible Early in the NTS-L discussion there was some for a macro behaving the crazy way it does, rather discussion concerning extending so it could flow rn than the way that was intended. Still, most text around pictures, and have other sophisticated l&X users do learn easily enough to write simple facilities of page layout programs such as PageMaker substitution macros or even special purpose macros or QuarkXPress. This quickly died out, I think with parameters. The real problems arise when because most people on the list had thought enough one tries to write a complex package of general about such matters to realize that typesetting and purpose macros for others to use in an unknown page layout are almost orthogonal activities. The environment. One can take the attitude that this ability of to break text into lines, paragraphs, rn activity is simply intrinsically difficult, and should and pages is aimed at producing printed pages be left to the experts, but it seems to me that consisting mainly of text for books and journals. those complaining have a good point. Someone who Of course, such pages frequently do need diagrams, has learned to program in a standard programming pictures, and other graphic elements. But these language should not have to learn another whole usually fit neatly inside captioned boxes, with no new system of programming; they should be able need to have text flow around them, and we have to use the familiar syntactic and semantic features already discussed making such extensions to m. that they are used to for programming m.Since The page layout programs, on the other hand, changing the 'l&X macro language would introduce are designed with the quite different purpose of the worst kind of compatibility problems, some producing illustrated magazines, newsletters, and other solution is called for. One that comes newspapers. These are documents in which the to mind is to write a "compiler" whose source graphics often outweighs the text, and in which language would be some sort of high-level, ALGOL- each page can have a complex, and different pattern like language, with all the usual features such as of text and pictures. Building such pages is an strongly typed variables and scoping rules, and interactive process best handled with a WYSIWYG whose target language would be the TEX macro interface. The good page layout programs often language. Creating such a compiler would not be an have only quite limited word-processing facilities easy task, but it would constitute another important built in, because the proper way to use them is application of Knuth's principle of keeping TEX itself not for creating either text or graphics, but rather a fixed point while making "changes" to the to organize into pages text and graphics imported rn system by creating new front ends. from other programs. But this brings up an interesting point. To Changing the Fixed Point what extent would it be possible to import text typeset by into a page layout program? Cer- I would be a lot happier if I could stop at this point tainly this would not be easy! The way TEX freezes and conclude that there is no need for any changes the shape of a paragraph, once it has created it, is to the 7QX code itself-that all of w'sperceived quite different from the way a normal word proces- problems can be solved by creating the appropriate sor works, so one would probably have to create a front and back ends. For the overwhelming majority special page layout program, one that understood of m users this is in fact the case. If one is willing m'sdata structures and could have an interactive to put up with occasionally having TFJ fall just dialog with Q$ during the layout process. This short of perfection, or if one doesn't mind making would be a tough but worthy undertaking. up for these lapses on m's part by doing some careful manual tuning (my own approach), then 'QX as a Programming Language the current is all one will ever need. But for those who take seriously Knuth's goal of not Many contributors to NTS-L have complained that compromising on quality, and moreover insist on a the T'programming language is terrible. In system that permits them to automate excellence, a its favor one should point out that it is Turing effective-and so just as powerful as say C or TUGboat, Volume 13 (1992), No. 4 431

very good case has been made that rn has several of Knuth's decision to limit the functionality serious deficiencies hard-wired into it. of m,in order to make it stable and trans- Frank Mittelbach made this point very co- portable. Many of these problems have been gently and convincingly in his presentation "E-w: solved in a quite satisfactory manner on one Guidelines for future at the 1990 TUG meet- or more platforms by coupling T)$ with the ing (published in TUGboat vol. 11 no. 3, September appropriate front or back end. What remains 1990). And Michael Downes amplified and extended is to solve these problems in a manner that Mittelbach's comments in a message he sent to the preserves transportability of sources, and tex-euro mail list, February 20, 1992, in response the way to do this is to specify standard file to an announcement by Joachim Lammarsch of the formats and other data strucures, and a stan- intent of Dante e.V. to set up a working group on dard \special syntax for instructing TfjX to "Future Developments of w. Downes posted a interact with them. copy of that message to NTS-L on June 2, 1992, and 0 To carry out the above, TUG should appoint I see no need to repeat either of their remarks here. a "Committee on rn Standards". This com- Instead I would like to suggest a mechanism mittee should have the overall responsibility for to permit necessary changes to be made to rn deciding what types of standards are important code and still maintain compatibility in the sense to insure that important front and back ends described above. The idea is both simple and for can be built in a way that is platform obvious. When NTS starts up it will be ordinary independent, and it should appoint committees m. However if the first string of characters in the of experts to promulgate and maintain these source is, let us say, "\VERSION=NTSn then the l&X various standards. code will be rolled out of RAM and replaced with 0 Nevertheless, an excellent case has been made NTS code. that certain specific features of W's primi- But how are we going to get from 'l&X to NTS? tives and coding make it nearly impossible to My own preference would be to take a gradual automate certain functions required to attain approach, analyzing the problems that have been one of Knuth's goals for w, production of pointed out in m into families of related problems, "the finest quality that had ever been achieved each reasonably independent of the others, and then in printed documents". While most users may tackling these families one by one in stages, from never feel the need for the subtle touches that easiest to hardest, starting from the original w make the difference between typesetting that is sources and gradually perturbing them. In this merely excellent, and typesetting that is "the way NTS could evolve in a controlled way from finest quality", for those that do a follow-on to the current version of m through a sequence of w,NTS, should be developed. versions, each compatible with standard rn, each 0 NTS should be backward compatible with new version curing one more of the difficulties that source files from the current version of w. Mittelbach, Downes and others have pointed out, This means that it should default to a "com- and each being carefully tested before going on to patibility mode" that would pass the trip-test, the next stage. I know this may seem like a dull and and that any new features that might introduce . pedestrian way to go about things, particularly to incompatibilities should have to be "turned on" those wishing to strike out boldly in new directions. by the user. But I think it has the a very good chance of success. 0 NTS should be developed in a sequence of It will not demand many resources to get started versions, starting with rn and curing its so it stands a reasonable chance of getting off the problems one at a time. ground. And once the first step is taken, well as the saying goes, nothing succeeds like success. Postscript

Summary As indicated above, I believe it is possible for a group to design and implement ab ovo a completely Let me now summarize my major points and new and state of the art typesetting system-a suggest ions: for the Twenty-first Century" to use Philip Many of the problems and "missing features" Taylor's words. As explained above, I also believe in the m system that have been discussed that such a system could be implemented in a way in NTS-L are not really deficiencies of w, that would keep it functionally compatible with the but rather features omitted as a consequence current T)$ system. But, before getting started on TUGboat, Volume 13 (1992), No. 4 such a massive project, ample consideration should NTS isn't going to kill m, but it would be first be given to some prior considerations: sad to waste all that time and effort -and a great opportunity. 0 Don't forget what a monumental task the cre- ation of w was, and remember that its author is a totally exceptional individual. He is not Addendum only a great computer scientist who happens A number of people responded to my posting- to love and understand high quality typogra- some by email directly to me, and others by a phy, he is also, fortunately, an incredibly good posting of their own to NTS-L. I would like to programmer - and finally he has unmatched thank all who took the trouble to reply, but for Sitzjleisch. Whole work groups of system ana- reasons of space I will mention here only a couple lysts and programmers could easily have failed of replies that bear most directly on my previous in the same task-and if they had succeeded remarks. they would probably have taken longer to cre- I would particularly like to thank Nelson Beebe ate a buggy program that runs on a single for pointing out that several of the front and platform. And they certainly would not have back ends I was wishing for either already exist put the code in the Public Domain! or are in the works. First, and perhaps most Knuth is a tenured Full Professor at Stanford. important, Nelson himself has made a proposal for While he was designing and writing the rn a standardized syntax for \specials that he has code, he had NSF grant support that not only submitted to the TUG DVI Committee, and this provided him with the time and equipment he will appear shortly in TUGboat. Second, Nelson needed, but also supported a team of devoted reminded me of an article by Luigi Semenzato and brilliant graduate students who did an and Edward Wang in the November 1991 issue of enormous amount of work helping design and TUGboat. This describes a LISP front end for write the large quantity of ancillary software rn macro writing, of just the sort I was calling for needed to make the TEX system work. in the section "rnas a Programming Language". a So, consider this question: Where will the (But I'd still like to see one based on an ALGOL resources come from for what will have to be family syntax!) And finally he pointed out Graham at least an equally massive effort? And will Asher's article "Inside Type & Set" in the April the provider of those resources be willing, at 1992 issue of TUGboat, describing a program that the end of the project, to put the fruits of all does page makeup with lines and paragraphs typeset this effort in the Public Domain? I consider using code. this point particularly important. I think it rn Larry Siebenmann sent me a long list of inter- is accepted that it is the combination of the esting comments, however I will not mention them quality and the PD status of the code that rn here since I hope and expect he will himself write have been the two principal factors responsible something on these matters in these pages. for its remarkable and unique universality. I doubt that any system that is not PD would o Richard Palais have much chance of weaning away a sufficient Department of Mathematics number of rn users to make all the effort Brandeis University worthwhile. Waltham, Massachusetts 02254 0 Finally, don't repeat the sad history of ALGOL [email protected] 68! The ALGOL 60 programming language was a gem. True, it had its flaws, but these were well-known and understood, and I think all of us ALGOL lovers assumed that the ALGOL 68 design committee was going to polish that gem for us and remove the flaws. Instead they decided to start over from scratch and came up with a language that nobody understood, loved, or used. And that spelled the doom of poor old ALGOL- who was going to maintain an ALGOL 60 compiler once ALGOL 68 was "on the way"? Needless to say, even a botched TUGboat, Volume 13 (1992), No. 4

The Future of TJQC* of 7$jV Because, primarily. is already fifteen years old-four years as a child 78); eight Philip TAYLOR (m years as an adult (w82); and three years in matu- This paper is dedicated to Professor Donald Knuth, rity (Tp33). Fifteen years is a long time in the life- without whom there would simply be no m,no span of computer languages: Algol 68, for example, METAFONT, and almost no chance that any of was certainly at or beyond its peak by 1982, and is us would ever have met, on the occasion of the today almost as rare as the Tasmanian wolf,' if not approxzmate anniversary of his pronouncement two yet as dead as the Dodo:2 a language must evolve, or years ago that m and METAFONT were complete. die. (There are numerous natural languages which are almost certainly in terminal decline, despite the Abstract most strenuous efforts of a nucleus of active speak- ers to artificially prolong their lives: Cornish and QjX and the other members of Knuth's Computers & Manx are surely dead; Gaelic must feature in any Typesettzng family are arguably amongst the most suc- linguistic 'Red Book' of endangered languages; only cessful examples of computer software in the world. Welsh, which alone among the British native minor- having been ported to almost every conceivable oper- ating system and attracting an allegiance that verges ity tongues continues to evolve, shews any real resis- on the fanatical. Development work on this family tance to morbidity and eventual death.) If natu- has now ceased, and many members of the computer ral languages must evolve or die, how much more typesetting community are concerned that some action so must computer languages, whose evolution must should be taken to ensure that the ideas and philosophy keep pace with a technology which evolves at a rate enshrined in l&X are not allowed simply to fade away. so rapid that it is unmatched in the natural world In this paper. we discuss some of the options available even by irradiated fruit-flies.3 for perpetuating the philosophy, and examine the So, my underlying hypothesis is: TjjjX must strengths and weaknesses of the present QjX system. We evolve, or die. If we are to believe the evidence of conclude by postulating a development strategy for the our ears and eyes, the underlying Tj-$ philosophy is future which will honour both the letter and the spirit of already as anachronistic as the horse and cart: TEX Knuth's wish that Q$. METAFONT and the Computer Modern typefaces remain his sole responsibility, and at represents the pinnacle of Neanderthal evolution, the same time ensure that the philosophy and paradigms building on the genetic heritage of Runoff, Nroff, which are the strengths of are not lost for ever by Troff, Ditroff and Scribe, whilst Cro-Magnon man, having artificial constraints placed on their evolution. in the guise of Ventura Publisher, Aldus Pagemaker and Quark Xpress, is already sweeping over the face of the planet. The halcyon days are long since gone "My work on developing m.METAFONT and Com- (or so it would seem) when it was socially accept- puter Modern has come to an end." [I] With these able to: enter text; check it for spelling errors (by words, Professor Donald E. Knuth, creator of m, eye!); insert a series of formatting commands: pass informed the world that the evolution of probably the whole through an interpreter; identify the first the most successful computer typesetting system yet error; correct the first error; pass the whole through developed had ceased, and that with the sole excep- the interpreter again; identify the second error; cor- tion of essential bug fixes, no further changes would rect the second error; pass the whole through the be made. m'sversion number will asymptotically interpreter for a third time; repeat for all subsequent approach ;.r as bug fixes are made, and at the time of errors.. . ; pass the whole through the interpreter for the nth time; then pass it through the interpreter his death, it will be renamed 'm,Version T';there- after it will remain exactly as he last left it: a fitting again (to resolve forward- and cross-references); pre- and appropriate memorial to one of the most pro- view a facsimile of the final copy on the computer ductive and inspired computer scientists (and math- screen; notice a formatting error; and go right back ematicians, and Bible scholars) that the world has to editing the file: our colleagues sit there click- ever known. ing away on their mice4 like demented death-watch The future of l&X is therefore totally deter- Thylacznus cynocephalus mined: why, then, is this paper entitled The Future Raphus cucullatus * This article is reproduced by kind permission Drosophzla melanogaster of the organisers of the Euro-m '92 MUS ordznatus mzcrosoft~en~~sor MUS conference in Prague, Czechoslovakia, in the ordznatus applemaczntoshzz proceedings of which [4] it first appeared. TUGboat, Volume 13 (1992), No. 4 beetles5 and think us totally mad; and mad we example represents a failure of the evolutionary sys- surely must be, for we not only enjoy this mode tem, for in its heyday Pascal was almost universally of working. we seek to convert the demented mouse adopted. giving birth to the UCSD 'P' system as clickers into users as well! well as making possible the unbelievably successful Why? What is it about that is so totally (and revolutionary) 'Turbo Pascal', whilst Modula, addictive? Is it perhaps m's descriptive and although lauded by computer scientists, remained of character-oriented nature -the fact that, in direct relatively limited acceptance and acceptability, and opposition to current trends, m requires the user Oberon remains almost unknown without the walls to think about what he or she wants to achieve, and of academia. Most recently, among the procedu- then to express that thought as a series of words ral languages at least, we come to 'C', and its bas- and symbols in a file. rather than as a series of tard offspring 'C++'; these languages have an hon- ephemeral mouse movements on a screen? Is it. ourable history, tracing their roots back through 'B' perhaps, its portability -the fact that implementa- (or so I am told-I have never encountered 'B' tions (almost entirely public domain) exist for every myself) to BCPL, the 'Basic Combined (or Cam- major in the world? Is it the deter- bridge, depending on one's background) Program- ministic nature of T)$- the fact that a given sequ- ming Language', itself derived from CPL which sim- ence of 'IJjX commands and text-to-be-typeset will ply wasn't so basic! En route, data typing was always produce exactly the same results, regardless acquired, and lost, and acquired again, and poly- of the machine on which it is processed? Is it the morphism was acquired with the advent of 'C++'. 'boxes and glue' paradigm, which provides a sim- Other evolutionary lines are represented by Pro- ple but somewhat naive model of black and white log, which epitomises the declarative family, and space on the printed page? The ease with which Lisp, which is the archetype of list processing lan- form and content can be separated? The imple- guages (and which remains almost unchanged since mentation as a macro, rather than a procedural, its inception). Poplog, encompassing as it does rep- language? (would a procedural still be recog- resentatives of all three families (Pop 11, based on nisably m?)Is it, perhaps, the incredible contor- Pop 2, Prolog and Lisp) is perhaps a unique synthe- tions through which one occasionally has to go to sis. Finally one should not omit mention of that achieve a desired result? (Or the incredible elation most modestly titled of all programming languages, when such contortions finally achieve their intended APL: 'A Programming Language'. effect?) How many of these elements could be elim- But this is not a history of programming lan- inated and still leave something that is recognisably guages: I cite the above examples only to place QX m?I propose to return to these questions, and to within context. for although when teaching to attempt to answer some of them, later in this paper. secretaries one does not necessarily stress the fact of A related question: what is the potential life- its being a computer programming language per se. span of a w-based typesetting system, or for that a computer programming language it most certainly matter, of any computer language? Of all the gen- is. Indeed, TjiJ is 'Turing complete', which is a com- eral purpose computer languages which have sprung puter scientist's jargon for saying that 7$J could be into existence since the advent of compilers (which used as a general purpose programming language point in time really marks the beginning of all the since it has the necessary flexibility, although apart computer languages that are in general use today), from the intellectual satisfaction there would be lit- Cobol and Fortran are probably among the longest tle point in so doing: w'sforte is clearly computer lived; but Fortran has evolved enormously since the typesetting. and only programmers or perverts could days of Fortran 2 (which is as far back as my mem- derive pleasure from coercing it into calculating cube ory goes), whilst Cobol has evolved relatively little; roots or cosines! Basic, too, is still with us, although the originators So what is the common theme among all the of Dartmouth Basic would find little to recognise languages cited above? Simply this: that almost in the 'Visual Basic' of Microsoft today. Algol60 every one of them has either given birth to a suc- evolved via various routes into Algo168, which for cessor (which is not necessarily more successful: me represents the pinnacle of language design, but cf. Pascal 4 Modula -+ Oberon), or has simply evolved no further, and is today reaching the end fallen into disuse; Cobol and Lisp alone, which of its twilight years. Pascal, which owes much to occupy highly specialised niches, remain relatively the Algol family, gave birth to Modula, which itself unchanged. and of these only Cobol continues to became transmuted into Oberon; in a sense, this last play a significant rijle in mainstream computing (although Lisp remains the language of choice for Xestobzum rufovzllosum many linguistic and related tasks). TUGboat, Volume 13 (1992), No. 4

It seems, then, that we have a choice: we can No doubt each of us will have his or her own ideas on either allow natural selection to take its course, in the desirability or otherwise of each of these options; which case m,having fulfilled its appointed r81e on it is not my intention in this paper to attempt to this planet (which I assume is to teach us the merits persuade you that any one of them is clearly prefer- of literate programming, whilst encouraging us to able; but I would be shirking my responsibilities devote ever more time to the typesetting of beauti- were I not to caution that, in my opinion, option 3 ful papers, presumably at the expense of ever less appears to represent the worst of all possible worlds. time spent actually researching or writing them), representing as it does a clear case of 'creeping fea- will surely join XCHLF, JEAN & JOSS in the great turism' at its worst while not possessing any redeem- bit-bin in the sky; or we can adopt a corporate ing qualities of originality. responsibility for the future of and intercede Option 1 is, as I have suggested above, clearly in the process of natural selection, taking steps to defensible, in that it is Knuth's own preferred posi- ensure that evolves into a typesetting system tion; despite my fears that rn will succumb to the which is so demonstrably superior to the miasma pressures of natural selection if it is adopted, it may of mouse-based, menu-driven, manipulators of text be that represents both the pinnacle and the and images which are currently snapping at its heels end of an evolutionary line, and that future typeset- that no-one will be able to deny it its rightful place ting systems will be based on an entirely different at the forefront of typesetting technology for the philosophy (e.g. mouse-based). twenty-first century. Option 2 represents the most conservative evo- Let us consider the options which are available lutionary position and has. I believe, much to com- to us: mend it, certainly in the short term: it would retain 1. We can leave exactly as it is: this is clearly the present look and feel of TEX; and compatibility a defensible position as it is exactly what Knuth with current programs, whilst not intrinsically himself intends to do: it would be extremely guaranteed, could be ensured by careful design; at arrogant of us to suggest that we know better the very worst, one could envisage a command-line than Knuth in this respect. qualifier which would disable the extensions, leav- 2. We can enhance rn by just enough that those ing a true QjX3 underneath. Although option 2 who really understand its power, its limita- is in opposition to Knuth's expressed wishes, he tions, and its inner workings agree that it has made it plain that he has no objection to such no longer has demonstrable defects (i.e. there enhancements provided that the resulting system is are some 'simple' typesetting tasks with which not called 'l$JL I propose that we term the results of Tj$r could not deal correctly, but with which adopting option 2 'Extended W',both to indicate an enhanced T&X could). its nature, and, more importantly. to comply with 3. We can enhance TEX by incorporating the the spirit as well as the letter of Knuth's wishes. combined wish-lists of its major practitioners, Option 3 is considerably less conservative, but thereby seeking to make all things to does at least retain the present look and feel of all men (and all women), whilst retaining its w; it is completely open-ended in terms of the present 'look and feel'. extensions made to w, and offers the opportu- 4. We can enhance as in option 3 above, nity to make sweeping enhancements (I hesitate to whilst taking the opportunity to re-consider. use the word 'improvements' for the reasons out- and perhaps substantially change, its present lined above). Compatibility with current TFJ pro- look and feel. grams need not prove problen~atic,provided that the 5. We can take the opportunity to do what design were adequately thought out, and again the I believe Knuth himself might do, were he possibility of a '/noextensions' qualifier provides to consider today the problems of typesetting a fallback position. The timescale for such an imple- for the first time: look at the very best of mentation would not be small if a new swarm of bugs today's typesetting systems (clearly including is to be prevented, and it is not clear how future lJ$ among these), and then design a new type- obsolescence is to be avoided: after all, if 'The Ulti- setting system, far more than just a synthesis mate m' (as I will term it) includes all the pro- of all that is best today. which addresses the posed enhancements of m's major practitioners, needs and potential not only of today's technol- what enhancements remain to be implemented in ogy, but that of the foreseeable future as well. the future? We would need to find some way to incorpo- Option 4 represents the first attempt at a true rate that spark of genius which characterizes Knuth's work! 436 TUGboat, Volume 13 (1992), No. 4 re-design of m,allowing as it does the option to re- DANTE(the German-speaking Users' Group) think m'slook and feel, whilst continuing to incor- earlier this year, Joachim Lammarsch announced porate many of its underlying algorithms. One could the formation of a steering group, organised under envisage, for example, an implementation of in the zgis of DANTE,to co-ordinate developments of which text and markup were kept entirely separate. m;this group, diplomatically called 'NTS' so as with a system of pointers from markup to text (and to avoid any suggestion that it is T)$ itself whose vzce versa?). One advantage of such a scheme is future is being considered, is chaired by Rainer that it would eliminate, at a stroke, the trouble- Schopf; the members are listed in Appendix . An e- some nature of the character which cur- mail discussion list has also been created (called rently complicates p;the escape character could NTS-L),~with an open membership;7 all messages become redundant, and the problems of category are automatically forwarded to members of the NTS codes possibly eliminated. Of course, this is just one team. At the time of writing this article, the group of many such possibilities: once one abandons the has not yet formally met: instead, we have been con- look and feel of m,the whole world becomes one's tent to listen to the many positive suggestions which typesetting oyster. One might term such a version have been put via the medium of NTS-L. It is clear of 'Future m'. that there is no general consensus at the moment Option 5 is without doubt the most radical: not as to which of the five options outlined above is only does it reject (at least, initially), W'slook and preferable; some argue for strict compatibility with feel, it challenges the entire received wisdom of m existing implementations, whilst others argue and asks instead the fundamental question: "How that we must grasp the nettle and take this oppor- should computer typesetting be carried out?" In tunity to create a truly revolutionary typesetting so doing, I believe it best represents Knuth's own system. Some, at least, are quite content to adopt thoughts prior to his creation of p78, and, by the Knuthian position, and simply use ?&X as it is: extrapolation. the thoughts which he might have "mis perfect" was the subject of more than one today, were he faced for the first time with the prob- submission to NTS-L. One of the more interesting lems of persuading a phototypesetter to produce facts to emerge from the discussion is the different results worthy of the texts which it is required to set. ways in which m is perceived: some see it simply I think it important to note that there is nothing in as a tool for mathematical typesetting; others want option 5 which automatically implies the rejection to be able to create the most complex graphics with- of the '&jXphilosophy and paradigms: it may well out ever leaving m'sprotective shell; many want be that, after adequate introspection, we will decide to be able to typeset arbitrarily complex documents that does, in fact, continue to represent the (not necessarily containing one line of mathematics), state of the typesetting art, and that we can do no but are content to leave graphics, at least, without better than either to leave it exactly as it is, or per- W's remit. haps to extend it to a greater or lesser extent whilst So far, this paper has been concerned primarily retaining its basic model of the typesetting universe with generalities; but I propose now to look at some of discourse; on the other hand, neither does it imply of the specific issues to which I have earlier merely that we wzll reach these conclusions. I will call such alluded, and to offer some personal opinions on pos- a system 'A New Typesetting System' (to differen- sible ways forward. I propose to start by attempt- tiate it from 'The New Typesetting System' which ing to answer the question which I believe lies at is the remit of NTS, 9.v.). the very heart of our quest: "What is the essence The options outlined above are not necessarily of W?" mutually exclusive: we might decide. for example, to It seems to me that there are some aspects adopt option 2 as an interim measure, whilst seek- of which are truly fundamental. and some ing the resources necessary to allow the adoption of which are merely peripheral: among the funda- option 5 as the preferred long-term position (indeed, mental I include its descriptive and character- I have considerable sympathy with this approach oriented nature, its portability, and its determinis- myself). But no matter which of the options we tic behaviour; I also include some elements which adopt, we also need to develop a plan of campaign. I have not so far discussed: its programmability both to decide which of the options is the most preferable (or perhaps to adopt an option which NTS-L@VM .URZ .Uni-Heidelberg . De Send a message to I have not considered) and then to co-ordinate the implementation of the selected option or options. [email protected] with a single line body containing the text As many of you will be aware. a start has Subscribe Nts-L already been made to this end: at a meeting of TUGboat, Volume 13 (1992), No. 4 437

(for example, the way in which loops can be imple- intervention would be unnecessary, and the whole mented, even though they are not intrinsic to its question of the future of TEX would never have design), its generality (the fact that it can be used arisen. But whilst it is (relatively) easy to iden- to typeset text, mathematics, and even music), its tify a subset of its characteristics which the major- device independence, and its sheer xithetic excel- ity of its practitioners (I hesitate to say .all') would lence (the fact that, in reasonably skilled hands. agree represent its fundamental strengths, identify- it can produce results which are virtually indistin- ing a similar subset of its characteristics which rep- guishable from material set professionally using tra- resent its fundamental weaknesses is far more con- ditional techniques). Equally important, but from tentious. None the less, identify such a subset we a different perspective, are the facts that it is totally must. documented in the ultimate exposition of literate Perhaps the safest starting point is to con- programming (the Computers 63 Typesetting quin- sider the tacit design criteria which Knuth must tology), that it is virtually bug-free, that any bugs have had in mind when he first conceived of QX, which do emerge from the woodwork are rapidly and which remain an integral part of its function- exterminated by its author, and finally that for ality today. w, remember, was born in 1978- higher-level problems (i.e. those which are at the a time when computer memories were measured in programming/user-interface level rather than at the kilobytes rather than megabytes, when laser print- WEB level), there are literally thousands of skilled ers were almost unknown, when the CPU power of users to whom one can appeal for assistance. We even a University mainframe was probably less than should not forget, too, Knuth's altruism in making that available on the desktops of each of its aca- the entire source codes freely available with an abso- demics today, and when real-time preview was just lute minimum of constraints. It is almost certainly a pipe dream.'' Each and every one of these limita- true that this last fact, combined solely with the tions must have played a part in w'sdesign, even sheer excellence of 'I$$,is responsible for w's though Knuth may not have been consciously aware widespread adoption over so much of the face of our of the limitations at the time. (After all, we are only planet today. aware of the scarcity of laser printers in 1978 because Among its more peripheral attributes I include of their ubiquity today; we aren't aware of the lim- its implementation as a macro, rather than as a pro- iting effects of the scarcity of ion-beam hyperdrives cedural or declarative, language, and perhaps more because they haven't yet been invented. . . .) But contentiously, its fundamental paradigm of 'boxes by careful reading of The 7jjXboolc (and even more and glue'. I hesitate to claim that boxes and glue careful reading of TEX .WEB), we can start to become are not fundamental to m, since in many senses aware of some of the design constraints which were they clearly are: yet it seems to me that if a descen- placed on Knuth (and hence on w)because of the dant of were to have detailed knowledge of limits of the then-current technology. For example, the shape of every glyph (rather than its bound- on page 110 one reads: "muses a special method ing box, as at present), and if it were perhaps to to find the optimum breakpoints for the lines in be capable of typesetting things on a grid, rather an entire paragraph, but it doesn't attempt to find than floating in space and separated by differentially the optimum breakpoints for the pages in an entire stretchable and shrinkable white space, but were to document. The computer doesn't have enough hzgh- retain all of the other attributes asserted above to speed memory capacity to remember the contents of be truly fundamental, then most would recognise several pages [my stress], so simply chooses each it as a true descendant of w, rather than some page break as best it can, by a process of 'local' mutated chimera. rather than 'global' optimization." I think we can Without consciously thinking about it. I have, reasonably deduce from this that if memory had of course, characterized TEX by its strengths rather been as cheap and as readily available in 1978 as it than its weaknessesg But if we are to intervene in is today, w'spage-breaking algorithm may have the processes of natural selection, then it is essen- been very different. Other possible limitations may tial that we are as familiar with m'sweaknesses as be inferred from the list of numeric constants which with its strengths: if it had no weaknesses, then our appear on page 336, where, for example. the limit of 16 families for maths fonts is stated (a source including source for the TEX and METAFONT books; this is frequently lo Although on page 387 (page numbers all forgotten.. . refer to The TJjXbook unless otherwise OK, I admit it: w might have stated), we find "Some implementations of weaknesses. . . QX display the output as you are running". 438 TUGboat, Volume 13 (1992))No. 4 of considerable difficulties for the designers of the ble for format designers to conceal certain deficien- New Font Selection Scheme);'' 16 category codes. cies in TFJ itself (e.g. the lack of a \loop primi- too, although seemingly just enough, force the caret tive), the more fundamental deficiencies will affect character (-) to serve triple duty, introducing not both. (Although it is fair to say that a sure sign only 64-byte offset characters and hexadecimal char- of the skill of a format designer is the ease with acter specifiers, but also serving as the superscript which he or she can conceal as many of the apparent operator. deficiencies as possible.) An excellent introduction So. we may reasonably infer that the combined to this subject is the article by Frank Mittelbach restrictions of limited high-speed memory. inade- in TUGboat, 'E-m: Guidelines for future m' quate CPU power, and very limited preview and 121, and the subsequent article by Michael Vulis, proof facilities, combined to place limitations on the 'Should l'@be extended?' [3]. Perhaps less acces- original design of TEX, limitations the effect of which sible, and certainly more voluminous, are the com- may still be felt today. It is perhaps unfortunate bined submissions to NTS-L, which are archived at that in at least one of these areas, that of high- TeX.Ac.Uk as Disk\$TeX:[TeX-Archive.Nts]Nts- speed memory, there are still systems being sold L .All and at Ftp .Th-Darmstadt. De as /pub/tex/ today which have fundamental deficiencies in that documentat ion/nts-l/*. area: I refer, of course, to the countless MS/DOS- So, what are these so-called 'fundamental defi- based systems (without doubt the most popular ciencies'? No doubt each of us will have his or her computer system ever invented) which continue to own ideas, and the three references cited above will carry within them the design constraints of the orig- serve as an excellent starting point for those who inal 8088/8086 processors. Because of the ubiquity have never considered the subject before. What fol- of such systems, there have been a fair number of lows is essentially a very personal view-one per- submissions to the NTS list urging that any devel- son's ideas of what he regards as being truly funda- opment of bear the constraints of these systems mental. It is not intended to be exhaustive, nor nec- in mind; despite the fact that I too am primarily essarily original: some of the ideas discussed will be an MS/DOS user, I have to say that I do not feel found in the references given; but I hope and believe that the 64K-segment, 640K-overall limitations of that it is truly representative of current thinking on MS/DOS should in any way influence the design of the subject. Without more ado, let us proceed to a new typesetting system. Whilst I feel little affinity actual instances. for the GUI-based nature of Microsoft Windows. its 1. The lack of conditzon/exception handling: It elimination of the 640K-limit for native-mode pro- is not possible within to trap errors; if grams is such a step forward that I am prepared an error occurs, it invariably results in a stan- to argue that any future typesetting system for dard error message being issued, and if the MS/DOS-based systems should assume the existence severity exceeds that of 'warning'13 (e.g. over- of Windows (or OS/2), or otherwise avoid the 640K full or underfull boxes), user interaction is barrier by using techniques such as that adopted by required. This makes it impossible for a format Eberhard Mattes' ernm386.l2 If we continue to designer to ensure that all errors are handled by observe the constraints imposed by primitive sys- the format, and actually prevents the adoption tems such as MS/DOS. what hope have we of creat- of adequate defensive programming techniques. ing a typesetting system for the future rather than For example, it is not possible for the designer for yesterday? of a font-handling system to trap an attempt to These might be termed the historical (or 'nec- load a font which does not exist on the target essary') deficiencies of TJ$C deficiencies over which system. Knuth essentially had no control. But in exam- 2. The znabzlzty to determine that an error has ining the deficiencies of m, we must also look occurred: The \last... family (\lastbox, to the needs of its users, and determine where \lastkern, \lastpenalty, \lastskip) are mX falls short of these, regardless of the rea- unable to differentiate between the absence of sons. The term 'users', in this context, is all- a matching entity on the current list and the encompassing. applying equally to the totally na'ive presence of a zero-valued entity; since there is user of LATEX and to the format designers them- all the difference in the world between a penalty selves (people such as Leslie Lamport, Michael Spi- vak, and Frank Mittelbach); for although it is possi- l3 I use the VAX/VMS conventions of 'success', 'informational', 'warning', 'error' and l1 Frank Mittelbach and Rainer Schopf 'severe error' as being reasonably intuitively l2 emQX386 uses a so-called 'DOS extender' meaningful here. TUGboat, Volume 13 (1992). No. 4

of zero and no penalty at all. vital information straints of \lineskiplimit (i.e. if the effect of is lost. drawing a baseline upwards were to bring two 3. The hzerarchzcal nature of lzne-breakzng and lines too close together, then the baseline would page-breakzng: Once a paragraph has been bro- be drawn downwards instead). ken into lines, it is virtually impossible to cause The lack of any generalised ability to flow to reconsider its decisions. Thus, when text: 7&X provides only very simple paragraph a paragraph spans two pages, the material at shaping tools at the moment, of which the the top of the second page will have line breaks most powerful is \parshape; but one could within it which are conditioned by the line envisage a \pageshape primitive and even breaks at the bottom of the previous page: a \spreadshape primitive, which would allow this is indefensible, as the two occur in differ- the page or spread to be defined as a series of ent visual contexts. Furthermore, it prevents discrete areas into which text would be allowed top-of-page from being afforded special typo- to flow. There would need to be defined a mech- graphic treatment: for example, a figure may anism (not necessarily within the primitives occur at the top of the second page, around of the language, but certainly within a kernel which it is desired to flow text; if the para- format) which would allow floating objects to graph has already been broken, no such flowing interact with these primitives, thereby provid- is possible (the issue of flowing text in general is ing much needed functionality which is already discussed below). The asynchronous nature of present in other (mouse-oriented) systems. page breaking also makes it almost impossible An over-simplistic model of lines of text: Once to make paragraph shape dependent on posi- has broken paragraphs into lines, it encap- tion: for example. a particular house style may sulates each line in an \hbox the dimensions require paragraphs which start at top of page of which represent the overall bounding box to be unindented; this is non-trivial to achieve. for the line; when (as is usually the case) two 4. The local nature of page breakzng: For anything such lines occur one above the other, the min- which approximates to the format of a West- imum separation between them is specified by ern book, the verso-recto spread represents one \lineskiplimit. If any two such lines con- obvious visual context. Thus one might wish tain an anomalously deep character on the first to ensure, for example, that verso-recto pairs line, and/or an anomalously tall character on always have the same depth, even if that depth the second, then the probability is quite great varies from spread to spread by a line or so. that those two lines will be forced apart, to hon- With m'spresent page breaking mechanism, our the constraints of \lineskiplimit; how- allied to its treatment of insertions and marks, ever, the probability of the anomalously deep that requirement is quite difficult to achieve. character coinciding with an ascender in the Furthermore, by localising page breaking to the line below, or of the anomalously tall character context of a single page, the risk of generating coinciding with a descender in the line above, truly 'bad' pages is significantly increased, since is typically rather small: if TEX were to adopt there is no look-ahead in the algorithm which a 'skyline'14 model of each line, rather than the could allow the badness of subsequent pages to simplistic bounding-box model as at present, affect the page-breaking point on the current then such line pairs would not be forced apart page. unless it was absolutely necessary for legibil- 5. The analogue nature of 'glue': m's funda- ity that they so be. Note that this does not mental paradigm, that of boxes and glue. pro- require to have any knowledge of the char- vides an elegant. albeit simplistic, model of the acters' shape; the present bounding-box model printed page. Unfortunately, the flexible nature for characters is still satisfactory, at least for of glue, combined with the lack of any underly- the purposes of the present discussion. ing grid specification, makes grid-oriented page 8. Only partial orthogonality in the treatment oj layup impossible to achieve, at least in the gen- distinct entities: provides a reasonably eral case. The present boxes and glue model orthogonal treatment for many of its entities could still be applicable in a grid-oriented ver- sion of ?jEX, but in addition there would need '"his most apposite and descriptive term n-as to be what might be termed 'baseline attrac- coined by Michael Barr. tors': during the glue-setting phase, baselines would be drawn towards one of the two nearest attractors, which would still honour the con- 440 TUGboat, Volume 13 (1992), No. 4

(for example, the \new.. . family of genera- may still be poorer than that achieved by more tors). but fails to extend this to cover all enti- traditional means. The reason for this lies in ties. Thus there is no mechanism for gener- the increased detachment of the human 'oper- ating new instances of \marks. for example. ator', who now merely conveys information Similarly, whilst \the can be used to deter- to the computer and sits back to await the mine the current value of many entities, \the results. When typesetting was accomplished by \parshape returns only the number of ordered a human compositor, he or she was aware not pairs. and not their values (there is no way. only of the overall shape of the text which was so far as can be ascertained, of determining being created, but of every subtle nuance which the current value of \parshape). It is possi- was perceivable by looking at the shapes and ble to \vsplit a \vbox (or \vtop), but not patterns created on the page. Thus, for exam- to *\hsplit an \hbox. The decomposition of ple, rivers (more or less obvious patterns of arbitrary lists is impossible, as only a subset white space within areas of text, where no such of the necessary \last.. . or \un... operators patterns are intended), repetition (the same is provided. The operatorless implicit multi- word or phrase appearing in visually adjacent plication of locations, typically on the immediately preced- (yielding ) is also a source of much ing or following line), and other zsthetic con- confusion; it might be beneficial if the con- siderations leapt out at the traditional typeset- cept were generalised to ter, whereas w is blissfully unaware of their (yielding ). However, this raises very existence. Fairly complex pattern match- many related questions concerning the arith- ing and even image processing enhancements metic capabilities of w which are probably might need to be added to m before it was superficial to our present discussion. I would truly capable of setting work to the standards summarise the main point by suggesting that established by hot-metal compositors. orthogonality could be much improved. Clearly one could continue adding to this list almost 9. Inadequate parameterrsatzon: provides indefinitely; every system, no matter how complex, a very comprehensive set of parameters with is always capable of enhancement, and is no which the typesetting process may be con- exception to this rule. I have quite deliberately trolled, yet it still does not go far enough. omitted any reference to areas such as rotated text For example, one has \doublehyphendemerits and boxes, support for colour, or support for graph- which provide a numeric measure of the unde- ics, as I believe them to be inappropriate to the cur- sirability of consecutive hyphens; it might rea- rent discussion: they are truly extensions to m. sonably be posited that if two consecutive rather than deficiencies which might beneficially be hyphens are bad, three are worse, yet m eliminated. But I believe I have established that provides no way of indicating the increased there are areas in which w is capable of being undesirability of three or more consecutive improved, and would prefer to leave it at that. hyphens. Also concerned with hyphenation is This brings us therefore to the final theme: how \brokenpenalty, which places a numeric value should we proceed? The NTS-L approach is obvi- on the undesirability of breaking a page at ously helpful, in that it allows the entire (e-mail a hyphen; again it might be posited that the connected) 7Q$ community to contribute to the dis- undesirability of such a break is increased on cussion, but I see at least two problems: a recto page (or reduced on a verso page), 1. Those who are not on e-mail15 are essentially yet only one penalty is provided. simple. A excluded from the discussion; I do not see any but potentially infinite, solution would be to easy solution to this problem. increase the number of parameters; a more flex- 2. The views expressed are, in some cases, radi- ible solution might be to incorporate the con- cally different, and I wonder whether we will cept of formula-valued parameters, where, for ever converge on a universally acceptable deci- example, one might write something analogous sion. to \brokenpenalty = {\ifrecto 500 \else 200 \f i), with the implication of delayed eval- The second is in many ways the more important uation. issue (Knuth apart), for unless the decisions made 10. Inadequate awareness of esthetzcs: lJjX is are acceptable to a very large majority of the con- capable of producing results which ~sthetically tributors, the group may split, with part electing to are the equal or better of any computer type- l5 Knuth is not on e-mail. . setting system available today, yet the results TUGboat, Volume 13 (1992), No. 4 go one route and another part electing to adopt a dif- willing to fund the project. There seems no point in ferent strategy. This could result in a proliferation projecting beyond this stage in the present paper. of ~ber-ms,with a concomitant fragmentation of For the radical approach, familiarity with WEB the user community. Natural selection would surely is probably unnecessary, and indeed may be a dis- winnow out the real non-starters before too long, advantage: if we are seeking a truly NEW Typeset- but I seriously worry about the effect of such a pro- ting System, then detailed familiarity with current liferation on the m community, and even on w systems may tend to obfuscate the issue, and cer- itself: after all, if we can't agree amongst ourselves tainly may tend to constrain what should otherwise whether there should be a successor to w,and if be free-ranging thoughts and ideas. We will need so what functionality it should possess, the whole to consult with those outside the Q$ world, and credibility of the ethos will be called into ques- the advice of practising typographers17 and (proba- tion. I would not like this to happen. bly retired) compositors will almost certainly prove Somehow, therefore, we have to find a generally invaluable. But above all we will need people with acceptable solution. My intuitive feeling is that such vision, people who are unconstrained by the present a solution will either be conservative or radical. but limits of technology, and who are capable of letting nothing in between. (This may seem like a distinct their imagination and creativity run riot. hedging of bets, but I hope that my meaning is clear: And what conclusions might such a group I believe that a compromise solution. which tries to reach? Almost by definition, the prescience required be all things to all people, is doomed to failure.) I do to answer such rhetorical questions is denied to mere truly believe that adopting both solutions (one con- mortals; but I have my own vision of a typesetting servative. one radical) may be the best way forward: system of the future, which I offer purely as an exam- as an initial step. we identify (as I have tried to ple of what a New Typesetting System might be. do above) any true deficzenczes of m-those that Firstly (and despite my quite ridiculous prejudices actually prevent it from accomplishing its stated against windowing systems), I believe it will inher- aims-and rectify those, producing a system that is ently require a multi-windowing environment, or will backwards compatible with present implemen- provide such an environment itself (that is. I require tations whilst being capable of achieving superior that it will make no assumptions about the under- results. In parallel with this (which is intended to be lying operating environment. but will instead make a reasonably short term and straightforward project. well-defined calls through a generic interface: if the requiring not too much in the way of resources), host system supports a multi-windowing environ- we start planning a truly radical New Typesetting ment such as Microsoft Windows or the X Window System, with the same fundamental design desider- System, the NTS will exploit this; if the host sys- ata as (portability, freely available, fully docu- tem does not provide such intrinsic support. then it mented, bug-free. . . ), but designed for the technol- will be the responsibility of the implementor to pro- ogy of tomorrowl%ather than that of today. vide the multi-windowing facilities). I envisage that Considering first the conservative approach, we perhaps as many as eight concurrent displays might will need to identify what is feasible, as well as what be required: linked graphic and textual 110 dis- is desirable. Clearly this will require advice from plays, through which the designer will be able to those who are truly familiar with TEX. WEB, as I see communicate the underlying graphic design in the this approach purely as modifications to the WEB medium of his or her choice (and observe in the rather than as a re-write in any sense. Chris Thomp- other window the alternative representation of the son and Frank Mittelbach are obvious candidates design); an algorithmic (textual) display, through here, and Frank is already a member of the NTS which the programmer will communicate how deci- team; I would suggest that if we adopt this strategy, sions are to be made; two source displays. one text, Chris be invited to participate as well. Once we have one graphic, through which the author will commu- identified what is possible, we will need a reasonably nicate the material to be typeset; and a preview accurate estimate of time-to-implement, and if this display, through which an exact facsimile of the fin- exceeds that w-lnich can be achieved with volunteer ished product may be observed at any desired level labour, we will need to seek funds to implement this of detail. A further display will provide interac- solution. I would suggest that TUG be approached tion (for example, the system might inform the user at this stage (obviously they will have been kept that some guidance is needed to place a particularly informed of the discussions), and asked if they are Michael Twyman and Paul Stiff have l6 and beyond indicated a keen desire to be involved in the project. TUGboat, Volume 13 (1992), No. 4 tricky figure), and the last will enable the user to to know, above all, what changes he would make watch the system making decisions, without clut- to m, were he to be designing it today, rather tering up the main interactive window. Needless to than fifteen years ago; I would like to know if he say, I assume that the system will essentially operate agrees that the deficiencies listed above (and those in real time, such that changes to any of the input that appear elsewhere) are genuine deficiencies in windows will result in an immediate change in the TEX, or are (as I sometimes fear) simply the result of corresponding output windows. I assume, too, that an inadequate understanding of the true power and the input windows will be able to slave other unre- capabilities of TEX; and I would like to know how lated programs, so that the user will be able to use he feels about the idea of an 'Extended TjjX' and the text and graphics editors of his or her choice. Of of a New Typesetting System (I suspect he would course, not all windows will necessarily be required be far more enthusiastic about the latter than the by all users: those using pre-defined designs will not former). And I suppose, if I am honest, I would need either the design-I/O or the algorithm-input just like to say 'Thank you, Don', for the countless windows, and will be unlikely to need the trace- hours, days, weeks, months and probably years of output window; but the interaction window may still pleasure which has given me. be needed, and of course the source-input windows unless the source, too, has been acquired from else- Philip Taylor; July 1992 where. For just such reasons, the system will be capable of exporting any designs or documents cre- References ated on it in plain text format for import by other Donald E. KNUTH: ''The Future of and systems. METRFONT", in TUGboat, Vol. 11, No. 4, And underneath all this? Perhaps no more than p. 489, November 1990. a highly refined version of the Tm processor: totally Frank MITTELBACH:"E-TFJ: Guidelines for re-written. probably as a procedural language rather future w. in TUGboat, Vol. 11, No.3, than a macro language (why procedural rather than. pp. 337-345, September 1990. say, list processing or declarative? to ensure the Michael VULIS:"Should TEX be extended?". in maximum acceptability of the system: there are stzll TUGboat. Vol. 12, No. 3. pp. 442-447, Septem- more people in the world who feel comfortable with ber 1991. procedural languages than with any of the other ZlatuSka. Jiii (ed): Euro TjjZ '92 Proceedzngs, major genres). and obviously embodying at least the pp. 235-254, September 1992. Published by same set of enhancements as the interim conserva- CSTUG, Czechoslovak QjX Users Group, ISBK tive design, together with support for colour, rota- 80-210-0480-0. tion. etc. The whole system will, of course, be a fur- ther brilliant exposition of literate programming; Appendix A will be placed in the public domain; will be capa- Inaugural members of the NTS-L team ble of generating DVI files as well as enhanced-DVI and POSTSCRIPT;and will be so free of bugs that Rainer Schopf (Chairman) its creators will be able to offer a reward, increasing 0 Peter Abbott in geometric progression, for each new bug found. . . 0 Peter Breitenlohner But we will need one final element, and I have 0 Frank Mit>telbach deliberately left this point to the very end: we will Joachim Schrod need the advice of Don Knuth himself. Don has now distanced himself from the project, and 0 Norbert Schwarz is concentrating on The Art of Computer Program- Philip Taylor mzng once again. This detachment is very under- standable- TEX has, after all, taken an enormous o Philip TAYLOR chunk out of his working (and. I suspect, private) Royal Holloway and Bedford New College. University of London, life -and I hope that we all respect his wish to be allowed to return once again to 'mainstream' com- Egham Hill, Egham, puter science, mathematics, and Bible study. But Surrey, U.K. I think it inconceivable that we can afford to ignore his advice; and if I were to have one wish, it would be this: that I would be permitted to meet him, for whatever time he felt he could spare. and dis- cuss with him the entire NTS project. I would like TUGboat: Volume 13 (1992), No. 4

Software XBibTeX

X-Window application for manipulating XBibm and Friends* the BlbTeX bibliography database, Nickolas J. Kelly and Christian H. Bischof

Abstract The XBibTEX utility provides an X Window interface for inserting entries into a bibliography database in Figure 1: Application Window BIB^ format. XBibT@ provides a template of the I Article required and optional fields for each entry type defined by BIB^. In addition, XBibm accommodates two I additional entries named "keyword" and "annote" for Directory: ~~et/rparky/sparky2/b1schof/tex/blbtex 1 maintaining an annotated bibliography. The user enters the information to be stored in the database; XBibTE)C automatically inserts the entry in the bibliography file in a format that conforms to BIBTJ~X'Sspecifications. Author: Ronald Reagaa We also introduce two related utilities, bibprocess and I bibsearch. bibprocess allows one to merge the con- Tltle: It never rams ~n Southern Cal~formq tents of user-defined fields into a .bbl file produced by BIB^: bibsearch allows one to retrieve the LAW Journal: Sunny Side Ug key of publications that contain user-specified keywords. This article describes the features of these programs.

1 How to Use XBibm While BIB^ provides a convenient mechanism for Number: 3- storing and retrieving bibliographic records, it lacks I a convenient means for entering new items. The user Pages: 33-44- can easily make mistakes-for example. forgetting month:

the required fields, the double quotes, or the commas Note: surrounding the information in an entry. XBibW minimizes these errors by displaying a template with all the fields defined for a particular type of bibliographic entry. Figure 2: Entry Window for an Article making sure that information for required fields is indeed provided, and storing the information in a format that is guar- XBibW pops up when the user presses the Oth- anteed to be syntactically correct. ers button. The 'look and feel' of XBibTpX is best con- Let us assume we enter an article into our bib- veyed through an example. After typing "xbibtex" , liography database. After pressing the Artzcle but- the Application Window in Figure 1 will appear. ton, the Article Entry Window displayed in Fig- This window contains a menu of options which the ure 2 will pop up. but with empty text fields. Notice user may select by pressing the left mouse button that all of the buttons in the Application Window over the appropriate option. have been grayed except for the ClzpBoard button. The Article, Book, Inproceedings, and Tech- This "grey-out" prevents one from exiting the ap- report buttons are bibliography entry types defined plication while entering an entry. by BIB^. A menu containing the other (in our There are two kinds of fields: "required" and experience, less common) entry types known to "optional". The "required" fields must be filled in for XBib'QX not to complain. For example, let us * This work was supported by the Applied Math- assume that the author is Ronald Reagan; the title ematical Sciences subprogram of the Office of En- of the article is "It never rains in Southern Califor- ergy Research, U.S. Department of Energy, under nia''; the date of publication is 1987; the page range Contract W-31-109-Eng-38. is 33-44: and the volume, issue, and journal title TUGboat, Volume 13 (1992), No. 4

I I

I 1 Could not fmd database f~la: Directory: k~et/spark~/sparky2/b1s~hof/tex/b~btex/ I /Net/sparky/sparky2/b1schof/tex/bibtex/r.bib I Would you like the database file to be created? I I Required B~blmgraphyFields

Author: "elpresldente- Figure 3: The Confirmation Window Title: Hollywood Dreams,

<** XBIBTEX MESSAGE 86 $*> Publisher: Beverley Hills Press, I Biblmgraphy Entry Information I Type: ''artde'' Key: "RonnleBIa" Year: /1987. 1 DB File Name: '/Net/sparkr/sparkrJZ/b~zchhf/tsx/b~bte

Press any button vhlle In wmdou to dismiss mesrage... I I Optional Blblmgraphy Flelds Figure 4: A Sample Message Window Volume: Series:

Rddress: I I are Vol. 1, No. 3, Sunny Szde Up. Then one would enter the text as displayed in Figure 2. Note that there is no need to type the double quotes that sur- Month: I I round information in BIBWentries. XBibW will Note: automatically generate them. In addition, we have to specify a "key", and I we enter "Ronnie87" (say). One has to specify a directory where the database (.bib) files are kept. The path can be an absolute path or can be relative WQRNINGl May need to edlt entry depandmg on whether you want fddname to be: Author" OR "Edltar". to the directory from which XBibW was started. Will autonatically rave fleld as ''Ruthor'. The path entered is not expanded by the shell, so the tilde (") notation does not work, for example, Figure 5: Entry Window for a Book to specify your . Since database files are usually kept in one directory. the environment variable XBIBTEXDATABASE-PATH can be set Now let us repeat the same procedure, ex- to specify this path so it need not be reentered ev- cept this time a book will be entered into the ery time. database. Let us assume the book is, say, "Holly- When all the information has been entered. wood Dreams", again by Ronald Reagan, published pressing the Save button causes the Article Win- by Beverly Hills Press in 1987. After opening the dow to disappear. and the Confirmation Win- "book" template by pressing the Book button in the dow (see Figure 3) will appear since the database Applications Window, we enter the information file r.bib does not yet exist. Upon confirmation, as shown in Figure 5. Note that we entered the the Message Window (see Figure 4) will be dis- same XBibW key as before, namely, "Ronnie87". played. The Message Window identifies the key Since there is already an entry that used the same that should be used from now on in a LAW \cite XBibW key (and was stored with the LAW key command to refer to this entry. Notice that the "Ronnie87an), the new entry will be assigned the L*m key is not the same as the XBibm key that LAW key "Ronnie87bn. Also note that we entered was entered-the LAW key is the XBibw key "elpresidente in the author field. If an entry starts with an "a" appended to it. XBibm automati- with a leading quote and has no spaces, newlines, or cally indexes entries by appending a lower-case let- tabs in it, it will be saved without quotes surround- ter. This procedure allows for multiple entries to ing it. Therefore, a declaration like have the same XBibW key, but has the restriction @string(elpresidente = "Ronald Reagan") that one can create only twenty-six entries with the causes this entry to be expanded correctly by same "base" XBibW key. The Message Win- BIBW. The WARNING! message at the bottom dow also shows in which file the new entry was of the template indicates that if one wanted to enter stored. The database file name is determined by the an 'editor' field instead of an 'author' field BIB^ first character of the XBibm key with the ". blb" requires one of the two), one has to edit the .bib extension appended. file by hand after storing this entry, since XBibW TUGboat, Volume 13 (1992), No. 4 assumes that the "author" field has been entered. bibprocess: which allows one to merge the con- If we press the "annote" button. another win- text of additional fields added to .bib files into dow pops up into which additional information can the . bbl files produced by BIB^, and be entered, which will be stored as an additional bibsearch: which allows one to search for the entry labeled "annote". BIBWwill ignore this en- LATEX keys of bibliography entries containing try since it is not one of those that BIB= knows the desired information. about. (The "bibprocess" utility described in Sec- tion 2 makes it possible to merge this information 2.1 bibprocess with output generated by standard BIBW.) As mentioned above. XBibTm allows one to en- After saving this entry, the contents of the ter two additional fields ("annote" and "keywords") BIB^ database file will look as follows, assuming which are ignored by BIB^. bibprocess pro- that the file "r .bibn did not exist or was empty vides the functionality to merge the contents of those before, and "What great stuff!" was entered in the fields (as well as others ) with the BIB^ output. "annote" window. Consider the output produced by BIB= when we Qarticle{Ronnie87a, cite "Ronnie87an and "Ronnie87b". (For future ref- author = "Ronald Reagan", erence. assume that it was written to test.bbl.) title = "It never rains in Southern California" \begin{thebibliographyrn journal = "Sunny Side Up", year = "1987", \bibitern{Ronnie87b) volume = "I", Ronald Reagan. number = "3", \newblock {\em Hollywood Dreams). pages = "33--44" \newblock Beverly Hills Press, 1987 1 \bibitem{Ronnie87a) Qbook{Ronnie87b, Ronald Reagan. author = elpresidente, \newblock It never rains in Southern California. title = "Hollywood Dreams1', \newblock {\ern Sunny Side Up), 1(3):33--44, 1987. publisher = "Beverly Hills Press", year = " 1987" , annote = "What great stuff !" 3 Since "annote" is a keyword that is not known to BIB^, the information in the "annote" field (i.e., This example provided a flavor of the function- "What great stuff!") was ignored. ality that XBibm affords. In summary. XBibW The bibprocess utility makes it possible to has the following features: merge this information into the . bbl file. The syn- 0 Automatically provides a ternplate of the re- tax is quired and optional fields associated with each bibprocess entry type as defined by BIB^. [ ... ] 0 Ensures that the required fields of a specific en- -f try are filled. -k [ -k ... 1 0 Produces a unique LAW key by which entries [ -0 1 are referenced. Given a cbblf ile> (a file with a .bbl exten- 0 Automatically inserts entries in alphabetical or- sion) produced by BIB^ from a set of der (by key) into the database. (files with a .bib extension), bibprocess appends 0 Provides a clipboard that can be initialized to the contents of the fields specified by display a specified file. This feature can be to the corresponding entries in cbblf ile>. The useful for displaying an abbreviations file from output is written to if the -0 op- which to cut and paste. tion is present. and to stdout otherwise. The 0 Provides two new fields, "annote" and "key- specifies how the new information is words", that are useful for maintaining an an- to be formatted. notated bibliography. Again, it's easiest to understand this pro- cess with an example. Assume that we wish to 2 bibprocess and bibsearch merge the "keywords" and "annote" information In this section we describe two related utilities: that XBibW allowed us to specify. The origi- nal BIB^ output is in test .bbl, the bibliography 446 TUGboat, Volume 13 (1992). No. 4 file is r .bib, and the merged output should go to bibsearch r.bib -k annote -s "great stuff" testmerged .bbl (say). We issue the command will produce bibprocess r.bib test.bb1 -f merge.fmt Ronnie87b -k keywords -k annote on the standard output. Note that one must en- -0 testmerged.bb1 close the search string in quotes if it contains more The file merge. fmt contains the following informa- than one word. tion: In summary. bibsearch is useful for retriev- annote ing citations containing information on specified before: @\newblock {(\bf annote:) @ words -in particular, if one maintains a "keywords" after: Q)Q entry in the BIB^ database. keywords 3 How to Obtain XBibm and Friends before: @\newblock ({\bf keywords:) @ The source for XBibTFX, bibprocess. and bib- after: @)@ search as well as a more detailed user and instal- We see that we have an entry for each keyword that lation guide can be retrieved via anonymous ftp is to be merged, and for each keyword we specify from info .mcs . an1 . gov (current Internet address: what string to place before and after the information 140.221.10.1). The pub/xbibtex subdirectory con- to be merged. The "at" sign @ is used as a delimiter. tains the following files: the entries must be separated by blank lines, and userguide. ps. Z: A more complete description of the ("annote" and "keywords" in our XBibm, bibprocess, and bibsearch, as well example) must be specified with lower-case charac- as installation instructions. ters. testmerged.bb1 then contains the following xbibtex.shar.Z: Source code. man page, and information: makefile for XBibw. \begin{thebibliography}{13 bibuti1s.shar.Z: Source code, man pages and \bibitem{Ronnie87b) makefiles for bibprocess and bibsearch. Ronald Reagan. All files must be transferred in 'binary' mode. \newblock {\em Hollywood Dreams). \newblock Beverly Hills Press, 1987. o Nickolas J. Kelly \newblock C(\bf annote : ) What great stuff ! ) Nielsen Advanced Information Technology Center \bibitem{Ronnie87a) Bannockburn Lake Office Plaza Ronald Reagan. 2345 Waukegan Rd. \newblock It never rains in Southern California. Bannockburn. IL 60015 \newblock {\em Sunny Side Up), 1(3):33--44, 1987 o Christian H. Bischof \end{thebibliography} hlathematics and Computer We see that the "annote" information has been ap- Science Division pended to the "Ronnie87aWentry using the format Argonne National Laboratory specified in merge. fmt . There was no "keywords" Argonne, Illinois 60439-4801 information, so no field was created for it. bischof@mcs,anl.gov Using bibprocess you can thus augment the functionality of BIB^ and augment its output with any number of user-defined fields.

2.2 bibsearch The syntax of bibsearch is as follows: bibsearch -k [-k ] [-o coutputf ile>] -s bibsearch searches the title field and the fields specified by in a bibliography file for an occurrence of and prints the LATEX keys of all entries either to or stdout . For example, TUGboat, Volume 13 (1992), No. 4

Searching in a DVI File make use of macros and to carry out searches on all features of a document, including math mode Nigel Chapman material and even rules and spaces. Search patterns I. Introduction could be extracted directly from the TJ$ source of a document. (In fact. for non-trivial search strings Most, if not all, DVI previewers and printer drivers they would probably have to be, because of the provide a facility for selecting a subset of the pages difficulty of deciding exactly what TJ$ commands of a document; this subset is specified using the produced some particular output.) However, the contents of the \count0 to \count9 registers that problems of interfacing TF$ are considerable, and w outputs to identify each page of the file. This the overheads of running it to process every search makes it easy to preview just pages 7, 8 and 9, but string are unlikely to be acceptable. Furthermore, what if you know you want to look at the page with the actual DVI produced by for a particular the paragraph about Katzenellenbogen by the Sea? string will depend on the context in which that If you're not sure how the page makeup worked out, string appears. Such elements as interword spacing, you won't know where that is. Trial and error will line breaking and hyphenation may be very different find the right page sooner or later, but it would be when the string appears in the middle of a paragraph more convenient if there was a facility for selecting and when it is typeset in isolation. Thus, even after a page by its content, that is, the occurrence on it a pattern was converted to DVI, it would not be of a particular string. possible to apply simple string matching: some sort Many efficient string searching algorithms al- of fuzzy matching would be necessary. ready exist; they are used routinely in text editors If converting the pattern to DVI is problemat- and other programs. These algorithms take as their ical, what about converting the DVI file to ASCII? input a string of characters -the target - and a This is essentially the same task as that performed pattern. The pattern specifies a set of strings. by DVI previewers for dumb terminals, and it suffers The task of the searching algorithm is to find the from the same limitations: only text material can location, if any, within the target of a substring be dealt with properly, and spacing must be approx- that belongs to the set specified by the pattern. imated. It has the great virtue of being simple, and, The pattern may simply be a single string, speci- once the transformation has been done, any string fying itself, or it may use metacharacters and some matching algorithm can be used, including those formalism such as regular expressions to specify a that support regular expressions. This approach larger set of strings. In general, the more elaborate will be looked at further in the next section. the language permitted for specifying patterns, the Finally, there is the possibility of converting more elaborate the search algorithm will be. There both the DVI file and the pattern to some common are well known efficient algorithms for searching for representation. The obvious choice here is the single strings [4] and for sets specified by regular extended character code set used by w to specify expressions [I]. characters in its math symbol and extension fonts. A DVI file is a sequence of typesetting com- This requires some means of specifying characters in mands, some of which may have parameters. (DVI the pattern other than printable ASCII characters: commands are fully described in [3,$§583-5901.) A the obvious way of doing this is by permitting a user specifying a pattern to search for will want to suitable subset of TEX commands to be used in type that pattern at a terminal using the subset patterns. Matching can then be done on text and of ASCII that corresponds to printable characters. math mode material. This approach is further Thus, before one of the standard string searching al- described in section 3. gorithms can be employed, either the pattern must be converted to a sequence of DVI commands, the 2. Text Searching DVI file must be mapped into a string of printable ASCII characters, or both DVI file and pattern must The text parts of a TJ$ document will be typeset be mapped into some other common representation. using m's text fonts. Computer Modern text Leaving aside the possibility of using anything fonts each contain 128 characters and these are more elaborate than simple strings as patterns. a laid out in such a way that the printable ASCII possible approach based on the first of these options characters occur in the positions corresponding to is to use TEX to convert the pattern into DVI. Using their ASCII codes. The positions corresponding this approach, it would be possible for patterns to the ASCII non-printable (control) characters are to be specified in the w language, and thus to used for ligatures, accents and Greek letters (see the TUGboat, Volume 13 (1992), No. 4 font layout tables in Appendix F of [2]). A search A possible strategy for converting a DVI file pattern typed by a user will only use printable into a stream of characters is to scan the file, ASCII characters, but it is necessary to ensure that, ignoring everything except set and put commands, for example, the pattern ffi matches the ligature and return the corresponding ASCII code. But this ffi. doesn't do quite what is required. In the first A DVI file can be thought of as a program in place, all characters not in text fonts should also be the machine code of a virtual typesetting machine. skipped. To do this, it is necessary to keep track The instructions of this machine perform primitive of the current font by interpreting the additional typesetting operations, such as set a character or DVI commands fnt-def, fnt and fnt-num. The select a new font. These instructions are held external name of each font used can be found among in the DVI file as bit patterns. For reading by the parameters of its fnt-def; it is necessary to people, they can be represented by mnemonics, have a priori knowledge of which of these names just as conventional machine code instructions are correspond to text fonts-for Computer Modern given mnemonic form in assembly language. DVI fonts this knowledge is obtainable in Appendix F of instructions may have parameters, specifying, for The wbook [2]. example, the length of a rule to be set, or the Secondly, ligatures should be expanded into code for a character. There are two sets of DVI their component letters, so, for example, when commands that cause a character to be typeset: a set-char-14 command is found, it should be the set commands, with mnemonics set-char-0 converted to the three letters f f i. Dashes should through set-char-127, seti, set2, set3 and set4, also be expanded, en-dash to -- and em-dash to and the put commands, putl, put2, put3 and put4. --- . Dotless i and j should be replaced by ordinary The first 128 of these are unparameterized and i and j. All other non-printable characters will have directly specify a character code, the others take to be skipped, as should the Spanish punctuation an argument of between one and four bytes. QX marks i and i and hyphens, the last since a always uses set-char-n for a character with code n, pattern should match irrespective of whether the if 0 < n 5 127, so any ASCII character will be set corresponding occurrence in the DVI file is split with either a set-char-n or puti (see [3,§585]). across lines. Strictly speaking, to skip hyphens it is Because of kerning, commands for spacing may necessary to know the \hyphenchar of the current appear between character setting commands, even font, and this can only be determined by examining within a word. For example, the DVI commands the format used in wing the document. It will corresponding to the word 'Katzenellenbogen', as it usually be safe, though, to assume it is '\-. appears near the beginning of the file containing this If the scheme described is used, a stream paper, have the following mnemonic representation. of characters can be produced from the DVI file, setchar75 corresponding to the textual parts of the document, setchar97 and these can be matched against a search string setchar116 made up of printable ASCII characters. However, setchari22 spacing in the DVI file will be entirely skipped, so setchar101 ASCII space characters in the search string will not setchar110 match anything. One response to this is to insert setchar101 space characters in places that correspond to word setchar108 breaks in the DVI file. Because of what TpjX does setchar108 with glue, however, these cannot be identified with setcharloi certainty (as the spacing produced by ASCII DVI setchar110 previewers such as dvitty testifies). The easier right2 -18205 alternative is to remove all spaces from the search setchar98 pattern. This will produce spurious matches, e.g.. x0 18205 pullover will match pull over, and vice versa, setchar111 but this is preferable to failing to match because of setchar103 incorrectly inserted spaces. setchari0i By allowing an escape character in the search setcharil0 pattern, this scheme can be extended to cope with the full range of accents in the Computer Modern (The right2 and xO commands perform horizontal spacing.) text fonts. The obvious scheme is to use plain TUGboat, Volume 13 (1992), No. 4 449 w's control sequences for accents and accented m. As all text fonts are assigned to family 0, the characters and expand them in the pattern. text matching using ASCII codes will still work. Use of negative glue, \llap, characters with Not all the special symbols available in math negative width, and so on can lead to the commands mode are defined by \mathchardef. Some are for setting characters occurring in the DVI file in built up as a combination of other symbols, for a very different order &om that in which the example -. Such composite symbols must be characters appear in the typeset document. Thus, expanded into their components.t Some of these the matching obtained can only ever be approximate combinations are defined in quite an elaborate way, unless DVI commands are first sorted by x and but it is relatively easy to deduce the sequence of y coordinates. For most applications, this probably character setting DVI instructions they will produce. wouldn't matter, since most searches will be for Multiple sub- and superscripts present a dif- obviously identifiable words. ferent sort of problem. A term such as x: can be produced in ?]EX by either $x-i^2$ or $x^2-i$. 3. Searching in Mathematics Either pattern should match the DVI for x:, irre- spective of how that was specified in the original A DVI searching program based on the previous source. Study of Appendix G of The wbook section will suffice to find the page with the text reveals that when an atom has both a subscript 'Katzenellenbogen by the Sea', but what about the and a superscript, TEX always sets the superscript page with n k first, followed by the subscript. Thus, a pattern (z.pl + P?) ? with both can be normalized to a form with the superscript first. The - and - can be ignored This is much more of a challenge. To begin with: and the sequence of component characters, in the how should the search pattern be specified? The appropriate families, can be searched for. Again. obvious way is to use the rn language, but this is this may produce spurious matches ($x-i^2$ will not, in fact, an answer, because of W's powerful match x2i, for example) but will not fail to match macro facilities and its almost unbounded possibil- when it should. ities for redefining the meaning of any character. The last major complication of searching in One must assume at least part of a format in math mode is caused by those characters that can interpreting a search pattern. The obvious choice change their size. (How big are the parentheses is the plain format, so that a search string for the in the example at the beginning of this section?) above could be $(\sun-

pattern + pterm { I pterm ) metacharacters {, ) and I and the terminals {, pterm -+ pfactor ( pfactor) -) and I.) In patterns, the I operator separates pfactor + pprimary lr l El alternat&es, the postfix ;r meak that the preceding pprimary + { [pattern]-) I $ mathpattern $ pattern element may occur zero or more times, pelement and the 2 that it is optional. Curly brackets are pelement + charla used to group items: the syntax of the pattern mathpattern + mathelement { mathelement) language means that they work as expected to mathelement -+ pelement [ scription] delimit complex sub- and superscripts, but they -{ mathpat [ scription] ) are also used as brackets to override the default scription + -t scriptelement [,scri~telement] associativity of regular expression operators, in the ,scriptelement [ tscriptelement] usual way. The terminals char and g represent scriptelement + pelement I { [ mathpat] ) lexical classes consisting of single characters other than pattern metacharacters and m-style control mathpat i mathelement { mathelement) sequences, respectively. The metacharacters are Figure 1. Grammar for search patterns. represented in patterns by \\, \*, \?, etc. A pattern input by the user is parsed by a sim- A delimiter specifies dl I d2 where dl and d2 are the ple recursive descent parser, and a data structure for small and large versions of the symbol; a series of a nondeterministic finite state machine with 6 tran- characters is just cl I cg I . . . I c,, and an extensible sitions is constructed in a syntax-directed manner recipe is (TR*MR*B) I (TR*B), which may be using the conventional construction (see [I]).When simplified to TR*(M I e)RSB (6 is the empty the lowest level parsing function recognizes a con- string). Thus if patterns are specified as regular trol sequence or an extensible character, it returns expressions, and searching is done using finite a primitive finite state machine to recognize the state machines, control sequences and characters strings described by it. For most control sequences corresponding to symbols that can change size one defined by mathchardefs this is just a two state, one way or another can be treated as shorthands for transition machine that recognizes the correspond- these regular expressions. Note that the fact that ing mathcode. For delimiters and other characters the regular expression for an extensible character that change their size in different ways, and for does not enforce the restriction that the number of composite characters, a more elaborate machine, repeatable segments above and below the middle corresponding to the appropriate regular expres- must be the same doesn't matter, because no other sions, as described in section 3, are produced. For combination can occur. any single, non-extensible character, a machine to In summary, to deal with math mode, the recognize the character in the appropriate family DVI file must be converted to mathcodes specifying is constructed. A special control sequence \any is font family and character position and the pattern recognized; it matches any single symbol. must be modified so that characters and control The code to construct the finite state machines sequences in it are mapped into regular expressions for control sequences and so on is derived from matching such codes, taking into account the font the definitions in plain.tex and PL files for the family characters will be typeset in, delimiter codes, Computer Modern fonts. If a more general facility character series and extensible characters. were desired, tables would have to be constructed automatically from any user-specified format 4. An Implementation m and TFM or PL files, a task requiring non-trivial A prototype DVI searching facility based on the analysis of these files. ideas in the previous sections has been implemented Once the nondeterministic finite state machine as part of a m-based hypertext system I am with 6-transitions has been constructed, the 6- developing. Search patterns may be written in a transitions are removed, but the machine is not language defined by the extended BNF grammar made deterministic. The nondeterministic machine in Figure 1. (The symbols [, 1, {, ) and I are is used directly in the searching process, by keeping grammar metacharacters: items enclosed in [ and ] track of a set of active states. State transitions are optional, those in { and ) may occur zero or are performed by calling a function that returns more times, I separates alternatives. The terminal the next symbol from the DVI file. This function symbols-the symbols of the pattern language- performs the mapping to a sequence of mathcode are underlined. Note the difference between the values as described previously. It is assumed that only Computer Modern fonts are used, and the font TUGboat, Volume 13 (1992), No. 4 451 family assignments of plain are wired into the it would be no trivial task to construct a suitable code. pattern out of the facilities available. A problem not previously mentioned is that of However, searching in text is quite another displaying the location of the matching string if one matter. Implementing the transformation of the is found. This facility was felt to be useful. In textual parts of the DVI file to ASCII is very order to do it, it is necessary to interpret enough simple. This can easily be combined with any of the DVI commands to keep track of the x and string searching algorithm that scans from left to y coordinates at which each character would be right to produce an efficient text searching facility. displayed. When the finite state machine accepts In practice, this is likely to be adequate to select a string, the coordinates of its end are known and any page of a document by content. As well as an arrow can be displayed pointing back at the the experimental system described in section 4, the matched string. A more elegant method, such dviscr previewer distributed with emtex already as highlighting the entire match in reverse video, supports basic text searching, correctly handling requires finding the coordinates of the start of the accents and ligatures. It is to be hoped that, string too, which is more difficult. in future, text searching will become a common The majority of the code implementing DVI enhancement to DVI previewers and printer drivers. searching is concerned with parsing patterns, con- structing nondeterministic finite state machines and References removing €-transitions - that is, the code that any searching program based on finite state machines 1. Alfred V. Aho, John E. Hopcroft and Jeffrey D. would require. Most of the overhead specifically Ullman, The Design and Analysis of Computer resulting from the application to DVI searching Algorithms. Reading, Mass.: Addison-Wesley, is in the code to produce primitive machines for 1974. control sequences and extensible characters. The 2. Donald E. Knuth, Computers and Typeset- code required to transform the DVI into a stream of ting, Volume A, The Wbook. Reading, Mass.: mathcodes is relatively simple. Addison-Wesley, 1986. 3. Donald E. Knuth, Computers and Typesetting, 5. Conclusion Volume B, l&Y: The Program. Reading, Mass.: Addison-Wesley, 1986. The implementation described demonstrates that it 4. Klaus Pirklbauer, 'A study of pattern-matching is possible to search in a DVI file, using the ideas algorithms', Structured Programming 13(2), presented here. Consideration of this implementa- 89-98, 1992. tion suggests that text searching is a feature well worth implementing, but that searching in math o Nigel Chapman mode is less clearly worthwhile. Department of Computer Science, As should be evident, searching in mathemat- University College London, ics adds a good deal of complexity and requires Gower Street, large amounts of code for dealing with mathemat- London, WClE 6BT ical control sequences. This in turn requires the U.K. manual or automatic processing of formats Janet: N. Chapman@&.ac .ucl.cs and PL or TFM files. Extensible characters pretty much dictate the use of finite state machines for searching, rather than some simpler algorithm such as Knuth-Morris-Pratt. Searching in maths also introduces an undesirable feature into the searching interface: some mathematical control sequences are recognized, but others are not. It might seem capri- cious to a user that it is all right to use \alpha in a search pattern, but not, for example, \pmatrix. Furthermore, if you actually did want to search for the page containing x-X 1 ( 0 x-A ! ) 0 0 x-X TUGboat, Volume 13 (1992), No. 4

Hyphenation Exception Log appears in this list, hyphens are shown only for the portions of the word that would be hyphenated Barbara Beeton the same regardless of usage. These words are This is the periodic update of the list of words marked with a '*I; additional hyphenation points, if that fails to hyphenate properly. The list needed in your document, should be inserted with last appeared in TUGboat 10, no. 3, starting on discretionary hyphens. page 336. Everything listed there is repeated The reference used to check these hyphenations here. Owing to the length of the list, it has been is Webster 's Third New International Dictionary, subdivided into two parts: English words, and Unabridged. names and non-English words that occur in English texts. English hyphenation This list is specific to the hyphenation patterns It has been pointed out to me that the hyphenation that appear in the original hyphen. tex, that is, rules of British English are based on the etymology the patterns for US. English. If such information of the words being hyphenated as opposed to the for other patterns becomes available, consideration "syllabic" principles used in the U.S. Furthermore, will be given to listing that too. (See below. in the U.K., it is considered bad style to hyphenate "Hyphenation for languages other than English" .) a word after only two letters. In order to make 7JjX In the list below, the first column gives re- defer hyphenation until after three initial letters, sults from W's \showhyphensi. . . ); entries in set \lef thyphenmin=3. the second column are suitable for inclusion in a Of course, British hyphenation patterns should \hyphenation{. . .) list. be used as well. A set of patterns for UK English In most instances, inflected forms are not shown has been created by Dominik Wujastyk and Graham for nouns and verbs; note that all forms must be Toal, using Frank Liang's PATGEN and based on a specified in a \hyphenation{. . .) list if they occur file of 114925 British-hyphenated words generously in your document. made available to Dominik by Oxford University Thanks to all who have submitted entries to Press. (This list of words and the hyphenation the list. Since some suggestions demonstrated a break points in the words are copyright to the lack of familiarity with the rules of the hyphenation OUP and may not be redistributed.) The file of algorithm, here is a short reminder of the relevant hyphenation patterns may be freely distributed; it idiosyncrasies. Hyphens will not be inserted before is stored in the UK TEX Archive at Aston and may the number of letters specified by \lefthyphen- be retrieved by anonymous FTP. min, nor after the number of letters specified by \righthyphenmin. For U.S. English, \lef thy- Hyphenation for languages phenmin=2 and \righthyphenmin=3; thus no word other than English shorter than five letters will be hyphenated. (For the details, see The Wbook, page 454. For a Patterns now exist for many languages other than digression on other views of hyphenation rules, see English. The Stuttgart archive below under "English hyphenation" .) This partic- ftp.uni-stuttgart.de ular rule is violated in some of the words listed; holds an extensive collection in the directory however, if a word is hyphenated correctly by soft/tex/languages/hyphenation except for "missing" hyphens at the beginning or end, it has not been included here. Some other permissible hyphens have been The List -English words omitted for reasons of style or clarity. While this is academy(ies1 acad-e-my (ies) at least partly a matter of personal taste, an author addable add-a- ble should think of the reader when deciding whether ad-di-ble add-i-ble or not to permit just one more break-point in some adrenaline adren-a-line af -terthought af-ter-thought obscure or confusing word. There really are times agronomist agron-@mist when a bit of rewriting is preferable. am-phetamine am-phet-a-mine One other warning: Some words can be more anal-yse an-a-lyse than one part of speech. depending on context, and anal-y-ses analy-ses * have different hyphenations; for example, 'analyses' anomaly (ies) anom-aly (ies) an-tideriva-tive an-ti-deriv-a-tive can be either a verb or a plural noun. If such a word anti-nomy(ies) an-tin-emy(ies) TUGboat, Volume 13 (1992), No. 4 antin-u-clear an- ti-nu-clear cognac co-gnac antin-u-cleon an-ti-nu-cle-on cog-nacs co-gnacs an-tirev-o-lu-tion-ary an- t i-rev-o-lu-t ion-ary com-parand corn-par-and apotheoses apoth-e-o-ses com-para-nds com-par-ands apotheo-sis apoth-e-o-sis comptroller comp-trol-ler ap-pendix ap-pen-dix con-formable con-form-able archipelago arch-i-pel-ago con-formist con-form-ist archety-pal ar-che-typ-a1 con-for-mity con-form-ity archetyp-i-cal ar-che-typ-i-cal congress con-gress arc-t-an-gent arc- tan-gent cose-cant co-se-cant (better: arc tangent) cot an-gent co-tan-gent assignable as-sign-a-ble crankshaft crank-shaft as-sig-nor as-sign-or crocodile croc-o-dile as-sis-tantship as-sist-ant-ship crosshatch(ed) cross-hatch(ed) asymp-tomatic asymp-to-matic dachshund dachs- hund asymp-totic as-ymp-tot-ic database data-base asp-chronous asyn-chro-nous dat-a-p-ath data-path atheroscle-ro-sis ath-er-o-scle-ro-sis declarable declar-able at-mo-sphere at--phere def ini-tive de-fin-i-tive at-tributed at-trib-uted delectable de-lec-ta-ble at-tributable at-trib-ut-able democrat ism de-moc-ra- tism avoirdupois av-oir-du-pois de-mos demos avo-ken awok-en deriva-tive de-riv-a-tive ban-dleader band-leader diffract dif-fract bankrupt (cy) bank-rupt(-cy) di-rer direr ba-ronies bar-onies di-re-ness dire-ness base-li-neskip \base-line-skip dis-parand dis-par-and bathymetry ba-thym-e-try dis-traugh-tly dis-traught-ly bathyscaphe bathy-scaphe dis-tribute(d) dis-trib-ute(d) bea-nies bean-ies dou-blespace (ing) dou- ble-space(-ing) be-haviour be-hav-iour dol-lish doll-ish be-vies bevies drif -tage drift-age bib-li-ographis-che bib-li-o-gra-phi-sche driver (s) dri-ver(s) bid-if-fer-en-tial bi-dif-fer-en-tial dromedary (ies) drom-e-dary(ies) bil-1-able bill-able duopolist du-op-o-list biomath-e-mat-ics bio-math-e-mat-ics duopoly du-op-oly biomedicine bio-med-i-cine eco-nomics eco- nom- ics biorhythms bio-rhythms economist econ-o-mist bitmap bit-map elec-trome-chan-i-ca1 electro-mechan-i-cal blan-der bland-er elec-tromechanoa-cous-tic electro-mechano-acoustic blan-d-est bland-est eli-tist elit-ist blin-der blind-er en-trepreneur(ia1) en-tre-preneur(-ial) blon-des blondes epinephrine ep-i-neph-rine blueprint blueprint equiv-ari-ant equi-vari-ant bornolog-i-cal bor-no-log-i-cal ethy-lene eth-yl-ene bo-tulism bot-u-lism ev-ersible ever-si-ble brus-quer brusquer ev-ert (s ,ed, ing) evert(s,-ed,-ing) bus-ier busier exquisite ex-quis-ite bus-i-est busiest ex-traor-dl-nary ex-tra-or-di-nary buss-ing bussing fermions fermi-ons but-ted butted flag-el-lum(1a) fla-gel-lum(-la) buz-zword buzz-word flammables flam-ma-bles ca-caphony (ies) ca-caph-o-ny(ies) fledgling fledg-ling cam-er-a-men cam-era-men flowchart flow-chart cartwheel cart-wheel formidable(y) for-mi-da-ble(y) catar-rhs ca-tarrhs forsythia for-syth-ia catas-trophic cat-a-stroph-ic forthright forth-right catas-troph-i-cally cat-a-stroph-i-cally freeloader free-loader cauliflower cau-li-flow-er friendlier friend-lier cha-parral chap-ar-ral frivolity fri-vol-ity chartreuse char-treuse frivolous friv-0-lous cholesteric cho-les-teric ga-some-ter gas-om-e-ter cigarette cig-a-rette geodesic ge-o-des-ic cin-que-f oil cinque-foil geode-tlc ge-o-det-ic TUGboat, Volume 13 (1992), No. 4 ge-o-met-ric geo-met-ric metropoli-tan met-ro-pol-i-tan geotropism ge-ot-ro-pism mi-croe-co-nomics micro-eco-nomics gnomon gno-mon mi-crofiche mi-cro-fiche grievance griev-ance mil-lage mill-age grievous(1y) griev-om(-ly) milliliter mil-li-liter hairstyle hair-style mimeographed mimeo-graphed hairstylist hair-styl-ist mimeographs mimeo-graphs harbinger har-bin-ger mimi-cries mim-ic-ries harlequin har-le-quin mi-nis min-is hatcheries hatch-eries min-uter (est) mi-nut-er(-est) hemoglobin he-mo-glo-bin mis-chievously mis-chie-vous-ly hemophilia he-mo-phil-ia mis-ers mi-sers hep-atic he-pat-ic mis-ogamy mi-sog-a-my hermaphrodite(ic) her-maph-ro-dite(-ic) mod-elling mod-el-ling heroes he-roes molecule mol-e-cule hex-adec-i-ma1 hexa-dec-i-ma1 monar-chs mon-archs halon-omy ho-lo-no-my mon-eylen-der money-len-der ho-mo-th-etic ho-mo-thetic monochrome mono-chrome horseradish horse-rad-ish mo-noen-er-getic mono-en-er-getic hy-potha-la-mus hy-po-thal-a-mus monoid mon-oid ide-als ideals monopole mono-pole ideographs ideo-graphs monopoly mo-nop-oly id-iosyn-crasy idio-syn-crasy monos-pline mono-spline ig-niter ig-nit-er monos-trofic mono-strofic ig-n-i-tor ig-ni-tor mono-tonies mo-not-o-nies ig-nores-paces \ignore-spaces monotonous mc-not-o-nous impedances im-ped-ances mo-ro-nism mo-ron-ism in-f initely in-fin-ite-ly mosquito mos-qui-to in-finites-i-ma1 in-fin-i-tesi-ma1 mu-d-room mud-room in-fras-truc-ture in-fra-struc-ture mul-ti-f aceted mul-ti-fac-eted in-ter-dis-ci-plinary in-ter-dis-ci-pli-nary mul-ti-pli-ca-ble mul-ti-plic-able inu-tile in-utile mul-tiuser multi-user (better inu-til-ity in-util-i-ty with explicit hyphen) ir-re-vo-ca-ble ir-rev-o-ca-ble ne-ofields neo-fields itinerary(ies) it in-er-ary(ies) newslet-ter news-let-ter jeremi-ads je-re-mi-ads none-mer-gency non-emer-gency keystroke key-stroke nonequiv-ari-ance non-equi-vari-ance kil-ning kiln-ing noneu-clidean non-euclid-ean la-ciest lac-i-est non-i-so-mor-phic non-iso-mor-phic lamentable lam-en-ta-ble nonpseu-do-corn-pact non-pseudo-com-pact land-sca-per land-scap-er non-s-mooth non-smooth larceny(ist) lar-ce-ny(-ist) nonuni-f orm(ly) non-uni-form(1y) lif es-pan life-span nore-pinephrine nor-ep-i-neph-rine lightweight light-weight nutcracker nut-crack-er limousines lim-ou-sines oer-st-eds oer-steds linebacker line-backer oligopolist oli-gop-o-list lines-pac-ing \line-spacing oligopoly (ies) oli-gop-oly(ies) lithographed lith-o-graphed operand(s) op-er-and(s) lithographs lith-o-graphs orangutan orangutan lobotomy(ize) lo-bot-omy(-ize) or-thodon-tist or-tho-don-tist lo-ges loges or-thok-er-a-tol-ogy or-tho-ker-a-tol-ogy macroe-co-nomics macro-eco-nomics or-thoni-tro-toluene ortho-nitro-toluene malapropism mal-a-prop-ism (or-tho-ni-tro-tol-u-ene) manuscript man-u-script overview over-view marginal mar-gin-a1 ox-i-dic ox-id-ic mat-tes mattes painlessly pain-less-ly med-i-caid med-ic-aid pal-mate palmate mediocre medi-ocre parabola par-a-bola medi-o-crities medi-oc-ri-ties parabolic par-a-bol-ic me-galith mega-lith paraboloid pa-rab-c-loid metabolic meta-bol-ic paradigm par-a-digm metabolism me-tab-o-lism parachute para-chute met-a-lan-page meta-lan-guage paradimethyl-ben-zene para-di-methyl-benzene metropo-lis(es) me-trop-o-lis(es) (para-di-meth-yl-ben-zene) TUGboat, Volume 13 (1992), No. 4 paraflu-o-ro-toluene para-fluoro-toluene quasiequiv-a-lence qua-si-equiv-a-lence (pareflu-o-ro-tol-u-ene) or quasi- para-g-ra-pher para-graph-er qua-si-hy-po-nor-ma1 par-ale-gal para-le-gal quasir-ad-i-cal qua-si-rad-i-cal par-al-lelism par-al-lel-ism quasiresid-ual qua-si-resid-ual para-m-ag-netism para-mag-net-ism qua-sis-mooth qua-si-smooth paramedic para-medic qua-sis-ta-tion-ary qua-si-sta-tion-ary param-ethy-lanisole para-methyl-anisole qu-a-sito-pos qua-si-topos (para-meth-yl-an-is-ole) qu-a-si-tri-an-gu-lar qua-si-tri-an-gu-lar parametrize pa-ram-e-trize quintessence quin-tes-sence paramil-i-tary para-mil-i-tary quintessen-tial quin-tes-sen-tial paramount para-mount rab-bi-try rab-bit-ry pathogenic pat h-o-gen-ic ra-dio-g-ra-phy ra-di-og-ra-phy pee-vish(ness) peev-ish(-ness) raf-f-ish(1y) raff-ish(-ly) pen-tagon pen-ta-gon ramshackle ram-shackle petroleum pe-tro-le-um ravenous rav-en-ous phe-nomenon phe-nom-e-non re-ar-range-ment re-arrange-ment philatelist phi-lat-e-list re-ciproc-i-ties rec-i-proc-i-ties phos-pho-ric phos-phor-ic reci-procity rec-i-proc-i-ty pi-cador pic-a-dor rect-an-gle rec- tan-gle pi-ran-has pi-ra-nhas ree-cho re-echo pla-ca-ble placa-ble restorable re-stor-able plea-sance pleas-ance ret-ri-bu-tion(s) ret-ri-bu-tion(s) poltergeist pol-ter-geist retrofit (ted) retro-fit(-ted) polyene poly-ene rhinoceros rhi-noc-er-os polyethy-lene poly-eth-yl-ene righ-teous(ness) right-eous(-ness) polygamist (s) po-lyg-a-mist(s) ringleader ring-leader poly-go-niza-tion polyg-on-i-za-tion robot ro-bot polyphonous po-lyph-o-nous robotics ro-bot-ics polystyrene poly-styrene roundtable round-table pomegranate pome-gran-ate salesclerk sales-clerk poroe-las-tic poro-elas- tic salescle-rks sales-clerks postam-ble post-am-ble saleswoman (en) sales-woman(en) postscript post-script salmonella sal-mo-nel-la pos-tu-ral pos-tur-a1 sarsaparilla sar-sa-par-il-la pream-ble pre-am-ble sauerkraut sauer-kraut preloaded pre-loaded sca-to-log-i-cal scat-o-log-i-cal prepar-ing pre-par-ing schedul-ing sched-ul-ing pre-pro-ces-sor pre-proces-sor schizophrenic schiz-o-phrenic pre-s-plit-ting \pre-split-ting schnauzer schnau-zer priestesses priest-esses schoolchild(ren) school-child(-ren) pro-ce-du-ral pro-ce-dur-a1 schoolteacher school-teacher pro-cess process scy-thing scyth-ing procu-rance pro-cur-ance semaphore sem-a-phore pro-ge-nies prog-e-nies semester se-mes-ter progeny prog-e-ny semidef-i-nite semi-def-i-nite pro-hibitive (ly) pro-hib-i-tive(-ly) semi-ho-mo-th-etic semi-ho-mo-thet-ic prosci-utto pro-sciut-to semir-ing semi-ring pro-test-er(s) semiskilled semi-skilled protestor (s) pro- tes- tor(s) seroepi-demi-o-log-i-cal sero-epi-de-mi-o-log-i-cal pro-to-ty-pal pro-to-typ-a1 ser-vomech-a-nism ser-vo-mech-anism pseu-dod-if-fer-en-tial pseu-do-dif-fer-en-tial setup set-up pseud-of i-nite pseu-do-fi-nite severely se-vere-ly pseud-ofinitely pseu-do-fi-nite-ly sha-peable shape-able pseud-o-f orces pseu-do-forces shoestring shoe-string pseudonym pseu-do-nym sidestep side-step pseu-dovord pseu-do-word sideswipe side-swipe psychedelic psy-che-del-ic skyscraper sky-scraper psy-chs psychs smokestack smoke-stack pubescence pu-bes-cence snorke-1-ing snor-kel-ing quadrat-ics qua-drat-ics solenoid so-le-noid quadra-ture quad-ra-ture so-lute(s) solute(s) quadriplegic quad-ri-pleg-ic sovereign sov-er-eign quaint-er(est) spaces spa-ces TUGboat, Volume 13 (1992), No. 4 specious spe-cious va-per vaguer spelunker spe-lunk-er vaudeville vaudeville spendthrift spend-thrift -cars vic-ars spheroid(a1) spher-oid(a1) vil-lai-ness vil-lain-ess sph-inges sphin-ges viviparous vi-vip-a-rous spi-cily spic-i-ly voiceprint voice-print spinors spin-ors vs-pace \vspace spokeswoman (en) spokes-woman(en) wallflower wall-flower sportscast sports-cast wastew-a-ter waste-water sportively spor-tive-ly waveg-uide wave-guide sportswear sports-wear we-b-like web-like sportswriter sports-writer weeknight week-night sprightlier spright-lier wheelchair wheel-chair squeamish squea-mish whichever which-ever stan-dalone stand-alone whitesided white-sided startlingcly) star-tling(1y) whites-pace white-space statis-tics sta-tis-tics widespread wide-spread stealthily stealth-ily wingspread wing-spread steeplechase steeple-chase witchcraft witch-craft stochas-tic sto-chas-tic workhorse work- horse straight-est straight-est wraparound wrap-around strangeness strange-ness wretched(1y) wretch-ed(-ly) stratagem strat-a-gem yesteryew yes-ter-year stretchier stretch-i-er stronghold strong-hold Names and non-English words stupi-der(est) summable sum-ma-ble used in English text su-perego super-ego al-ge-brais-che al-ge-brai-sche su-pere-gos super-egos Al-legheny Al-le-ghe-ny supremacist su-prema-cist Arkansas Ar-kan-sas surveil-lance sur-veil-lance au-toma-tisierter autemati-sier-ter swim-m-ingly swim-ming-ly Be-di-enung Bedie-nung syrup-tomatic symp-tematic Brow-n-ian Brown-ian syn-chromesh syn-chro-mesh Columbia Co-lum-bia syn-chronous syn-chrenous Czechoslo-vakia Czecho-slo-va-kia syn-chrotron syn-chro-tron Di-jk-stra Dijk-stra talkative talk-a-tive dy-namis-che dy-na-mi-sche tapestry(ies) ta-pes-try(ies) En-glish Eng-lish tarpaulin tar-pau-lin Eu-le-rian Euler-ian tele-g-ra-pher te-leg-ra-pher Febru-ary Feb-ru-ary telekinetic tele-ki-net-ic Festschrift Fest-schrift teler-obotics tele-ro-bot-ics Florida Flor-i-da testbed test-bed Forschungsin-sti-tut For-schungs-in-sti-tut tha-la-nus thal-%mus funk-t-sional funk-tsional ther-moe-las-tic ther-mo-elas-tic Gaus-sian Gauss-ian times-tamp time-stamp Greif -swald Greifs-wald toolkit tool-kit Grothendieck Grothen-dieck to-po-graph-i-cal topegraph-i-cal Grundlehren Grund-leh-ren to-ques toques Hamil-to-nian Hamil-ton-ian traitorous trai-tor-ous Her-mi-tian Her-mit-ian transceiver trans-ceiver Hi-bbs Hibbs transgress trans-gress Jan-uary Jan-u-ary transver-sal (s) trans-ver-sal(s) Japanese Japan-ese transvestite trans-ves-tite Kadomt-sev Kad-om-tsev traversable tra-vers-a-ble Kansas Kan-sas traver-sal(s) tra-ver-sal(s) Karl-sruhe Karls-ruhe treacheries treach-eries KO-rteweg Kor- te-weg treach-ery treach-ery Leg-en-dre Legendre troubadour trou-ba-dour Le-ices-ter Leices-ter turnaround turn-around Lip-s-chitz(ian) Lip-schitz(-ian) ty-pal typ-a1 Louisiana Lou-i-si-ana unattached un-at-tached Manch-ester Man-ches-ter unerringly un-err-ing-ly Marko-vian Mar-kov-ian un-friendly(ier) un-friend-ly(i-er) Mas-sachusetts Mass-a-chu-setts TUGboat, Volume 13 (1992), No. 4

Min-nesota Min-ne-sota Ni- jmegen Nij-me-gen Philology Noethe-rim Noe-ther-ian No-ord-wi-jk-er-hout Noord-wijker-hout Novem-ber No-vem-ber Poincare Poin-care Hyphenation patterns for ancient Greek Po-ten-tial-gle-ichung Po-ten-tial-glei-chung and Latin rathskeller rat hs- kel-ler Rie-man-nian Rie-mann-ian Yannis Haralambous Ry-d-berg Ryd-berg schot-tis-che schot-tische The amount of compound words in ancient Greek Schrodinger Schro-ding-er makes its hyphenation by computer a quite difficult Schwabacher Schwa-ba-cher task; it is impossible to predict all combinations of Schwarzschild Schwarz-schild words. To be efficient, a set of patterns must be Septem-ber Sep-tem-ber Stokess-che Stokes-sche accessible to the final user; a scholar must be able Susque-hanna Sus-que-han-na to add patterns, according to new words he/she en- tech-nis-che tech-ni-sche counters. Use of w's\hyphenation primitive is Ten-nessee Ten-nes-see not appropriate since most Greek words are declin- ve-r-all-ge-mein-erte ver-all-ge-mein-erte able: for each word one would have to add a dozen Verteilun-gen Ver-tei-lun-gen Wahrschein-lichkeit-s-the-o-rie hyphenation exceptions. Wahr-schein-lich-keits-the-o-rie After a short introduction to the concept of hy- Werthe-rian Wer-ther-ian phenation by TEX the author presents a method for Winch-ester Win-ches-ter hyphenation of ancient Greek. Using this method. Yingy-ong Shuxue Jisuan Ying-yong Shu-xue Ji-suan he compiled a list of patterns out of a dictio- Zeitschrift Zeit-schrift nary [Bail of 50,000 words. These patterns are pre- sented in a comprehensible format, in a way that scholars can easily determine the patterns that have to be added, to solve specific hyphenation problems. The same approach is applied to Latin. A list of patterns has been compiled out of a dictio- nary [B-C]. The size of this list is very small com- 1 Literate Programming 1 pared to the one of ancient Greek patterns. although Latin also uses compound words. Finally examples of hyphenated classical texts Errata: Literate Programming, are given. A Practitioner's View TUGboat 13, no. 3, pp. 261-268 Bart Childs 1 What do I have to know about hyphenation? The address lyman .pppl .princeton. edu should When creates a format like Plain or LaTeX it have read lyman.pppl .gov (a careless error on also reads information from a file called hyphen. tex my part). The address csseq. cs. tam. edu no (or Ushyphen. tex, or FRhyphen. tex and so forth) longer permits anonymous ftp. Due to some which contains the hyphenation patterns for a spe- network breakins from different places, extensive cific language. These are clusters consisting of let- local network changes are being done and relevant ters separated by digits, like xly2z. The idea is the sources will be placed on f tp. cs .tamu. edu no later following: than January 1993. The author will e-mail any desired sources in the meantime. 0 if your set of patterns is empty. there is no hy- o Bart Childs phenation at all. Texas A&M University a if you have a pattern xiy then on every occur- Department of Computer Science rence of the cluster "xy", hyphenation "x-y" College Station, TX 77843-3112 will be possible. If the pattern is xlyzw, then bartQcs.tamu.edu the pair of letters "xy" will be hyphenated only when followed by "zw" . TUGboat. Volume 13 (1992), No. 4

if there is a pattern xly and a pattern x2yabc. comprehension of a word. they rather obstruct the then the pair "xy" will be hyphenated, except work of the computer. Because for the computer when it is followed by "abc". So the digit 2 a. &. ?i.a, it, &, etc., are dzstznct entities. So indicates an exception to the rule .'separate z tmi and insi are to be treated as entirely dis- and y". tinct words. In most languages declension affects the same holds for greater numbers: 3 will be only endings of words: ~A~HEI~,3~aw~sr. ~A~HMK). an exception of patterns with number 2, and so ~J~HZP.3~a~~elr. 3,qa~mn and so forth. In Greek, on. You can now read [DEK], pp. 449-451. for the root of the word remains mostly the same (ex- more details on W'shyphenation algorithm. cept in cases such as 6 bvip, TOG bv6pb~)but the a dot in front of (or behind) a pattern specifies accent migrates: 6 &vOponog, to6 kvOp6nou. It fol- that the latter is valid only at the beginning (or lows that when creating patterns, one must consider the end) of a word. In this way, for example. all possible diacritics and their positions. . xy2z. will be applied only to the word .xyz'. To illustrate this, here is an example of two Despite the existence of some fundamental words which look very similar but are hyphenated rules, hyphenation of a particular language can be in two different ways: very complicated, especially when it depends on ety- &+-oppoc (from B+ and Bpvvp) mological criteria. There are two ways to handle this and complexity: one can investigate the hidden mecha- &+6-ppoog (or b+6ppou<. from B+ and ,bdw). nisms of hyphenation and make patterns correspond We will decline them and try to extract the neces- to the analytical steps of manual hyphenation; or sary patterns so that can correctly hyphenate one can use a "pattern generator" like PATGEN on a them. in all cases1: sufficiently representative set of already hyphenated words. The choice of the method depends on the na- B &+oppo< B &+6ppoog toi, h+6ppou toi, &+opp6ou ture of the language and on the size of the available set of hyphenated words: theoretically one could cre- + &+6ppy 74 h+opp6y zbv &+6ppoov ate a file containing all words of a particular lan- zbv &+oppov ij &+6ppos guage in hyphenated form; the pattern generator 6 &+oppe would then give an exhaustwe set of patterns. Since ol &+oppoi oi &+6ppoot it is more probable to have partial sets of words, the rijv h+6ppwv TGV &+opp6ov "pattern generator" will only produce more or less zois &+6ppot< zoiq &+opp6oi< good approximations. For ancient Greek and Latin, tab< &+6ppou< zob< &+opp60u< the author has chosen the first method. 6 &,boppot 6 h+6ppoot For the word h+oppog it would be enough to intro- duce patterns &+-opp and h+-6pp. In this case, the 2 Why is hyphenation of ancient Greek so word &+6ppoo 1 will be set of rules, compound words are separated, except vowels and c,, n 2 1 consonants): when an eclipse has occurred: napQxwis hyphenated as if it was a simple word: nu-pi-xw. instead of mp- 1. WHEN A SINGLE CONSONANT OCCURS BE- ixo as suggested in [Chi]. Following the rules of the TWEEN TWO VOWELS, DIVIDE BEFORE THE Academy of Athens would result in a completely dif- CONSONANT: vl-cv2. The necessary patterns ferent set of patterns, since the eclipse phenomenon will be alp, uly, a16. . . . ol+ where vowels are occurs very often. taken with all possible combinations of accents. The patterns we have introduced thus far are spirits, dizresis and subscript iota. These pat- not sufficient for fundamental hyphenation. We still terns cover also the case of a vowel followed by must introduce two families of patterns: more than one consonant; this feature will be useful in rule 4. Pairs of vowels are to be separated, except in the case of diphthongs. This leads to patterns 2. IF A CONSONANT IS DOUBLED, OR IF A MUTE IS FOLLOWED BY ITS CORRESPONDING AS- ulct, al~,ulq, al'i . . . olo including all diacrit- PIRATE, DIVIDE AFTER THE FIRST CONSO- icized vowels. NANT: vlcl-e2v2 for c1 = c2, or (el, CZ) E 0 In Greek, the smallest part of a word remaining {(x,v) , (T,0)) (x, X) , (y, X)). The patterns will be on a line is a syllable. This may shock a Tj$ 2plp, 2yly . . . 2+1+ for the first part of the user, but hyphenations like &-npoo&ppomoqand rule, and 2nlv, 2210, 2x1~~2ylx for the second. dn~be~-ware allowed, and can frequently be For grammatical reasons, it would be best to found in books. The problem is that by setting exclude 2plp (and 2645) from these patterns. \lefthyphenmin and \righthyphenrnin equal 3. IF THE COMBINATION OF TWO OR MORE CON- to 1, one can eventually separate single conso- SONANTS BEGINS WITH A LIQUID OR A NASAL, nants, which do not form syllables: Fijpo-v is DIVIDE AFTER THE LIQUID OR NASAL [although Wnically allowed, since \righthyphenmin=l. not stated in the rule. it follows from the exam- but should be avoided. For this we just have ples given in [Chi] that two consecutive nasals to introduce patterns 2P.. 26. . . . 2+. [or even should not be separated]: vlcl-cz . . . c,u~, for 6P., 66. . . . 6+. to be sure that no forthcoming cl E {A, p, p.~)but vl-cl . . . cnv2 if (el, c2) = exception will affect them]. 460 TUGboat; Volume 13 (1992), No. 4

What remains now are patterns concerning sep- words. By checking in the list, one can instantly ver- aration of compound words, according to rule 5. ify why a specific word is hyphenated in a particular These are described in the following section. way; once this is understood, one can add the nec- essary pattern(s) to remedy to the situation. This is highly inadvisable for a pattern file created by a 4 Hyphenation of ancient Greek "pattern generator", where a simple change can have compound words very strange and obscure results (until now pattern No puede combinar unos caracteres dhcm- files always started with the most categorical phrase rlchtdj que la divina Biblioteca no haya pre- [NOT TO BE CHANGED IN ANY WAY! I ). visto y que en alguna de sus lenguas secretas To facilitate even more the comprehension of this list of patterns, the author has chosen to present no encierren un terrible sentido. . . it in a very special format. Here is a sample excerpt writes J. L. Borges in the "Biblioteca de Babel"; the of the pattern list which the reader can find in next situation is similar for ancient (or modern) Greek section: compound words. By combining words one can eas- ily exceed Mark Twain's "Mekkamuselmannenmassenmenchenmorder- mohrenmuttermarmorn~onumentenmachen", given in [DEK], p. 451. As already pointed out, one could make patterns out of all possible roots, so The words abt6-oo(u~o<)and a8to-oo(btou) consti- that any possible combination of them is correctly tute one entry. In both cases, the patterns them- hyphenated. The problem is, though, that the com- selves are given in straight characters: abt6-oo and binations of letters forming these roots can also oc- aha-oo. The slanted endings between parentheses cur inside single words, and only by their meaning are just possible examples, which justify the exis- can one decide if a particular root is present in a tence of these patterns. It is important that the word: nsvtepqq is formed by nsvr- and -qp- (from reader realizes that these examples are not unique &pa). The words tpnjpq~,pov$pq<, tqfipq<,a11 con- but just indicative. So only what is written in tain the same root -qp- But introducing a pattern straight letters will appear as a pattern. 3q4p3 would cause tremendous problems, since thou- The entry 6.q-, &q- is called a rule. Because of sands of words contain the cluster qp, hyphenated as its frequency, the author has preferred not to give q-p: tsxpfi-PLOV,074-plypa, xq-p6a and so forth. The any example, and to present it "as a general rule". fact is that such patterns should be avoided, or in- The symbol introduces exceptions, and exceptions troduced only after extensive investigation. + to exceptions. The difference is shown by indenta- The author has chosen a different method. In- tion. In this case, h-cp&h is an exception to &cp-, and stead of introducing patterns for roots of words, only hcpblou (genitive case of ijlcpahog) is an example of a beginnings of words are taken into account. In this word starting with this cluster. hy-&hA is an excep- way, when writing for example .i4v3 one can be sure tion to &-y&h,and &y&Ahoya~a possible example. that only words beginning with the prefix iv will Same thing for hy-, h-cqhv, hy-avF. be affected. Exceptions to this rule can easily be Let's take a look to the concrete realization of found by consulting the dictionary. This method these patterns: since hy- is an exception to the fun- is very effective in hyphenating the most frequent damental hyphenation rules, the pattern can for ex- words, but fails when new compound words are to ample be .h2yl; the exception &-rqhA could be ex- be hyphenated: in-arvG and xat-alvG will be cor- pressed as "zf by rectly hyphenated (since patterns in- and xat-al are is followed by &A, do not cut be- y &, & This included in the list) but not an eventual xar-m-a~vG, tween and but do cut between and y". leads us to the pattern .b3y2hh The reader can unless of course the user adds a new pattern xat-en- . verify that the further exception hy-&Ah requires a to the list in section 5. pattern like .&4cp3&AA Another advantage of this method is the fact . In the next section, the complete list of patterns that, contrary to most pattern lists, such a list is extracted from [Bail is presented, in the format ex- easily comprehensible, and hence can be completed plained above. easily by the final user himself (who does not have to be a %-guru). This comes from the fact that - except for the fundamental patterns explained in the previous section- all patterns are beginnings of TUGboat, Volume 13 (1992), No. 4

5 Patterns for ancient Greek compound hv-hEt(og). hv-at;i(ou), hv-a&(dzepog) words hv-crnh6jo) hv-axoF~(ixzo<) byan-fiv(op), hyan-qv(6pwv) hv-an6Fp (otozog), av-anobp (horou) hyeh-hp(~qg), hyeh-ap(~6v) &v-hno~(vog), av-anoi(vou) ayp-u(nvog), &yp-6jxvou) hv-an6Xa(uorog), hv-axoXa(iozou) hyx-6(paAog), hyx-w (pOiAou) hv-an60 (razog), av-anoo (zoizou) hywv-h (p~qg), hywv-a(px6v) ~V-&~T(~),&V-~+(U) atxp-&A (ozog), ccixp-ah (Bzou) &v-ap (Opog), bv-hp (Opou), Zxv-ap (iepqzog) hxp-Qv (u~og), hxp-wv (ixou) hv-haxq (zog), &v-aoxfi (zou) hxp-Qp(eia), ixxp-wp(cia~) &v-mo (g), inv-&so (u) , &v-hm(v) hhi&av(Fpog). hh~&hv(Fpou), &hat-av(Fpivb~) + hva-soh(4) &p-a(&), &p-hjtqg), &p-a(&%) &v-au (Fog), hv-a6 (yqrog), hv-au(y+pov) hpph-w (xbg) + &-vaug hpx-dx(w), hpcp-kE (w) clv-acpp6F (izog), hv-acppob (izou) + &p-*-x&-x6 (vq) hvFp-hy (pia), &vFp-ay (aOio) &px-i(oXw), ixyn-L(upiopai) hvbp-ax(0fig) hpcp-ay (axhGd) hvbp-aix(cAog), av&p-etx(6Aou) hpcp-ap (aj36w) hvsp-qh (oizqg) hpcp-kn(wj &v-E, bv-i. hv-E ~P'P~PX(OP"~) + &-veu hp(p-fi(xqd, ~p'P-q(xGv) + h-vdpjAogj, &-v&(pd(kou) &pq-Lhx(w) + in-~&+(~a) hpcp-L@.(vo) &v-q, bv-fi, hv-?j, bv-q hpcpio-P(awa), hpcp~o-P(ctzkw) + k-v4p, a-v+p hpcp-ior(rpi), hpcp-10s (Tjuo) hve- + hpyi-oso (poq), hpp-os6(pou) + &v-qqulgj &ppou(Fi<), &~*(P-o~(FEw<) + &v-0ep(ov), ixv-0ip(iov), &~-0ep(icopar) &pcp-os(o<), hpcp-Br (ou), hpcp-wsjiq) + hv-0ko, &~-0ds(ig), clv-0fo(pev) &v-ayvo(g), &v-ayva, hv-hyvo (u), hv-hyvo;, + hv-8W (pcv), &~-0ei(ze), hv-0ofi(ui) hv-ayo(pc6w) + av-Bfio(ewg), av-0qp(bg) hv-hyw, &v-ayhjyiov), hv-ayw(yfi) + hv-Oi([w), &v-0t(vbg) &v-hbeh (yo<), &v-aFih (pou) + hv86(xpoxog), hv0o- (xpdxou) hv-ad (po) + hv0-op(ohoyo6pai) hv-a0pk (o) + hv0-on(Ai(w) + clva-0pi+ (w) + kv0-op (ph) av-at (pog), &v-ai (vopai), bat(ago), hv-SLL(pod) + bv0-oojpia) bv-hxav (Ooq), clv-axhv (Oou), ixv-axav (Oivov) + hv-0pjaxsLg) &v-axio (par), kv-ax& (at) &v-L, hv-i. bv-r hv-axo(6pa1) + in-vixq(zog), &-vtxfi(zou) hv-axox(fi) + h-v~xs6(noug) &v-ahccX (h@) + ti-vrn(zog), h-vixso(u), h-vinzo(v) hv-hhy (qzog), ixv-a)il(fig) &v-o, hv-6, hv-o hv-ahjlfJ(qg), hv-ah$(eg) a-v6q(zog), h-vofi (zov) hv-ahi (uxw) + &-vopo (g), h-v6yo (ug), ix-v6pw (v) &v-ahx (ig), ixv-hhx(iFog), hv-ahx (eia) + &-voo (g), h-v6o(u) hv-ahh(oiozog) + &-voo (og), in-v6o(ov) &v-ahp(og), hv-hhp(ou) + hv-6o~(og), hv-ooi jou) hv-ah6 (w) + h-vou0(hqzog) + hva-X6y (wg) bvs-&, hvx-u &v-ah(og), &v-hk (ou), bv-ah(hepo;) &VT-k, ~VZ-E hv-hhw (zog), bv-ah& (zou) + hv-reiv(w) ixv-apht (auzo<), hv-apaE (e6zou) + av-rUh(w) hv-aphp (zqrog), hv-apap (zrjzou) bvs-fi, hvs-q bv-hpP (azog), hv-apP (hou) ixvt-to6 (w) hv-ap'p(ihoyog) avr-~ox(upicopar) &v-avF (pog), hv-hvF (pou), hv-crvF (pia) hvs-0, hvs-u. ixvs-w hv-av~(ippqzog) &v-u, hv-6. kv-u &v-WUT(a), hv-hvr (75) + &-vuyqjog), &-v6pcp(~vzog), 21-vupcp(e6rou)

TUGboat, Volume 13 (1992), No. 4

xat-eyy (udw) xaz-i6 (w) + xazf-6p(aOov)

xaz-ep (yhropar) xaz-ao (Oh) xaz-au (qp~pedw) xaz-ecp(cil;iopu1) xaz- kx(w) xar-4, xaz-q xas-i, xas-L x&s-0, xas-6, xas-o

xevzp-qv EX*^) xkpx-ou (pog)

x6xX-w+, xJxX-wnjog), xuxh-6n(wv) xuv-ah (dnq5) xuv-68 (oug), xuv-06 (dvzov) TUGboat, Volume 13 (1992): No. 4 p6v-in jnog), pov-in(nou) nahui-x0(ov), nahat-~8(dvwv) pov-68 (oug), pov-08 (6vrov) xcrhiv-. nah~v- pov-W (&) nuh-iw (&), nah-id(fsog) pov-d+, pov-b+, pov-ijnjog), pov-hn(ov) xkv-, 7CcrV- pu0-iay(j3og). pu8-ihp (pou) + na-vog. xa-v6<, xu-vi, na-vi, nit-va pup-ah(oyia) + nh-vu P~P-E(W) nap-hy (w), nap-ay (yWhw) puus-ay (w yio) + napa-ye j6w) vaxp-hy (y~hrog), vexp-ay jykhrov) + naps-yri(p&o) V"~Y(&pw + napa-yi (yvopar), napa-yt(yvdps0a) vexp-ax(a6qpia) + naph-yp (api*a), n~p9-p(a?fi) vouv-ex(dvzog) + napa-yujpvdo) vuxs-ey (spriw) nap-aa (ism) vuxt-qy (opkw) nap-ai(orog), nap-at(ouw), nap-atjvko), nap-a~(oodpe0a) vuxvp("cP?jd nap-axp(&(w) vuxz-oJ(pwv), vuxs-oi)(poq) nap-axoh(ou0dw) Sev-ay (wyk) nap-axov (oiw) ~EV-an(&zqg) nap-hxo(uupa). nap-axojriw) Ssv-qA (azkw) nap-ah(oq), nap-hh jou), nap-ah(ia) 68-q (ybd + napa-Xh(pnw), napa-Aajppoivo) 68-06 (vsxa), 68-06 (vexa) + napa-Aiy (w) oix-oup(6g) + naph-hei(+g), napa-heijno), napa-As~(xrkov) oix-ocp (ehia) + nap-aheicpjw) oiv-hv8 (q), oiv-av8(Gv) + naph-h~p(voq), napa-hip(vou) oiv-ep (aozfiq) + nap&-hoy jog), napa-h6y (ov), napa-Aoy (i(opar) oh-o+. ob-on jog). oiv-6xjwv) + naph-Au(org), napa-X6(uawg), napa-Xu(nio) oiov-ei, oiov-EL nap-apa (ptoivw) oi6o-xsp, oi6o-TE nap-a$ (hrivw) Bxraxro- (~Uror) nap-aps (ipw) 6xt-.ild?ld, dx.c-.iip (4 + nccpa-pLv(w) bxswxa~8ex-k(zqg) + napa-yes jpio) dX~y-av(6pia) nap-apx(dxw) 611y-&p(~qq), Bhy-ctp(rasIa) nap-ava (yryvduxw) bh~y-6te(poc), 6h~y-orijpov) + mpa-vai(as&o) BAiy-op(og), 6Aty-dp(ou) nap-avi(qpr), nap-av~(axdps0a) 8p-ur(pog), 6p-aijpou) + xapa-vrx(+) 6p-hh(rxog), 6p-M.h(4 nap-uvoiy (a) 8p-au(hog), 6p-a6jhou) nhp-avsa 8p-EU(voq), 6pe6 (vou), bp-eu (vizqg) nap-ho (pog), nap-a6 (pou) ~p-rl(p4,bp-.il(pou), ~P-~(Y&P%) nap-anas(oiw) Bp-!(hog), by-i(hou), 6p-~(hiaj nap-anacp (iuxw) 8p-~(pog), Bp-6p(ou), by-opjdprog) nap-hnt (w) 6p-oup jog), 6p-06p (ou) nap-hp(Opqorg), nap-ap(0prjaawg) 6p-dv (vpog), 6p-wv ($0~) + naph-ppjupa), napa-pp(6pazog) 6ydp (opoc). 6p-up (dylrog) nhp-au(hog), nap-a6 (Aou), nap-au(F&o) 6v-qA (a~qg) xhp-&(6pog), nap-d@pou), nap-~(yypoinrov) 65-hh (h) + na-pLo, na-pkejrg) Bnou-ocv, Bxoo-r~(o6v) 7~.hp-ri(w),nap-fi(yopoc), nap-.?(W, nap-q(Po) 6px-wp6(urov), opx-wpojuiou) nhp-L(uog), nap-i (uou), nap-L(nneh) 60-qp(ipar) dip-o(8og). nap-6(80u), nap-0(6~6~) Bu-zs + nh-pog 80-rrg + ~cc-P~v(~o<) ijr-av nap-pq (uia) 066-onoo-tt(oh~), 068-oojzruoGv) nap-6(ylarvov), nap-u(paivo) 068-ap(6g) nhp-~(~pog),nap-6(~pou), nap-wjvvpici) 06x- (ow), oh-(06v) + na-phv. xa-phv + oiLxfd(v) xazp-hy (aOog), xasp-ay (aOia) 6+-d(vrov), 6+-w (viou) natp-ah (oiag) na~8-oh(kzerpa) nacp-wv6(p~og), nasp-wvujpiou) TUGboat, Volume 13 (1992), No. 4

nooo-4 (papas), nooo-ij (pap). nooo-q (pcipwv) xp6o-, xpoa-

+ npo-oriv (w), npo-orev (&(a) + np6-mepv (oc), npo-azkpv (ou), xpo-ozepv (i6ro1 + np6-oq(ov), npo-ozG(ou), npo-ot@(ov)

owp-ao (xkw) TUGboat, Volume 13 (1992), No. 4

A LATIN WORD HAS AS MANY SYLLABLES AS IT HAS VOWELS OR DIPHTHONGS (z, au. ei. eu. ce, ui). Concerning word division, this rule should be interpreted as "vowel clus- ters should be separated, except when they form a diphthong": vl-uz, for (vl, uz) pf a,1, (a , e,9, , 1,0, , u,4. The necessary patterns are ala. alae (since TEX con- siders ae as one character) ali, alo, aice (same remark) eia, eke, eie, elo, eice, ila, iiae, ile, ilo, ilce, ili, ilu, oia, 012, oli, 010, ole, olu. ula, ulae, uie, uio, ulce, ulu. WHEN A SINGLE CONSONANT OCCURS BE- TWEEN TWO VOWELS, DIVIDE BEFORE THE CONSONANT: u1-~1u2. The required patterns will be iba, ibae . . . Izu. IN THE CASE OF TWO OR MORE CONSONANTS, DIVIDE BEFORE THE LAST CONSONANT EX- CEPT IN THE COMBINATIONS: MUTE (p, ph, b, t, th, d, C, Ch, g) $ LIQUID (I, T), AND qU OR gu. The first part of this rule can be expressed as

0

0

0 The required patterns will be ph21, ph2r . . . ch2r, p21 . . . g2r and p2h. t2h, c2h which is not stated in the rule but seems to be an im- plicit consequence, especially since "th" , "ph , "ch" are just transliterations of the Greek let- ters 0, cp, X. The second part of the rule ("and qu or gu") is not clear. According to the examples given in [Chi] ( "e-quus" , Yin-gua" ) the author esti- mates that the correct interpretation is "con- szder 'qu' and 'gu' as szngle consonants". It follows from this interpretation, that these two clusters form exceptions to rule 1 and that hy- phenations "qu-a", "gu-a" . . . "gu-u" should be prohibited. The required patterns are qu2a 6 The fundamental rules of Latin . . . gu2u. hyphenation, and the corresponding COMPOUNDWORDS ARE SEPARATED FIRST patterns INTO THEIR COMPONENT ELEMENTS; WITHIN EACH ELEMENT THE FOREGOING RULES AP- Taken from [Chi] (9.56-9.59), here are the rules PLY. The patterns needed to fulfill this rule of Latin hyphenation and the necessary patterns will be discussed in next section. (v,, n > 1 will be vowels, including z and ce, and c,. n 2 1 consonants) : 468 TUGboat, Volume 13 (1992)) No. 4

There is no mention of minimal left and right a-spern (ari) hyphenations; after comparing several Latin edi- a-spi (cere) tions, the author considers the traditional values a-ste(rnere) for \lefthyphenmin and \righthyphenmin to be 2 a-sti (pulari) and 3 (as in English). a-stre (pere) a-strin (gere) a-strue (re) 7 Hyphenation of Latin compound words a-stup(ere) cav-j jdium) As with ancient Greek, the first idea would be to circum- make patterns out of roots: "ab" is such a root, cis-a1[pinus) a pattern ab would insure hyphenation of "ab- cis-rh (enanus) undare" , "in-ab-undare" and so forth. The problem com- is again that the cluster "ab" is contained in thou- + co-metjes) sands of other words, where it should be hyphenated + co-mi [cus) as LLa-b'l("la-born , "pro-ba-bi-lis" , "fa-bu-la" , etc.). + co-mff (dia) Therefore the same method is applied as in ancient de-sc (endere) de-sp (icere) Greek: only beginnings of words are taken into ac- de-st (inare) count. As the reader will see in next section where di-ch(oreus) all patterns are listed, hyphenation ab- at the begin- di-gn (oscere) ning of a word is a general rule, with certain excep- dir-im (ere) tions ("a-bacus", "a-bitus", and so forth). To hy- di-scrib (ere) phenate correctly the word "abs-cidere", a pattern di-sperg (ere) "abs-ci" has been introduced; this pattern produces di-spi (cere) wrong hyphenation of word "ab-scindere". and so a di-sta [re) second pattern 'lab-scin" is introduced. This explains the format of the pattern list in ex- next section: indentation and the symbol + indi- id-eo cate entries, exceptions and exceptions to excep- in- i-nan(is) tions. The endings of words placed between paren- + + ianim(us) theses are just examples, THEY ARE NOT TAKEN + ind-ue(re) INTO ACCOUNT IN PATTERN CONSTRUCTION. En- + ind-ep (tus) tries in boldface are "general rules". For these, no + ind-ig(es) example is given. The same format has been used + ind-ip (iscor) in the list of patterns for ancient Greek compound + ind-ue(re) words, in section 5. + ini-ti(a) inter- long-jv (us) 8 Patterns for Latin compound words neg-oti (urn) ob- ab- + obli-vi(o) a-bac(us) + + oblon- (gus) a-bit (us) + + obff-di(re) abs-ce (dere) + pjn-ins (ula) + abs-ci(dere) per-, post-, prj- ab-scin(dere) + prod-ir (e) abs-co(ndere) + prod-es (se) + abs-que prod-ig(ere) abs-te (mius) + pro-sc(jniurn) abs-ti (nere) + pro-sp (ect us) + abs-tr (ahere) pro-st (are) ad- quinc-un [x) a-gnasc (i) quot-an (nis) amb-i (gere) re- antid-ea + red- (arguere) a-sc (endere) re-don (are) a-sperg (ere) + + re-dor(mire) TUGboat, Volume 13 (1992), No. 4

+ re-duc(ere) esse, de ter-tia ui-gi-lia cum le-gi-o-ni-bus tri-bus e sat-ag (ere) cast-ris pro-fec-tus ad eam par-tem pe-ru-e-nit quz sat is-ac (cipere) non-dum flu-men transti-e-rat. Eos im-pe-di-tos sem-un (ciarius) et in+o-pi-nan-tes ad-gres-sus mag-nam par-tem eo- sem-us (t ulatus) rum con-ci-dit: re-li-qui sese fugz man-da-runt at- sesc-en (naris) que in pro-xi-mas si-luas ab-di-de-runt. sic-ut (i) sub-, super- from CE-sa-ris Corn-men-ta-rii su-scr (ibere) de Bello Gal-lico. /CE] su-sp (icere) ter-un(cius) trans-ab- (ire) 10 Availability trans- The files AGRhyphen. tex and LAThyphen. tex con- tran-sil (ire) + taining hyphenation patterns for ancient Greek and + tran-su(ere) + trans-us(que) Latin (as described in this paper) are part of the vel-ut (i) Scholarw package. The hyphenation patterns for modern Greek mentioned in section 2 (file GRhyphen.tex) are in 9 Examples the public domain; they are included in Euro-Ozm and can also be obtained directly from the author. Follow some examples of hyphenated ancient Greek Readers interested in Greek (ancient or modern) are and Latin texts. The symbol t indicates hyphen- invited to join the ELLHNIKA discussion list, by send- ation using patterns from sections 5 and 8. ing the SUBSCRIBE ELLHNIKA command to 'EvzsG+0ev t(+s-Aab-vel oza0-pobq zpdg na-pa- [email protected]. a&y-yag mv-ze-xai-FE-xa k-xi zbv EG-cpp&-zqv no-za- p6v, dv-za zb sbpoq z~t-z&-puvma-Fi-ov xai x6-hrg a6-26-81 Q-x~kopa-y&-Aq xai €6-Fai-pwv O&-+a-xog References 6-vo-pa. 'Evzabt0a I-PEL-vev3-pi-pag xiv-TE.Kai KG- I. KahA~zoouv&xqq(siaqyqz4g), 'OpBoypa- pog ~~.s-za-7csy-~&-p~-vogtoLg ozpat+q-yobq zi3v 'EA- pxbv &bypappa zflg 'AxaFqpiag 'ABrjvdv, 14-vwv I-As-~EV8-TL 4 8-Fbg I-ool-zo npbg pa-01-Ad-a IIpaxz~xbt.'AxaFqpiaq 'ABqvijv, z. LF', 1939. pi-yav aiq Ba-pu-AG-va xai xs-h~b-s~aG-zotg A&-yew za6-za roiq ozpa-z1-rj-talg xai &-va-xsi-8&~v&-xa-o8~~. A. Bailly, Abrdg4 du dictionnaire grec- O'i Fi nol-+av-teq ix-xAq-ai-av hx+4y-ye-Aov TUG-za. fran~ais,Hachette, Paris, 1901. oi Fi ozpa-tl-Cj-ra1 b-xa--hi-xal-vov zoig azpastq-yoig, H. Bornecque et F. Cauet, Dictionnaire xai I-cga-oav aG-rot< n&-ha1mGz' d-86-zaq xpb-nzelv, latin-fian~ais, Librairie classique Eugkne xai oGx 2-cpa-oav i-i-val, t-inv pfi z~gab-zoiq xpfi-pa-za Belin, Paris, 1990. 81-FQ. 6-omp zoiq xpo-zd-po~gps-zix KG-pou b-va-PC-UL Cksar, Guerre des Gaules, trad. par L.-A. [na-piz, zbv xa-zi-pa TOG Kb-pou], xai za6-za oGx 6-xi Constans, Les belles lettres, Paris 1984. p&-xrp i-6v-zov, hh-Aix xa-Ao6v-zog TOG na-zpbq KG- The Chicago Manual of Style, The Univer- pov. TaO-ta oi ozpaztqyoi Kb-pct, hxf4y-yd-Aov. sity of Chicago Press, Chicago and Lon- "0 F'bi~t&-ox~-zohv-Fpi i-x&-ozct,86-oslv dv-TE &p- don, 1982. yu-pi-ou pvkq, i-xixv sig Ba-pu-AG-va 4-xu-al, xai zbv D. E. Knuth, Computers & Typesetting, pl-00bv bv-ss-A-fj pi-XPLbiv xa-za-otfi-q robq "EA-Aq- A: The Wbook, Addison-Wesley, Read- va< &i< 'I-w-vi-av x&-ALV.Tb piv Ffi no-At to6 'Eh-Aq- ing, 1989. v1-xoO 06-zwq &nei-oQq. XBnophon, Anabase, trad. par P. Mas- from Ewe-@v-zog K6-pou 'A-v&/3a-org. [EEv] queray, Les belles lettres, Paris 1970. Flu-men est Arar, quod per fi-nes Hz-du-o-rum et Se-qua-no-rum in Rho-da-num in-fluit, in-cre-di- bili le-ni-tate, ita ut ocu-lis in ut-ram par-tem fluat iu-di-cari non pos-sit. Id He-lu-e-tii ra-ti-bus ac lin- tri-bus iunc-tis transti-bant. Vbi per ex-plo-ra-to- res CE-sar cer-tior fac-tus est tres iam par-tes co- pia-rum He-lu-e-tios id flu-men tra-du-xisse, quar- tam fere par-tem citra flu-men Ara-rim re-li-quam TUGboat, Volume 13 (1992), No. 4

The Exotic Croatian Glagolitic Alphabet In 1248, by the decree of Pope Innocent IV, Croats were allowed to practise Glagolitic liturgy Darko ~ubrini~ (i.e. early Croatian), using holy books written in Dedicated to the memory of Gordan Lederer Glagolitic instead of Latin or Greek. This decision (1958-1 991) of the Pope was unique in medieval Europe- Croats were the only nation in Europe who were Just for fun, one day I decided to write my own allowed to use their own language in liturgy instead name in Glagolitic letters. I was very proud of the of Latin. result: Uhhhca ~a~6z~sw.Without creating TfjX Even today the Glagolitic liturgy is preserved Prof. Donald Knuth probably would have never had in some parts of Croatia, with priests still singing opportunity to see his name written as in early Croatian language as in St. Cyrill's time (the ninth century!). The Glagolitic alphabet has probably been our most important cultural (The h = k was dropped because it is not pro- monument for thirteen centuries of difficult, but nounced.) rich life in Europe. The origins of the Croatian Glagolitic alphabet As for the name of Croatia, let me mention are still mysterious. The only thing we can state for by the way that the French and German names for sure is that it has existed in my homeland for more tie -cravate and die Krawate -were coined from than a thousand years, i.e. since the ninth century. it. It would take us too far from our purpose to tell Croats have been living in their homeland since in detail this very interesting story. the seventh century and they were the first among There are thousands of monuments, pergament Slavs to be Christianized. It used to be generally letters and books written in the Glagolitic alphabet. regarded that the Glagolitic alphabet was created One of the most beautiful certainly is "Misal" by St. Cyrill, a Greek apostle from Thessaloniki, (or Mxahdb), printed in 1483, most probably in but now there exist several very different theories the Croatian town of Kosinj, only 37 years after about its origins. However, the fact that Croats had Gutenberg's invention, or only six years after the already been Christianized when St. Cyrill was born first printed books appeared in Paris and Venice, (825), together with the unique multiorthographic or 70 years before the first book was printed in tradition of written documents (Glagolitic, Latin, Moscow. Like Gutenberg's Bible, it has many Cyrillic) in medieval Croatia, and above all, more ligatures. Unfortunately, in 1493 there was a than a thousand years' history of Glagolitic script in penetration of the Turkish Ottoman Empire, which Croatia, seem to prove that the origins of Glagolitic was stopped in Croatia (until the XIXth century!). script are authentically Croatian. This did not allow a normal development of printing One of the earliest Glagolitic inscriptions we as in other parts of Europe. Despite very difficult know of in Croatia can be seen on a stone monument conditions many Glagolitic documents bear witness found in the church of St. Lucy near the city of to surprisingly rich cultural activity in medieval Bashka on the island of Krk, dating back to around Croatia, especially on the island of Krk and the 1100 AD. It is the oldest known monument written Istrian penisula. in my native tongue which mentions the name of Glagolitic books for Croatian priests were also Croatia (i.e. Hrvatska) and the name of the Croatian printed in Venice, which even had two Glagolitic king Zvonimir . churches at one time, then in Rome. With the Through the Glagolitic alphabet Croats kept in help of Croatian protestants books were printed touch with other European cultures of the Middle in Wittenberg and Urach in Germany. One of Ages. For example, in 1347 the famous Czech the founders of protestantism in Europe was the king Charles IV established a Glagolitic convent Croatian philosopher Flacius Illiricus. The Gla- near Prague, where Croatian priests were teaching golitic alphabet was also taught in the city of the Glagolitic alphabet. Similarly, the Polish king Dubrovnik. Besides in Croatia, Croatian books Wladislav I1 Yagiell organized (in 1390) a Glagolitic and manuscripts written in the Glagolitic alphabet convent near Krakow. are now kept in Rome, Sankt Petersburg, Berlin, Especially interesting is the story of the old Vienna, Innsbruck, Moscow, Copenhagen, London, Glagolitic book handwritten on the island of Krk in Oxford, Constantinople, Paris, Tours, New York, Croatia, that somehow came from Prague to Reims Krakow, Porto, Budapest, Trento, Padova, Sienna, in France. There, for centuries afterwards, French and some other places. kings were sworn in by putting their hands on this There are a few Glagolitic letters that came holy book (it still exists). from Greek, like Q, (f), 3 (e); the letter u (sh) came TUGboat, Volume 13 (1992), No. 4 471

from Hebrew. You will also find these letters in Cyrillic script, created later by the followers of St. am e$ mi 0 olju Method in Bulgaria on the basis of the Greek uncial script. a bl Z ko a!? ml 3 ot Of course, one can find some similarities with bo li @ mlc nl[l pl other Cyrillic and roman letters, but the difference is considerable. It is interesting to note that $ br lo d mo pivr the Glagolitic A = is almost the same as the il abO it 4% ms d so Ethiopian 'ha'. I learned that in a very interesting ili lv ? no tvr article [I]. The complete font, together with numerical it bfO lju a 01 vod values, looks like this: jur dfOb ljud oli 86 zr Ligatures give a special flavor to Glagolitic A 1 0 manuscripts. As an example, the Glagolitic expres- B 2 P sion for 'moon' is in some manuscripts given by v 3 R &% (in Croatian: mjesec). G 4 S A few words about the T@-community in D 5 T Croatia. It is rather widespread. Many students prepare their graduation works using TEX, while E 6 u among mathematicians it has become a routine z 7 F means of creating documents. However, we still Dz 8 H lack some basic literature, and we are still not z 9 Ot organized as in other countries. We hope this will Iie 10 st, sc, c improve through collaboration with your excellent journal. I 20 C I would be pleased to contact anyone wishing J 30 c to learn more about the Glagolitic alphabet. Let K 40 s me take the opportunity to illustrate it by greeting L 50 Ja, Je my friends and colleagues in the USA who know M 60 Ju Croatian: N 70

It was created according to the above men- tioned "Misal" from 1483. Note that the letter I would like to thank Sonja ~terc(Zagreb) and .Pt = ch looks rather 'chinese'. From the table we Barbara Beeton for help during the preparation of see that some of the symbols had only numerical this article. values, like T = 10. The letters were also assigned appropriate nu- References merical values, similarly to the old Greek script. For example the year 1254 could have been written as [1] Abass Andulem: The road to Ethiopic W. .B.a.fi.%.. Numbers from 11 to 19 were written TUGboat, Vol. 10, No. 3 (November 1989), in the reverse order, for instance P?? = 12. What 352-354. do you say about the following arithmetic: [2] Donald Knuth: The METRFONTbook, Addison Wesley, 1986. &+%=PT, T+B=.Pth? Among many interesting ligatures let me men- o Darko ~ubriniC University of Zagreb tion a 'three storey m' = which was used a, ETF, Avenija Vukovar 39, Zagreb for [ml] (our language is not easy -remember the Croatia tongue-twisting island Krk), and 'double i' = a for Internet: [ili], which I like very much. Some of the ligatures darko.zubrinicQetf.uni-zg.ac.mai1.y~ are represented on the following list: TUGboat, Volume 13 (1992), No. 4

3 The METAFONT Font Fonts The Postnet font file begins with identification and setup information. % Postnet font, for USPS barcodes. Postnet codes using METAFONT % John Sauter mode-setup; %displaying:=O; Abstract "Postnet digits" ; A reimplementation of Dimitri Vulis' Postnet f ont-identif ier "POSTNET" ; bar codes. font-coding-scheme "Digits"; As Mr. Vulis describes in his article, Postnet rep- 1 Introduction resents digits using long and short bars. The first I was excited to read in TUGboat 12, no. 2, order of business in the font, therefore, is to define about Dimitri Vulis' work with the Postnet bar the dimensions of the bars and the spacing between codes for envelopes. I was determined to include them. This information is taken from the United his work into my letter-writing software until I States Postal Service regulations as described in the came to the last line of his article, where he says Domestic Mail Manual (DMM) issue 39 (June 16, "The macros are copyrighted, though, and I intend 1991) sections 551 and 552, as summarized and ex- to defend them strenuously against unauthorized plained in Bar Code Update, a document provided commercial use." to me by my Postmaster. I was disappointed. This stricture meant that % Primary parameters, as specified by I could not use Mr. Vulis' work, since I sometimes % the U. S. Postal Service. write letters on behalf of a small retail store near bar-width# := 0.020in#; my home. I was determined to find a way to use % plus or minus 0.005in the Postnet codes in spite of Mr. Vulis' limitation. half-bar-height#:= 0.050in#; % plus or minus 0.010in 2 A Different Approach full-bar-height#:= 0.125in#; % plus or minus 0.OlOin To avoid violating Mr. Vulis' copyright on his bar-spacing# := 1/22in#; macros, I decided to take a different approach to % 20 to 24 bars per inch the problem of producing Postnet codes. I would implement the bar codes using METAFONT as much The tolerances placed on the bar dimensions are as possible, with only as much TJ$ macros as great enough that any reasonably modern printer necessary for support. I started by visiting my should have no trouble producing acceptable bar local Post Office, so I could obtain the information codes. for constructing the bar codes from the source, to I now define some secondary parameters, so avoid any accusation that I had violated Mr. Vulis' called because they are based on the primary copyright by using the dimension information in his parameters. macros. % Secondary parameters I was pleased to find that the Post Office digit_width#:=5/22in#; has liberalized the rules for Postnet codes since % width of a digit Mr. Vulis did his work. The FIM is no longer digit-height#:=full-bar-height#+O.O4in#; necessary, and the Postnet code can be placed % leave space above bars immediately above the addressee's name, as follows: digit-depth#:=O.O4Oin#; % min space below bars 1111111111l11lll,1lIIIIIIIIIIIIIIIIIIIIIllllllllllllllllllllll The font parameters are next. These parame- John Sauter ters are very simple, since this is a fixed-width font 9-801128-09 Elizabeth Drive and all the characters are the same height. Merrimack, NH 03054-4576 font-size digit-height#; Placing the Postnet code here avoids the hassle font -slant 0 ; of figuring out how to get the code to appear in the font-normal-space digit-width#; proper corner of the envelope. font-normal-stretch 0; font-normal-shrink 0; TUGboat, Volume 13 (1992), No. 4

font-x-height half-bar-height#; so the only parameter is the character code of the f ont-quad digit-width#; digit. The end macro is for aesthetics. font-extra-space 0; def beginpostnetchar (expr char-code) = It is now time to specify pixel-dimensioned beginchar (char-code, digit-width#, versions of the necessary parameters. These will be digit-height#, digit-depth#) ; used when actually drawing characters. bar-pos := 0; def ine-pixels (bar-width) ; pickup stdpen; def ine-pixels (half -bar-height) ; enddef ; def ine-pixels (full-bar-height) ; def ine-pixels (bar-spacing) ; def endpostnetchar = define-pixels (digit-width); endchar ; def ine-pixels (digit-height) ; enddef ; def ine-pixels (digit-depth) ; We use only a single pen, with a simple shape: Here is an alternate version of Plain MET& it has no height and is the width of a bar. We will FONT'S makebox, which provides more information use this pen only for vertical strokes. when printing proofs. It is based on an example in pen stdpen; The METRFONT~OO~,Appendix E. stdpen = penrazor xscaled bar-width; def makebox(text r) = Well, it seems I lied about this font only for y=O,full-bar-height, containing digits. We need an additional full bar at half-bar-height,digit-height, the beginning and end of numbers, and as long as -digit -depth: we need a separate full bar we should in fairnes~also r((0, y) , (w, y)) ; endf or % horizontals have a half bar. We can use the draw-bar macro, for x=O step bar-spacing until w: but not the others since they assume a complete r((x,O),(x,h)); endfor % verticals digit. r((w,O), (w,h)); "full bar" ; enddef ; beginchar ('If 'I, bar-spacing#, All of the real work in a bar code font is done digit-height#, digit-depth#) ; by drawing bars. It therefore seems fitting to place bar-pos := 0; the bar-drawing macro next. This macro has two pickup stdpen; explicit parameters, the bar number and the bar draw-bar (0, f ull-bar-height) ; height. It defines two points, t at the top and b at endchar ; the bottom of the bar, and uses the current pen to draw it. The macro also depends on bar-pos to be "half bar" ; the left edge of the bar, and increments this value beginchar ("h" , bar-spacing#, so that the next invocation of the macro will draw digit-height# , digit-depth#) ; the next bar in the following position. bar-pos := 0; def draw-bar (suffix $1 pickup stdpen; (expr bar-height) = draw-bar (0, half -bar-height) ; lft x$t = bar-pos*bar-spacing; endchar ; top y$t = bar-height; Now that the preliminaries are out of the way x$b = x$t; we can proceed with the digits themselves. Each bot y$b = 0; digit consists of five bars, two full height and three draw (z$t -- z$b); half height. The pattern for each digit is described labels ($t, $b); in Bar Code Update. bar-pos := bar-pos + 1 "Digit Zero" ; enddef ; beginpostnetchar ("0") ; Now, following the example of Computer Mod- draw-bar (0, full-bar-height); ern, I have defined macros to provide the beginning draw-bar (I, f ull-bar-height) ; and end of each character. These macros are quite draw-bar (2, half -bar-height) ; simple because of the simple nature of the font. All draw-bar (3, half-bar-height); of the digits have the same width, height and depth, draw-bar (4, half -bar-height) ; endpostnet char; TUGboat. Volume 13 (1992), No. 4

"Digit One"; "Digit Seven"; beginpostnetchar ("I"); beginpostnetchar ("7") ; draw-bar (0, half -bar-height) ; draw-bar (0, full-bar-height); draw-bar (1, half-bar-height); draw-bar (1, half -bar-height) ; draw-bar (2, half -bar-height) ; draw-bar (2, half-bar-height); draw-bar (3, full-bar-height) ; draw-bar (3, half-bar-height); draw-bar (4, full-bar-height) ; draw-bar (4, full-bar-height); endpostnetchar; endpostnet char ;

"Digit Two" ; "Digit Eight" ; beginpostnetchar ("2") ; beginpostnetchar ("8") ; draw-bar (0, half-bar-height); draw-bar (0, full-bar-height) ; draw-bar (I, half -bar-height) ; draw-bar (1, half-bar-height); draw-bar (2, f ull-bar-height) ; draw-bar (2, half -bar-height) ; draw-bar (3, half-bar-height); draw-bar (3, f ull-bar-height) ; draw-bar (4, full-bar-height); draw-bar (4, half-bar-height); endpostnetchar; endpostnet char ;

"Digit ThreeH; "Digit Nine" ; beginpostnetchar ("3") ; beginpostnetchar ("9") ; draw-bar (0, half-bar-height); draw-bar (0, full-bar-height); draw-bar (1, half -bar-height) ; draw-bar (1, half -bar-height) ; draw-bar (2, full-bar-height) ; draw-bar (2, full-bar-height); draw-bar (3, full-bar-height) ; draw-bar (3, half -bar-height) ; draw-bar (4, half-bar-height); draw-bar (4, half -bar-height) ; endpostnetchar; endpostnetchar; In the Postnet code a number is more than a "Digit Four"; string of digits. To be a proper number a string beginpostnetchar ("4") ; of digits must have a full height bar before and draw-bar (0, half-bar-height); after it. We can use the new facilities of META- draw-bar (I, f ull-bar-height) ; FONT version 2 to provide these additional bars as draw-bar (2, half -bar-height) ; ligatures. draw-bar (3, half-bar-height); % draw-bar (4, f ull-bar-height) ; % ligature table for Postnet font. endpostnetchar; % provide tall bars at the beginning % and end of numbers. "Digit Five" ; % beginpostnetchar ("5") ; boundarychar := 32; draw-bar (0, half -bar-height) ; beginchar (boundarychar, 0, 0, 0); draw-bar (1, full-bar-height) ; endchar ; draw-bar (2, half -bar-height) ; draw-bar (3, full-bar-height); draw-bar (4, half -bar-height) ; endpostnetchar;

"Digit Six" ; beginpostnetchar ("6") ; draw-bar (0, half -bar-height) ; draw-bar (1, full-bar-height); draw-bar (2, f ull-bar-height) ; draw-bar (3, half-bar-height); draw-bar (4, half -bar-height) ; endpostnetchar; TUGboat, Volume 13 (1992), No. 4 475

so they can be printed wherever in the letter the style requires. In some cases the Postnet code will And with that, the font description is complete. be unknown or inappropriate, and so should not be printed. bye; To accommodate these needs I have a macro \Postnetdigits which accepts the digit string, 4 The macros and \Postnetline which is used from my letter The font itself is adequate for simple examples, formatting macros to set a line of Postnet bar like the one earlier in this article. However, as codes. explained by Mr. Vulis, each number also ends with \def\Postnetdigits #I{% a check digit. I considered, very briefly, trying to do \Postnettoken=C#l3% the check digit computation as a ligature table in \postnettrue3 the font. I came to the conclusion that METAFONT \def\Postnetline(\ifpostnet is the wrong language for such a computation, since \expandafter\postnetcheckdigit the size of the ligature table gets very large with \the\Postnettokenl% 11-digit numbers. Therefore, I decided to write the \Postnettoken=\expandafter\expandafter check digit code using T@ macros. Mr. Vulis used \expandaf ter(\expandaf ter a very clever technique, but because of his copyright \the\expandafter\Postnettoken I had to use a different method. After some hunting \the\Postnetchecktoken]% I found an example of almost exactly what I needed {\Postnetfont \the\Postnettoken\hfil)% in The Wbook, Appendix D. \f i3 In the following pair of macros, \postnet- In support of the above macros we must declare checkdigit takes as its argument a string of digits the token registers and the condition. followed by a vertical bar. It uses \getpostnet- \newtoks\Postnettoken checkdigit to set \count0 to the sum of the digits, \newtoks\Postnetchecktoken and then arranges for token register \Postnet- \newif\ifpostnet checktoken to be set to the correct checksum digit \postnetf alse for the string. My letter formatting macros are based on \def\getpostnetcheckdigit#l~\ifx#l\end The Wbook, Appendix E. I have placed the \let\next=\relax Postnet code only on the envelope, so only macro \else\advance\countO by #I% \makelabel needs modification. The Postnet bar \let\next=\getpostnetcheckdigit\fi code goes just above \theaddress, as follows: \next3 \def\postnetcheckdigit#l~{{\count0=0 \def\makelabel(\endletter\hboxi\vrule \getpostnetcheckdigit#l\end \vbox{\hrule \kern6truept \countl=\countO \hboxC\kern6truept \divide\count 1 by 10 \vbox to 2truein \multiply\count 1 by 10 {\hsize=6truein \advance\countO by -\count1 \smallheadf ont \count i=lO \baselineskipgtruept \advance\countl by -\count0 \returnaddress \ifnum \count1>9 \vfill\vbox C% \advance\countl by -10\fi \hskip 2truein\Postnetline)% \af tergroup\Postnet checktoken \moveright 2truein \af tergroup=\af tergroupC% \copy\theaddress\vfi113% \expandafter\aftergroup\number\countl \kern6truept)% \af tergroup3% \kern6truept\hrule3% 33 \vrule3 \pageno=O\vfill\eject) The check digit must be combined carefully with the rest of the digits so that the ligatures work correctly, placing a full bar before the first digit and 5 Conclusion after the check digit. In addition, it is convenient I thank Mr. Vulis for the motivation his article to have a macro which specifies the Postnet digits gave me to re-implement his Postnet bar codes.

TUGboat, Volume 13 (1992), No. 4

Diag: A Drawing Preprocessor for W7i&X age overcomes most of the limitations of the other macro packages and can produce high-quality graph- Benjamin R. Seyfarth ics. Unfortunately it and the other macro packages Abstract suffer from the inconvenience of doing arithmetic us- ing T@ macros. Diag is a preprocessor for drawing diagrams for In contrast to these IPm macro packages is the I4m documents. The user prepares a text file PIC preprocessor [2] for the troff typesetting sys- containing commands in the diag language which tem [6]. PIC provides a separate language support- are processed by diag producing fig commands ing variables, infix expressions, looping and macros. which are then processed by transf ig producing This language allows a user to describe a diagram commands in a variety of formats acceptable to very simply using variables to define the x and y I4m. The diag preprocessor interprets a lan- coordinates for graphics objects. This makes it easy guage with graphics commands using infix expres- to position objects relative to other objects which sions with user-defined variables. In addition it pro- makes diagrams easier to modify. vides a macro facility for simplifying repetitive op- There is a version of the PIC preprocessor erations. The combination of diag and transf ig called tpic, which has been altered to output TEX provides a simple, portable method for producing \special commands. These specials are then in- diagrams within I4". terpreted by DVI drivers to do the actual drawing. 1 Introduction Unfortunately tpic is a modification of PIC and can only be distributed to licensed PIC users. The T@ typesetting system by Donald Knuth [3] A completely different alternative for producing provides a method for producing high-quality type- drawings in I4m is to use an interactive drawing setting on a wide variety of computer systems. TEX program such as fig or xf ig. fig is a graphics edi- has been augmented by Leslie Lamport's IPT@ [5] tor originally writ ten by Supoj Sut ant havibul at t he to provide an easier interface for TEX users. T@ University of Texas. xf ig is a version of fig writ- was designed for typesetting text and mathematical ten for the X Windowing System by Brian Smith formulas and does a splendid job for both. How- of the Lawrence Berkeley Laboratory and others. ever, QjX provides nearly no support for graphics. Both these programs output fig commands which I4m provides a variety of macro packages which do can be translated using transf ig into EPIC, EEPIC, allow the user to incorporate drawings in a IPm PfZQX, tpic and several other formats usable in document, but none of these is particularly easy This is a convenient proposition for people to use. Diag provides a convenient alternative for with graphics terminals, but graphics terminals are I4m drawings. not always available. Another drawback to using in- LNQX incorporates a simple picture drawing teractive drawing programs is that they do not gen- environment which can be used to produce lines, erally support a convenient language interface. A boxes, circles and arrows. Unfortunately, this pack- language interface would allow users to write special age is designed around a set of line drawing char- programs to output graphic commands when there acters which can only be used to draw lines with are many drawings to create. a Limited number of preset slopes. In addition the The diag preprocessor provides a language sim- package is written as T&X macros which means that ilar to the PIC language, although it is considerably specifications of x and y values can become oner- simplified. It does support variables, in& expres- ous if the user must use macros to compute sions, relative positioning and macros similarly to locations. Lamport suggests that BTJ$ drawings PIC. It does not presently support loops or if state- be completely designed using an initial drawing on ments, nor does it support as many relative posi- a piece of graph paper. This is feasible, but it does tioning options as PIC. It was decided that loops not provide easily-modifiable diagrams. and conditional statements would be most useful There are several macro packages which have for graphing mathematical functions and the au- been written for I4m to provide better graphics. thor suggests using the GNUPLOT program for plot- EPIC is an extension of the picture environ- [7] IPW ting functions. The relative positioning options in ment which uses the LATEX drawing commands as diag are fewer than those in PIC, but sacient for primitives to produces lines, grids and arcs. EEPIC most uses. The diag language is designed to be easy [4] is an extension of EPIC which uses specials tpic to learn and is capable of producing high-quality to overcome the limitations inherent in the IPm graphics for IP'QX documents. picture drawing primitives. The QCI'EX [8] pack- TUGboat, Volume 13 (1992), No. 4 479

diag tion can be used as a default for most commands start finish and it can be explicitly altered. The variables x and y refer to the current position and are available to the user. Figure 1: Getting There 4 The Diag Language Parsing in diag is performed by an interpreter gen- 2 Using diag erated using the yacc parser generator. The in- The input to diag is a text file containing diag com- terpreter consists of a lexical analyzer feeding the mands. Let's suppose that we have a text file named LALR(1) parser from yacc. The two work together "exl.dn which contains the following: to translate commands in the diag language into equivalent fig commands. Start: circle "start" at (I, I) ; Finish: circle "finish" at (3,1); 4.1 Diag Lexical Conventions arrow "diag" Start. e to finish.^; The lexical analyzer expands macros. ignores com- This file contains three diag commands. The ments and groups input characters into lexical items. first two draw circles and the third command draws The macro expansion facility will be defined later. an arrow from the start circle to the finish circle, The diag lexical items are identifiers, numbers, placing the word "diag" above the arrow. The words strzngs and the following special characters: before the colons of the first two commands are the +-/*()>. : ?and= names of the objects. The arrow is drawn from the An identifier is a letter followed by any number easternmost point of the start circle to the western- of letters or digits. Upper and lower case letters are most point of the finish circle. We could modify permitted and denote different identifiers. Several .the location of either circle and still connect the two unexpected identifiers are keywords in diag and will circles using the same arrow command. most likely cause syntax errors if they are used as To convert the diag commands into variable names. These include: commands, we use the following command e n s w ne nw sw se A number in diag must start with a digit and diag < ex1.d I fig2dev -L pictex > ex1.tex may have any number of digits afterwards with at This will produce a file, "exl.texn containing com- most one decimal point. Any fraction less than 1.0 mands which can be input into using must have a leading zero as in "0.5". A number can be preceded by a minus sign. \begin(figure) A string is defined as in the C programming \begin(center> language to be anything between a pair of quote \input{exl) symbols as in "string". It is not possible to place \end(center) a quote symbol in a diag string. \caption(Getting There) The special characters are used to form arith- \end(f igure) metic expressions and for a handful of special pur- The resulting diagram is shown in Figure 1. poses detailed below. 3 The Diag Coordinate System Comments in diag are identified by either a # or % and extend from that character to the end of The default coordinate system for diag uses mea- the line. This allows comments to either stand alone surements in inches. The origin of the coordinate or to be placed on the end of a command. system, (O,O), is defined to be the lower left corner An identifier in diag is either a keyword or a of the diagram. From there increasing x values refer variable name. A variable becomes defined either by to points to the right and increasing y values refer an assignment statement or by a graphics command to points up the page from the origin. preceded by an identifier naming a graphics object. The default scaling can be altered by assigning In either case the variable name is the first element a new value to the scale variable which is initially 1. of the command. Most commands start with one Making scale larger will shrink your diagram, while of the command keywords defined below and every making it larger will expand your diagram. It is diag command is terminated with a semicolon. possible to change scale in the middle of a diagram, but this is likely to cause confusion. As graphics commands are executed, diag maintains a current drawing position. This posi- 480 TUGboat, Volume 13 (1992), No. 4

4.2 Diag Statements A diagram is defined to be one or more statements in the diag language. Using Backus-Naur Form (BNF), we have:

diagram + diagram statement ;

-+ statement ; There are several types of statements in diag:

statement -+ assignment + drawbox Figure 2: Ellipses and arrow + drawcircle + drawellipse + drawline Object names and corner points are special + drawarrow cases of point expressions in diag. A point expres- -+ drawtext sion can also be specified as two arithmetic expres- -+ drawarc sions in parentheses. Here is the syntax for point + drawcurve expressions: -+ gotostatement ptexpr + ( expr , expr ) + ptexpr + ptexpr 4.2.1 Assignment Statement + ptexpr - ptexpr An assignment statement is defined to be a variable -+ IDENTIFIER name followed by an equals sign and an arithmetic -+ IDENTIFIER . pos expression. The variable will be created if it does not -+ IDENTIFIER . ? already exist. The BNF for assignment statements pos -+ nl sl el w1 ne1 nwIseI sw and expressions is The following code draws two ellipses and con- assignment + IDENTIFIER = expr nects them with an arrow: expr --+ IDENTIFIER XI = I; + NUMBER x2 = XI + 2; + expr + expr el: ellipse "1" at (x1,l); + expr*expr e2: ellipse "2" at (x2,eI.y+1); + expr - expr arrow from el.ne to e2.w; + expr/expr The diagram is in Figure 2. The second ellipse + - expr is placed two inches to the right and one inch higher

+ (expr) than the first ellipse. The arrow is drawn from the + IDENTIFIER . xory northeast point of the first ellipse to the west com- + IDENTIFIER . pos . xory pass point of the second ellipse. xory x 1 y Sometimes the eight compass points are not ex- Precedence for arithmetic expressions follows actly the right points. Suppose we wish to draw an the normal pattern with multiplication and division ellipse with four circles beneath and draw arrows to having higher precedence than addition and subtrac- each circle. This is indicated with an object name tion. Parenthetical expressions are evaluated first. followed by " .?" to indicate that diag should calcu- Boxes, circles and ellipses may be named within late a boundary point of the object for the connect diag. This is done by preceding the command to line or arrow. This is shown in Figure 3. Here is the draw an object by a variable name and a colon. Af- code required: terwards the object's name can be used to specify a scale = 1.5; position. The x and y coordinates of an object can el: ellipse "Start" at (2.5,2); be used in an expression by adding either ".x" or cl: circle "1" at (1,l); " .y" after the variable name. c2: circle "2" at (2,l) ; There are eight compass point positions defined c3: circle "3" at (3,1) ; for every named object. These can be used to specify c4: circle "4" at (4,l) ; positions in a diagram. This can be quite convenient arrow from el.? to cl.?; compared to computing a position like the northeast arrow from el.? to c2.?; point of an ellipse. arrow from el.? to c3.?; TUGboat, Volume 13 (1992), No. 4

sentence Start

Figure 4: Simple sentence Figure 3: Ellipse and arrows to circles

arrow from el.? to c4.?; line from bl.? to b3.?; line from bl.? to b4.?; 4.2.2 Drawing Boxes A diag box is a rectangle which has sides paral- 4.2.3 Drawing Circles and Ellipses lel with the x and y axes. A box may include a text string placed at its center. A box may be de- A diag circle is defined by its radius and center scribed by giving two corner points or by specifying point. The default for the radius is provided by its height, width and center point. A box speci- the variable "circlerad", while the center point de- fied by corner points must specify two corners which faults to the current drawing position. An ellipse is must be opposite corners for the box. The syntax defined similarly except that an ellipse has a ma- allows the keywords from and to to be optional. jor axis and a minor axis rather than a radius. In A box command without two corner points diag the major axis always refers to the x axis of specifies a box by height, width and center point. an ellipse and the minor axis refers to the g axis. The predefined variables boxht and boxwid provide The defaults for the ellipse axes are the variables convenient defaults and the current point is used for "majoraxis" and "minoraxis". the center if it is omitted. drawcircle + objectname circle circleopts drawbox + objectname box boxopts circleopts + E boxopts + E + circleopts label + boxopts from ptexpr to ptexpr --+ circleopts radius expr + boxopts label + circleopts at ptexpr + boxopts height expr drawellipse + objectname ellipse ellipseopts + boxopts width expr ellipseopts + E + boxopts invisible + ellipseopts label + boxopts at ptexpr ellipseopts major expr objectname + E IDENTIFIER : I ellipseopts minor expr label -+ STRING ellipseopts at ptexpr from -+ E 1 from to E I to 4.2.4 Drawing Lines and Arrows at E 1 at There are two basic ways to draw lines and arrows. Notice that a box can be invisible. This can First you can specify the start and end points for be useful for drawing lines between words in a parse the line. The keyword from is optional, but the tree. Consider the following code and its diagram in keyword to is required if the end point is specified. Figure 4: The second way to specify a line is to specify the end scale = 1.5; point, a direction and a line length. The only possi- boxht = 0.3; ble directions are up, down, left and right. The start bl: box invisible width 1.5 "sentence1' point defaults to the current point and the direction at (2,2> ; defaults to right. b2: box invisible width I "subject" Text may be drawn at the midpoint of the line at (1,l); or arrow. Following a text string you may option- b3: box invisible width 1 "verb" ally specify where to place the text relative to the at (2,l); midpoint of the line. The default is to place the text b4: box invisible width I "object" slightly above the midpoint. at (3,l); Here is the full syntax for line and arrow draw- line from bl.? to b2.?; ing: 482 TUGboat, Volume 13 (1992), No. 4

drawline + line lineopts

lineopts --t E 4 lineopts label where i lineopts from ptexpr 4 lineopts to ptexpr Figure 5: Curvature definition 4 lineopts direction expr direction + up 1 down I left I right drawarrow 4 arrow lineopts drawarc + arc arcopts where 4 E 1 above I below arcopts + E 4 left I right 4 arcopts quadrant 4.2.5 Placing Text at Arbitrary Positions + arcopts arcdir i arcopts radius expr It is possible to place a text string at any arbitrary 4 arcopts ptexpr position of a diagram by entering the string followed drawcurve + curve curveopts by the position for the string. The keyword at is op- CUTU~O~~S--+ E tional and the position defaults to the current posi- -i curveopts label where tion. 4 curveopts > drawtext -+ STRING at ptexpr 4 curveopts arcdir + STRING 4 curveopts bend expr i curveopts from ptexp~ 4.2.6 Drawing Circular Arcs and Curves i curveopts to ptexpr There are two types of curves supported by diag. arcdir --+ CW I ccw They are both circular arcs, but they are given sep- quadrant -+ ul I ur I 11 I lr arate commands for simplicity. The first type of 4.2.7 Changing the Current Drawing circular arc is drawn with the arc command. It is Position always a 90 degree arc in one of the four quadrants. Such an arc is specified by starting point, quadrant There is a goto command to explicitly change the and direction. The starting point defaults to the current drawing position of diag. It consists of the current point. The quadrant is specified as ur, ul, keyword goto followed by an arbitrary point expres- 11 or lr to indicate upper-right, upper-left, lower- sion. left or lower-right. The direction is either cw or ccw gotostatement + goto ptexp~ to indicate clockwise or counter-clockwise. The second type of arc is specified by start 4.3 Predefined Variables point, end point and curvature. The curvature is There are a number of variables created by diag specified by the keyword bend followed by a number which can be changed to control things like line or an expression. The curvature defaults to value of thickness and arrow head length. These variables the variable curvature. In general, the curvature are different from user-created variables only in the should be between 0 and 1, but not very close to sense that they exist when diag starts and diag uses either. their values for various purposes. The bend keyword is illustrated in Figure 5. In this figure the bend was set to 0.2. This means that 4.3.1 arcrad and circlerad the height of the curve, h, is 0.2 times the length of The arc command will draw a 90 degree arc of the chord c. The code to produce Figure 5 is: a certain radius. If the radius is not specified, it will default to the value of arcrad. Similarly the scale = 2.0; circle command defaults to a radius of circlerad. curve cw bend 0.2 (1,l) to (5,1); Both these variables are measurements in inches un- linestyle = dashed; less scale has been changed. The initial values for line "cl' below from (1,i) to (5,l); arcrad and circlerad are each 0.25 inches. line "hl' left from (3,l) to (3,1.8); 4.3.2 boxht and boxwid It is also possible to place an arrow head on The box command can be used to draw a box with the end point of a curve. This is done by placing a center at a certain position. In that usage the user a greater than symbol in the command. The full can specify the height and width of the box, or allow syntax for drawing arcs and curves is: diag to use boxht and boxwid as default values. TUGboat, Volume 13 (1992), No. 4

These are measurements in inches by default. The 5 Defining and Using Macros initial value for boxht is 0.5 inches and the initial The macro facility of diag is implemented as a text value for boxwid is 0.75 inches. replacement algorithm by the lexical analyzer. A 4.3.3 curvature macro is defined by the keyword define, the name of the macro, and its replacement text. The replace- The curve command allows the user to specify the ment text is identified by starting and ending it with curvature using the bend keyword. If bend is not a special symbol such as '/,. specified, the value of curvature will be used in- A macro invocation is either the macro name stead. The initial value for curvature is 0.2. followed by a semicolon or the name followed by 4.3.4 dashlength parameters in parentheses. These parameters are positional parameters separated by commas and are If the linestyle has been selected as dashed or dotted, referred to within the macro's replacement text as then the variable dashlength can be set to control $1, $2, . . ., $9. There can be up to nine positional the length of dashes or the spacing of dots. This is a parameters. measurement in inches by default. The initial value A sample macro definition to define a macro to of dashlength is 0.1 inches. draw three boxes centered at a given position would 4.3.5 head be define ThreeBoxes # The length of the head of an arrow can be controlled by the head variable. This is a measurement in box at ($1-boxwid, $2) ; inches by default. The initial value of head is 0.1 box at ($1 ,$2) ; inches. box at ($l+boxwid,$2) ; # 4.3.6 linestyle This macro be used to create a three by three The variable linestyle can be used to change the arrangement of boxes using line style from solid to dashed or dotted. The p = 2; initial value of linestyle is solid. The variables ThreeBoxes ( 3, p ) ; solid, dashed, and dotted have the values 0, 1 and ThreeBoxes ( 3, p-boxheight ) ; 2 matching their fig values. ThreeBoxes ( 3, p+boxheight 1; 4.3.7 linethickness A Larger Diagram This variable controls the thickness of lines in pixels. this section a diagram is shown of an array Its initial value is 5 pixels. pointers to structures containing pointers and names. This is a reasonable example for illustrat- 4.3.8 majoraxis and minoraxis ing macros. The code for this example is split up These variables are used as defaults by the ellipse into several sections along with some explanation. command. The x axis is always considered the ma- The diagram is shown in Figure 6. jor axis and the the y axis the minor axis. These First there is a macro to draw a NULL pointer variables represent inches by default. The initial to the right of some of the array elements. This value for majoraxis is 0.3 inches and the initial macro uses the variable bw to determine how long value for minoraxis is 0.2 inches. the constituent lines should be. 4.3.9 pi define Null % line right bw * 1.0; This variable has the value 3.14159 and should not line down bw * 0.15; be changed. X = x; 4.3.10 scale Y = y; line (X-0.2*bw,Y) to (X+0.2*bw,Y); The default scaling of coordinates in diag is in line (X-O.I25*bw,Y-0.05*bw) inches. This can be overridden by assigning a new to (X+o.l25*bw ,Y-0.O5*bw) ; value to scale. Coordinates in diag are divided by line (x-0.05*bw,~-O.l*bw) scale before translating into dot positions on the to (X+O.O5*bw,Y-O.l*bw); scale page. This means that making greater than % 1.0 will shrink the diagram. Next there is a macro to draw a box and then move down bw inches. This macro draws the box 484 TUGboat, Volume 13 (1992), No. 4

- array of pointers to records is drawn along with sev- Bob Bea - , \ eral null pointers. I A\ scale = 1.8; xi = 1; y1 = 4; bw = 0.6; # # Place the array of record pointers # on the left. # A: Vbox; B: Vbox; Null ; C: Vbox; Null ; D: Vbox; E: Vbox; Null ; F: Vbox; Figure 6: Symbol Table with an Auxiliary Linked Null ; List G: Vbox; H: Vbox; at (xi,y1) and then modifies y1 to prepare for the Next the variable bw is shrunk to make slightly next vertical box. smaller boxes and then the structures are drawn. define Vbox % After the structures on a row are drawn, connecting box (xi ,yi) to (xl+bw,yi-bw) ; arrows and null pointers are drawn. yi = y1 - bw; bw = bw * 0.8; goto (xl+bw/2,yi+bw/2) ; # % # Add the 'B' records Similarly there is a macro to draw a horizontal # Bob"); box at (xi,yl) and move to the right bw inches. struct(s1,3.25,A.y,"C\small Bea"); This macro is used to draw structures containing struct(s2,5.5,A.y,"C\small arrow from A to s1l.w; three boxes. In the struct macro each Hbox is given arrow from slr to s21.w; a name to make it easy to connect the components goto s2r; later. The first parameter of struct is the prefix Null for the names of the boxes. The middle box is given ; that name and the others are given that name with # # Add the 'J' records an added 1 or r. # define Hbox % struct (s3,3.25,D.y, "(\small Joe)") ; box $1 (xi,yl) to (xl+bw,yi-bw); struct(s4,5.5,D.y,"{\small Jan)") ; xi = xi + bw; arrow from D to s31.w; arrow from s3r to s41.w; goto s4r; Null ; define struct % # x1 = $2 - bw * 1.5; # Add the 'S' records yi = $3 + bw * 0.5; # $11: Hbox; struct (s5,3.25,G. y, "I\small Sue)") ; $1: Hbox ( $4 ; struct (s6,5.5,G.y,"{\small Sam)") ; $ir: Hbox; arrow from G to s51.w; % arrow from s5r to s61.w; Now begins the first non-macro code. First the goto s6r; variables xl, y1 and bw are initialized and then the Null ; TUGboat, Volume 13 (1992), No. 4 485

# Another possible improvement to diag would # Add the 'T' record be to use the ".?" positioning operator with the # curve command. This would be relatively easy to struct(s7,3.25,H.y,"C\small Tom)"); implement and could be useful for some diagrams. arrow from H to s71.w; It would be useful to draw and fill polygons. goto s7r; This is supported by transf ig and would be easy Null ; to add to diag. Another feature supported by Finally we add a collection of dashed arrows transfig which could be added is a spline draw- and curves to indicate another linked list comprising ing command. the same set of records. There are many more features which could be added to the diag language. The author selected the # most basic commands for the first version of diag. # Add auxiliary linked list pointers It is anticipated that the language will grow as needs # arise. linestyle = dashed; arrow from sll to s31.n; References goto s31; [I] Micah Beck, TransFig: Portable Figures for line down bw; TEX, Cornell University Dept. of Computer Sci- arc 11 ccw; ence Technical Report #89-967, February 1989. line right s4 .x-s3 .x-2*arcrad; [2] Brian W. Kernighan, PIC - A Graphics Lan- arc lr ccw; guage for Typesetting, Bell Laboratories Com- arrow to s41.s; puting Science Technical Report 85, March arrow s41 to s21.s; 1982. ya = (s2.y+s4.y) / 2; yb = (s4.y+s6.y) / 2; [3] Donald E. Knuth, The 7&Xbook, Addison- curve ccw bend 0.1 from s21 Wesley, 1986. to (s4r.x,ya); [4] Conrad Kwok, EEPIC: Extensions to EPIC curve cw bend 0.4 to (s4r.x,yb); and Picture Environment, Software doc- curve > ccw bend 0.1 to s61.n; umentation, University of California, Davis, curve > ccw bend 0.2 from s61 to s51.n; Dept. of Computer Science, July 1988. arrow from s51to s71.n; [5] Leslie Lamport, l8W: A Document Prepara- goto s71; tion System, Reading, Mass.: Addison-Wesley, line down bw*1.5; 1986. X = x; [6] Joseph F. Osanna, NROFF/TROFF User's Y = y; Manual, Bell Laboratories Computing Science linestyle = solid; Technical Report 54, October 11, 1976. line (X-0.2*bw,Y) to (X+0.2*bw,Y); [7] Sunil Podar, Enhancements to the Picture En- line (X-0.125*bw,Y-0.05*bw) vironment of Urn, State University of New to (X+O. l25*bw ,Y-0 .05*bw) ; York at Stony Brook, Dept. of Computer Sci- line (X-0.05*bw,Y-O.l*bw) ence, Technical Report #86-17, July 1986. to (X+0.05*bw1Y-O.l*bw); [8] Michael Wichura, The P- Manual, Univer- 7 Possible Additions to the Language sity of Chicago, November 1986. The most obvious features missing from the lan- o Benjamin R. Seyfarth guage are conditional statements and loops. These Department of Computer Science would clearly be useful, but are not critical for the and Statistics anticipated uses of diag. The University of Southern If diag needs conditional statements and loops Mississippi at some future date, it is likely that procedures Southern Station would also be added. The current implementation Box 5106 uses macros which look like procedure calls, but they Hattiesburg, Mississippi use global variables. There is no such thing as a 39406-5106 local variable and using macros which manipulate variables is a hazard. Procedures would eliminate this problem. TUGboat, Volume 13 (1992), No. 4

about more theoretical aspects of T@L Part V is Book Reviews about 'Bug Diagnosis7 and has two appendices. The book's index contains both the concepts and control sequences that were treated in the book Review of: for the Beginner itself, as well as the primitives and plain control sequences that have to be looked up in The Victor Eijkhout 'IJ~Xbook.The latter kind simply do not have page Wynter Snow, T)$ for the Beginner. Addison- references. This makes sense: if you are trying to Wesley, 1992. xii + 377 pp. + index (23 pp.) ISBN decode someone else's macros it tells you that some- 0-201-54799-6. thing is a primitive or part of plain TEX (and you'll have to consult another book), and it can prevent you from redefining such commands. The spectrum of books about TEX has been Although the division in parts globally makes broadened by another beginner's book about plain sense, on a detailed level the organization is some- l&X: with Introduction to (Norbert Schwarz; what messy. For instance, the chapter 'Adjusting Addison-Wesley, 1990), A Beginner's Book of TJ$ awkward line breaks' is in part I among the basics, (Etaymond Seroul and Silvio Levy; Addison-Wesley, while 'Adjusting awkward page breaks' is in part IV 1991) and by Example (Arvind Borde; Aca- with advanced topics. Also, the 'actor model', the demic Press, 1992) there is now for the Begin- author's metaphor for m'sworkings, is introduced ner by Wynter Snow. in a chapter called 'Getting a printout'. While its In contrast to the Seroul and Levy book, which place is logical in the course of the exposition, it is somewhat academic in style, this book has a very makes for awkward referencing. chatty style that is both its strong and its weak point. The author has a lively style of writing and 2 Who is this book meant for? uses rather unorthodox metaphors for W's be- Among the books that aim to be for the begin- haviour (did you know that macros come in meat- ning mer, this book presents the most basic in- and-potatoes and jelly-doughnut varieties?), which formation, including tidbits that are specific to cer- in general are quite illuminating. tain computers. The discussion is clearly for people For instance, the fact that lines are spaced at wanting to learn plain TE)C, but there are so-called \baselineskip distance is described "as if TEX has 'U~notes', which can function both to point the a ruler exactly \baselineskip long that it uses to plain TJ$X user to corresponding concepts in IPW, decide where the next shelf should go", which is a and to help the IPWuser make a transition to plain good way of putting it. Sometimes, however, too m. They are not enough to learn UTJ$ from. Too much American cultural background is needed. For often they tell the reader that the whole of a chapter instance, I think I understand what is meant by cannot be used in LPm. "back in grade school" (page go), but I'm not sure Another concept that will help the beginner is what is meant by "a taffy-like substance" (page 97). that the author identifies a few dozen bugs, which Considering how international the community are clearly marked in the text, and referenced in the is, this point is not without significance. index. They have been given names with varying de- 1 Structure of the book grees of helpfulness, ranging from the 'Disappearing footnote bug' to the 'Cart before the horse bug'. T&$ for the Beginner is divided in five parts. The first two parts are about the basics of using TEX. In 3 Level of complexity particular the first part is very practically oriented: Since this is a beginner's book, some topics are only there are tips for people using word processors who touched on lightly. The author advises the reader to dump their file in ascii mode, and there are instruc- write lots of macros (and gives many examples) but tions for people using the Macintosh implementation real TE)C programming is never done: the control of QX, Textures. sequences \edef and \expandafter don't appear in Part I11 is the longest and probably the most the book. useful. Its sixteen chapters explain TEX commands Similarly, there are chapters about headers and and give macros for the most common things that footers and about (stationary and floating) figures, you do in m. Part IV is about advanced topics but \output is not mentioned. such as boxes and rules, and it has a short chapter TUGboat, Volume 13 (1992), No. 4

4 Layout stance, chapter 16, 'Obeying lines and spaces: verse Unfortunately, I cannot say much positive about the and computer code' does not give macros for a true looks of this book. The author uses a liberal amount verbatim mode, so the computer code that can be of white space around examples and list items, the handled is rather limited. (The examples are in the text has a ragged right margin, and the output of the language Logo, and don't use special characters such examples is indented to a different margin than the as the caret, which appears in Pascal, or braces, input code. All together it swims before my eyes. which occur very often in C.) In addition to changing from roman type to type- More surprising, chapter 17 about headings writer for the examples, the author uses Computer never mentions \nobreak to prevent a page break Modern Sans Serif type for the bugs and the IN&$ between a heading and subsequent text. A \Title- notes. This only adds to the confusion. The fact Section example in the chapter about headers and that headings are underlined with a page-wide rule footers does incorporate a \nobreak, however, with- makes the pages look only slightly more structured. out drawing attention to it. The back cover of this book appears to use In general, though, the examples cover a lot of the Computer Modern type, and it has plain 'T)5i7s territory, and they do so with a good explanation. extended spacing after punctuation, but strangely Snow introduces some non-standard terminol- enough the and logos do not have any of ogy ('giving a reporter an input' instead of 'giving their characteristic back kerning, and ligatures are a parameter a value') which may make the transi- missing. Let's say the front cover makes up for the tion to more advanced TEX literature harder for the back. reader. Since the terminology is used consistently I don't have too much of a problem with it. 5 But are there jokes? In all, this book is a useful addition to the Snow has a lively imagination in coming up with library. It is well written and contains many practi- novel analogies for W's workings, and that defi- cal examples. Readers who would like to learn lJi$ nitely makes this book amusing to read. And if the in a linear, incremental way, should definitely check author has ever been teased about her name, she cer- out this book. tainly hasn't suffered from it: the parts of the book 0 Victor Eijkhout have ski-oriented titles ('Onto the slopes', 'Down we Department of Computer Science go7),and the kont cover shows lion cubs throwing University of Tennessee at snowballs and building a snow man in the likeness Knoxville of the lion. Knoxville TN 37996-1301 Internet: eijkhoutQcs .utk.edu 6 Evaluation for the Beginner goes easy on the theory of TEX, and instead takes the reader by the hand, showing in a practical way how to get the work done. The explanations are enough to give a beginning 'IjEX user a basic understanding, but are often not 100% accurate. For instance, the statement 'The primitives \csname and \endcsname take a string Review of: TEX by Example: A Beginner's of characters and convert it into a control sequence7 Guide and its clarification in a footnote '\csname converts George D. Greenwade a token list into a control sequence' are both slightly off: in between \csnane and \endcsname all tokens Arvind Borde, QjY by Example: A Beginner's are expanded (so unexpandable tokens are not al- Guide. San Diego: Academic Press, 1992. xiv + 169 lowed) until only character tokens remain, then a pp. ISBN 0-12-117650-9. $19.95. control sequence is made out of these. Arvind Borde's QjY by Example: A Beginner's However, I haven't found any real errors in the Guide is very obviously a labor of love in introduc- book. ing new users to the world of - or the result of If the explanations can best be characterized as the frustration associated with having to repeatedly 'adequate', similarly the macros in part I1 get the explain commonly-used formatting commands to user under way, but they are not complete. For in- one's colleagues. Since it is noted that the book TUGboat, Volume 13 (1992), No. 4 represents a significantly expanded version of the comprehensive alphabetical Appendix, which serves author's widely-distributed An Absolute Beginner's as both an index of topics and a glossary of Guide to Using rn (1987), either of these motiva- commands. It is fashioned very much after The tions is possible as a non-unique factor. The text Permuted Index of Commands. Admittedly, utilizes a practical and visually appealing side-by- this is not the best way to learn a language; side layout, making Borde's book one of the most however, many basic aspects of are explained useful introductory primers on the market for virtu- throughout this Appendix. Also, the Appendix ally any language. Notably, most of this is achieved serves as a good quick reference which can be used without the employment of extensive macros; how- in concert with other manuals. The reader can ever, where non-standard T@ or author-written easily look for a topic, such as "equation numbers" macros are employed, it is liberally noted. and be pointed to examples from within the text, as Does this place rn by Example in the 5ntro- well as related commands. Alternately, the reader ductory" class of rn materials? Very decidedly can just as easily look for a Tj$ command, such so! However, readers should not make the mistake as "\medbreakn, and find an explanation of that of placing this innovative text in the "introductory- command's use. A very important dimension of only" class of m materials. Indeed, in the case of the glossary of commands is the clear identification !&X by Example it is not wise to limit the reader- of TkX primitives, as compared to m composite ship even to a "m-only" audience as users of any commands or command macros utilized directly in derivative of ~-IPI$jX, AMS~,REVTEX, the production of the book. eplain, . . . -can benefit from the information and Second, Borde has been generous enough to examples contained in it by reviewing the underlying include virtually all of his macros used in by command structure used in a "plain" rn environ- Example for use by the reader and public at large. ment to generate various outputs. Since derivatives The major command macros are referenced on page may or may not be fully compatible with all aspects 136 of the Appendix, which points the user to their of "plain" T@, the examples may not be directly use and first appearance in the text. One of the most applicable, although the concepts certainly provide intriguing commands defined by Borde is \f ermat. an acceptable template for extensions. This command tackles Pierre Fermat's generally The real beauty of !Q@ by Example lies in accepted "theorem", making necessary calculations, its design. From the beginning of the text (p. then reporting the result. The insights from this vi) to the end (p. 91), each right-hand side (RHS) reveal m's usually-undiscussed capability as a page is 'l&X output, covering properly-formatted programming language. topics from poetry, to philosophy, to physics, to The book ends with its Epilogue. The Epilogue mathematics, to the game of cricket, to just about includes the major layout commands used by Borde anything else -even m. in his creation. The complete macros used in the Each facing left-hand side (LHS) page includes text appear here. Readers can easily copy them two very important components. First, the actual for their own use, selectively use them as templates m input code which created the m output for their own macro sets, or merely refer to them on the RHS facing page is provided verbatim. for some of the tricks Borde employs (such as the Therefore, a very quick reference tool is at the side-by-side layout with accompanying notes). If fingertips of the reader -if you see what you want the reader doesn't wish to type in the text of the final output to look like on a RHS page, these macros, they have been made available from just look directly to the facing LHS page and most major m-related archives for electronic mail the necessary m code to generate this output is retrieval or access through anonymous ftp, or, in the immediately available. Second, the LHS input pages absence of an electronic link, the files are available are marvelously documented in a series of footnotes on diskette. which generally explain some of the differences In summary, users at all levels of =-related available to users, as well as how the structure of processing languages ought to have this innovative the input can impact the ultimate output. If a topic guide handy. While covering a wide array of top- has been covered previously, the reader is usually ics, the general tone of the text is very reader provided at least a hint where to look earlier in the friendly, which allows it to serve as a remarkable text for its previous discussion. beginner's guide, per its title. However, its compre- Additionally, by Example includes at least hensive overview of usage, meaning, and structure two other components of interest. First, following is invaluable to users at all levels, making it a the text of the book (pp. 91-159) is a relatively TUGboat, Volume 13 (1992), No. 4 489 very powerful reference guide to complement the less than 12 points I usually had to use a magnifying standard manuals for your favorite flavor of m. glass for that too. There is a name index but no subject index. Despite these problems this book is References well worth the attention of TJ$ devotees. The articles on TJ$ and IPW will contain Arvind Borde, An Absolute Beginner's Guide to Us- no real surprises for readers of TUGboat, as they ing T$jY, informal report (prepared for the Syracuse could have appeared in the proceedings of the University Relativity Group), 1987. TUG annual meeting for 1991 which was devoted Bill Cheswick, A Permuted Index for T$jY and to publishing. The leading journals in astronomy JAW, Providence, TEX Users Group, mniques. and astrophysics are now encouraging manuscript No. 14, 1991. submission in m or IPT)jX. For me the fun part of the book was in reading what those who do not use o George D. Greenwade had to say. Some of the time it was clearly due Department of Economics and Business Analysis to ignorance. For example, J. 0. Breen gave a talk College of Business Administration which was an undiluted advertisement for the Apple P. 0. Box 2118 Macintosh and the wonderful software that can run Sam Houston State University on it, including this gem: "equation editors such Huntsville, TX 77341-2118 as Prescience's Expressionist and Design Science's bed-gdgBSHSU.edu MathType, create typeset equations to be pasted into scientific and technical papers." Mr. Breen is not an editor, nor is he a publishing astrophysicist as far as I can discover. Mr. Breen prefers to create manuscripts using Wordperfect 5.1, as do a couple of other contrib- utors, and output examples of this word processor Review of: in Astronomy are on display. TEX users can justifiably feel smug & Space Sciences and optionally can wear a condescending sneer. WP 5.1 has terrible internal spacing in its equations A. G. W. Cameron and displays extremely loose lines, showing far too Andr6 Heck, ed., Desktop Publishing in Astronomy much white space. The other non-W contributors & Space Sciences. Singapore: World Publishing Co. do not identify their output programs, but their Pte. Ltd., 1992. ISBN 981-02-0915-0. contributions give good illustrations of why desktop publishing acquired a bad name in its early stages. These are the proceedings of a conference There was a significant amount of discussion held on 1-3 October 1991 at the Astronomical about how the software should evolve. There was Observatory, Strasbourg, France. This meeting clearly a desire on the part of some people that a was organized by Andre Heck, who edited the wider selection of fonts should be readily available proceedings. The book was produced in record with m. For example, publishers frequently would time: I am writing this review in September 1992.* like to use Times Roman; at least one of them The authors of the individual articles prepared converts to Times after receiving a compuscript in them in camera-ready form, most of them using Computer Modern, but others are clearly prepared 7QX or I4W. However, I am afraid that the to use Computer Modern. I was surprised to resulting product is not a publishing work of beauty. find essentially no discussion of scalable fonts; for The instructions to the authors were to prepare a some time now I have been using such fonts in manuscript at 12 points with a baselineskip of 14 conjunction with Vector TEX from Micropress, points, and I presume that the hsize was 6.5 inches and I don't know how I ever got along without and the vsize was 9 inches. But as published the them previously. People would like to have better hsize was 4.6 inches and the vsize was 6.5 inches. graphics facilities to use with m, either as a With this reduction I had to use a magnifying glass language facility incorporated into W, or a more to read some of the abstracts, which were prepared convenient way to merge Postscript into a 'l&X file. at less than 12 points, and if the original text was There is a general expectation in the astronom- ical community that on-line electronic publishing * Editor's note: The review copy was received will have a rapid growth in the near future. Edi- at the TUG office in June 1992. tors clearly intend to subject papers for electronic 490 TUGboat, Volume 13 (1992), No. 4 publication to a standard refereeing process. But These were the tested versions: what format should such papers have? Since people SBm3.8 will want to be able to print copies of particular emw3.0 [3a] papers, formatting in T)$ becomes a leading pos- emm286 3.0 [3a] sibility. Such papers could then be passed through bigemw 3.0 [3a] a standard wing process and printed, or they bigemm286 3.0 [3a] could be read after processing through a l&X screen PCm3.14 previewer. However, there was additional discus- emW386 (beta8) sion about how one could create electronic archives mas1.0 consisting of large data bases of electronic papers. PCm386 3.14 Would 'I)$ help in the archiving and accessing BigPCW386 3.14 processes? The files used for testing were the same as in the It has been very interesting to read a book previously published series of benchmarks: about desktop publishing in which W is the leading contender, rather than being out of sight 0 Text1 is The wbook.* It is 494 pages long. among the packages that allow you to produce fancy Text2 is a mathematical paper which needs newsletters. But the growth of desktop publishing I4m and qC?jEX, so it really uses lots of software packages has been so rapid that it is memory. The document is 11 pages long. clear that must make good use of the new 0 Text3 is a book of solutions for a college emerging technologies if it is to maintain its leading mathematics textbook. It consists almost position among astronomers and other scientific completely of formulas and there is almost users. Despite its faults of presentation, the book is no text. It is among the most complicated recommended. l&X files I have ever seen. It uses I4w and additionally the msxm and msym fonts from (old) o A. G. W. Cameron AMS-W. The document is 40 pages long. Harvard-Smithsonian Center for Text4 is the demo file for Musicm, which is Astrophysics a rather large macro package for typesetting 60 Garden Street music. The document is 2 pages long. Cambridge, MA 02138 0 Text5 is Michael Wichura's original paper from TUGboat 9, no. 2, describing PICI'EX. It makes extensive use of macros and also uses rather large data sets for the graphics. Additionally it uses the TUGboat macro files (in a stripped down version). The document is 10 (narrower than a page) columns long. Typesetting on PCs 0 Text6 is Barbara Beeton7s review and the 1 1 Boston Computer Society mathematical text processor benchmark from TUGboat 6, no. 3. It (naturally) contains complicated formulas 'I'EX-386 implementations for IBM PCs: and uses the TUGboat style. The document is Comparative timings 4 pages long. Erich Neuwirth Table 1 shows the times associated with the tests. Timing tests were performed on several implemen- The following special events occurred during tations of 'TEX for IBM PCs (and compatibles). the benchmark: All currently available 386-specific implementations (1) capacity exceeded, program stopped. were tested. Additionally the latest available ver- (2) Michael Wichura's article could only be sions of emwfor other processor classes were run in one column mode with non-386 versions tested. Since the last published benchmarks used of m having standard T)$ memory. sb'I)$ in the 8086 version as the standard the latest version of this implementation was also included for reference purposes. PCW as the most widely used commercial implementation of 'I)$ for PCs was used in its 8086 flavor for the same reason. * The file for The wbook used with permission of the American Mathematical Society. TUGboat, Volume 13 (1992), No. 4

If we take emm 386 as the base for a specific m implementations are using some sort of comparison of performance, we get relative indices DOS extender it is important to know which version of performance as shown in Table 2 (a low value of TEX will be compatible with which multitasking indicates fast performance). environment. Experience has taught us that one All these benchmark runs were performed on a must be very careful when using multitasking en- 50MHz 486 DX2 machine with MSDOS 5.0 installed. vironments. Therefore some additional tests were All programs were run with QEMM-386 installed performed. All tested implementations of TEX were giving 600KB free main memory and either 7Mb run under DesqView 386 and under Windows 3.1 of extended memory or 7Mb of simulated expanded in standard and in enhanced mode. To reduce the memory. number of runs only text3 (being a very complicated When using 386 machines most people do not document) was used for this test. run just plain MSDOS. Additionally in most cases Table 3 gives an overview of timings and of multitasking environments are used. Since all 386 compatibility problems.

Table 1. Test times Textl Text2 Text4 2:39 (1) 0:lO 0:18 (2) 2:50 (1) 0:lO 0:18 (2) 2:43 (1) 0:lO 0:18 (2) 6:20 0:27 0:24 0:40 6:OO 0:26 0:23 0:39 3:11 0:15 0:12 0:23 1:41 0:09 0:08 0:13 1:49 0:15 0:12 0:20 1:44 0:lO 0:08 0:15 1:48 0:lO 0:08 0:16

Table 2. Relative performance Textl Text2 Text 4 Text 5 1.57 1.25 1.38 1.68 1.25 1.38 1.61 1.25 1.38 3.76 3.00 3.00 3.08 3.56 2.89 2.87 3.00 1.89 1.67 1.50 1.77 1.00 1.00 1.00 1.00 1.08 1.67 1.50 1.54 1.03 1.11 1.00 1.15 1.07 1.11 1.00 1.23

Table 3. Test times and compatibility with Windows and DesqView DesqView 386 Windows standard Windows enhanced (3) (3) 0:33 0:36 0:34 0:35 0:34 0:34 0:33 6:37 5:40 2:29 6:24 5:30 2:20 0:56 1:22 0:54 0:23 3:38 (5) 0:33 (4) 0:32 0:25 (6) 0:24 0:26 (6) 0:25 492 TUGboat, Volume 13 (1992), No. 4

The following problems occurred during the Other implementors are invited to provide tests: copies of their implementations to be run through (3) Program started, but not enough memory to the same tests, the results to be reported in a future compile document. issue of TUGboat. I am willing to accept hints (4) Loader failed (DOS4GW) and suggestions from the implementors about how (5) DPMI not supported to make the tests run as efficiently as possible. I (6) Insufficient physical memory available am also willing to send out any files which cause problems and rerun the tests after the problems This table clearly shows that none of the have been solved. available implementations of for 386 PCs under rn This test would not be what it is without DOS can run in both variants of Windows: emw valuable advice and some test files from Barbara cannot run in enhanced mode, and PCw386 Beeton. and mas cannot run in standard mode. Since Windows only functions as a full multitasker for o Erich Neuwirth DOS tasks in enhanced mode, running a 386-7&X Institute for Statistics and for this configuration can be accomplished only Computer Science with PCWand Was. When using DesqView all University of Vienna three 386-rn implementations will work, but only UniversitatsstraDe 519 standard mode Windows will be available, because A-1010 Vienna, Austria Internet: a4422dabQVM.UniVie .AC .AT DesqView and Windows enhanced mode cannot be run concurrently.

/ FOR YOUR 'I)ijX TOOLBOX FOR YOUR BOOKSHELF CAPTURE TjjX BY EXAMPLE NEW! Capture graphics generated by application programs. Input and output are shown side-by-side. Quicltly Make LaserJet images compatible with T#. Create see how to obtain desired output...... $19.95 pk files from pcl or pcx files...... $135.00 ?JE;Y BY TOPIC NEW! texpic Learn to program complicated macros. ...$29.25 Use texpic graphics package to integrate simple TjjX FOR THE IMPATIENT graphics-boxes, circles, ellipses, lines, arrows-into Includes a complete description of 'QX's control se- your documents...... $79.00 quences...... $29.25 Voyager FOR THE BEGINNER NEW! Tj$X macros to produce viewgraphs-including bar A carefully paced tutorial introduction. ..$29.25 charts-quickly and easily. They provide format, in- BEGINNER'S BOOK OF TjjX dentation, font, and spacing control. ....$25.00 A friendly introduction for beginners and aspiring "wizards." ...... $29.95

[Mtl Micro Programs Inc. 251 Jackson Rve. Syosret, NY 11191 (516) 921-1351 TUGboat, Volume 13 (1992), No. 4

in the plain. tex format and, as the name suggests, Warnings should always be void, i.e., it's a constant. These symbolic names are declared with a function called \newbox(box) that allocates for (box) a new unique Solution to the puzzle from TUGboat 13#2: box register that later on can be referred to via this Where does this character come from? name, e.g., Frank Mittelbach \setbox(box) = \hboxC . . .) For other types of registers in there exist simi- Puzzle: lar functions to create symbolic names; for example, If some complex macro defined by you \newcount(cnt) makes (cnt) a symbolic name re- produces funny extra characters like ferring to some unique internal integer register. But "R" or "ae" in the output, what kind of the \newbox command is somewhat special. The use mistake could be the reason? of (box) declared with it does not mean "use the box After the above puzzle was published several people register that I represent"; instead it means "typeset sent me their solutions and they all thought of prob- the character whose number corresponds to the box lems that I didn't have in mind when I was writing register I represent". Only when (box) is preceded this short article. by a "box" command (like \setbox, \unhbox, etc.) Indeed, it is possible to sometimes get a weird is it interpreted as a box register. Therefore, a (box) character at the end of an input file, namely 'd. out of sequence silently typesets some character in This is a control-Z (-Z), the old end-of-file marker the current font; in such a case it is equivalent to from the DOS operating system. This character \char(no of the register (box) represents) once marked the end of a file but is obsolete with This is a speciality of \newbox; all other types of newer versions of DOS. Nevertheless, many editors symbolic names are always interpreted as referring and other programs still write such a mark at the to an internal register. For example, a (dimension) end of a file, and when such a file gets transferred declared with \newdimen which is used out of se- to another operating system the character suddenly quence will be interpreted as an assignment to becomes an ordinary source character, namely the the dimension register and the following tokens are character in position 26 of the current font. You scanned for a dimension. This will usually result can try this, by typing ^-Z in a document (the dou- in an error, but if one is unlucky enough (e.g., if ble hat is W'snotation for a control character). In a dimension follows) one will get an equally weird principle, any character may show up in your doc- behavior. ument due to incorrect transfer protocols between So far, I have explained this problem as a plain different operating systems, but the 'ae' is probably rn problem. but actually the same might happen the most common one. In an earlier TUGboat Bar- to a UTj$ user who declares a "save-box" with bara Beeton discussed the sad story of --M behaving \newsaveboxC(box)) and later on uses (box) but for- differently on different rn installations due to op gets to call it via the \usebox command. The second erating system differences [BB88]. weird character in the puzzle above was generated But I wasn't thinking about file transfer prob- this way by saying lems. I was talking about macro definitions that all of the sudden produce additional and undesired characters. So here follows my original answer: The above riddle comes from some real life ex- From this we can deduce that \newsavebox allo- perience during the implementation of a complex cated box register 27 for \errorbox since this is the macro for I4W3. One evaluation of this macro font position for "a? in the Computer Modern fonts. under \tracingall results in more than 700 lines References of trace information which made debugging this way somewhat unattractive. Eventually I found the [BB88] Barbara Beeton. Controlling cctrl-M>. source of these extra characters to be an innocent TUGboat 9(2):182-183 (August l988). \voidbQx which I had forgotten to remove after changing parts of the code. Frank Mittelbach For those who never heard of this name, a short Electronic Data Systems (Deutschland) GmbH explanation: \voidb@xis a symbolic name for one of Eisenstraae 56 (N15) the 256 internal box registers of m. It is declared D-6090 Riisselsheim Federal Republic of Germany MittelbachQmzdmza.zdv.Uni-Mainz.de TUGboat, Volume 13 (1992), No. 4

Macros

The bag of tricks or (a particularly neat effect by using four spaces): Victor Eijkhout G7day,my friends in TEX. Today I want to address two slightly Wnical points. The first is the prac- Indent the material in a box: tical issue of how to format macros, the second is in response to comments from readers. \def\EnvMakeBox#1#2{ \setbox#l\vboxC 1 How to lay out a macro \par indent Opt If you write macros that will sooner or later be given to other people, you may want to be particularly Indent statements that have to be broken because careful about your style of writing. The way you they are too long: write a macro should bring out its structure. If \expandaf t er\expandaf ter you ever wonder 'now, where is the closing brace \expand& ter#l% for this box' in your own macro, consider it an in- \expandafter\expandafter dication that other people will have trouble reading \expandafter#3\expandafter#3#4 that macro too! Do you wonder about the percent sign after #1 and Here are some guidelines, distilled from my ex- the lack of one on the last line? The first one is nec- perience, and from looking at the style of format- essary to prevent an unwanted space in the middle ting in TUGboat. The examples are all taken from of a statement. There is no percent sign necessary TUGboat with spacing and line breaking intact. Al- at the end of the whole statement because the au- though all illustrate the general principle, their style thor apparently knows that this statement will be still differs in detail. executed in a place where spaces are ignored. See 1.1 Align for readability the next section. Recognize when things are 'on the same level' and 1.3 But what about all those spaces? align them vertically. For example, I have met people whose experiences with unwanted spaces were so traumatic that they didn't indent their macros any more, and didn't put spaces in them either. This is unnecessary, and sometimes even dangerous. Here are some rules.'

0 Spaces at the start of a line are irrelevant, and

0 a space or a line end after a control sequence is irrelevant. This point and the previous are true unless a macro such as \obeyspaces appeared earlier. On the other hand,

0 A space or a line end after a control symbol, that is a backslash followed by anything but a letter, for instance \I, is relevant; this is not true for control space: \u. 1.2 Indent for readability Multiple spaces are almost always equivalent to just one space. Look for 'levels' in your input, and give the next level more indentation. For instance, indent nested 0 Spaces are a good idea after a number, but be definitions: careful, not all numbers are numbers. For in- stance, you want a space (or a line end) after This is no attempt at explanation, and these rules are not 100% accurate either. TUGboat, Volume 13 (1992)' No. 4

\pageno=13, \box37 or \ifodd42, but not af- ter \multispan5, \magstep2 (\multispan and \magstep are macros with one parameter), or #I (neither in the definition parameter text or the body of a macro). There is more to this number business; for in- TJ$ will get confused if the outer conditional is false: stance, after control sequences that expand to num- it matches that conditional with the first \else or bers you sometimes want to place \relax analogous \f i that it finds. to the space after a genuine number. But this would Here's a way out, proposed by the big K himself, be taking us too far. and used extensively in Stephan von Bechtolsheim's forthcoming book in Practice. Define 1.4 When is a space not a space? Sometimes a macro can contain spaces in the in- put that are relevant, but that you don't care about anyway. This happens if that macro or some part of and use it as it will occur in vertical mode. If is in vertical mode it ignores spaces. Thus, if you write \hbox{ Now sees a conditional, and this conditional is \Title matched up correctly if you nest it. 3 And that's it for this time. \relax and hang on to you get an unwanted space after the opening brace, your towel! but not in \vboxC o Victor Eijkhout \noindent\Title Department of Computer Science 1 University of Tennessee at Knoxville because Qi$starts vertical boxes in vertical mode. Knoxville TN 37996-1301 (Makes sense, doesn't it?) Similarly, often you know Internet: eijkhout@cs .utk.edu that a part of a macro will be in vertical mode:

After the \par is in vertical mode, so the space after the \hbox is irrelevant. In general it is advisable to put comment signs Too Many Errors at line ends only if a space there can find its way Jonathan Fine into the output. If the space is guaranteed to disap- pear, as in the above examples, an extra comment One of the attractions of TJ$ the program is that it sign would only confuse the readers who understand is substantially without error. Sadly, the same is not this point, whereas the readers who are (blissfully!) always true for macros written for w. I would like unaware of it will not be bothered by its absence. to see a regular column in TUGboat where errors (A bonus remark for advanced TEX users: most discovered in previous issues are reported. Perhaps spaces in output routines are also irrelevant.) a small prize could be given each year to the person who finds the most. Here is my contribution for the 2 Skip that question! June 1991 issue (vol. 12, no. 2). In a previous issue of TUGboat I wrote about con- ditionals such as Some tools etc.: Part I-Lincoln Durst (p.248- 252) Here, the error is slightly complicated to ex- plain. The macro \Pageno (p.252) is intended to help write zero-padded page numbers (001, . . . , 009, 010, 999) to an index file. Its use is within There is a problem with such home-made condition- . . . , a context equivalent to als: rn treats them as ordinary macros, so if you try to nest them in another conditional as \edef\next{\write\inx(\PagenoH 496 TUGboat, Volume 13 (1992), No. 4

\next them, reporting them, or being told about them. but the definition supplied by Durst (not reproduced We all wish that they did not exist. I hope that this here) will produce 0010 if called within text that letter has not made me any enemies, and has en- is considered (i.e. typeset) for page 9 but actually couraged authors to submit more articles with fewer appears on page 10. errors. This will not happen if the \noexpands are o Jonathan Fine taken from \Pageno, and \noexpand\Pageno used 203 Coldhams Lane in place of \noexpand\nurnber\pageno in Durst's Cambridge \maexref macro. CB13HY England The bag of tricks-Victor Eijkhout (p.260) J.FineQpmms.cam.ac.uk Here, two macros \storecat and \restorecat are defined, to be used as in f ilel. (In the article, \storecat is mistakenly also called \savecat.)

% file1.tex \storecat Q % macros One error less % Q is a letter \restorecat Q Victor Eijkhout Jonathan Fine correctly points out that the macros The purpose is to allow Q to be a letter within f ilel, \storecat and \restorecat cannot be used nested. but then to restore it to what it was before, when This problem cannot be remedied by using grouping, f ilel is finished. because these macros may enclose arbitrary pieces of But now suppose we input f ile2 below, using code, and you may not want a group around them. the definitions supplied by Eijkhout. Here is a solution: the call \storecat\% defines \storecat Q the control sequence \restorecat% to restore the % file2.tex category code and restore the previous definition of \input f ilel itself. % macros \def\storecat#lI% \restorecat Q \count255 =\escapechar \escapechar=-l\relax When file2 is finished, Q will have \catcode 11, \csarg\ifx(restorecat\string#l~\relax regardless of what it was before file2 was input. \toksOI\relax3\else This is not what is wanted. \edef \actC\toksO(% \CSname~restorecat\string#l~~~\act Babel, a multilingual etc. -Johannes Brahrns \toksO\xp\xp\xpC\the\toksO3% (p.291-301) This article is inconsistent in its use \f i of % to eliminate the space tokens that would \csarg\edef(restorecat\string#l)% otherwise place after ( and 3 characters at the end (\catcode1 \string#l=\the\catcode of a line. \expandafterl\string#l% The use of \expandafter in Fig. 1, and its sec- \def\CSname{restorecat\string#l)% ond use in Fig. 4, add nothing and are redundant. C\the\toksO33% These defects are relatively slight, for they do \catcode\expandafter'\string#l=l2\relax not prevent the macros from working as advertised. \escapechar=\count255 3 where the auxiliary macros Letter from Victor Eijkhout (p.303) Here, he \let\xp\expandaf ter quotes a user as writing \def\csarg#l#2{% \def \caption#lC\hboxI\hboxC . . . )\vtopC#l)) \expandafter#l\csname#2\endcsname3 This line has 4 left braces but only 3 right braces. \def \CSname#li% \xp\noexpand\csname#l\endcsname) Conclusion Errors lie in the dark side of program- are used. The definition of \restorecat stays the ming. Usually, nobody likes making them, finding same. TUGboat, Volume 13 (1992), No. 4

Here is some test input: Zzw: A Macro Package for Books \storecat\% Paul C. Anagnostopoulos \cat code' \%=3 \storecat\% Introduction \cat codec\%=4 Zzmis a macro package for producing books, jour- \storecat\% nals, and technical documentation. The primary \catcode1\%=5 advantage of Zzm is its design flexibility, which \restorecat \% makes it well-suited to typesetting books according \showthe\catcode'\% to the specifications of a professional book designer. \restorecat% During the past three years, I and my associates \showthe\catcode'\% have used the package to produce approximately \restorecat\% 25 books, ranging from the 100-page journal, Sys- \showthe\catcode'\% tem Dynamics Revzew, published by John Wiley & As a whimsical aside, the double assignment to Sons, to the 1400-page book, VMS Internals and \toksO can also be done in one statement: Data Structures, Version 5.2, published by Digital Press. In this article I hope to give you a taste of some of Zzm's more interesting technical aspects. Future articles will delve deeper into the details of the macros themselves. using 15 consecutive \expandaftem. I was initiated into the composition and type- setting business when I agreed to compose my own o Victor Eijkhout book for Digital Press. I had written the book using Department of Computer Science IPm, and continued to use it for the composition. University of Tennessee As a software engineer, I found it impossible not 104 Ayres Hall to fall in love with book production: finally, an Knoxville, Tennessee 37996, USA endeavor that produces a concrete work of art as eijkhoutQcs.utk.edu its end product, rather than some ethereal software. However, I needed more design and page-makeup flexibility than IPmhad to offer, so I undertook to write my own macro package, which I subsequently named Zzm, after a rock group from Texas. De- sign flexibility is of paramount importance when producing books according to typographers' de- signs; neither they nor the publishers like to hear "I'm sorry, that element is too difficult to typeset." The first book produced with Zzmwas a real struggle. It took about two weeks to create the design file and produce sample pages. With time, I refined the package and added many new features. Each enhancement was a direct result of a design requirement in a book I had produced, so I believe Zzm is a practical, realistic macro package. Fur- thermore, my knowledge of the publishing business grew with each book. Now when I receive a design specification I can produce sample pages in less than a day. The package includes approximately 7,200 lines of m code and various utilities written in AWK. The Zzm macro package and manual are available from the author for a nominal fee. The macro package may be freely distributed, but the manual is copyrighted and must be ordered from the author. Zzm uses significant amounts of TUGboat, Volume 13 (1992), No. 4 rn memory, so the author recommends a w Opens the block scope by starting a group. implementation that has memory areas at least This hides any parameter changes made inside doubled in size. the block, allowing parameters to revert to their previous values when the block terminates. The Block Stores the \baselineskip, \parskip, and \parindent of the enclosing block in three In general, each of Zzm's typographic elements is special parameters, thus making the surround- assembled from a fundamental construct called the ing values available within the new block (after block. A block "contains" the text of the element, all, these parameters may be changed within and separates its text from that of surrounding the block). blocks. Here is an example of a block that produces Increments a block-specific depth counter. a bulleted list: Invokes the design macro for the block. Design \listIbullet) macros are contained in the design file loaded \item This is the first item of the by Zzm at the beginning of the run (see bulleted list. next section). In the case of lists, there is a \item This is the second item of separate design macro for each type of list. The the list. It can contain many design macro establishes a set of parameters lines of text, and even multiple that controls further processing of the block. paragraphs. Increments a block-specific sequence counter. \item This is the last item. If appropriate, this counter can be used to \endlist number the instances of the block, as might be The \list command begins a list block. The done with sections or footnotes. argument in braces is called the block type, which Resets the sequence counter of any subordinate allows you to specify arbitrarily many list designs. blocks. Zzmassumes the existence of certain The text of the list begins after the \list command block relationships, such as the standard sec- and ends at the \endlist command. Each item in tion, subsection, and subsubsection hierarchy, the list is initiated with the \item command. and resets counters accordingly. Furthermore, The list block implementation in the Zzw Zzm provides the \resetnumber design pa- macro package provides a "generic List formatter" rameter on most blocks, with which you can that has the capability to produce almost any explicitly specify other sequence counters to be style of list. In order to format a particular type reset. of list for a particular book design, the block Invokes a command (defined in the design accepts a set of design parameters that directs macro) that formats the composite number for its formatting of that list (e.g., the \leftindent the block. For example, the composite number parameter determines the indentation of the list for a subsection might be '3.2.5', for a table items). You are responsible for providing the design '3-8'. parameters for each type of list, placing them in Performs any formatting required at the be- your book's design file (see next section). The ginning of the block, including vertical space design file contains a design macro for each type of above and perhaps a title. block element in the book; the design macro encloses Once the contents of the block are typeset. - and the specifications of the block's design parameters. Zzmencounters the ending command, it performs Zzm provides approximately 35 kinds of these steps: blocks, many of which accept a type argument to 1. Checks to make sure that the ending command allow an unlimited number of variations. had a matching starting command. The power of the block lies in the steps that 2. Recursively closes any subordinate blocks that Zzwtakes when it begins and ends a block. When are still open (e.g., the \endsection com- a block is started, Zzm performs the following mand automatically closes any subsection in steps: progress). 1. Automatically closes any blocks that are ter- 3. Performs any formatting required at the end of minated by the new block. For example, the the block, including vertical space below. section block terminates a preceding section 4. Decrements the depth counter. block. 5. Closes the block scope, discarding any param- eter changes made in the block. TUGboat, Volume 13 (1992), No. 4

The Design File \def \documentdesign 1% \setf lag\cropmarks \true A book's design specification is embodied in the \eveninnermargin = lin Zzm design file, which includes a design macro \evenlefttextmargin = 4pc for each element in the book. The design macro \evenrighttextmargin = Opt for a particular element specifies values for various \footerheight = 26pt design parameters that determine the formatting of \headerheight = 17.5pt the element and control behind-the-scenes activities \headmargin = .5625in such as the generation of marks. In addition, \hoffset = -.25in , the design file contains commands that establish \maxbottomcolumnfloats = 3 the font table, a matrix that correlates type sizes \maxtopcolumnfloats = 3 and styles. The design file for a typical book \oddinnermargin = .646in might comprise 50 design macros and 200 font table \oddlefttextmargin = 4pc commands, with a total of 800 lines. \oddrighttextmargin = Opt Most of the elements in a book are realized \parindent = 1Opt in Zzm with a block. Your design file contains \parskip = Opt the design macros for all the blocks used in your \setflag\PostScriptoutput = \true book. There are no block designs embedded in \textareaheight = 526.5pt Zzm, only generalized macros that can format a \textareawidth = 28pc block given your design parameters. Therefore, as \topskip = 13.5pt far as design is concerned, Zzw is a tabula rasa \trimheight = 9.25in waiting for your book's design. You must always \trimwidth = 7in include a design macro for a special block called \voffset = -.125in) the document block. The document block design includes parameters that specify the overall design Figure 1 of the book, plus parameters that control the look can invoke the first-level bulleted list macro, thereby of the main text paragraphs (e.g., their paragraph sharing common parameters such as \aboveskip, skip and indentation). Figure 1 illustrates the \belowskip, and \bodyf ont. document block design macro for a book I recently Careful page composition often requires that completed. In addition, the design file might individual blocks be adjusted. The \with command contain design macros for bulleted lists, numbered is used as a prefix on a block command to alter lists, and plain lists. It might contain a macro one or more design parameters for that particular for computer program examples in running text, instance of the block. This is how you can change and another for program examples in figures. And the space above and below a list: it might contain macros for chapters, appendixes, \with(\aboveskip=18pt plus 1.2pt sections, and subsections. \belowskip=\aboveskip) Figure 2 illustrates the bulleted list design \listIbullet) macros from the same book. The name of the main list macro is \listbulletidesign: 'list' is the Zzmperforms \with assignments after it invokes name of the block, 'bullet' is the block type, and the block's design macro. 'i' is the depth. Similarly, the name of the sublist macro is \listbulletiidesign. This naming The Font Table scheme accommodates many types, or flavors, of One of my primary goals in creating ZzT@ was the same block, and also different designs for to allow complete flexibility in selecting fonts. In first-, second-, and third-level nested lists. The fact, I have never typeset a book using Computer first thing the sublist macro does is invoke the Modern Roman. (I have used Computer Modern main list macro; this establishes all of the main Typewriter, because many book designers realize it list design parameters. Then the sublist macro is better than other available monospaced fonts.) redefines only those parameters that are different Zzm employs a font table to select fonts. You in the sublist design. Design macros can be can think of the font table as a matrix with rows arbitrarily interdefined in this manner. Another corresponding to type sizes and columns to type common reason for defining one block in terms styles. Figure 3 illustrates a simple font table. of another occurs when you want a design for Three steps are required to set up the font numbered lists. The first-level numbered list macro table: 500 TUGboat, Volume 13 (1992), No. 4

\def \listbulletidesign C% \aboveskip = 21pt plus 1.6pt minus 3.1pt \belowskip = \aboveskip \bodyfont = 0%Same as surrounding. \interitemskip = 15pt \def \labelformat ##i{##l\hfil)% \definefont(\twentyfourdrm)Css at 24pt) \labelshift = -\enclosingparindent \definefont{\twentyfourdbf){ssb at 24pt) \def \labeltext C% \definefont{\eighteendrm)(ss at 18pt) \centeronxheightC\bul .)I% \definefont{\ninetqtt){cmttlO at 9.75pt) \labelwidth = \enclosingparindent \definefonti\nineqrm)

\textsize 10' Nofret 10' Nofret - \setfontmath(\textsize)~\mex)~\nineqmex~ Regular Italic C\nineqmex)C\nineqmex) \setfontmath{\textsize)(\it)C\nineqit) \ftntsize 7' Nofret 7' Nofret - C\sevenit)C\f iveit) Regular Italic Figure 3 \setfontC\textsize)C\tt)C\ninetqtt3 \setfont(\textsize){\sb)C\nineqsb) 1. Define any type styles you need in addition to \setfont{\textsize)C\sbi)C\nineqsbi) the built-in ones (Roman, math italic, math \setfont{\textsize){\bul)C\eighteendrm) symbol, math extended symbol, Postscript Figure 4 symbol, italic, bold, bold italic, and type- writer). The definition includes a specification the baseline-to-baseline distance. After each of the character set encoding used by the style size definition, set the fonts for those styles (e.g., Roman vs. italic vs. monospace). Know- that appear in that size. Styles that are used ing the encoding, Zzm can, for example, in math require three fonts (text, script, and automatically insert an italic correction after scriptscript); other styles require one font. italic text. Figure 4 shows a portion of the font table for a 2. Define all the fonts you need. book. 3. Define the logical type sizes you need (there are no built-in ones). The size definition includes TUGboat, Volume 13 (1992), No. 4

of floating elements (e.g ., computer program code) and produce a listing of those elements. An entry for each symbolic tag that is referred to elsewhere in the book. \document An entry for each endnote. \copyident{\sevenm Merusi first pages) A single snapshot at the end. The snap- \printart{\true) shot contains the division's final page number, chapter number, section number, and so forth. At the end of a run, Zzm combines all the root and division cross-reference files into one composite cross-reference file. The composite file is considered the master list of cross-reference information. At the beginning of a run, Zzm: 1. Loads the composite cross-reference file to ob- tain the symbolic cross-reference tags. (All tags in a book must be unique, so if you are producing a book from multiple independent authors, you may have to alter tags during conversion to make them unique.) 2. Starts a cross-reference file for the root file. For each division, Zzm: \enddocument 1. Adds an entry to the root cross-reference file Figure 5 that names the division cross-reference file. 2. Creates the division cross-reference file. In addition to the main font table, Zzm 3. Writes table of contents entries, cross-reference provides a second table that specifies style relation- tags, and endnotes to the division file. ships. There is a built-in relationship called \emph 4. Finishes the division file with the snapshot of that you use to produce . The relationship that division. table specifies that Roman is emphasized with italic, At the end of a successful run, Zzm: and vice versa. Furthermore, bold is emphasized with bold italic, and vice versa. You can add 1. Closes the root cross-reference file. additional entries for emphasis, and invent your 2. Combines the root and division cross-reference own relationships such as \smallcaps, \newtem, files into one composite cross-reference file. or \varname. Whenever Zzm needs cross-reference infor- mation, it consults the composite cross-reference The Division file. Thus, when you send a book to someone else for processing, you send only the source files Any book longer than about 20 pages is best broken and the single composite file. If encounters into divisions, each of which typically contains the an error processing your book, and you terminate material in one chapter. The entire book is repre- the run, that division's cross-reference file is invalid, sented by a root file, and the root file incorporates but the composite file still accurately reflects the each division with a \division command. Figure 5 previous run. So when you reprocess the book to shows a small root file. You can use the \set- correct the error, the cross-reference information is divisions command to select specific divisions for still intact. The second reprocessing run behaves processing. just like the first run. Associated with the root file and each division If the \setdivisions command excludes a file is a division cross-reference file that contains division, Zzw does not process it. Instead, it the following information: searches the composite cross-reference file for the An entry for each title that should appear in a division's snapshot and updates important counters table of contents, list of figures, list of tables, such as the page number and chapter number so or a similar listing of other floating elements. they reflect the state of affairs at the end of the Zzm allows you to define additional types division. In this way, the next division processed will appear to be in the correct place in the book. TUGboat, Volume 13 (1992), No. 4

Zzw writes "moving arguments", such as it more than once on a single page, usually in titles, into the cross-reference files without expan- front matter to format the half title or full title sion, so that no "protect" mechanism is needed. page. A special command, \adjusttitle, allows you to \vspace. This command adds additional ver- customize the format of a title where it appears in tical space between two elements that is inde- the main text, a table of contents, a running head, pendent of any other explicit or implicit base- or a textual cross-reference. An adjustment can be to-base space between those elements. Thus it as simple as a line break or as complicated as a replaces \vskip. footnote. The first four commands also accept an argument that specifies the page-break penalty inserted above Vertical Spacing the vertical space. If a \bbskipabove command One of the most difficult tasks I encountered in follows one of the \bbskipbelow commands, the creating ZzW was to ensure consistent vertical maximum of the two spaces is used. If the reverse space between elements. If the book designer occurs, an error is signaled. requests 24 points base-to-base above an A-head In order for vertical space to be consistent, you and 16 points below, then ZzW must produce must use these six commands wherever you request that much space, regardless of the element above explicit vertical space. However, most vertical space the A-head, the size of the A-head, or whether is produced implicitly at the beginning and end of there is text or a B-head immediately below it. a block. Any block that produces vertical space Allowing some stretch and shrink above a heading accepts the \aboveskip and \belowskip design does not diminish the need for consistent nominal parameters, which specify the space above and space. I solved the problem with the vertical below the block, respectively. The macros that spacing environment (not to be confused with a implement the block use \bbskipabove to produce IPWenvironment). the space above the block, and \bbskipbelowblock Zzwprovides six commands to produce ver- or \bbskipbelowblockpar to produce the space tical space: below. Therefore, you usually only need \vsink to format pages such as title pages, or \vspace to \bbskipabove. This command specifies a force more or less space between certain elements certain base-to-base space between the previous for aesthetic purposes. You occasionally have to element and the next. If two or more of these use \bbskipabove or \bbskipbelow to obtain the commands appear in a row, the space from the correct base-to-base distance between two elements first one prevails. that are not blocks (e.g., a title and subtitle). \bbskipbelow. This command specifies a The vertical spacing environment is maintained certain base-to-base space between the previous as a stack of structures, for reasons explained below. element and the next. This command is not The structure at each level of the stack includes the used to produce vertical space at the end of a following data items: block (see next item). If two or more of these commands appear in a row, the space from the The type of the previous vertical space: none; last one prevails. inter-paragraph space specified by \parskip; \bbskipbelowblock. This command is equiv- space above, produced by \bbskipabove; or alent to \bbskipbelow, but must be used to space below, produced by \bbskipbelow and produce vertical space at the end of a block. It Fiends. compensates for any change in the \baseline- The page-break penalty associated with the skip and \parskip values that might occur previous vertical space. after the block terminates. The base-to-base space requested for the previ- \bbskipbelowblockpar. This command per- ous vertical space. forms the same functions as \bbskipbelow- The actual glue Zzwinserted for the previous block, but also checks whether the next el- vertical space. ement begins a new paragraph. If not, it By carefully inspecting and maintaining these items, ensures that the paragraph continuation is not the vertical spacing commands consistently produce indented. the correct amount of space. The environment is on \vsink. This command specifies a certain a stack because vertical spacing within some blocks, base-to-base distance between the top of the such as floating figures, is independent of the vertical type page and the next element. You can use spacing in progress in the surrounding text. When a TUGboat, Volume 13 (1992), No. 4 503 floating figure begins, it pushes the current vertical the "see also" locator, and the "consult" locator spacing environment on the stack, and reinitializes (for referring to other books). the environment. The vertical spacing within the A locator definition creates one or more macros figure thus begins afresh, unaffected by the space you can use throughout a book to produce index above the figure. When the figure block terminates, entries. If the locator is named command and has the it pops the stack. Each level of the stack is simply \page attribute, then \xcornmand produces a locator implemented as a numbered definition containing with the current page number. The \xcommand- the saved values of the environment items. The begin and \xcommandend macros produce locators items for the top level are in global variables. that begin and end a page range, respectively. Each macro accepts one, two, or three arguments The Index designating up to three levels of index headings. To prepare an index entry file, you include the The only difficulty about typesetting an index from \prepareindex command in the root file. This a prepared file of entries is producing carry-over lines command specifies an index type, thereby allowing when a first- or second-level entry continues onto a you to have more than one index in a book (e.g., new page. However, creating that file of entries from a main index, an index of commands, and an indexing commands in the book is a challenge. I am index of variables). It also specifies the name of a rarely asked to do it, because most authors do not index preparation file that receives all of the control index their books, and many publishers prefer not information necessary to prepare an index: root file to use authors' indexes. Nevertheless, to support name, index type, list of locators included in this those publishers and authors who want to generate index, and the definitions of those locators. The an index automatically, I developed facilities to \prepare index command also activates indexing produce an index entry fiIe from commands in the so that Zzm attends to indexing commands and text. writes the entries into the raw index files. Without To produce an index you must first define the a \prepareindex command, index entries in source required index locators. An index locator is a files are ignored. There is one raw index file for particular item of information associated with an the root and one file for each division (as with entry. The most common index locator is a page cross-reference files). number or page range. Another common locator is After a Zzmrun, three steps are required to the "see also" locator that refers to another index produce the index described by one particular index entry. When you define a locator, you specify the preparation file: following information: 1. An AWK program consolidates all the locators The name of the locator. in the raw index files into one composite index A set of attributes. The \page attribute speci- file. Prefixed to each record is a six-part fies that a page or range of pages is associated key that includes the headings (canonicalized with the locator. The \text attribute specifies for sorting), precedence, segment number, and that arbitrary text is associated with it (e.g., page number. The segment number is used to another index heading). separate front matter pages from main body The sorting precedence of the locator. For pages. This step discards any locators that example, "see also" locators have a lower should not be included in the index. precedence than page locators, so they appear 2. The composite index file is sorted. after the page numbers in an entry. 3. Another AWK program processes the sorted The prefix text. The prefix text for a "see also" index file and creates the source file for entry in English is "See also". the index. All of the locators for one entry are A template that specifies how to format a single merged into a paragraph, using the prefix text, page number or the text of the locator. single-page template, and page-range template A template that specifies how to format a page specified with each locator definition. The range. resulting file is suitable for inclusion in an ZzW predefines the following locators, in \index block anywhere in the book. order of precedence: the null locator (for entries without any locators), the "see" locator, the page Conversion To and From Zz'QiJC nurnber/range- locator, a locator for each type- - of floating object (for referring to tables, figures, etc.), My colleagues and I have typeset books from authors who used many different document preparation 504 TUGboat, Volume 13 (1992), No. 4 systems, including Microsoft Word, troff. VAX proofreading changes, produces an almost-complete DOCUMENT, DECwrite, m. and @?]EX. Not set of the second pages, and produces the final only are there many document systems, but the pages for reproduction proof or film. degree to which an author uses the features of any If you are writing and producing your own given system varies greatly, as does the author's book, you may be responsible for all of the steps level of consistency. To facilitate the conversion outlined above. In either case, care is required of these books to Zzm, I developed a table- to keep the master files up-to-date, and to ensure driven translator called ZzTran. Because ZzTran is that the notations on paper manuscripts marked based on AWK, you can specify regular expression by copyeditors and proofkeaders are incorporated patterns that match tags in the source language. back into the files completely and accurately. The For each pattern you specify how to generate the biggest dilemma concerns automatic indexing: how corresponding tag in the target language (usually can the compositor work on the files while the Zzw), so that a translation file consists of a indexer "owns" them to enter index entries? In table of patterns and their replacements, along with a confined computer environment, some type of auxiliary AWK functions you write to help with the source control system can be used. But, in the real more complicated tag translations. world of far-and-wide subcontractors, I have not To translate files, ZzTran runs an AWK pro- devised an acceptable solution. We usually have gram that "compiles" the translation table into a the indexer put the entries in a text file, convert it pure AWK program. The compiler incorporates to Zzw, and typeset it independently of the rest both driver functions that control the translation of the book. process and a standard library of utility functions (e.g., replace 0 to replace a tag, keep0 to main- Future Work tain a tag as is). ZzTran then runs the resulting Although I have been developing Zzm for three AWK program, which reads a source file and pro- years, there is still significant work to be done. My duces the corresponding target file. ZzTran can to-do list includes the following: usually accomplish about 95% of the translation automatically, so that very little must be done by The multicolumn support must be redesigned. hand. At present, Zzmproduces multicolumn pages Occasionally, after typesetting, I am asked to by treating each column as a separate logical translate the final Zzmfiles back to the author's page. This allows single-column footnotes and original document preparation system. This is floating figures, but makes it difficult to bal- usually simple because the tags in Zzm files ance the columns on the final page, particularly are more specific and complete than those in files when switching back to single column format acceptable to the author's system. The reverse on the same page. A hybrid scheme is re- translation is a matter of converting some Zzw quired, where each column is a separate logical tags to the original coding system and discarding page, but, when necessary, all columns can be the rest. collected and treated as one page. While the current scheme for horizontal place- Production Methodology ment of elements is flexible, its use is not intuitive. It is particularly difficult to produce A commercial book is created by a team of people. atypical kinds of centering, such as centering When my colleagues and I produce a book with text in an area other than the normal text Zzw we usually break the work down as follows. measure. I want to implement a new technique I am responsible for converting the author's files involving four parameters: \hshif t, to control to Zzw, because this often involves some pro- horizontal shift; \measure, to control the text gramming with ZzTran. I am also responsible for measure; \flush, to control whether text is creating the design file according to the book de- flush left, flush right, or centered; and \width. signer's specifications, and producing sample pages to specify the width on which the flushing is that illustrate the design. Once the design is ac- performed. cepted by the publisher and author, I deliver the I want to complete the work necessary to make design file and the Zzm source files to a person Zzm independent of Plain m,yet allow who will be responsible for the composition of the them to coexist. You will be able to load book. The compositor enters copyediting changes, Zzminto TJ$ with or without the Plain w produces a rough set of first pages (galleys), enters macros. TUGboat, Volume 13 (1992), No. 4 505

e The Zz'IjEX manual is incomplete. It is cur- refinements over the usual verbatim listing for rently about 220 pages, and will expand to source code were also desired. approximately 400 pages. In the course of this programming, extensive No software is ever finished, and I will continue access to characters with \catcodes other than to enhance Zzw. Nonetheless, I know that Donald those usually given was desired. This proved to Knuth's '.IJEX is capable of producing truly beautiful be a stumbling block for this project, which still books. awaits completion. Various programming tricks were introduced. The result of systematically o Paul C. Anagnostopoulos developing these devices is the \noname macros. Windfall Software Although they have now reached the stage of being 433 Rutland Street useful, there are developments being considered that Carlisle, MA 01741 will further increase their power and usefulness. [email protected] The physical activity of erecting a building commences with the digging of a hole, that will become the foundations that support the planned structure. The larger the building, the deeper the hole. The \noname package is intended to provide secure foundations for large scale collections of TEX macros. The \noname macros -a technical report Jonathan Fine 2 Examples Abstract Here is a line of code from plain. tex. It supports the \newif construction. It creates a control The \noname package provides a powerful envi- sequence \if@ that must be followed by other ronment for writing macros. Its use makes characters 'i' and 'f' with catcode other, i.e. 12. macros easier to read, easier to write, and easier Such funny letters arise from use of \string. to document. It allows ready access to powerful {\uccoder l=' i \uccoder2='f control macros. It allows diagnostic and other code \uppercase{\gdef\if@12{}}} to be tagged for conditional inclusion. The \noname package is fully compatible with existing macros. (The purpose of \if@ is to extract the string Here are two major features. It allows easy foo from \iffoo, which is then used to construct access to arbitary character tokens. Lines that \f oof alse and \f ootrue. The macro \if@is also do not begin with a white space character are intended to give an error if the argument to \newif comments, and are ignored. is not of the form \if. . .). The intention has been to provide the pro- Here is the same macro defined using \noname. ductive features that users of other programming \def \if@ 'i'f (1 languages take for granted. This article provides an The right quote symbol "' is an escape character outline of the history, design and implementation of that serves to produce a character with catcode the \noname package. other, whose character code is given by the following alphabetic constant. Acknowledgements Here is another example. The \noname macro I would like to thank Nelson Beebe, and particularly definition Michael Downes, for their careful comments on an \def \spaces{ 1 earlier version of this article. defines \spaces to be a macro whose replacement text is five ordinary space tokens. (Ordinarily, 1 Introduction special tricks are required to get a space after a The \noname package grew out of work the author control word or another space). Finally, was doing two years ago. The goal was to write \def !\-^M I \par 1 macros, for setting verbatim code, that would will in \noname define active carriage return to set source in a \tt font, and comments in a expand to \par. proportional font. This effect was to be achieved without additional mark up of the input file. Other 506 TUGboat, Volume 13 (1992), No. 4

3 Influences code or a hash command-came from a wish to have a natural input scheme for the typesetting of This section attempts to list the various sources for source files. the design of the \noname macros. Although the doc option gives a pleasant ap- 3.1 Knuth's WEB system. WEB allows source and pearance to the large comment blocks, it leaves the documentation to be mixed in the same file, and macro language of TEX unchanged, and sets small in a disciplined manner. It implements literate comments within the code lines in a typewriter font. programming. The WEB system allows a module WEB consists of TANGLE, which provides a lan- to be incrementally coded. This means, to use guage enhancement to PASCAL, and WEAVE, which an example of Knuth, that with a module named typesets source files. The doc system as published (Global variables in the outer block) one can add provided no language extension. It leave the w to this module as, where, and when new global macro language unchanged. (The later docstrip variables are required. Without this feature the feature does, however, allow for code to be tagged global variables would have to be declared all to conditional inclusion). together and at once in the PASCAL source file. WEAVE recognises the key words and symbols Such a feature is not provided, nor planned, for of PASCAL, and uses this when the source file is \noname. typeset, to improve the typographic quality. When Perhaps the most important idea borrowed doc typesets a source file it sets code lines verbatim. from WEB is the introduction of a preprocessor to Apart from recognizing and indexing control words, augment the facilities of the language. it has no understanding of the 'I)$ macro language. Because Pascal is not well adapted to storing (The \noname package, by counting braces, is able character strings, Knuth implemented a "string to guess when a \def-inition has come to an end). pool" feature. Such a device might be welcome As mentioned earlier, much of the motive for when writing 'I)$ macros, for storing error and \noname came from a wish to code something other messages, which otherwise would consume superior to the doc option. This turns out to be large amounts of main memory. These messages a larger project than I imagined. The \noname could be stored either in in 'I)$'s string pool, or in macros provide part of the foundation. separate files on disc, to be read in as needed. 3.4 Smalltalk. Certain concepts in Smalltalk 3.2 The C programming language. This lan- have had an influence on the internal coding of guage is used widely for both system and applica- \noname. The idea of compiling source into an tion programming, and its syntactic style is widely intermediate form came from Smalltalk, which uses known and imitated. Source written using \noname bytecode instructions. It also provides an excellent tends to have a C-like appearance. example of a productive integrated programming The C language provides a preprocessor for environment. source files, just as does WEB. The \noname package 3.5 Wirth's Modula-2. When the module con- also includes a source file preprocessor. In partic- cept is added to \noname, it is quite possible that ular, the hash command syntax has been copied the syntax, and some details of the implementation, from C, although the functioning will be different. will draw upon Modula-2. Also copied is the use of the colon ':' as a label, and names for some of the control macros. (The 4 Design and Implementation MS-DOS batch language- - also uses ':' as a label). 4.1 The Basic Problem. A 'I)$ macro consists 3.3 Mittelbach's doc option for BW.This of a string of tokens. A token is either a character work showed to me that documenting source files for token -i.e. a character/catcode pair -or a control 'I)$ macros was a problem. Although his solution sequence. The problem of producing any given is a significant advance, it has limitations. His open macro therefore reduces to producing any given recognition control sequence, and any given character token. [tlhe method of documentation of w The control sequence problem shall be put to one macros which I have introduced here side, for except when control sequence names are should . only be taken as a first sketch. . . used to store textual information, it is enough that TUGboat 10, no. 2 (1989), page 246 the control sequence have a comprehensible name of this encouraged me to find my own solution. formed from a fixed collection of characters. The convention- that the initial character de- termines whether a source file line is a comment or TUGboat, Volume 13 (1992), No. 4 507

Arbitary character tokens are produced via Q* ; will produce unusual character tokens. They careful use of the \uppercase command. They are intended for use with the \CASE and \FIND are placed into macros by use of the \aftergroup macros (TUGboat, to appear), and some other primitive. The 7&Xbook1s"dirty trick construction purposes. of a macro whose replacement text is \n asterisks Finally, the characters {I$#^-&and % have (p373-4) illustrates the basic technique. their usual effect. 4.2 \load, \comp, \online and \hsl. The 5.4 Control words. When using \noname, not macro writer will specify, using a syntax to be only can the letters a. .zA. .Z and the Q character described later, a sequence of control sequences be used for forming control words, but also the and character tokens, to be formed into a macro. characters $&*- : and the digits 0. .9. This does The \noname macros will read and act upon this not interfere with the usual use of the characters, input stream- there are examples above- so as to outside of control words. For example construct the desired macro. \def \subscript-character{ - The \load command will read these macro- building instructions from a file, and place the defines \subscript-character to be a macro whose result into m's memory. The \comp command replacement text is a subscript character, with '-' will write the content of these instructions to a file as its character code. on disc, in a form that can then be re-processed at 5.5 Numeric constants. Within plain and high speed, by use of the \hsl command. Finally, LKQjX the control sequence \mQne is used to re- the \online command is like \load, except that it fer to a \count register whose value is fixed to be takes its input from the console, rather than a file. -1. This feature is provided because -1 is a ubiq- uitous constant. Macros run quicker, and occupy 5 Structure of source files less space, if \m@ne is used in place of -1. The 5.1 White space. All white space is ignored \noname package provides the same functionality, (unless preceded by a \noname escape character). It but by typing [-I]. is no longer necessary to use '%' symbols to prevent With \noname, the tokens [nm] where nnn is a space tokens creeping into your macros. literal number such as -1 or "57 or 16 will produce a control sequence which is to store the number 5.2 Comment lines. Any line that does not nnn. This allows the popular numeric constants to begin with white space is a comment line, and be referred to in a literal manner, rather than via will be ignored (unless it begins with a '#' hash cryptic names. character -see below). A similar convention applies to numeric con- 5.3 Escape characters. The \noname package stants specified as character constants. The charac- has a rich range of escape characters. ter '" followed by a control symbol such as \x or \^^M will produce a control sequence which stores " produces an ordinary space token. a number, namely the ASCII value of x or ^^M ' produces a character, with catcode other = 12, respectively. whose character code is given by the token If C is followed by a token that cannot begin immediately following ' ' '. This token may be a literal number, i.e. other than 0. .9 or +-"I. a white space token, or some other character, then no special behaviour occurs. Similarly, if ' is or a control symbol. not followed by a control sequence, then no special ! is like '", except that it produces an active behaviour occurs. character. I is the bar construction, which allows access to 5.6 Hash commands. This is a feature bor- arbitary character tokens. It should be followed rowed from C. Any source line beginning with a by the \catcode, as a hexadecimal digit, and hash # is a hash command. Hash commands control then the character code, as a character or a the processing of the file. They allow conditional control symbol. Thus ID is equivalent to ! and inclusion of code. For example, if \ifdebug is I C is equivalent to ' . \iftrue then the line below : is a label which produces an otherwise inacces- #\if debug sible macro, whose expansion is empty. This \checkingcode device is most useful when used in conjuction #\f i with the Basic Control Macros cited elsewhere. 508 TUGboat, Volume 13 (1992), No. 4 which contains \checkingcode will be processed, versions of the same macros in a single file, the while if \if debug is \iff alse then this line will be most recent first, it is possible to load the macros skipped. that are in force at some given date. Simply load This feature allows the same file to contain the first macro package whose date is before the several variants of the same code. Currently, given date. (The date is precise to time of day, in IPmhas three files-artlO.sty, art11 .sty, and minutes, as supplied by Tj3X7s \time primitive). artl2.sty-which are identical in all aspects, Currently, the optional code controlled by hash except for the values of some numerical and other commands can be used only to generate multiple parameters. Use of hash commands allows these .hsl files, each obtained by processing a different files to be described using a single source file. subset of the source file. Essentially, the variant is This feature can also be used to maintain a determined at the time of the \comp-ile. However, single file for several versions of a macro package. the basic structure of the .hsl file is sufficiently rich, as to allow these variants to be combined into 6 Control macros a single .hsl file. The setting of a flag will then control the choice of variant at the time of the \hsl The author's Basic Control Macros in TUGboat 12, of the file. This feature could be used to produce, no. 2 are easier to use within the \noname environ- if wished, a single art. sty file for use with IPW. ment, for they depend on a label ' : ' being available. The author has also written powerful control macros 8 Modularity and named parameters \CASE and \FIND, which again depend on \noname features-in this case that * and ; produce not Many other languages restrict the scope of an ordinarily accessible character tokens. identifier, so that the same identifier can be used The author is about to release a control macro for different purposes in different contexts. For \FSA (for Finite State Automaton). Here is an example, in C, identifiers declared within a function example of its use. When, on a page, one vertical are local to that function, while identifiers prefixed item is placed beneath another, vertical space may by the keyword static are local to the file in which be required, or perhaps a penalty, or some other they appear. activity. The \FSA device allows the decision has a single global name space. Conse- table for such transitions to be coded in a simple, quently. each author of macros has to be sure that elegant, and economical manner. It will use @*;as his or her control sequences do not clash with those delimiters. of plain, IPW, or some other package. This is a burden. 7 Structure of . hsl files Here is a related matter. In other languages the parameters to functions (the 'I)$ equivalent The details of the fine structure of the .hsl files is macros) are identifiers. This improves the code should be of little concern to macro programmers, greatly. For example so long as it adequate to support their needs. Here is an extract from a .hsl file.

^^@ \FILE tutor.hs1 % ^^@ \year 1992 \month 9 ... 720 % %{ \hs~~~{~~c~~o~~n~~ty. . . 00000000LLLLLLLL is easier to read and maintain. % \tracinglostchars ... 11 { 11~11~11i% ;/O~~II~II~II~II~II>II)){ ... e \online% The addition of these facilities to the \noname % \def \online1'{ \e . . . #,Ill WL%00 0 package is being investigated. % \immediate \writeM\ . . . 11 {LLLLLOOOOO 9 Performance Normally, during a \hsl, ^^@ is a comment charac- ter and % is ignored. This is designed to support The single most important aspect of the perfor- macro library files. (In this context, see The mance of the \noname package is the degree to mbook, p382-4). By setting % to comment, the which it allows the macro writer to produce better macros can be skipped at high speed. code quicker. I will leave the measurement of this By setting -^@ to ignore, it is possible to read to others, who are able to be more objective. My the \FILE and date information in the header. experience of using \noname is that the code written The date can be used for version control and is much easier to read after the event, and that compatibility. For example, by storing multiple the various helpful facilities reduce coding time by TUGboat, Volume 13 (1992), No. 4 between 10 and 30 percent. The saving will depend Publishers and other major users of TEX require on the nature of the macros being written, and the custom macro packages. These are either written extent to which they are basic. If two (or more) al- in house by expert staff, or commissioned from most identical versions of the same file are required, outside. These packages are usually proprietary, then the time saving can be much greater. This is although publishers tend to make them available also true if active and other special characters are when appropriate to their authors. required. At the other end, there is a large mass of un- The commands \load or \online are quick supported macro files, of variable quality, available enough, on a slow machine, to process small (say for no cost. In addition, there are packages such as 50 line) files, but become tedious for much larger plain, I4W, w. files. They also have an overhead of one (1) control Discussion with TEX users will reveal the tech- sequence for every new control sequence processed. nical and other merits of \noname, and help provide This overhead will increase, and the performance a basis for pricing, licensing, distribution and other fall, when the various enhancements are added. policies. However, the \hsl command works at much greater The current version is already useful. It may speed, and with minimal overhead. take six months to add modules, named parameters The .hsl files are much smaller that the and other advanced features. Also required, as in source files from which they are generated. They C, are libraries of standard functions. can be combined into a single library .hsl file, A demonstration version is available (from the with conditional run-time loading of the constituent author only), so long as you agree to respect his parts. These features can be used to save mass intellectual property rights. storage requirement (note that file space is allocated in fixed size blocks), and reduce traffic on a network o Jonathan Fine and on email. Note also that it can take the 203 Coldhams Lane Cambridge operating system longer to find a small macro file, CB1 3HY than it takes TEX to process it. England However, most macros are loaded once, and J.FineQpmms.cam.ac.uk then \dump-ed as a format file, which can then be loaded at high speed. The quality of the code will then determine the size of this file, and thus how quickly it can be loaded.

10 Future developments Briefly, here are some projects that are under way. Much progress has been made on coding a pretty printer for typesetting source files written in the \noname dialect. It is intended that it should also be able to typeset suitably laid out C and C++ source files. A proof-of-concept prototype for a single step debugger, that will execute or expand macros and commands one at a time, has been coded, and will also form part of the \noname package. I hope that it will be useful both for learning and teaching how works, and also for development. Finally, an interactive tutorial for \noname- consisting of 'Q,X macros and so running within -has been written.

11 Availability This package has been developed privately. Future developme&s will require financial support,- - most likely from sale of thesoftware. TUGboat, Volume 13 (1992)) No. 4

to correct; testing interaction with various docu- ment styles, style options, and environments. We would like three kinds of validation files: 1. General documents. Volunteer work for the lXQX3 project 2. Exhaustive tests of special environments/mod- Frank Mittelbach, Chris Rowley and ules such as tables, displayed equations, theo- Michael Downes rems, floating figures, pictures, etc. 3. Bug files containing tests of all bugs that are 1 Introduction supposed to be fixed (as well as those that are This is a call for volunteers to help in the develop- not fixed, with comments about their status). ment of IPW3. There are many tasks needing to A procedure for processing validation files has be done in support of the IP'3project which can been devised; details will be furnished to anyone in- be worked on concurrently with the development of terested in this task. the I4w3kernel. Furthermore, some tasks require Coordinator: Daniel Flipo special expertise not found among the core program- [email protected] ming team. Initial research, analysis, and work on these tasks by volunteers can greatly speed up the 3 Syntax questions process of integrating a number of desirable features 3.1 .sty metacomments for smart editors into IPw3. Many of these features can be exten- Develop conventions for documentation of styles sively developed and tested under I4'2.09 even which could be picked up by editor packages to pro- before the WQX3 kernel is available. vide editing help. Therefore we are publishing a list of tasks to the The idea is to place metacomments in . sty files IPWuser community through various channels and which smart text editors (in particular) can use to we ask readers to consider contributing some time get information about the 'exported' (user interface) and effort (particularly, but not exclusively, readers macros for that particular style. The information with expertise in the various areas touched on). The would be useful for word completion and spelling task list is distributed in the form of a UTEX article; checking, at least. (The auc-tex package for GNU it is fairly readable in electronic form, and it can be Emacs currently has such information hard-wired printed on paper if desired. for a number of common styles.) If the editor has If you are interested in working on a particular access to the \documentstyle line or suitable alter- task, see Appendix A for details on how to volunteer. native instructions it can poke about in the appro- The task list will be updated at regular inter- priate style files rather than using its own database. vals. For instructions on obtaining a copy from the Such information could be written out by a run public archives, see Appendix B.l with doc. sty on the basis of \Describe {Macro, 2 General tasks Env) commands in the .doc file and subsequently included in the docstrip'ped . sty file. That's easy 2.1 Volunteer list management enough, but if it's to be generally useful the result Organization, publication and maintenance of the ought to be somewhat standardized and in a form general volunteer task list. suitable for use by as many editors or other tools as List manager: George Greenwade. possible. Would conventions for supplying other infor- 2.2 Validating IQm2.09 mation this way be useful (along the lines of the Writing test files for regression testing: checking bug Postscript structuring conventions)? fixes and improvements to verify that they don't Coordinator: David Love have undesirable side effects; making sure that bug JANET: d. 1oveQuk.ac .dl, fixes really correct the problem they were intended BITIINTERNET: d .love0dl. ac .uk Editor's note: This summary is based on ver- 3.2 Syntax proposal for bibliographical sion 5.1 of the task list, dated 15 October 1992. The commands archived list contains some information not included Extensions of current IPTEX syntax for \cite com- here, such as time estimates and the names of vol- mands and bibliography commands. A number of unteers other than the task coordinators. specialties have conventions for citations and bibli- ographies that Uw2.09 is ill equipped to handle. TUGboat, Volume 13 (1992), No. 4 511

David Rhead published several papers con- of VMS-TEX have arrow directions specified as vec- cerning the handling of bibliographies and cita- tors with the units being rows and columns rather tions [RheSO, Rhegla, Rhe92a, Rhe92bl. Some of than distances, e.g., \arrow (1,2) means a diago- them have been distributed via the latex-1 mail nal arrow from the current element to the element list. Counter-proposals or further argumentation for one row over and two columns down. David Rhead's ideas would be useful. There is a catmac.sty by Michael Barr that Coordinator: Open uses the line fonts of J.4" for drawing slanted ar- rows. The XY-pic package by Kristoffer Rose is re- 3.3 Research on syntax for tables portedly usable with I4W and comes with its own What features are important (and not covered)? line and arrowhead fonts. Logical representation of tabular material versus vi- For I4W3 we would like to see an analysis of sual representation. Syntax proposal and report. the logical structure of commutative diagrams and About tabular material presentation many in- recommendations on user syntax. teresting papers are published. For example, Coordinator: Paul Taylor ptQdoc.ic . ac .uk general articles [Bea86, Bea85]; I4m related [Cargo, Car91, Rheglb]; logical table representa- 4 Research tasks tion [Van92]. Important work was done by Michael 4.1 Experimenting with \emergencystretch Spivak in [Spit391 and of course in his "Tables to Testing the new features of m3where no experi- die for" (T2D4). Standard books on typesetting ence is available so far. Writing up a report. ([But81, McL80, Chi82, Whi881, to name only a few) Research on \emergencystretch, in particu- also usually contain important information about lar, is an important area where the m community tabular typesetting. What is necessary is a survey doesn't have enough experience so far, e.g., what are of the requirements for tabular material in printing, good values in what situations, why? What happens a proposal for an extended standard syntax, and if. . . and so on. This would also make a good article perhaps a proposal for syntax of extra features that for TUGboat if the report were given some finishing could be provided through a separate 'super tables' touches afterwards. module that is not loaded until the user requests it. Coordinator: Open Coordinator: Ed Sznyter ewsQbabe1. com 4.2 Research on indexing commands 3.4 Research on syntax for chemistry What kinds of indexes are needed for various fields? The typography of chemical texts is rather different What kinds of indexes are needed for various special- from, say, mathematics. We need a taxonomist to ties? What kinds of \index commands/syntax need classify the primary elements of an article or book to be provided for marking entries? What kinds of on chemistry and suggest syntax for user commands commands need to be provided for printing indexes to handle each element. What proportion of cherni- after they have been processed by a program like cal diagrams can be constructed with primitive line MakeIndex? graphics such as given by the I4mpicture envi- ronment (with suitable extensions)? Or should di- Coordinator: Open agrams just always be done in some other graphics 4.3 Research footnote/endnotes language and imported via \special? conventions Coordinator: Chris Carruthers What conventions are used for various specialties? cjcQacadvm1.uottawa.ca What user commands and syntax would be recorn- 3.5 Research on syntax for commutative mended? Report on the results. diagrams Coordinator: Open Commutative diagrams occur often enough in math- 4.4 Syntax diagrams ematical literature that even the first version of Designing a command syntax (and implementation AMSTEX back in 1981 or so included a rudimen- tary facility for constructing rectangular cornmuta- in IPTfjX2.09) for syntax diagrams used to illustrate tive diagrams. Since then several people have pro- programming language syntax. duced various alternatives, most involving special Reference: Michael F. Plass, Charting your fonts with line segments slanted at various angles, grammar with TQX. TUGboat, 2(3):39-56, and arrow heads. The commutative diagram macros November 1981. 512 TUGboat, Volume 13 (1992), No. 4

The described syntax is probably not appropriate ferent action for different classes of floats? What do for I4W and the implementation needs refinement we need for multi-figure groups and their captions? since it was done for W78but it is a good starting Coordinator: Sebastian Rahtz point. [email protected] Coordinator: David Morgan morganQsocs.uts.edu.au 5.3 Research on the use of ^- conventions

Check the actual use of the -^ convention for special 4.5 BNF notation characters in the INEX community by polling as Designing command syntax and prototype MW- many users, organizations, mail-lists, usenet groups, 2.09 implementation for BNF (Backus-Naur) nota- etc., as possible. Write report. tion used to describe syntax of programming lan- In W the ^- notation is sometimes used for guages. access to unusual characters (< 32 or > 126). It Coordinator: Mike Piff would be useful to separate this function from the M.PiffQsheffield.ac.uk superscript function by assigning it to some charac- ter other than -, if that would not be too large an 5 Research tasks (cont.) inconvenience for users. One approach, for exam- 5.1 Research on use of shorthand forms ple, would be to change - and - to be active char- acters so that they can always keep track of current In SGML there is a concept called 'short ref' which math style, which would allow a better definition means for example that the double quote character " for \mathchoice and simplify many things having can be defined to produce directional quotes, blank to do with math fonts. It seems that the -- nota- line can be interpreted as end of paragraph, and so tion is indispensable only when the character is used forth. in a control sequence name or as a macro argument What kind of similar shorthand forms in ASCII delimiter (or in hyphenation patterns?). Note: doc- files may be desirable for IPWusers, e.g., => to be ument styles are of less concern since they will have converted to =+,/= or <> to be converted to #, '? to to be mostly rewritten for I4W3 anyway. be converted to upside-down Spanish question mark, "u to be converted to umlaut ii, and so forth. What Coordinator: Open conventions are currently in use for various kinds of 5.4 Research on typographic conventions documents? and requirements in multilingual Something along these lines is currently done in environments AMSW with the Q character: Q- is a shorthand meaning 'nonbreaking hyphen', 0, is a shorthand Typographic conventions differ from one language/ meaning one-tenth of a thinspace, Q> is a shorthand country to another. Collect information about such for an extensible right arrow, and so forth. conventions and try to identify the basic data-types It is envisioned that in IPW3 the user will be and operations required in M'3,so that most allowed to designate certain characters to be short- or, ideally, all features necessary for the support of hand initiator characters. For efficiency reasons, the many languages can be implemented in the IP'3 set of allowed initial characters will probably be re- programming language. stricted to nonalphanumeric only. It would be helpful also to include anything whose provision is already supported by the babel sanchezQgmv.es Coordinator: Julio Sanchez j system and/or other systems: e.g., hyphenation. 5.2 Research on figures and captions Coordinator: Open What rules are in common use for placement and 6 Miscellaneous items formatting of floating figures and their associated captions? Propose syntax for user commands. Write 6.1 Math font handling report. Test math font handling in the latest release of NFSS Placement rules for floats and their captions are and write up detailed comments. so far very limited in batch formatters like W. We Last year there was some discussion among the are interested in rules for such placement which are M'3 programmers and others on how to handle used in practice, algorithms, and possible user syn- math fonts under an enhanced release of NFSS for tax. What could be a good user syntax for putting M'I3733. The discussion finally drifted off into areas captions above, below, on the side, centered or top that are far beyond the scope of the IP73X3 project or bottom or left or right? Do we need to allow dif- but the actual questions that were raised have not TUGboat, Volume 13 (1992), No. 4 513 yet been answered. The only contribution that came and translation numbers for passing to a IP-TEX close was the detailed suggestion and experience re- \special command)? Checksum utility by R. Solo- port by Sebastian Rahtz about the alpha release vay for updating Nelson Beebe's standardized file for an extended text font handling which was sent headers. Auxiliary program to help in constructing around via the latex-1 list. complicated tables (decimal point alignment, row A related, but separate, subtask involves think- spanning, other fancy effects that are hard to do in ing about proper math font handling taking into ac- TJ$ currently)? Auxiliary program similar to Type count the papers already sent around. & Set to do interactive page-breaking/float place- ment? Coordinator: Open Coordinator: Open 6.2 Converting numbers to textual form 7.3 Bibliography style programming Currently counter values can be displayed in cer- tain styles, e.g., as roman numerals. But it may Write bibliography styles for BIB^^. The current be interesting to extend the available commands version of BIB^ is 0.99. A reimplementation of by cardinal and ordinal representations, e.g., 5 - BIB^ for UW3is under way, by Oren Patashnik. 'five' or 'fifth' (for example, if you wanted to re- When this is finished, or perhaps even before, suit- fer to 'the fifth item' in a list using something like able standard bibliography styles for I4W3need to WW's \ref). Spivak's UMS-W has \cardinal be written. and \ordinal macros to do this, for handling cross- Pending because of status of BIB^^ references such as 'the fifth item in the list' where 7.4 Bibliography style requirements 'fifth' is supposed to be generated by a \ref com- mand. The main question: How much do we need Collect available B1~QjX0.99styles and, if possible, this capability? Should it be standard, or merely a further journal and publisher requirements regard- nice option for those who want it? Can it be easily ing bibliographies and analyze them. Summarize extended to support various language conventions? the functionality of each style, whether or not it is Are there other significant uses besides the cross- easily programmable with the current BIB^, what reference idea? special functions would be helpful, etc. Coordinator: Open Coordinator: Robert Tolksdorf tolkC2cs.t~-berlin.de 7 Miscellaneous items (cont.) 7.5 Survey of existing WTEX style options 7.1 Rewrite MakeIndex in WEB Using David Jones' TeX-Index (and any other useful Convertlrewrite the C source code of MakeIndex. sources), evaluate the status of the many uT~X2.09 For consistency it would seem desirable to have all options currently available, e.g., whether they are auxiliary programs designed for use with Urn3to up-to-date, whether the authors still support them, be compilable in the same way as QjX. Currently or if unsupported, whether they are interesting this means use of the WEB language, with or with- enough to make it worthwhile to seek a new main- out the CWEB intermediate step. tainer for them. Furthermore, the MakeIndex program could use Write a report indicating the status of each style some work to deal with a few shortcomings that have option, a short description of its features and, if it become evident with the passing of time and ex- is not maintained, if you think it is worth upgrading tended usage. or maintaining it. Coordinator: Open TeX-Index is an index of (IP-)W macros. 7.2 Write other auxiliary programs From its documentation: Create programs for support tasks related to UTEX The most recent version is always available by anony- documents but not part of the primary typesetting mous FTP from theory.lcs .mit . edu in the directory functions. pub/tex/TeX-index. Copies can also be obtained from the following lo- Question: what other auxiliary programs do we cations: need? Conjectures: Compiled version of docstrip? Programs to help designers in creating document styles? Program for dealing with graphics files in various formats (e.g., read Bounding Box com- ments from a Postscript file and compute scaling TUGboat, Volume 13 (1992), No. 4

Correction sheets in Ikw tions begin, since it is possible to be heavily nested within several layers of environments at the start of Mike Piff a page, as well as being mid-paragraph in section 9 Abstract of chapter 4, and about to produce Example 4.97 and Theorem 4.25. Moreover, at the end of the page In this article the author explains how to produce we may be in a different paragraph and a different minor correction sheets to a book. The sort of section. The headers on the pages will have to re- corrections handled are those which involve changes flect the current state, and the page must finish flush to a few words or possibly rewriting a few lines on a right. page, but not the sort that would cause m to re- None of these problems is of much significance format the whole book because a page has stretched in itself, but the combination of all of them means or shrunk too much. The author has used these that we have to be pretty careful in giving the ex- macros for corrections to a book in print, but they act state of the book for each page. Some counters could equally well make the last stages of proof read- change rapidly from page to page, whereas some ing and correction less irksome. change more slowly. I have divided them accord- 1 Introduction ingly, and provide explicit commands to reset the slow counters, such as chapter and section, whilst Reprinting individual pages of a I4m book for cor- allowing the individual page instruction to reset the rection can be quite a tricky task. One can always quicker moving sort, such as Theorem or Example. process the whole book again, but chances are that The instructions the page breaks will all be different. This can also cause cross-references and the index to be inaccu- \currentstate(chapter)i4)% rate, and so is not really suitable unless the whole (The theory of relaxorsl book is being reset. \currentstateCsection)i9)% The following style option corrects. sty makes (Covariant relaxorsl the job easier. It was developed in particular for the tell I4m that we are firmly in chapter 4, section 9. author's needs, but should be easy to customize. I4m now needs to know how many theorems and examples are behind us. We will tell it at the start 2 The style in use of the next page. It is assumed that a root file is available to produce But first we need to inform IPm of the current the book. Make a copy of this, and insert the cor- state of nesting of environments at the top of the rection style option, and also the commands next page. We can do this either by leaving the \correctionsonly immediately preceding text in, or by just giving it a \renewcommand(\resetcounters)C2]~% clue like this. \setcounterITheoremlC#ll% \begin(enumerate) \setcounterCExampleH#2)% \item \mbox() \ignorespaces) \item \mbox() in the preamble. The former is to tell IPm to pro- \item duce only correction sheets, and the latter is cus- \beginCitemizel tomized to the particular counters being used in the \it em\mboxCl current book-in this case, theorem and example %%This is the text that counters. We must either make a copy of the aux file %%immediately preceded the curr- from the original book, or carefully replace any \ref The paragraph is clearly in full flow, and so we and \pageref commands with their expansions in tell IPm to start the page flush left, where "left" the corrections file. The author's own preference means according to the level of indentation of envi- was the latter; he changed his root file so that it ac- ronments. tually contained the pages to be printed, rather than \startpageflushleftilOll~24lC96l% have to \input or \include copies of each chapter -ent page. file and aux file. As a precaution, he also redefined Now we are producing page-101. \ref and \pageref so as to give an error message. The next theorem will be"25. Most of the body of the book may now be dis- The next example will be"97. carded. In its place, we put instructions to print There is also a similar \startpage command to pro- individual pages. At least the text of these pages duce a normally indented paragraph at the top of must be retained. But this is where the complica- TUGboat, Volume 13 (1992), No. 4 the page, or to use if the first thing on the page is a \def\correctionsonly{% theorem, say. \correctionstrue \realpagefalse> This page ends in mid-flow, so we let Urn The sectioning counters can be changed by know about this. means of the \current st ate command. We pro- . ..it was clearly not too diff-% vide some dummy text by means of the \mboxC> \endpagef lushright. command. The \endpage command has a similar meaning, but \def\currentstate#1#2#3{% allows normal paragraph termination in mid-line. \setcounter{#l){#2)% Both cause the page to end flush bottom. Just use \addtocounter{#l>{-13% \clearpage if this page is at the end of a chapter. \csname #l\endcsname{#3)\mboxo)% It may happen that a run of two or more pages To start a page of output, we specify the page have mistakes on them. The macros in the style number and then call a command \reset counters, option are designed to make that easier to handle. whose default meaning is to do nothing but ignore At the start of a second, or subsequent, page in mid- spaces. This command should be redefined in the paragraph, insert the instruction user's preamble to take account of any counters that \anotherpageflushleft might need updating. or include the command \anotherpage in its text if \def \startpage#l{\npageC#l)% it does not have to start flush left. Terminate any \resetcounters) such pages in the usual way. This saves having to \def \startpagef lushleft#l{\npagei#l)% retype the current state of the fast moving counters. \noindent\resetcounters) The author has found that floating figures are \newcommand{\resetcounters)(\ignorespaces~ handled correctly, but 'I)$has to see the whole page Both commands to produce a new page make where the figure is defined. Alternatively, the figure use of the \npage command. can be moved to an appropriate place on the page being printed. Clearly a large number of held-over \def\npage#lC\clearpage insertions could present some problems, and the best \global\realpagetrue course of action might then be to move them to the \setcounter{page){#i>} exact place where they should appear, with the "in- The end of a page, flush right or not, is pro- sert here" option active. duced by the following two commands, or if appro- Footnotes on the current page can be handled priate by a \clearpage. by using the optional parameter to set the correct \def\endpageflushright{% mark. Footnotes held over wholly from a previous {\parf illskipOpt\par\pagebreak)) page can be inserted with \f ootnotetext. A split \def \endpage{\pagebreak) footnote from a previous page is handled by means If the page after this one also needs to be printed, of the \moref ootnotetext command, which takes an alternative way of producing it is to use one of the text of the footnote as its only parameter. the following two commands. The final feature of this style option is the fact that only the pages specified above get through to \def\anotherpageflushleft(% the dvi file. \global\realpagetrue\noindent> \def\anotherpage{\global\realpagetrue> 3 The style in detail A footnote from the previous page. part of We first of all define two boolean variables. The vari- which appears at the bottom of the current page. able \if correct ions is an indicator of whether we can be handled by inserting a left justified footnote are producing corrections or not. Its default is false, without a mark in either the text or the footnote so the style will have no effect unless it is changed itself. This command should be invisible in the sur- to true. Variable \ifrealpage is used internally to rounding text, and so we make certain that it does tell IPm to actually ship out the current page. Its not alter m' space factor. default is true. \def\morefootnotetext#l~\@bsphack~% \def\@makefntext##l{\noindent ##I)% \f ootnotetext{#l)>\@esphack~ To switch from this default mode, where the style The only thing that remains is to make sure has no effect, we provide a command to change the that any extraneous text, such as is created by sec- values of these two variables. tioning commands, is not printed. We first take a 518 TUGboat, Volume 13 (1992), No. 4 copy of the Urn command that actually ships a 1 Introduction page to the dvi file. It is often said that although I4m is good at type- setting mathematics, it is wholly unsuitable for com- The command \@outputpage is then redefined in mon word processor functions such as mail merges. terms of its old meaning. First, only "real" pages The latter are easy to achieve in most ordinary word are printed, that is, only when \if realpage returns processors, but in its raw state I4wis incapable true. Then, if we are only printing correction sheets, of doing a mail merge, or, indeed, of generating the we immediately switch off printing of pages after same block of text over and over again but with this one. Only the \startpage and \anotherpage different parameters in each block, those parame- commands will switch printing on again. ters having been read from a subsidiary merge file. Note that we need to ensure that any special The latter file might possibly be the output from a page style set by \thispagestyle on a page that has database or any other program. not been printed does not carry over to the following This article aims to show the reader that such page. For instance, a \chapter command will gen- a repetitive task need not be as difficult as it at erally introduce a plain page style command into first appears. In w, it is possible to hide many the document. details of a facility inside a subsidiary style file, so The command \@outputpageshould otherwise that the user is unaware of what fearful processes do everything that its old version did, apart from are going on in the background. It is then possible shipping the page out to the dvi file. to present the end-user with an extremely simple interface, perhaps simpler and more powerful than is available in other systems. In earlier TUGboat articles [Be187, Gar87, Lee86, McK871 it was shown how a standard letter could be customized by adding names and addresses from a separate file. I aim to show that it is possible to achieve far more than this with a fairly compact o Mike Piff Department of Pure Mathematics but general set of macros. University of Sheffield 2 A simple example Sheffield S10 2TN England Suppose that we have a list of student names and Janet: M.Piff Bshef . ac .uk examination grades, one per student, and that we wish to send a letter to each student giving his/her exam grade. We must decide first what bits of infor- mation must be prepared in our subsidiary file, by looking at an example letter and finding out which items change from letter to letter. Suppose that one instance of our letter is the Text merges in T@ and Ww following, a Urnexample. Mike Piff \begin(letter)(Mr Abraham L Spriggs\\ 34 Winchester Road\\ Abstract Sheffield S99 5BX\\ In this article the author explains how to do some England) standard and not so standard word processor text \opening(Dear Mr Spriggs, merges in documents, using no other tools than This letter is to inform you itself. A common application is to the mail that you obtained grade C in merge or form letter, where names and addresses are your recent examinations. stored in a file, together with other bits of informa- \closing(Yours faithfully,) tion, and a standard letter with variable fields em- \endCletter) bedded in it is customized for every name from this We can see that we need to know the student's title, file. Another application is to the pretty-printing of forename(s), surname, address and grade to com- the contents of a database. pose such a letter. The macros described in textmerg. sty work One of the simplest ways of achieving this effect equally in both plain rn and Urn. is to prepare a file with lines of the form TUGboat, Volume 13 (1992), No. 4 519

3 A few complications for each student and then simply \input it into Looking at the above example in a bit more gener- a IPT@ file in which \MyLetter has been defined ality, we see that we are reading records of n fields as having five parameters. A problem with this &om the merge file and placing them into a TEX doc- approach is that we may not be able to coax the ument in such a way that they replace n preassigned student database into producing such a file. An- control sequences. However, it may happen that the other problem is that we need something more sub- merge file is prepared by humans, who might pos- tle if there are fifty parameters. For example, we sibly have inserted some extra blank lines into the might want to print out the contents of the student file. Again, it could be that certain sorts of fields database with one page per student, but it could be might be blank, whereas others can never be blank. that there are fifty information fields per student. Perhaps it would be better to build in some degree Even worse, the number of pieces of information per of error recovery. student might not be a constant number, because, We shall make the assumption that the first say, we are printing out fields from a related file in field in any record is definitely a non-blank one and which marks on individual examination papers are that we know beforehand whether each of the others held. might conceivably be blank. We make a modifica- We shall tackle our simple example in a way tion to our \Fields statement. It can contain not that lends itself to more generality later on, and in only the field name control sequences but also the a form that most database programs should be ca- tokens + and -, with the following interpretation. A pable of handling. + indicates that all following fields should be re-read We thus prepare a subsidiary file results .dat until a non-blank result is obtained. A - indicates with records of five fields in it. Each student is rep- that any following fields could conceivably be blank, resented by five lines of this file, subject to the restriction that the very first field is Mr always non-blank. Abraham L Thus the command Spriggs \FieldsC\a+\b\c-\d) 34 Winchester Road\\ \\England ... would indicate that only \d is allowed to be blank. C because the + token has no effect. In and the student records appear one after another in \Fields{-\a\b+-\c+\d) this file. Thus both the field and record separators are carriage returns. the initial - token enables blank reading of data to- 7$J itself needs to know three bits of informa- kens, but the very first data token is not permitted tion: to be blank anyway. Thus \a is read as a non-blank 1. the name of the subsidiary file, token and \b as a possibly blank token. The se- 2. the fields to read, and quence +- now switches non-blank reading on and 3. the template of the letter. off again, so \c is read as possibly blank. Finally \d is non-blank. We pass it this information in the following form Another complication we allow is that the \Fields{\Title\Forenames\Surname \Fields command can appear several times in our \Address\Grade) file. The interpretation is that the last occurrence of \Mergeiresults.dat)C% \Fields before we encounter the \Merge command \begin(letter)i\Title\ \Forenames\ will indicate the fields to be read for every record. \Surname\\\Address) Any occurrences of \Fields within the merged text \opening(Dear \Title\ \Surname, indicate a new list of fields to be read when that This letter is to inform you - command is encountered. This lets us do some con- that you obtained grade \Grade\ in ditional processing, such as1 your recent examinations. \ifx\Title\Mrs \closing{Yours faithfully,) \Fields{\MaidenName) \endCletter)) \f i IP7$J should open the subsidiary file and, for each set of five parameters. generate a letter in the dvi and also gives us some flexibility about the field or- file. When it reaches the end of the merge file, IPl&X der later on. should terminate execution of the \Merge command It is assumed that \Mrs expands to Mrs. and presumably finish the document. TUGboat, Volume 13 (1992), No. 4 * . It should also be stressed that the undefined The command \MakeTemplate will be used later to control sequences appearing in the template need generate the body of the form into which fields are not correspond exactly to the fields in the subsidiary inserted. We redefine it if the file is empty so that file. An example might be that the subsidiary file it produces no text. contains the text Because the conditional \if eof does not return Spriggs, Mr Abraham L true until after an unsuccessful read operation, a mechanism of looking ahead is used which is similar and one field read is \FullNme. TFJ would then have to pre-process this name to generate its several to that found in Pascal. components as used in the template. The command \def\GetInput{{\endlinechar=-1 \Preprocess could be included at the start of the \global\read\MergeFile to\InputBuffer)) template. We set up a mechanism for deciding whether \def\parse#l, #2 #3\endparse{% or not we have exhausted the merge file. It forces \def \Surname{#l)\def \TitleC#2)% \if eof to return true by skipping over blank lines. \def\ForenamesC#3)) \def\SeeIfEof{% \def \PreProcessC\expandaf ter \let\NextLook\relax \parse\FullName\endparse) \ifeof\MergeFile An alternative and simpler looking approach to \else reading fields from a file \fil might be to define \if x\InputBuf f er\empty each such field as follows. \LookAgain \f i \def \Field#lC\def #l{\read\f il to#l#l)) \f i \Field\Name \Field\Address \Field\Mark \NextLook) The first time \Name is encountered, it reads its \def\LookAgain{\GetInput own expansion from \fil and then expands itself. \let\NextLook\SeeIfEof) Henceforth, it has acquired its new expansion. The We can now prepare to read actual fields from disadvantage is that \Name must appear in the text the merge file. A conditional is used to indicate before any subsidiary field such as \Surname can be whether or not the field we are about to read is used. allowed to be blank. We also set up a mechanism Finally we should consider the possibility that for changing its value. the second parameter of \Merge might be too large to fit into memory. We can clearly handle this prob- \newif\ifNonBlank \NonBlankfalse lem by allowing the second parameter merely to con- \def\AllowBlank{\global\NonBlankfalse) sist of the text \input template, so that the root \def\DontAllowBlank{\global\NonBlanktrue) file handles two subsidiary files, one containing the Fields are actually read by means of the follow- template and the other containing the fields. ing command. Its only parameter is the name of the control sequence into which the field is read. 4 Implementation of the simple case \def\ReadIn#lC% For convenience we define a frequently used combi- \ifNonBlank\SeeIfEof\fi nation here. \ifeof\MergeFile \def \glet{\global\let) \gdef#lC??)\MissingField The subsidiary merge file is defined next. A \else macro is then defined that attempts to open it for \glet#l\InputBuf f er reading. If that is unsuccessful, the file is closed and \Get Input an error message is issued. \f i) \def \MissingField{% \newread\MergeFile \messageCMissing field in file)) \def \InputFile#l{% \openin\MergeFile=#l The \Fields command places its parameter \ifeof\MergeFile into a token register called \GlobalFields. This \errmessageCFmpty merge file)% command will be redefined by the \Merge command. \closein\MergeFile \newtoks\GlobalFields \long\def\MakeTemplate##l{% \def\Fields#l{\Globa1Fields{#lH \def \Template{))% When a field token list is read, each individ- \else\Get Input\f i) ual token within it must be either read as a field or TUGboat, Volume 13 (1992), No. 4

interpreted as a blank/nonblank switch. The next \SeeIfEof token is then read by tail recursion. It is assumed \if eof \MergeFile that the final token in the list is \EndParseFields. \def\NextIterationi% This must be defined to expand to something un- \endgroup\closein\MergeFile)% likely to be read as a value of one of the fields. and \else so we \let it to \ParseFields. \let\NextIteration\Iterate \def\ParseFields#l{% \f i \ifx#l\EndParseFields \Next Iterat ion) \let\NextParse\relax The point of the use of counter 9 in the above is that \else it is accessible to the print driver for page selection. \let\NextParse\ParseFields Anyone who has started printing 150 letters, all with \if x#l+\DontAllowBlank page number 1, only to run out of paper half way, \else will appreciate the use of this artifice! \ifx#l-\AllowBlank \else\ReadIn#l 5 A complicated example \f i We will next look at an example in which the tem- \fi plate contains a table of indeterminate length, albeit \fi\NextParse3 fked width. So far our macros work in either plain \let\EndParseFields\ParseFields '&X or in IPW, but the way in which these two We apply this command to our token register after packages handle tables is slightly different. How- expanding it. ever, the only difference that need concern us is that I4W uses \\ where plain W uses \cr. \def\ReadFields#li\expandafter\ParseFields The example given here is in IPW, but our \the#l\EndParseFields style will work equally well in plain In our \AllowBlank) m. student letter we wish to insert a table of course At long last we are ready to define the \Merge codes and marks. Since each student did a different command itself. The first parameter is the filename number of courses, we need some way of recognizing of the subsidiary file and the second is the tem- the end of the course list in the merge file. The plate or form into which fields are inserted. Since a default will be to insert a blank line at the end of \Fields command within the \Merge text is meant such a sub-list. Thus, the following text appears to act immediately on the token list that follows it, before the close of the letter template. we redefine it to operate in a different way. Here are your marks on individual papers. \long\def\Merge#l#2C\begingroup% \beginO \global\advance\MultiCountl \SelectCR \NextField=\expandafter{\TempField)% \MakeEmptyC#l3% \edef\Append{\NextLine= \global\StartOf Listtrue {\the\NextLine&\csname \glet\NextRead\MRead pr\the\MultiCount\endcsname \AllowBlank {\the\NextField)))% \global\MaxCount=#l \NextRead \Append3 \f i) We need to insert the correct end marker af- ter each row of the table. The token \cr must be The command \MakeEmpty is required by the pre- disguised a little before it is acceptable in a LPw processing of each field. The idea is that the document. command \csname prnn\endcsname, which we will loosely call \prnn, is executed on each field in col- \def\SelectCR{% umn nn. However, most of these commands will be \ifx\array\undefined \gdef\EndLine{\cr)% TUGboat, Volume 13 (1992), No. 4

\else \ifnum\MultiCount<\MaxCount \glet\EndLine\\% \repeat \f i3 \the\NextLine} \def\FinishLineC% \if StartOfList 7 A final example \global\StartOfListfalse Here is a IPT@ example to illustra~ethe table pro- \else\EndLine\fi) cessing features of textmerg.sty. This makes the assumption that if \array is defined \documentstyle[l2pt,textmerg]~rticle~ then we must be in IPW. \MarkEnd{***) We need a command to finish off a table. This \ProcessC2)(\Advance} should reset \NextRead to \AllowBlank to termi- \def\Advance#lC#l\addtocounterCpage~C#1}} nate the tail recursion, and also do some error re- \Fields(+\Name\Verb) covery in case the file ends prematurely in the middle \begin(document} of a row. \MergeCsilly.datH% \def\StopProcessing(% Dear \Name,\par \global\MultiCount\MaxCount Here is a table to \Verb\ at: \glet\NextRead\AllowBlank) \Fields{\Width)% The command \MRead prepares to read a row \beginCtabular)(*{\Width)c) of a table. It reads a field from the merge file and \MultiRead\Width checks to see whether the table has been exhausted. \end{tabular).\par \FieldsC\Adj)% \def\MReadC% That was \Adj ! \clearpage) \global\MultiCount=l \end(document} \ReadIn\TempField \ifx\TempField\EndMarker The effect of this file is not apparent until we see \StopProcessing silly.dat. It is listed here in four columns. \else Mike good 22 \FinishLine look Shelagh 23 \NextField=\expandafter{\TempField}% 3 gaze 24 \edef\StartLineC\NextLine=C\csname 1 2 *** prl\endcsnameC\the\NextField)))% 2 21 horrid \StartLine \ConstructNextRow References \f i Edwin V. Bell, 11. AutoLetter: A \NextRead) T@ form letter procedure. TUGBoat, Command \ConstructNextRow does most of the 8(1):54, April 1987. work of assembling a row of the table. It assembles John S. Garavelli. Form letter macros. \MaxCount fields at a time into \NextLine unless an TUGBoat, 8(1):53, April 1987. error is encountered. John Lee. Form letters. TUGBoat, \def\ConstructNextRowC% 7(3):187, October 1986. \loop Graeme McKinstry. Form letters. \ReadIn\TempField TUGBoat, 8(1):60, April 1987. \ifx\TempField\EndMarker \glet\TempField\empty o Mike Piff \StopProcessing Department of Pure Mathematics \MissingField University of Sheffield \else Sheffield S10 2TN \ifeof\MergeFile England \glet\TempField\empty Janet: M. Pif f Qshef . ac .uk \StopProcessing \MissingField \f i \fi \AppendNextField 524 TUGboat, Volume 13 (1992), No. 4

A style file for printing sheets of labels Sebastian Rahtz

Contents addresses in the main file, rather than using \input to include them. If the file ends in blank lines, ex- 1 Usage 524 pect problems - sorry! Use your editor. . . 2 The utility macros 525 But there are also other ways off accessing the same system: 3 User macros 527 I. by having entries like this: 4 History and acknowledgements 528 \addresslabel{me\\ here and there\\ Abstract england\\ A P'style to print a regular grid of labels on 1 a page, suitable for sheets of labels which can be without the labels environment. fed through a laser printer. Macros are provided to 2. if you have labels in the simple format in a file, allow easy input of names and addresses in a form just write a .t ex file like this: free of markup.

1 Usage This style file was written to print labels from the shop around the corner from me. These have 8 rows and 3 columns on a sheet of A4 paper. Your labels and all will be done for you. will very likely be different. So first you have to 3. if you want to duplicate the label, there is a tailor this file to your particular type of label. Edit counter called \numberof labels which you can the lines below which look like this: set, so \numQlabelcols=3 \numberoflabels=4 \num@labelrows=8 \addresslabel{Me \\my street \\ mytoun \\ England) to reflect your grid (maybe you have only two columns of ten labels each, for instance). Now make will print the address 4 times in a row sure that your printer driver prints the page exactly 4. For more sophisticated users, there is a macro as it should in vanilla W, i.e. with the origin of the \genericlabel which you can call, with an ar- page down lin and right lin from the top left hand gumenc of whatever you want to appear on the corner of the paper. 1f it doesn't, adjust your driver label (e.g. for disk labels, etc.). Thus you could parameters, or edit the settings below where I take have lin off the margins. The most likely problem with \genericlabel{% these macros is that you will have contents which \begin{tabular){c) are quite wide, and which therefore need to use the \hline very edges of the paper, on which your printer may My Amazing Program\\ not write correctly. Little one can do about this - \hline use a small point size. Disk 1 of 1 The simplest form of input is very easy, as in \hline the following example: \em We aim to serve\\ \end{tabular) \documentstyle(labels) 1 \begin

In all modes, you can opt for a frame around each label by setting a Boolean variable called 'framedlabels', e.g. \f ramedlabelstrue

By default you get no frames - I am not sure when you would want frames, but who knows.

2 The utility macros First of all, identify what is happening.

Now take a copy all of 'article' style to start with, just in case any of it is needed (probably not, but you never know). \input article. sty We will be recording the size of a label, and the dimensions of the grid, so set up variables accordingly. \newdimen\labelQwidth \newdimen\labelQheight \newcount\numQlabelcols \newcount\numQlabelrows \newdimen\leftQborder \newdimen\topQborder \neudimen\half Qlabel \newdimen\areaQwidth \newsavebox~\thisQlabel) \newcount\labelQnumber \newcount\numberoflabels \newcount\lQsoQfar \newif\ifframedlabels \newif\iffirstQlabel \firstQlabeltrue \f ramedlabelsf alse The user will probably need to change the following values to reflect the style of labels in use.

Variables are provided to allow you to force a border on the left edge of labels, in case you do not want to print right to the edge, and at the top; these values will affect every label, of course, so you may need to experiment to get pleasing results. 8mm is the amount my LaserJetIII seems to ignore on the left.

We need to reset all the dimensions appropriately for an A4 page of labels, and the printer will need to know about A4 as well. Obviously if you use a different page size, you will need to alter things here. Some of these changes may be printer dependent. This should all mean we are actually dealing with the whole bit of paper. TUGboat, Volume 13 (1992), No. 4

\headsep=Oem \topsklp=Oem \footskip=Oem \footheight=Oem \oddsidemargin=-lin \evensidemargin=- lin \pagestyleCempty> \parindent=Oem \parskip=Opt Now calculate the size of labels simply as a proportion of the page size (if you haven't got that right, this won't work, will it?). \label@width\textwidth\divide\label~uidth by\num@labelcols \labelQheight\textheight\divide\labelQheight by\num@labelrows \typeout{Creating labels sized \the\label@width\space by \the\label@height> \labelQnumber=l It is not usually advisable to make the label printing go right to the edge of the available area, so 'area@widthl gives the area that will actually be used for printing: the width is cut down by whatever we gave as 'left@border'. It can always be set to 0 if you have a design that uses the whole label. \area@width=\labelQwidth% \advance\area@width by -\left@border% \half@label=\label@height\divide\halfQlabel by 2 \advance\half@label by -\top@border We might want to print the same label several times, so \stickyQlabel will repeat \makeQlabel a specified number of times (\numberof labels) \numberoflabels=l% \def \sticky@label{\l@so@f ar=O% \loop\ifnum\l@so@f &\numberof labels\advce\l@so@f a by l\make@label% \repeat} The real label-making macro, which assumes the actual text is in a box called \thisQlabel. It is vital to make sure spaces are not included at the end of lines in these macros, or all hell breaks loose. \def\make@label{% \ifframedlabels% \let\boxing@type\framebox% \else% \let\boxingQtype\makebox% \f i% \boxing@type [\labelQvidth] [c] {% \rule{Opt}{\label@height)% We set a position to half-way up a strut of the height of the label, so forcing text to be the right height and vertically centred. \raisebox{\half @label} [Opt] [Opt] {% \rule{\lef t@border>~pt)\usebox{\this@label>>>% We only start a new line if we have printed a row of \numQlabelcols labels \ifnum\label@number=\num@labelcols% \endgraf\nointerlineskip% \label@number=l\else\advance\labelQnumber by l\fi% 1% Now some macros to allow 'verbatim' names and addresses separated by blank lines. First we need some hackery from Phil Taylor to redefine end of line; define carriage- return to check what the next token is; if its another -M then we have a blank line. \catcode '\--M = \active TUGboat, Volume 13 (1992), No. 4

If we have met a blank line, finish current label and start a new one. swallow pending ^M, or we will have a blank line at the start of each label

Otherwise just start a new line

Re-instate the original catcode for carriage-return

Define macros to call at beginning and end of labels, to set things up properly. \def \st art @@label{% \savebox{\this@label)\bgroup\raggedright% \begin{minipage){\area@width)% \catcode '\--M =\active)% \def\end@@label{% \end{minipage)\egroup\sticky@label)%

3 User macros The basic case is a generic macro which takes its argument and puts it out on a label.

For compatibility with an old label style, lines ending in // and marked with \addresslabel{. . . .)

Now easier environments for verbatim labels. If we want framed labels, we need to adjust the width available to use to allow for the ruli width and the gap between box and rule, in both axes. This is doubled up, as it happens on both sides / bottoms. We have to check in case the first \begin{labels) has a ^^M after it or (preferably) is terminated by a % TUGboat, Volume 13 (1992), No. 4

Even more foolproof: simply take a parameter of file name \def\labelfile#l{\begin{labels)\input#l\end~abels)) or prompt for it: \def\promptlabels{\typein[\labelfilename]{What is the name of the label file?) \labelfile{\labelfilename})

4 History and acknowledgements v.1 May 9th 1989 simply allowed for \addresslabel(. . . \\ . . .\\. . .) v.2 July 15th permitted verbatim style with no explicit end of lines 0 v.3 March 1991 made more generic v.4 January 1992 checked and made to work with emtex drivers to my satisfaction. and documented to bare-bones level with 'doc' system. The crucial macros which make the system bearable for mailing lists by redefining end of line came from Phil Taylor; apologies to him for using them in a I4m style file!

o Sebastian Rahtz ArchaeoInformatica 12 Cygnet Street York YO2 1AG spqrBuk.ac.york.minster

Abstracts

Les Cahiers G UTenberg (e.g., UW3), the increasing number of articles on Contents of Recent Issues (U)Win various national magazines and journals, the increase in requests to GUTenberg for informa- Numhro 13 -juin 1992 tion, courses and subscriptions to the Cahiers, all Bernard GAULLE,~ditorial : morositk francophone show that things are humming. It would therefore ou recession Bconomique ? [French moodiness or seem that the economy, not a downturn in interest economic recession?] ; pp. 1-4 (along with perhaps too many TEX meetings), is GUTenberg's president provides ample evi- the most likely cause for reduced participation at dence of a strong and dynamic (U)W com- recent meetings. munity, in spite of the low interest shown for the Hans Ed. MEIER,Rhgles fondamentales de mise en 1991 GUTenberg meeting and other reasons which page [Basic rules for page layout]; pp. 5-38 caused the board to decide to skip GUTenberg'92. Originally published in 1991 in German, this While the two meetings seemed to have all the best article as translated has been augmented with possible organisation and components, participation comments on French typographic style. Meier, didn't seem to match the efforts made. And yet described in the editorial as a retired typographer, the intensity of work being done on various fronts discusses in his article design elements not only of TUGboat, Volume 13 (1992), No. 4 529 books but all manner of documents, from in-house references. But this should not deter those who reports to business cards. The article comprises can read French from approaching the article and two parts: a section (pp. 6-14) on various elements reading an account which resides more at the meta of a document (e.g., spacing, margins, justification, level than at the mere production level. use of small caps, centering, the general look of a Bobby BODENHEIMER, IPw, etc : page, etc.), followed by beforelafter examples taken w, questions et rhponses [French adaptation and from documents Meier had worked on while at translation of an issue of the "FAQ" -Frequently the Swiss Federal Institute of Technology in Zurich Asked Questions -posted 2 March 1992 to (pp. 14-38). The first section provides very useful comp. text. tex, v.1.221; pp. 55-77 basic notions (as promised in the title) on style An excellent idea [one which TTN might con- and layout, and with the additional comments from sider!] of presenting some of the main items in a the GUTenberg editorial staff, this portion is very recent issue of the Frequently Asked Questions file interesting and informative for those interested in which is posted monthly to the c. t .t newsgroup, variations across linguistic and cultural groups. The the GUTenberg editors have produced a handy ref- second section, while its rather dogmatic rejection erence article for the many users of (I4)Wnot and improvements may not sit well with everyone, able to access the Internet. The main areas treated is nevertheless a good baseline which users new to include: archives (where to find what); drivers the notions of page layout and document design (queries for specific printers); graphics programs could either choose to adhere to, or deviate from. (where to get them, how to use them); fonts (work- The article has a short bibliography of 6 titles in ing with METAFONT, using PS fonts, converting German, with 2 references in French, added by the font formats, locating different fonts); "How do you GUTenberg editorial staff. do x in m?"(music, an index); conversions (e.g., Emmanuel SAINT-JAMES,Une police pour la x to IPW, IPm to x); hyphenation problems; science. De l'impact du traitement de texte sur error messages; "How do you do y in IPm?" (style l'activit6 scientifique [Guidelines for science: the files, various specific questions); and finally, user impact of word processing on scientific activity]; groups and documentation. The FAQ closes with pp. 39-54 a pertinent reminder that electronic accessing via The editorial for this issue introduces the Saint- ftp is a privilege, not to be abused. A welcome James article as one which is more philosophical- addition is the Index to the FAQ which the editors even epistemological-and as with the previous of GUTenberg have provided, making this a doubly article, one not specifically aimed at w at all. useful article. "Difficult to read, sometimes obscure and often Annonces et publicitks [Announcements and provocative, each paragraph prompts one to stop advertisements]; pp. 78-90 and think" is how the editorial describes the paper, The final portion of the issue carries a number and the argumentation is indeed difficult to follow of items, including a listing of TEX versions avail- at times. The paper is a result of the author's able from GUTenberg for various systems (Mac, efforts in producing a 400-page publication (Trait6 PCs, VAXIVMS, and UNIX variations); the detailed de programmation), and discusses the choices at announcement of the Prague Eurom'92 meeting various levels: characters (font selection), lexicon (including registration form); and the announce- (at issue, the infusion/intrusion of English computer ment for TUG'92 in Portland. As well, there terminology), the document structure, and a mini- are advertisements from Y&Y (fonts), Cambridge diatribe about bibliographies citing "old news", for University Press (their Cambridge Electronic Pub- which he has little use. Unfortunately, this disdain lishing service), and ET, a TEX text editor for is also apparent in the references which accompany the PC. A loose flyer contains advertisements for the article (in fact, the author explicitly refers Textures on one side, and MacFEM (a program "for to this "concession"!), so the reader is unable to solving partial derivative equations" ) on the other. readily pursue the casual asides which pass for 530 TUGboat, Volume 13 (1992), No. 4

Calendar

1993 Feb 24 T)$GStammtisch, Hamburg, Germany. (For contact information, Jan 7 T@GStammtisch at the Universitat see Jan 27.)

Bremen, Germany. For information, Feb 24 - 27 CONCEPPTS 93, The Prepublishing contact Martin Schroder Conference, Orange County (115dC3alf.zfn.mi-bremen.de; Convention Center, Orlando, Florida. telephone 0421/6289813). "International Conference on Jan 21 MITW meeting, Massachusetts Computers and Electronic Publishing Institute of Technology, and Printing Technologies". Cambridge, Massachusetts. For information, phone: Room 1-134, 12:OO-13:OO. For 703-264-7200, Fax: 703-620-9187. information, contact Robert Mar 1 Donald E. Knuth Scholarship, Becker ([email protected]; deadline for submission of 617-253-1797). projects. (See TUGboat 13, no. 3, Jan 21 w-Stammtisch in Duisburg. For pp. 395-396.) information, contact Friedhelm Sowa Mar 4 T&GStammtisch at the Universitat (texC3ze8.rz .mi-duesseldorf . de, Bremen, Germany. (For contact telephone 0211/311 3913). information, see Jan 7.) Jan 27 w-Stammtisch, Hamburg, Germany. For information. TUG Courses, San Francisco, California contact Reinhard Zierke (zierke@informatik .mi-hamburg . de; Mar 1-5 Intensive I4m telephone (040) 54715-295). Mar 8 7QX for Publishers

Feb 1-2 Symposium: The Ethics of Scholarly Mar 9 - 10 Practical SGML and Publishing, Toronto Hilton Hotel, Toronto, Ontario. For information, Mar 9 TUGboat Volume 14, contact L. Forget, Conference lStregular issue: Services Office, National Research Mailing date (tentative). Council, Ottawa, Ontario KIA OR6 Mar 9 - 12 DANTE'93 and General Meeting, (613-993-9009; Fax: 613-957-9828). Chemnitz, Germany. For information. Feb 4 T@-Stammtisch at the Universitat contact Dr. Wolfgang Riedel Bremen, Germany. (For contact (wolf gang. riedelahrz. tu-chemnitz . de) information, see Jan 7.) Mar 16 TUGboat Volume 14, Feb 16 TUGboat Volume 14, Znd regular issue: 2ndregular issue: Deadline for receipt of news items. Deadline for receipt of technical reports (tentative). manuscripts (tentative). Mar 18 MITTuG meeting, Massachusetts Feb 18 MITW meeting, Massachusetts Institute of Technology, Cambridge, Institute of Technology, Cambridge, Massachusetts. Room 37-252, Massachusetts. Room 37-252, 12:OO-13:OO. (For contact 12:OO-13:OO. (For contact information, see Jan 21.) information, see Jan 21 .) Mar 18 w-Stammtisch in Duisburg. (For Feb 18 w-Stammtisch in Duisburg. (For contact information, see Jan 21.) contact information, see Jan 21.) Mar 22 TUG Course: for Publishers, Feb 22 Papers for TUG Annual Boston, Massachusetts. Meeting, deadline for submission of proposals (see TUGboat 13, no. 3, p. 398).

Status as of 10 November 1992 TUGboat, Volume 13 (1992), No. 4

Mar 30 - 31 UK w Users' Group, Glasgow, Jun 6-10 Society for Technical Communication. Scotland. (Note: this is just before 4oth Annual Conference. the BCS EPSG meeting.) Topics: Dallas. Texas. For information, METAFONT, theoretical and contact the Society headquarters, practical; and font selection schemes, 901 N. Stuart St., Suite 904. virtual fonts, multiple languages and Arlington, VA 22203-1854. hyphenation, etc. -everything (703-522-4114; Fax: 703-522-2075), you need to know to use w to or the Conference Manager, Binion typeset non-American languages. Amerson (abaQoc. com). For information, contact Phil Taylor Jun 9 TUG Course: lJjX for Publishers, (chaaOO6Qvax.rhbnc .ac . uk). New York City. Mar 31 m-Stammtisch, Hamburg, Jun 10 llthNTG Meeting, Germany. (For contact information, "From Font to Book", Royal Dutch see Jan 27.) Meteorological Institute, De Bilt, Apr 1 m-Stammtisch at the Universitat Netherlands. For information. Bremen, Germany. (For contact contact Theo Jurriens information, see Jan 7.) ([email protected]). Apr 15 w-Stammtisch in Duisburg. (For contact information, see Jan 21.) TUG Courses, San Diego, California

Jun 7 - 11 Modifying I4wStyle Files

TUG Courses, Boston, Massachusetts Jun 14 - 18 BeginningIIntermediate TEX - Apr 19 23 BeginningIIntermediate TEX Jun 21 - 25 Advanced ?&$ and Macro Writing Apr 26 - 30 Intensive Is\?&$ Jun 17 ?&$-Stammtisch in Duisburg. (For Apr 28 m-Stammtisch, Hamburg, contact information, see Jan 21.) Germany. (For contact information, Jun 30 m-Stammtisch, Hamburg, see Jan 27.) Germany. (For contact information. May UK TJ$ Users' Group, see Jan 27.) Chichester, England. Visit to Jul 26 - 29 TUG Annual Meeting: "World John Wiley & Sons Ltd. Host: Wide Window on TjjX", Geeti Granger. For information, Aston University, Birmingham, contact David Murphy U.K. For information, contact the (D .V .MurphyQcomputer-science . organizing committee: Chris Rowley birmingham . ac . uk). (C .A. RowleyQopen.ac .uk) May 6 m-Stammtisch at the Universitat or Malcolm Clark Bremen, Germany. (For contact (malcolmc@wrnin. ac .uk), or the information, see Jan 7.) TUG office. May 20 m-Stammtisch in Duisburg. (For Aug 9- 13 TUG Course: contact information, see Jan 21.) BeginningIIntermediate l&X, May 25 TUGboat Volume 14, Boston, Massachusetts 2nd regular issue: Aug 17 TUGboat Volume 14, Mailing date (tentative). 3rd regular issue: May 26 T&GStammtisch, Hamburg, Deadline for receipt of technical Germany. (For contact information, manuscripts (tentative). see Jan 27.) Aug 23-27 TUG Course: Intensive IPm. Jun 3 m-Stammtisch at the Universitat Ottawa, Canada Bremen, Germany. (For contact Sep 14 TUGboat Volume 14, information, see Jan 7.) Pd regular issue: Deadline for receipt of news items, reports (tentative). 532 TUGboat. Volume 13 (1992), No. 4

Sep 23-24 TUG Course: Book and the computer environment in which it is displayed. Document Design with TEX, In either case, the key characteristics are that the Boston, Massachusetts document has been designed by an author with a particular purpose in mind and that the document's Oct 18 - 22 TUG Course: BeginningIIntermediate TJ$, content and/or structure responds to aspects of the Chicago, Illinois surrounding world's state. We are interested in papers on all aspects of active documents. As a very general starting point, TUG Courses, Boston, Massachusetts some possible topics include system design, under- Oct 25 - 29 Intensive IPm lying support issues, evaluation, language issues (especially the representation of the activity within Nov 1- 5 Advanced TEX and Macro Writing the system), and cognitive issues. Nov 8-9 Practical SGML and TJ$ As a rough guideline, papers should be in the range of 10 to 20 pages in length, although longer Nov 10 TUG Course: SGML and TEX for and shorter papers are appropriate if dictated by Publishers, New York City the subject matter. All papers will be refereed using Nov 12 TUG Course: m for Publishers. the normal EP-odd refereeing process. Manuscripts Washington, DC must be submitted in final form as the limited Nov 18 NTG Meeting, time available for reviewing the contributions to "(IP)m user environment", the special issue will not permit very many passes Oce, Den Bosch, Netherlands. through the editing cycle. Authors will be asked to For information, contact follow the EP-odd author guidelines, (four copies of Gerard van Nes (vannesQecn.nl). the manuscript are requested), and they are asked to include a copy of the EP-odd copyright release Nov 23 TUGboat Volume 14, form with their submission. Copies of the guidelines 3rdregular issue: and copyright release form may be found in each Mailing date (tentative). issue of EP-odd or may be obtained by mail from the guest editor (address below). For additional information on the events listed Because space is limited in the special issue, above, contact the TUG office (805-899-4673, email: it may not be possible to publish all deserving tugQmath. ams .corn) unless otherwise noted. papers. Unless authors request otherwise, such deserving papers will be referred to the normal EP-odd editorial process and will be considered for publication in a subsequent issue. This issue will be coordinated by Vincent Quint, member of the editorial board of EP-odd. He may be contacted at: Call for Papers: Vincent Quint Special Issue of Electronic Publishing: Origination, Dissemination and Design INRIAIIMAG 2, rue de Vignate on Active Documents F-38610 Gieres Electronic Publishing: Origination, Dissemination France and Design (EP-odd) is pleased to announce a e-mail: quint Qimag. f r special issue on the topic of Active Documents, Telephone: $33 76 63 48 31 planned to appear in 1993. Fax: $33 76 54 76 15 The presentation and contents of an active In order to receive maximum consideration, document are dependent on computation. An papers should be received by active document can be intended for interactive April 1, 1993 presentation or for paper presentation. A paper- Papers received after this date will be accepted, but based active document's content might be generated because of schedule constraints may not be able to by execution of an algorithm when the document appear in the special issue. is assembled. The organization of an interactive active document might depend on characteristics of TUGboat, Volume 13 (1992), No. 4

although it was the only article expressly requir- Late-Breaking News ing PostScript processing, several others were also output to Postscript devices for convenience. The following articles were prepared using the Production Notes plain-based tugboat. sty: Barbara Beeton - all articles in General Delivery. - Richard Palais. Moving a fixed point. Input and input processing page 425. Electronic input for articles in this issue was received - Nigel Chapman, Searching in a DVI file, by e-mail, on diskette, and was also retrieved from page 447. remote sites by anonymous ftp. In addition to - the Hyphenation exception log, page 452. text, the input to this issue includes METAFONT - Darko ~ubrinic,The exotic Croatian source code and several encapsulated PostScript Glagolitic alphabet, page 470. files. More than 75 files were used directly to - John Sauter, Postnet codes using METAFONT, generate the final copy: over 100 more contain page 472. earlier versions of articles, auxiliary information, - two book reviews: and records of correspondence with authors and Arvind Borde, TJJY by Example, page 487, referees. These numbers represent input files only; Andr6 Heck, ed., Desktop Publishzng zn .dvi files, device-specific translations, and fonts Astronomy &' Space Sczences, page 489. (. tfm files and rasters) are excluded from the total. - Erich Neuwirth, implementations for Most articles as received were fully tagged for IBM PCs: comparative timings, page 490. TUGboat, using either the plain-based or I4W - Paul Anagnostopoulos, Zzw: A macro conventions described in the Authors' Guide (see package for books, page 497. TUGboat 10, no. 3, pages 378-385). Several - Jonathan Fine, The \noname macros -A authors requested copies of the macros (which we technical report, page 505. were happy to provide); however, the macros have - abstracts of the Cahiers GUTenberg, also been installed at labrea. stanf ord. edu and page 528. other good archives, and an author retrieving them - the TUG calendar. page 530. from an archive will most likely get faster service. - announcement of the EP-odd special issue, Of course, the TUG office will provide copies of page 532. the macros on diskette to authors who have no - these Production notes electronic access. - "Coming next issue" Both the number of articles and the number of pages in this issue are just over half in I4m. Output In organizing the issue, attention was given to The bulk of this issue was prepared at the American grouping bunches of plain or I4m articles, to Mathematical Society from files installed on a yield the smallest number of separate typesetter VAX 6320 (VMS) and W'ed on a server running runs, and the least amount of handwork pasting under Unix on a Solbourne workstation. Most together partial pages. This also affected the articles output was typeset on an APS-p5 at the AMS using written or tagged by the staff, as the conventions resident CM fonts and additional downloadable of tugboat. sty or ltugboat .sty would be chosen fonts for special purposes. Three articles were depending on what conventions were used in the output on the Math Society's Compugraphic 9600 preceding and following articles; no article was Imagesetter: Taylor (p. 433), Kelly and Bischof changed from one to the other, however, regardless (p. 443, which contained encapsulated PostScript of convenience. images), and Haralambous on Greek hyphenation Font work was required for several articles: (p 457). ~ubrinicon the Glagolitic alphabet (p. 470), Sauter One photograph, photographically screened in on postal barcodes (p. 472), and two by Haralam- the traditional manner, accompanies the interview bous -the mactt font (p. 476) and Greek hyphen- with Donald Knuth (p. 419). ation (p. 457); this last article also required the new The output devices used to prepare the ad- font selection scheme (NFSS). vertisements were not usually identified; anyone The article by Kelly and Bischof (p. 443) incor- interested in determining how a particular ad was porates several (encapsulated) PostScript images; prepared should inquire of the advertiser. TUGboat, Volume 13 (1992), No. 4

A Multimedia Document System Based on Coming Next Issue l&X and DVI Documents R. A. Vesilo and A. Dunn examine the develop- ment of a multimedia document system based on Anchored Figures at Either Margin w. Multimedia document systems involve many complex components including editors, formatters, A figure in a box can be placed in text at one margin display systems and components to support the dif- or the other, by measuring the box and adjusting ferent media. By using 'QX to do the formatting, the paragraph shape parameters so as to allow using a standard text editor to enter the document room for it. Macros that try to accomplish this text contents and define the document structure, automatically must be resourceful enough to decide and modifying a DVI previewer to include support what to do in a variety of special circumstances; for non-text contents, the amount of effort required the correctness or appropriateness of each decision to develop a multimedia document system is greatly depends on the requirements of the user. Daniel reduced. [Delayed by technical difficulties.] Comenetz presents his solution to the problems that arise in mathematics texts. [Delayed by technical Using l&X to make Agendas and Calendars difficulties.] with Astronomical Events

FIFO and LIFO sing the BLUes Inspired by the agenda distributed at the Cork meeting, Jordi Saludes has created macros Kees van der Laan presents an exposition on FIFO. that will produce calendars and agendas in several First-In-First-Out, and LIFO, Last-In-First-Out, formats, allowing the user to include both 'fixed' well-known techniques for handling sequences. In and 'movable' events. Events of the latter type macro writing these techniques are used abun- depend on astronomical phenomena related to the dantly but are often not easily recognized as such. sun and moon, and include religious feast days and TEX templates for FIFO and LIFO are given and phases of the moon; all the necessary calculations their use illustrated. Their relation to several are done by based on traditional algorithms. techniques presented by Knuth in The !&%book is described.

ASCII Corporation, California Institute of Technology, I institutional Tokyo,Japan Pasadena, California Beckman Instruments, Calvin College, Members Diagnostic Systems Group. Grand Rapids. Michigan Brea, California Carleton University, The Aerospace Cor~oration, Belgrade University, Ottawa, Ontario, Canada Faculty of Mathematics, El ~egundo,~aliforiia Centre Inter-RCgional de Belgrade, Yugoslavia Air Force Institute of Technology, Calcul ~lectroni~ue,CNRS, Wright-Patterson AFB. Ohio Brookhaven National Laboratory, Orsay. France Upton, New York American Mathematical Society, CERN, Geneva, Switzerland Providence. Rhode Island Brown University, College Militare Royal de Saint Providence, Rhode Island ArborText, Inc., Jean, St. Jean, Quebec, Canada Ann Arbor, Michigan TUGboat, Volume 13 (1992), No.

College of William & Mary, GTE Laboratories, New York University, Department of Computer Science, Waltham, Massachusetts Academic Computing Facility, New York, New York Williamsburg, Virginia Hughes Aircraft Company, Communications Space Communications Division, Nippon Telegraph & Security Establishment, Los Angeles, Calzfornia Telephone Corporation, Department of National Defence. Software Laboratories, Hungarian Academy of Sciences, Tokyo, Japan Ottawa, Ontario, Canada Computer and Automation Construcciones Aeronauticas, S.A., Institute, Budapest, Hungary Northrop Corporation, Palos Verdes, California CAE-Division de Proyectos, IBM Corporation, Madrid, Spain Scientific Center, Observatoire de Genkve, Cornell University, Palo Alto, California Universit6 de Genkve, Sauverny, Switzerland Mathematics Department, Institute for Advanced Study, Ithaca, New York Princeton, New Jersey The Open University, DECUS, Electronic Publishing Academic Computing Services, Institute for Defense Analyses, Milton Keynes, England Special Interest Group, Communications Research Marlboro, Massachusetts Division, Princeton, New Jersey Pennsylvania State University, Computation Center, Department of National Defence, Intevep S. A., Caracas, Venezuela Ottawa, Ontario, Canada University Park, Pennsylvania Iowa State University, Personal 'l&X, Incorporated, Digital Equipment Corporation, Ames, Iowa Nashua, New Hampshire Mill Valley, California The Library of Congress, Politecnico di Torino, E. S. Ingenieres Industriales, Washington D. C. Sevilla, Spain Torino, Italy Los Alamos National Laboratory, Edinboro University Princeton University, University of California, Princeton, New Jersey of Pennsylvania, Los Alamos, New Mexico Edinboro, Pennsyhania Purdue University, Louisiana State University, West Lafayette, Indiana Elsevier Science Publishers B.V., Baton Rouge, Louisiana Amsterdam, The Netherlands Queens College, Macrosoft, Warsaw, Poland European Southern Observatory, Flushing, New York Garching bei Munchen, Marquette University, Rice University, Federal Republic of Germany Department of Mathematics, Department of Computer Science, Statistics and Computer Science, Houston, Texas Fermi National Accelerator Milwaukee, Wisconsin Laboratory, Batavia, Illinois Roanoke College, Masaryk University, Salem, VA Florida State University, Bmo, Czechoslovakia Supercomputer Computations Rogaland University, Research, Tallahassee, Florida Mathematical Reviews, Stavanger, Norway American Mathematical Society, Fordham University, Ann Arbor, Michigan Ruhr Universitat Bochum, Bronx, New York Rechenzentrum, Max Planck Institut General Motors Bochum, Federal Republic of fiir Mathematik, Germany Research Laboratories, Bonn, Federal Republzc of Germany Warren, Michigan Rutgers University, Hill Center, NASA Goddard Piscataway, New Jersey GKSS, Forschungszentrum Space Flight Center, Geesthacht GmbH, Greenbelt, Maryland St. Albans School, Geesthacht, Federal Republic of Mount St. Alban, Washington, Germany National Institutes of Health, D.C. Bethesda, Maryland Grinnell College, Smithsonian Astrophysical Computer Services, National Research Council Observatory, Computation Facility. Grznnell, Iowa Canada, Computation Centre, Cambridge, Massachusetts Ottawa, Ontario, Canada Grumman Aerospace, Software Research Associates, Melbourne Systems Division, Naval Postgraduate School, Tokyo, Japan Melbourne, Florida Monterey, California TUGboat, Volume 13 (1992), No. 4

Space Telescope Science Institute, University of Crete, University of Washington, Baltimore, Maryland Institute of Computer Science, Department of Computer Science, Heraklio, Crete, Greece Seattle, Washzngton Springer-Verlag, Heidelberg, Federal Republic of University of Delaware, University of Waterloo, Germany Newark, Delaware Library-Serials Department, Waterloo, Ontarzo, Canada Springer-Verlag New York, Inc., University of Exeter, New York, New York Computer Unit, University of Western Australia, Exeter, Devon, England Regional Computing Centre, Stanford Linear Nedlands, Australza Accelerator Center (SLAC), University of Glasgow, Stanford, California Department of Computing Science, Uppsala University, Glasgow, Scotland Uppsala, Sweden Stanford University, Computer Science Department, University of Groningen, Villanova University, Stanford, California Groningen, The Netherlands Vzllanova, Pennsylvanza Talaris Systems, Inc., University of Heidelberg, Virginia Polytechnic Institute, San Diego, California Computing Center, Interdisciplinary Center Heidelberg, Germany for Applied Mathematics, Texas A & M University, Blacksburg, Vzrgznza Department of Computer Science, University of Illinois at Chicago, College Station, Texas Computer Center, Vrije Universiteit , Chicago, Illinois Amsterdam, The Netherlands UNI-C, Aarhus, Denmark University of Kansas, Washington State University, United States Military Academy, Academic Computing Services, Pullman, Washzngton West Point, New York Lawrence, Kansas Widener University, University of Alabama, Universitat Koblenz-Landau, Computing Services, Tuscaloosa, Alabama Koblenz, Federal Republic of Chester, Pennsylvanza University of British Columbia, Germany Worcester Polytechnic Institute, Computing Centre, University of Maryland, Worcester, Massachusetts Vancouver, British Columbia, Department of Computer Science, Canada Yale University, College Park, Maryland Department of Computer Science, University of British Columbia, University of Massachusetts, New Haven, Connectzcut Mathematics Department, Amherst, Massachusetts Vancouver, British Columbia, Canada Universitk degli Studi di Trento, Trento, Italy University of Calgary, Calgary, Alberta, Canada University of Oslo, Institute of Informatics, University of California, Berkeley, Blindern, Oslo, Norway Space Astrophysics Group, Berkeley, California University of Oslo, Institute of Mathematics, University of California, Irvine, Blindern, Oslo, Norway Information & Computer Science, Irvine, California University of Salford, Index of Advertisers Salford, England University of California, 543 American Mathematical Los Angeles, Computer University of Southern California, Society Science Department Archives, Information Sciences Institute, 543 ArborText Los Angeles, Calzfornia Marina del Rey, California Cover 3 Blue Sky Research University of California, Santa University of Stockholm, 542 ETP (Electronic Technical Barbara, Santa Barbara, California Department of Mathematics, Publishing) Stockholm, Sweden University of Canterbury, 540,541 Kinch Computer Christchurch, New Zealand University of Texas at Austin, Company Austin, Texas University College, 492 Micro Programs, Inc. Cork, Ireland 539 Y&Y Individual Membership Application

Name Institutional affiliation, if any Position Address (business or home (circle one))

City State or Country Zip Daytime telephone FAX Complete and return this form with payment to: Email addresses (please specify networks, as well) QXUsers Group Membership Department 0.Box 21041 Santa Barbara, CA 93121-1041 I am also a member of the following other QXorganizations: USA

Membership is effective from Jan- uary 1to December 31 and includes Specific applications or reasons for interest in TEX: subscriptions to TUGboat, The Com- munications of the EX Users Group and the TUG newsletter, 'QZ and TUG News. Members who join after January 1 will receive all issues published that calendar year. Hardware on which TEX is used: Computer and operating system Output devicelprinter For more information . . . Whether or not you join TUG now, feel free to return this form to request more information. Be sure to include your name and address in the spaces provided to the right. There are two types of TUG members: regular members, who pay annual Check all items you wish to receive dues of $60; and full-time student members, whose annual dues are $30. below: Students must include verification of student status with their applications. Institutional membership information Please indicate the type of membership for which you are applying: Course and meeting information Regular @ $60 Full-time student @ $30 Advertising rates Amount enclosed for 1993 membership: More information on QX $ (Prepayment in US dollars drawn on a US bank is required) Correspondence unaccompanied by a payment should be directed to QX Users Group ChecWmoney order payable to TEX Users Group enclosed I?. 0.Box 869 Charge to MasterCard/VISA Santa Barbara, CA 93102 USA Card # Exp. date - Telephone: (805) 899-4673 Email: tug0Math. AMS . org Signature Institutional Membership Application

Institution or Organization

Principal contact I USERS I Address City IGROUP State or Country Zip Daytime telephone FAX Email addresses (please specify networks, as well)

Complete and return this form with payment to: Each Institutional Membership entitles the institution to: QXUsers Group Membership Department designate a number of individuals to have full status as TUG F! 0.Box 21041 individual members; Santa Barbara, CA 93121-1041 take advantage of reduced rates for TUG meetings and courses for USA all staff members; be acknowledged in every issue of TUGboat published during the membership year.

Membership is effective from Educational institutions receive a $100 discount in the membership fee. January 1 to December 31. Members The three basic categories of Institutional Membership each include who join after January 1 will receive a certain number of individual memberships. Additional individual all issues of TUGboat published that memberships may be obtained at the rates indicated. Fees are as follows: calendar year. Category Rate (educ. / non-educ.) Add'l mem. A (includes 7 memberships) $ 540 / $ 640 $50 ea. B (includes 12 memberships) $ 815 / $ 915 $50 ea. C (includes 30 memberships) $1710 / $1810 $40 ea.

For more information . . . Please indicate the type of membership for which you are applying: Correspondence Category -+ -additional individual memberships QX Users Group P. 0.Box 869 Amount enclosed for 1993 membership: $ Santa Barbara, CA 93102 USA Telephone: (805) 899-4673 0 Checkimoney order payable to QX Users Group enclosed Email: tugbath. ams .org (payment is required in US dollars drawn on a US bank) Charge to MasterCardNISA

Card # Exp. date - Whether or not you join TUG now, feel free to return this form to Signature request more information.

Please attach a corresponding list of individuals whom you wish to designate as TUG individual members. Minimally, we require names Check all items you wish to and addresses so that TUG publications may be sent directly to these receive below: individuals, but we would also appreciate receiving the supplemental information regarding phone numbers, email addresses, QX interests, Course and meeting information and hardware configurations as requested on the TUG Individual Advertising rates Membership Application form. For this purpose, the latter application More information on QX form may be photocopied and mailed with this form. Wouldn't it be nice to be able to preview DVI files at any magnification, not just those for which bitmap fonts have been pre-built? Or to produce truly resolution-independent output that will run on any Postscript device, whether image setter or laser printer? Perhaps you are looking for an alternative to Computer Modern? There now exist complete outline font sets which include math fonts that are direct replacements for those in CM. Even if you do want to remain faithful to CM, there are distinct ion of the fonts. We s

hdo - preview DVI files calli

Preview at arbitrary magnificatio * Preview in MS windowsTM-

how EPSF files with preview on screen -

downloading for speed an

memory on the printer olution-independent and pa

1 TM form (ATM compati

+ SLITEX font set - * AMS font set - Euler, * Lucidao Bright + Lucida New

Resolution-independent Postscript files using outline fonts can be printed by any se reau, not just those with Tgpertise - and that translates into considerable savings erhaps time to get rid of those huge, complex directories full of bihnap fonts?

86 - Fax: (508) 37 1-2004 AP-TJ~XFonts Avant Garde BoM Avant Garde :"hue =-compatible Bit-Mapped Fonts Identical to Avant Garde Demibold Adobe Postscript Typefaces Avant Gar& k$:d

Bookman Light If you are hungry for new TEX fonts, here is a feast guar- anteed to satisfy the biggest appetite! The AP-TEX fonts Bookman 1:; serve you a banquet of gourmet delights: 438 fonts cov- Bookman Demibold ering 18 sizes of 35 styles, at a total price of $200. The Demlbdd Boo kman ltal~ AP-TEX fonts consist of PK and TFM files which are ex- act w-compatible equivalents (including "hinted7' pix- Courier els) to the popular Postscript name-brand fonts shown COuri er Obliaue at the right. Since they are directly compatible with any Courier ~dd standard TEX implementation (including kerning and liga- tures), you don't have to be a expert to install or use Courier %& them. When ordering, specify resolution of 300 dpi (for laser Helvetica Oblique printers), 180 dpi (for 24-pin dot matrix printers), or 118 Heivetica Bold dpi (for previewers). Each set is on ten 360 KB 5-114" Helvefica Eque PC floppy disks. The $200 price applies to the first set you order; order additional sets at other resolutions for Helvetica Narrow $60 each. A 30-page user's guide fully explains how to Helvetica Narrow Obl~que install and use the fonts. Sizes included are 5, 6, 7, 8, 9, Helvetica Bold 10, 11, 12, 14.4, 17.3, 20.7, and 24.9 points; headline styles Narrow (equivalent to Times Roman, Helvetica , and Palatino, all Helvefica Narrow Eque in bold) also include sizes 29.9, 35.8, 43.0, 51.6, 61.9, and Schoolbook FE"maCnentury 74.3 points. Schoolbook /ZCentury The Kinch Computer Company Schoolbook :E'?e"'u' New Century Schoolbook Bold Italic 501 South Meadow Street Palatino Roman Ithaca, New York 14850 Telephone (607) 273-0222 Palatino ltali, FAX (607) 273-0484 Palatino BOM

Helvetica, Palatino, Times, and New Century Schoolbook are t,rademarks of Allied Linotype Co. ITC Avant Garde, ITC Bookman, ITC Zapf Chancery, Times Roman and ITC Zapf Dingbats are registered trademarks of International Typeface Corporation. Postscript is a registered trademark of Adobe Systems Incorpe Times ltdk rated. The owners of these trademarks and Adobe Systems, Inc. are not the authors, publishers, or licensors of the AP-TF$ fonts. Kinch Computer Com- Times Bdd pany is the sole author of the AP-T)$ fonts, and has operated independently of the trademark owners and Adobe Systems, Inc. in publishing this soft- Times kid, ware. Any reference in the AP-l$$ font software or in this advertisement to Medium these trademarks is solely for software compatibility or product comparison. Zapf Chncey Itaiic EaserJet and DeskJet are trademarks of Hewlett-Packard Corporation. 'IkX is a trademark of the American Math Society. Turbom and AP-l$$ are Symbol AQTfiAIIO trademarks of Kinch Computer Company. Prices and specifications subject to change without notice. Revised October 9, 1990. 2apf Dingbats K-O Executables $150 With Source $300

HE MOST VERSATILE TEX ever dialog boxes. Windows protected ecutable~)or $80 (including source). published is breaking new mode frees you from MS-DOS lim- Or, get either applicable upgrade free ground in the powerful and itations like DOS extenders, over- when you buy the AP-TEX fonts (see Tconvenient graphical envi- lay swapping, and scarce memory: facing page) for $200! ronment of Microsoft Windows: Tur- You can run long TEX formatting No-risk trial offer: Examine the ~oTEXRelease 3.1E. TurboT~Xruns or printing jobs in the background documentation and run the PC Tur- on all the most popular operating while using other programs in the ~oTEXfor 10 days. If you are not sat- systems (Windows, MS-DOS, OS/2, foreground. isfied, return it for a 100% refund or and UNLX)and provides the latest 6 MS-DOS Power, Too: TurboT~X credit. (Offer applies to PC executa- TEX 3.14 and M ETA FONT 2.7 stan- still includes the plain MS-DOS pro- ble~only.) dards and certifications: preloaded grams. Virtual memory simulation 6 Free Buyer's Guide: Ask for the plain TEX, 14TEX, &-TEX and &&- provides the same sized TEX that free, 70-page Buyer's Guide for de- 14TEX, ~reviewersfor PC's and X- runs on multi-megabyte mainframes, tails on TurboT~Xand dozens of TEX- servers, M ETA FONT, Computer with capacity for large documents, related products: previewers, TEX-to- Modem and BTEX fonts, and printer complicated formats, and demanding FAX and TEX-to-Ventura/Pagemaker drivers for HP LaserJet and DeskJet, macro packages. translators, optional fonts, graphics PostScript, and Epson LQ and FX editors, public domain TEX accessory 6 Source Code: The portable C dot-matrix printers. software, books and reports. 6 Best-selling Value: TurboT~X source to TurboT~Xconsists of over sets the world standard for power 100,000 lines of generously com- and value among TEX implementa- mented TEX, TurboT~X,M ETA FONT, tions: one price buys a complete, previewer, and printer driver source Ordering TurboT~X commercially-hardened typesetting code, including: our WEB system in system. Computer magazine recom- C; 'IASCHAL, our proprietary Pascal- Ordering TurboT~Xis easy and deliv- ery is fast, by phone, FAX, or mail. mended it as "the version of TEX to to-C translator; Windows interface; Terms: Check with order (free media have," IEEE Software called it "indus- and preloading, virtual memory, and and ground shipping in US), VISA, trial strength," and thousands of sat- gafhics code,-all meeting C portabil- Mastercard (free media, shipping ex- isfied users around the globe agree. ity standards like ANSI and K&R. tra); Net 30 to well-rated firms and 6 Availability & Requirements: TurboT~Xgets you started quickly, public agencies (shipping and media installing itself automatically under TurboT~Xexecutables for IBM PC's extra). Discounts available for quan- include the User's Guide and require MS-DOS or Microsoft Windows, and tities or resale. International orders compiling itself automatically under 640K, hard disk, and MS-DOS 3.0 gladly expedited via Air or Express or later. Windows versions run on UNIx. The 90-page User's Guide in- Mail. cludes generous examples and a full Microsoft Windows 3.0 or 3.1. Order index, and leads you step-by-step source code (includes Programmer's through installing and using TEX and Guide) for other machines. On the METR FONT. PC, source compiles with Microsoft The Kinch Computer Company 6 Classic TEX for Windows. Even if C, Watcom C 8.0, or Borland C++ 2.0; PUBLISHERSOF TURBOTEX other operating systems need a 32- you have never used Windows on 501 South Meadow Street bit C compiler supporting UNIXstan- your PC, the speed and power of Ithaca, New York 14850 USA dard I/O. Specify 5-1/4" or 3-1/2" TurboT~Xwill convince you of the Telephone (607) 273-0222 PC-format floppy disks. benefits. While the TEX command- FAX (607) 273-0484 line options and T~Xbookinteraction 6 Upgrade at Low Cost. If you work the same, you also can control have TurboT~XRelease 3.0, upgrade TEX using friendly icons, menus, and to the latest version for just $40 (ex- Electronic Technical Publishing Services Company 2906 N.E.Glisan Street Portland, Oregon 97232 503-234-5522 FAX:503-234-5604 [email protected] TEX Publishing Services From the Basic: The American Mathemdtl~alSociety offers you two basic, loa cost TEX publishing services You provide a DVI file and we will produce typeset pages using an Autologic APS Micro-5 phototypesetter. $5 per page for the first 100 pages; 52.50 per page for additional pages. You provide a Postscript output file and we will provide typeset pages using an Agfa/ Compugraphic 9600 imagesetter. $7 per page for the first 100 pages; $3.50 per page for additional pages. There is a $30 minimum charge for either service. Quick turnaround is also provided ... a manuscript up to 500 pages can be back in your hands in one week or less.

To the Complex: As a full-service TEX publisher, you can look to the American Mathematical Society as a single source for any or all your publishing needs.

I 1 Macro-Writing , T&X Problem Solving Non-CM Fonts Keyboarding 1 1 Art and Pasreup Camera Work 1 Printing and Binding Distribution I For more information or to schedule a job, please contact Regina Girouard, American Mathematical Society, PP.0. Box 6248, Providence, RI 02940, or call 401-455-4060

A Complete TEX Solution From ArborText!

ARBORTEXTINC We did the work so you don't have to! Ready to use, fully documented and supported TEX package

ArborText's TEX Full System Includes:

T@, pTS and Macro Packages Built-In Support for Virtual Fonts Screen Previewer Complete Comprehensive Installation Manuals DVILASERPS or DVILASER/HP 90 days of Free Quality Technical Support TEX User Manual of your choice 10 Years of T@ Product Development

Available For: Sun-4 (SPARC), IBM RS/6000, DECRISC-, HP 9000, and IBM PC's

1000 Victors Way A Suite 400 A Ann Arbor, MI 48 I08 A (313) 996-3566 A FAX (3 13) 996-3573 North America Cowan, Dr. Ray E Quixote Digital Typography, Don 141 Del Medio Ave. #134, Mountain Hosek Abraharns, Paul View, CA 94040; (415) 949-4911 349 Springfield, #24, Claremont, CA 91711; (714) 621-1291 214 River Road, Deerfield, MA 01342; Ten Years of QZ and Related Software (413) 774-5500 Consulting, Books, Documentation, Complete line of QX, WX,and Development of TEX macros and macro Journals, and Newsletters. nX& I~TEX METAFONT services including custom packages. Short courses in QX. Editing macropackages, graphics; PostScript WQX style files, complete book production assistance for authors of technical articles, language applications; device drivers; fonts; from manuscript to camera-ready copy; particularly those whose native language is systems. custom font and logo design; installation of not English My background includes customized nXenvironments; phone programming, computer science, consulting service; database applications Electronic Technical Publishing and more. Call for a free estimate. mathematics, and authorship of rnfor the Services Co. Impatient. 2906 Northeast Glisan Street, Portland, Richert, Norman Oregon 97232-3295; American Mathematical Society 1614 Loch Lake Drive, El Lago, TX 77586; (503) 234-5522; FAX: (503) 234-5604 (713) 326-2583 F! 0. Box 6248, Providence, RI 02940; (401) 455-4060 Total concept services include editorial, QX macro consulting. design, illustration, project management, Typesetting from DVI files on an Autologic composition and prepress. Our years of mnology, Inc., Amy Hendrickson APS Micro-5 or an Agfa Compugraphic experience with QX and other electronic 9600 (PostScript). Times Roman and 57 Longwood Ave., Brookline, MA 02146; tools have brought us the expertise to work (617) 738-8029 Computer Modern fonts. Composition effectively with publishers, editors, and QXmacro writing (author of MacronX); ,services for mathematical and technical authors. ETP supports the efforts of the custom macros to meet publisher's or books and journal production. QXUsers Group and the world-wide TEX designer's specifications; instruction. community in the advancement of superior Anagnostopoulos, Paul C. technical communications. 433 Rutland Street, Cadisle, MA 01741; Type 2000 (508) 371-2316 16 Madrona Avenue, Mill Valley, CA NAR Associates 94941; Composition and typesetting of high-quality 817 Holly Drive E. Rt. 10, Annapolis, MD (415) 388-8873; FAX (415) 388-8865 books and technical documents. 21401; (410) 757-5724 Production using Computer Modern or any $2.50 per page for 2000 DPI QX camera available PostScript fonts. Assistance with Extensive long term experience in QX ready output! We have a three year history book design. I am a computer consultant book publishing with major publishers, of providing high quality and fast with a Computer Science education. working with authors or publishers to turn turnaround to dozens of publishers, electronic copy into attractive books. We journals, authors and consultants who use offer complete free lance production QX. Computer Modern, Bitstream and ArborText, Inc. services, including design, copy editing, art METAFONT fonts available. We accept DVI 1000 Victors Way, Suite 400, Ann Arbor, sizing and layout, typesetting and repro files only and output on RC paper. $2.25 MI 48108; (313) 996-3566 production. We specialize in engineering, per page for 100+ pages, $2.00 per page for QX installation and applications support. science, computers, computer graphics, 500+ pages. QX-related software products. aviation and medicine. Outside North America Archetype Publishing, Inc., Ogawa, Arthur Lori McWilliam Pickert 1101 San Antonio Road, Suite 413, Typom Ltd. Mountain View, CA 94043-1002; P. 0. Box 6567, Champaign, IL 61821; Electronical Publishing, Battyhy u. 14. (415) 691-1126; (217) 359-8178 Budapest, Hungary H-1015; ogawa(0applelink.apple.com. Experienced in producing and editing (036) 11152 337 technical journals with QX; complete book Specialist in hetypography, WQX book Editing and typesetting technical journals production from manuscript to production systems, database publishing, and books with TEX from manuscript to camera-ready copy; TEX macro writing and SGML. Programming services in QX, camera ready copy. Macro writing, font including complete macro packages; WX,PostScript, SGML, DTDs, and designing, QXconsulting and teaching. consulting. general applications. Instruction in QX, WQX, and SGML. Custom fonts. The Bartlett Press, Inc., Frederick H. Bartlett Pronk&AssociatesInc. Harrison Towers, 6E 575 Easton Avenue, 1129 Leslie Street, Don Mills, Ontario, Somerset, NJ 08873; (201) 745-9412 Canada M3C 2K5; Information about these services can be obtained from: Vast experience: loo+ macro packages, (416) 441-3760; F&: (416) 441-9991 TEX Users Group over 30,000 pages published with our Complete design and production service. P. 0.Box 869 macros; over a decade's experience in all One, two and four-color books. Combine facets of publishing, both QX and text, art and photography, then output Santa Barbara, CA 93102 non-QX; all services from copyediting and directly to imposed film. Servicing the (805) 899-4673 design to final mechanicals. publishing community for ten years.

Volume 13, Number 4 / December 1992

Addresses General Delivery Changing 'l$jX? / Malcolm Clark Editorial comments / Barbara Beeton An interview with Donald Knuth, November 1991 Dreamboat Moving a fixed point / Richard Palais The future of m / Philip Taylor Software XBibm and friends / Nickolas J. Kelly and Christian H. Bisohof Searching in a DVI file / Nigel Chapman Hyphenation exception log Literate programming Errata: Literate Programming, A Practitioner's View, TUGboat 13, no. 3, pp. 261-268 / Bart Childs Philology Hyphenation patterns for ancient Greek and Latin / Yannis Haralambous Fonts The exotic Croatian Glagolitic alphabet / Darko ~ubrini~ Postnet codes using METAFONT 1 John Sauter A typewriter font for the Macintosh 8-bit font table / Yannis Haralambous Graphics Addendum: A style option for rotated objects in 'l$jX (TUGboat 13, no. 2, pp. 156-180) / Sebastian Rahtz and Leonor Barroca Diag: a drawing preprocessor for IAm / Ray Seyfarth Book Reviews Wynter Snow, for the Begznner / Victor Eijkhout Arvind Borde, by Example / George Greenwade Andre Heck, ed., Desktop Publzshzng an Astronomy & Space sczences / A. G. W. Cameron Typesetting on PCs implementations for IBM PCs: comparative timings / Erich Neuwirth Warnings Where does this character come from? Solution to the puzzle, TUGboat 13, no. 2, p.190 / Frank Mittelbach Macros The bag of tricks / Victor Eijkhout Too many errors / Jonathan Fine One error less 1 Victor Eijkhout Zzm: A macro package for books / Paul Anagnostopoulos The \noname macros-A technical report / Jonathan Fine Volunteer work for the Urn3project / Frank Mittelbach, Chris Rowley and Michael Downes Correction sheets in IAW 1 Mike Piff Text merges in 'JJ$X and / Mike PX A style file for printing sheets of labels 1 Sebastian Rahtz Abstracts Cahiers GUTenberg #13 News & Calendar Announcements Call for Papers: Special Issue of Electronzc Publzshzng: Orzgznatzon, Dzssemznatzon and Deszgn on Active Documents Late-Breaking News Production notes / Barbara Beeton Coming next issue TUG Business Institutional members Forms TUG membership application Advertisements Index of advertisers rn consulting and production services