<<

TUGBOAT

Volume 38, Number 1 / 2017

General Delivery 3 President’s / Jim Hefferon 5 Editorial comments / Barbara Beeton iTEX lives!; LATEX tutorials; The Go fonts; at 32; From TUG’16, more from Joe Clark 7 Interview with Scott Pakin / David Walden 10 What’s a Professor of Neurology doing using LATEX? / David Teplow 16 Typographers’ Inn / Peter Flynn 18 Review and summaries: The History of Typographic Writing — The 20th century Volume 1, from 1900 to 1950 / Charles Bigelow Software & Tools 23 SILE: A new system / Simon Cozens Fonts 28 BaskervilleF / Michael Sharpe Resources 31 Programming LATEX — A survey of documentation and packages / Brian Dunn 34 CTAN goes 2.0 — New community features and more / Gerd Neugebauer Tutorials 39 An introduction to the LATEX cross-referencing system / Thomas Thurnherr 41 How to use basic color models in LATEX / Behzad Salimi Electronic Documents 44 SageMathCloud for collaborative document editing and scientific computing / Hal Snyder 48 Producing HTML directly from LATEX — the lwarp package / Brian Dunn A L TEX 54 LATEX news, issue 26, January 2017 / LATEX Project Team 56 LATEX3 news, issue 10, November 2016 / LATEX Project Team 58 A key/value interface for generating LATEX floats — the keyfloat package / Brian Dunn 61 Glisterings: Hanging; Safety in numbers / Peter Wilson Methods 65 The optimal value for \emergencystretch / Udo Wermuth Hints & Tricks 87 The treasure chest / Karl Berry Reviews 89 Book review: More Math Into LATEX, 5th edition, by George Gr¨atzer / Jim Hefferon 90 Book review: The Noblest Roman: A History of the Types of Bruce Rogers by Jerry Kelly and Misha Beletsky / Boris Veytsman 92 Book review: Track Changes: A Literary History of Word Processing by Matthew G. Kirschenbaum / David Walden 93 Book review: Manuale Calligraphicum. Examples of Calligraphy by Students of Hermann Zapf, David Pankow, ed. / Boris Veytsman 94 Seminar review: Presenting data and information by Edward Tufte, November 9, 2016, Arlington, VA / Boris Veytsman Abstracts 96 Die TEXnische Kom¨odie: Contents of issues 4/2016–1/2017 97 Zpravodaj : Contents of issues 2015/3–4–2016/1–4 98 Eutypon: Contents of issue 36–37 (October 2016) TUG Business 2 TUGboat editorial information 2 TUG institutional members 99 TUG financial statements for 2016 / Klaus H¨oppner 100 TUG 2017 election Cartoon 106 File extensions / Randall Munroe Advertisements 107 TEX consulting and production services News 108 Calendar TEX Users Group Board of Directors TUGboat (ISSN 0896-3207) is published by the , Grand Wizard of TEX-arcana † ∗ TEX Users Group. : http://tug.org/TUGboat. Jim Hefferon, President Boris Veytsman∗, Vice President ∗ Individual memberships Klaus H¨oppner , Treasurer ∗ 2017 dues for individual members are as follows: Susan DeMeritt , Secretary Regular members: $105. Barbara Beeton Special rate: $75. Karl Berry The special rate is available to students, seniors, and Kaja Christiansen citizens of countries with modest economies, as de- Michael Doob tailed on our web site. Also, anyone joining or re- Steve Grathwohl newing before March 31 receives a $20 discount: Steve Peter Regular members (early bird): $85. Cheryl Ponchin Special rate (early bird): $55. Geoffrey Poore Members also have the option to receive TUGboat Norbert Preining and other benefits electronically, for an additional Arthur Reutenauer discount. Michael Sofka † Membership in the TEX Users Group is for the Raymond Goucher, Founding Executive Director calendar year, and includes all issues of TUGboat for Hermann Zapf (1918–2015), Wizard of Fonts the year in which membership begins or is renewed, ∗member of executive committee as well as software distributions and other benefits. †honorary Individual membership carries with it such rights See http://tug.org/board.html for a roster of all past and responsibilities as voting in TUG elections. All and present board members, and other official positions. the details are on the TUG web site. Addresses Electronic Mail Journal subscriptions TEX Users Group General correspondence, TUGboat subscriptions (non-voting) are available to P.O. Box 2311 membership, subscriptions: organizations and others wishing to receive TUG- Portland, OR 97208-2311 [email protected] U.S.A. boat in a name other than that of an individual. Submissions to TUGboat, The subscription rate for 2017 is $110. letters to the Editor: Telephone [email protected] +1 503 223-9994 Institutional memberships Technical support for Fax Institutional membership is primarily a means of T X users: +1 815 301-3568 E showing continuing interest in and support for TEX [email protected] and the TEX Users Group. It also provides a dis- Web Contact the counted membership rate, site-wide electronic ac- http://tug.org/ Board of Directors: cess, and other benefits. For further information, http://tug.org/TUGboat/ [email protected] see http://tug.org/instmem.html or contact the TUG office. Copyright c 2017 TEX Users Group. Trademarks Copyright to individual articles within this publication Many trademarked names appear in the of remains with their authors, so the articles may not TUGboat. If there is any question about whether be reproduced, distributed or translated without the a name is or is not a trademark, prudence dictates authors’ permission. that it should be treated as if it is. For the editorial and other material not ascribed to a particular author, permission is granted to make and distribute verbatim copies without royalty, in any medium, provided the copyright notice and this permission notice are preserved. Permission is also granted to make, copy and distribute translations of such editorial material into another language, except that the TEX Users Group must approve [ date: March 2017] translations of this permission notice itself. Lacking such approval, the original English permission notice must Printed in U.S.A. be included. ... I sat down to dinner to find my soup which was a sort of noodle soup, turning into all sorts of curious forms and even letters of the alphabet. ... On close investigation I found that the dough had been run through forms so as to make the different letters of the alphabet and figures, too! It was like looking in the “hell box” of a printing office, ... . Wilbur Wright, letter to sister Katherine, Le Mans, June 28, 1908 in David McCullough, The Wright Brothers (2015)

COMMUNICATIONS OF THE TEX USERS GROUP EDITOR BARBARA BEETON

VOLUME 38, NUMBER 1 • 2017 PORTLAND • OREGON • U.S.A. 2 TUGboat, Volume 38 (2017), No. 1

TUGboat editorial information Submitting items for publication This regular issue (Vol. 38, No. 1) is the first issue of the Proposals and requests for TUGboat articles are grate- 2017 volume year. fully received. Please submit contributions by electronic TUGboat is distributed as a benefit of member- mail to [email protected]. ship to all current TUG members. It is also available The second 2017 issue will be the proceedings of to non-members in printed form through the TUG store the TUG’17 conference (tug.org/tug2017); the deadline (tug.org/store), and online at the TUGboat web site for receipt of final papers is May 12. The third issue (tug.org/TUGboat). Online publication to non-members deadline is September 1. is delayed up to one year after print publication, to give The TUGboat style files, for use with plain TEX A members the benefit of early access. and L TEX, are available from CTAN and the TUGboat Submissions to TUGboat are reviewed by volun- web site, and are included in common TEX distributions. teers and checked by the Editor before publication. How- We also accept submissions using ConTEXt. Deadlines, ever, the authors are assumed to be the experts. Ques- templates, tips for authors, and more is available at tions regarding content or accuracy should therefore be tug.org/TUGboat. directed to the authors, with an information copy to the Effective with the 2005 volume year, submission of Editor. a new manuscript implies permission to publish the ar- ticle, if accepted, on the TUGboat web site, as well as TUGboat editorial board in print. Thus, the physical address you provide in the Barbara Beeton, Editor-in-Chief manuscript will also be available online. If you have any Karl Berry, Production Manager reservations about posting online, please notify the edi- Boris Veytsman, Associate Editor, Book Reviews tors at the time of submission and we will be happy to Production team make suitable arrangements. William Adams, Barbara Beeton, Karl Berry, Other TUG publications Kaja Christiansen, Robin Fairbairns, Robin Laakso, TUG is interested in considering additional manuscripts Steve Peter, Michael Sofka, Christina Thiele for publication, such as manuals, instructional materials, TUGboat documentation, or works on any other topic that might For advertising rates and information, including consul- be useful to the TEX community in general. tant listings, contact the TUG office, or see: If you have such items or know of any that you tug.org/TUGboat/advertising.html would like considered for publication, please contact the tug.org/consultants.html Publications Committee at [email protected].

Institute for Defense Analyses, Stanford University, TUG Center for Communications Computer Science Department, Institutional Research, Princeton, New Jersey Stanford, California Maluhy & Co., S˜ao Paulo, Brazil Stockholm University, Members Marquette University, Department of Mathematics, Milwaukee, Wisconsin Stockholm, Sweden TNQ, Chennai, India TUG institutional members Masaryk University, receive a discount on multiple Faculty of Informatics, University College, Cork, memberships, site-wide electronic Brno, Czech Republic Computer Centre, access, and other benefits: MOSEK ApS, Cork, Ireland http://tug.org/instmem.html Copenhagen, Denmark Universit´eLaval, Thanks to all for their support! New York University, Ste-Foy, Qu´ebec, Canada Academic Computing Facility, University of Cambridge, American Mathematical Society, New York, New York Centre for Mathematical Sciences, Providence, Rhode Island , London, UK Cambridge, United Kingdom Aware Software, Inc., University of Ontario, Midland Park, New Jersey River Valley Technologies, Trivandrum, India Institute of Technology, Center for Computing Sciences, Oshawa, Ontario, Canada Bowie, Maryland ShareLaTeX, United Kingdom University of Oslo, CSTUG, Praha, Czech Republic Springer-Verlag Heidelberg, Institute of Informatics, Heidelberg, Germany Fermilab, Batavia, Illinois Blindern, Oslo, Norway StackExchange, New York City, New York TUGboat, Volume 38 (2017), No. 1 3

President’s note and Misha Beletsky; Dave Walden reviewed Track Changes: A Literary History of Word Processing by Jim Hefferon Matthew G. Kirschenbaum; and I have looked at the This is my last column as President. I am delighted latest edition of George Gr¨atzer’s More Math Into A to announce our next President and a robust election LTEX. The link tug.org/books/ will take you to for the next Board. I will discuss some more events all the book reviews, discounts, and more. in the T X world, and I will also take a minute for E Membership an exit reflection. The winner of the prize for the 2016 Members Bring Elections Members drive is Doug Marmion. He received a lim- This is an election year for TUG. Since there was a ited edition of Manuale Zapficum, 2009: Typographic single candidate for President, Boris Veytsman, he arrangements of the words by and about the work of will serve for the next two years. Congratulations Hermann Zapf & Gudrun Zapf von Hesse from RIT Boris! Press. Congratulations to Doug, and thank you to For the Board there are ten open seats. To every everyone who participated (and another thank you one of the candidates, let me say on behalf of the to Boris for taking care of the prize and the project community, “Thank you for volunteering.” By the administration). time this reaches you the results will be posted at Membership remains a concern. If you know tug.org/election/. someone who uses TEX and friends then urge them to consider joining TUG. In particular, out Conferences to them how very inexpensive it is to support their This year’s TUG conference takes place in conjunc- tools. The basic membership early bird rate is $85, tion with BachoTEX, April 29–May 3, 2017. We are with a $40 deduction if you opt out of a paper copy joining the Polish group GUST in celebrating their of TUGboat and the software DVD and get them 25th birthday. See tug.org/tug2017/ for more in- in electronic form only. If you are a student, a new formation. If you are planning to go please read grad, a senior, or a citizen of a country with a modest “Things you always wanted to know about Bachotek” economy then after the deduction the annual mem- at tug.org/tug2017/bachotex.html. bership is only $15. It could not be more reasonable. The 11th International ConTEXt meeting will See tug.org/join.html. be September 11–17, 2017 in Butzbach-Maibach, Germany. See meeting.contextgarden.net/2017/ Reflections for the full information. Although I am not a tumultuous person, it is fair One more meeting note: we’ve submitted an to say that my brief time in office has been a tu- application to be a satellite conference for the 2018 multuous one for TUG. At times it seemed that the International Conference of Mathematicians in Rio organization could collapse. It is a lesson in how frag- de Janeiro. Nothing is firm yet but it is an exciting ile things are, that being good today is not enough prospect. Fingers crossed. and we must work hard to keep it up. But we came through, with the support of mem- TUG On the site bers and with the pitching-in of everyone on the Dave Walden has returned to doing interviews and Board. I must especially note the efforts of Pavneet the latest subject is Scott Pakin. I am a big admirer Arora, Barbara Beeton, Michael Doob, and Boris of Scott’s work, including the Comprehensive LATEX Veytsman. These folks have been an inspiration. List, and I often recommend it when answer- We are all glad to see TUG back accomplishing ing questions. But his Visual LATEX FAQ made a things in our community. Last summer’s conference bigger impression on me because the first time I saw was delightful. We have, with our friends in GUST, it, I was floored. This idea is so compelling that every prospect of another wonderful meeting in a few of course the document needs to be made, but how months. And, we are optimistic about our chances come I never thought of anything like it? A brilliant for a prestigious conference venue in 2018. idea just seems obvious in hindsight. As usual, Dave Positive things are of course also happening out- does a great job with an interesting subject. See side of TUG. I am particularly cheered by the emer- tug.org/interviews/pakin.html. gence of online sites for using TEX and LATEX. As a There are also new book reviews. Boris Veyts- college teacher, I would like to see more undergradu- man looks at The Noblest Roman: A History of ates turned on to TEX and these sites significantly the Centaur Types of Bruce Rogers by Jerry Kelly lower the barrier to entry.

President’s note 4 TUGboat, Volume 38 (2017), No. 1

Finally, to finish my time writing this column, pairing. Why are we going on the web? Because I ask your indulgence to state a personal opinion. that’s the only way to do the needed activity (for All is not roses. TUG’s slow but steady loss of instance, to have the computer simulate a thousand members is a worry. Others may not agree but I samples, each consisting of flipping a coin a hundred perceive that it is in part a reflection of a larger prob- times). Then why are we going back to a book? Be- lem, decreased use. For instance, among colleagues cause web pages in browsers do not succeed as texts, at my school TEX is no longer the go-to, even for at least as they are today constituted, at least in part semi-formal mathematical documents such as course because they are not typographically good enough. exams. Part of this decrease comes from users want- Despite the advantages of web pages — hyperlinks, ing things that they have trouble getting with TEX searchable text, etc. — the elements of composition and so they shift to reaching first for other tools. that have developed over centuries, the elements that Everyone here knows that the TEX family pro- TEX does so well, are critical to making the text us- grams set a standard. They have made it possible able, to making the material easily comprehensible, for users who have not spent years being trained and current pages and browsers do not do that well in printing, but instead are simply reasonably com- enough. petent with the programs, to produce documents Do TEX users have a way to do best-of-both? of professional quality, especially for mathematical In the PDF viewer category, the standard is Acrobat text. And they have done it while maintaining the Reader. It has high quality output and promises an advantages of being markup-based and of being Free embedded JavaScript interpreter and reflowing text, software. TEX continues in many ways to set the but it doesn’t do that across platforms. Among active standard; the work of Knuth, and of others in our formats, besides a browser the leading freely-usable community, remains a milestone accomplishment. one is Jupyter notebooks. They are very interesting But in acknowledging the milestone we must but have no claims to first-class typography, to being also acknowledge that the work continues. One of able to produce professional-quality output. TUG’s goals1 is “To foster innovation in high-quality Now, readers of TUGboat know that a great electronic document preparation.” And users want deal of very good work is being done on many of innovation. We have had our idea of documents the issues I’ve named. I’ll mention the LuaTEX and widened, in many cases by what browsers give us, or LATEX3 efforts as admirable examples and there are even word processors. We want a variety of non-text others. Indeed, some of the things I’ve mentioned are elements, including video and audio. We also want to possible today, but often even those can be done only simply include many more of them, so that the model in ways that are ungainly, that require knowledge of of floating occasional figures is stretched beyond a variety of technologies, that do not work across all its usefulness. We want reflowing text, including major platforms, or that are a hack that we cannot high quality line breaking, even if our content is reasonably expect to still work in a decade. mathematics. I don’t have a solution. But I do have this We also want documents that are active. I am of- column, this one last time, and I will use it to make ten asked about including interactive such as a request: the next time that you see a document zoom-in in Calculus, in both 2D and 3D. on the web that wows you, ask yourself whether A colleague asked about a textbook for a topic that this could be done today with the TEX family, by requires the most current information, mathematics a reasonably capable user. To the extent that the for social justice, so that the document must update answer is “yes” we as a community are doing great. itself from the web with the latest statistics, includ- But where the answer is “no”, I hope that we ing changing its graphs to reflect those facts, not just will see that as a challenge, and will work together to at compile time but at run time. And, I am writing make them do-able. Then TEX will retain its place as a document on computability in which I want to a leading tool for creating the best documents. The embed a Scheme interpreter, so that students can work that we’ve done will continue to move forward. run code. And I shall enjoy that, from the relative calm Here is an example that is relatively mainstream. of being an ex-President. My department teaches from a statistics text where doing the homework requires that students leave the ⋄ Jim Hefferon text for a JavaScript-heavy web site, and then return Saint Michael’s College to the book for the next exercise. It is an awkward jhefferon (at) smcvt dot edu

1 tug.org/aims_ben.html

Jim Hefferon TUGboat, Volume 38 (2017), No. 1 5

Editorial comments extent, this is subjective, and what is helpful for one person will not necessarily be effective for another. Barbara Beeton There are just a few tutorials listed on the TUG 3 A iTEX lives! website. While the basics of LTEX are stable, there are always new developments worth sharing — tuto- (ding-ding!)1 A communication from Don Knuth rials can be instructive for both beginners and more reports that his sister gave him “a curious Christmas advanced users. present”. Gift Republic Ltd. has a gimmick to offer a Prodded by a suggestion that this might be a previously nameless star to customers, and allow the useful area to explore, I decided to review some of customer to give it an unofficial name. According to what is now available. the promo lit, I admit to a strong bias in this area, based on The chosen star name will not necessarily be decades of experience assisting authors in prepar- recognised by any scientific organisation or by ing manuscripts for publication by the AMS, and astronomers and Gift Republic can accept no answering questions on various TEX forums. I am liability for this. Star names are published in not encouraged by much of what is found on the the Gift Republic Star Registry which is stored web. For example, the first two introductory tuto- in a secure location. A record of the Registry rials I sampled were well produced and organized is periodically submitted to the British Library logically, but they both recommended using a dou- to ensure public accessibility and preservation. ble to start a new line of text. Prejudice 2 The star chosen for Don has the AGASC_ID against this practice is not just personal bias; the of 29897992; its coordinates are 9h 23m 46.4s, learners are being taught some things that will get 1◦ 12′ 49.6′′. them in trouble later on. These particular examples had many thousands of views reported, and favor- That (appropriately) puts it in the constellation able comments, but in my opinion they should not Hydra, near the ‘head’ end — roughly midway be recommended unconditionally, which is what I between the serpent’s head and the constella- would hope for, for presentations listed by TUG. tion Sextans. Another example of a really good idea, but Its magnitude is 12.9. (That’s pretty dim, one that needs work, is the LAT X Wikibook, en. but it surely would be a lot brighter if we could E .org/wiki/LaTeX. Like the tutorials, get closer.) video and audio, this includes material does not I have no idea of the estimated distance from exemplify “best practices”. The Wikibook is being Earth to iTeX. But it’s probably pretty large, worked on, but progress is slow. and that might explain why I haven’t seen any It would certainly be welcome to have more good implementations yet. tutorials listed on the TUG website. If someone out Are there any astronomers in the audience? If so, we there would be interested in reviewing what is avail- invite confirmation of the name. able, please let us know. Like book reviews, which Don concluded his message with this postscript: are both published here in TUGboat and posted on “Maybe there’s even a computer scientist in iTeX’s the TUG website, such exposure can (we hope) be a solar system who has given the name ‘iTeX’ to our positive incentive for improved instruction. sun. . . ” [The recent announcement of a star, only 40 The Go fonts light years away, with seven approximately earth- A family of fonts commissioned by the Go program- sized planets, leads one to think that this could even ming language project has been developed by the be a possibility, however remote.] Bigelow & Holmes font foundry. The family (called “Go”) includes proportional and fixed width faces LAT X tutorials E in normal, bold and italic renderings. These fonts Searching with for “LATEX tutorial” produces are particularly well adapted for use in displaying the result “About 11,700,000 results (0.42 seconds)”. program code, with “ characters easily This is rather overwhelming. How is it possible to distinguishable and operators lined up and placed know what is current, demonstrates best practices, consistently.” They are licensed under the same open and presents material in a logical order? To some source license as the rest of the Go project’s software.

1 zeeba.tv/tug-2010/an-earthshaking-announcement 3 tug.org/begin.html#doc and 2 AGASC stands for the AXAF (Chandra) Guide and tug.org/interest.html#latextutorials with related Acquisition Star Catalog. material in the surrounding sections. 6 TUGboat, Volume 38 (2017), No. 1

The announcement, made last November, ap- renaming to conform to current PostScript charac- pears at https://blog.golang.org/go-fonts. ter naming. The “replacement” character LATEX support was announced shortly thereafter (U+FFFD, a reversed out of a black as the gofonts package, which includes both font ) is also being added. subfamilies under the names GoSans and GoMono; On a related note, “Go” is not the first font to the package is available from CTAN. be named after a programming language. Adrian Chuck Bigelow reports that the Go fonts work Frutiger designed a font named “Algol” to be used in well with fonts a book about the Algol language, published in 1963.4 because they have the same x-heights and sim- This was a one-off creation in phototype, and has ilar weights as Lucida, although width metrics been long out of production. Jacques André, who are like those of Helvetica and . That’s be- told Chuck about this type, wishes someone would cause the Go fonts were derived from the Luxi make a digital version. Any takers? fonts, which were derived from Lucida fonts. METAFONT at 32 The Go proportional fonts are sans , especially The 25 anniversary of METAFONT was celebrated appropriate for screen displays at small sizes. They last year, but I failed to mention it at the time. Well, are “humanist” in style, “derived from Humanist better late than never. handwriting and early fonts of the Italian Renais- As might be expected, Don Knuth presented a sance, and still show subtle traces of pen-written cal- retrospective, with slides, at the San Francisco Pub- ligraphy.” This is in contrast to the “grotesque” style lic Library. The talk was part of the “Type@Cooper characteristic of fonts like Helvetica. (An early 19th West” series, and the video is posted at vimeo.com/ century sans serif typeface was named “Grotesque”, 184705112. The video is also posted at www.youtube. and the name became generic.) The monospace fonts com/watch?v=0LR_lBEy7qU. carry slab serifs. The slides from the talk can be found on Don’s The italic form of the Go fonts is an oblique web page: www-cs-faculty.stanford.edu/~knuth/ version of the roman, with the notable exception MFtalk.. a that the is single story, redesigned to harmonize Among the photographs are pictures of everyone b with the bowl shapes of and similarly shaped letters, who worked on METAFONT, font and grad- as shown in this sample. uate students alike. There’s a particularly nice photo of Don with Hermann Zapf and Matthew Carter; an- abdgpq other shows the main “team”: Don with Richard abdgpq Southall and Arthur Samuel as well as the students — abdgpq how young they look! abdgpq From TUG’16, more from Joe Clark abdgpq Two adjuncts to Joe Clark’s presentation at TUG 2016 are posted on his web site: abdgpq blog.fawny.org/2016/11/07/tug2016/ joeclark.org/appearances/tug/ The Go Mono fonts are eminently suitable for rendering computer code, as The video from the conference is also up: zeeba.tv/type-and-tiles-on-the-ttc/ [they] conform to the DIN 1450 standard by The blog post contains Clark’s reactions to the differentiating zero from capital O; numeral 1 TUG contingent that took up his invitation to tour from capital I (eye) and lowercase l (ell); nu- some of the subway stops discussed in his talk. It also meral 5 from capital S; and numeral 8 from contains photos that are not in the published article. capital B. The shapes of bowls of b d p q follow And finally, it contains his admission that, after the the natural asymmetries of legible Renaissance TUGboat editors had “converted [it] to some version handwriting, aiding differentiation and reduc- of TeX” he simply edited the TeX file, “despite my ing confusion. never having done that before. A reason why TeX is The cited blog entry provides more complete infor- still in use is because it actually works.” mation. ⋄ Late addition from Chuck: An upgrade of the Go Barbara Beeton tugboat (at) tug dot org fonts is (already) in the making. It consists mostly of a bug fix to the chart/box characters, plus some 4 https://tinyurl.com/frutiger-algol TUGboat, Volume 38 (2017), No. 1 7

Interview: Scott Pakin DW : Can you say something about the kinds of computing you do at LANL? David Walden SP: At LANL, I’ve worked on a variety of research projects including tools for analyzing and improving the performance of supercomputers and the applica- tions that run on them. I’m currently having great fun experimenting with a supercomputer we just bought from D-Wave Systems, Inc., that exploits quantum effects to solve a specific type of optimiza- tion problem. Think of TEX’s -building algorithm, for example: It tries to find the best way to break into lines to minimize the total penalty for awkward spacing. The research ques- tion I’m currently investigating is if it’s possible to transform more-or-less ordinary looking computer programs into optimization problems suitable for Scott Pakin has developed many LATEX packages and running on a D-Wave system. other TEX-related tools. DW : How did you first come in contact with TEX? Dave Walden, interviewer: Please tell me a bit SP: I began using the WordPerfect about yourself. (under DOS) to write documents. (WordStar was Scott Pakin, interviewee: I’m 46 years old and already losing popularity, and hadn’t have lived my whole life in the United States. I grew yet caught on.) In my opinion, the best thing about up in Chicago, Illinois (population: 2,700,000) and, WordPerfect was its “reveal codes” feature, which let after graduating high school, moved repeatedly to one see the formatted document — calling it WYSI- successively smaller cities and towns: Pittsburgh, WYG would be overly generous — and the underlying Pennsylvania (population: 304,000) for my under- markup (begin bold, end bold, begin italic, end italic, graduate degree at Carnegie Mellon University, then etc.) in a split-screen layout. Both were editable, but Champaign, Illinois (population: 232,000) for my I really liked the precise control provided by the Master’s and PhD at the University of Illinois at markup pane so I favored using that. Urbana-Champaign, and finally to Los Alamos, New I hadn’t heard about TEX until college, where a Mexico (population: 18,000) to work at Los Alamos math-major friend who had recently learned LATEX National Laboratory (LANL), where I’m still em- was excitedly talking about it. However, I didn’t ployed. bother trying it out myself at the time. Once I I knew from an early age I wanted to work with began writing research papers in graduate school, I computers. I started programming in BASIC at age 9 took the time to read through Lamport’s book (first on an obscure computer at my parents’ company: an edition, of course) and learn LATEX. Having been SDS 420 from Scientific Data Systems. (It used a weaned on WordPerfect’s “reveal codes” feature, I 1 MHz 6502 processor and took 8-inch floppy disks, found LATEX very natural to use. which contained maybe a hundred kilobytes of ca- Like most LATEX newcomers, I managed to slop- pacity.) When I was in high school, I wrote, in pily hack my way through whatever typesetting chal- 8088 assembly language, a screen-dump utility called lenges I encountered. It wasn’t until I started writing DumpHP that printed a screen of CGA graphics to an my dissertation that I decided to spend some effort HP LaserJet printer. A small company named Orbit on really learning how LATEX works, how to use it Enterprises licensed the code from me, incorporated more efficiently, and how to more precisely control it into their commercial LaserJet setup program, its behavior. While doing so, I picked up TEX and SetHP, and paid me royalties. Over the next few LATEX programming aspects and even wrote my first years, I made US$3000 in royalties — not bad for a LATEX package, bytefield, which I used in my dis- teenager. I had no trouble deciding I wanted to get sertation. a bachelor’s, master’s, and eventually a doctoral de- DW gree in Computer Science. Along the way, I realized I : What was your dissertation topic? especially enjoyed working with novel hardware and SP: My PhD thesis considered processors distrib- high-performance computers, and LANL has some of uted over a high-speed network working together to the world’s fastest. perform a computation fast. I presented an approach

Interview: Scott Pakin 8 TUGboat, Volume 38 (2017), No. 1

for robustly synchronizing large numbers of such pro- conflicting elements in the same document. The sym- cessors such that a few laggards don’t necessarily bol list, which tabulates a vast number of symbols slow everyone else down. that LATEX documents can typeset, started with rel- A 1 atively few packages — base L TEX, AMS, St Mary’s DW : You have a bunch of useful tools at CTAN . Road, wasy — so it began being reasonably man- Trying to grasp what is there, I can divide them ageable. However, each new symbol package that into several categories: LAT X packages; LAT X meta- E E gets added brings a new source of woe. Perhaps things (e.g., ctanify, dtxtut, bundledoc); Post- the biggest headache is that TEX has a hard-wired Script, EPS, and PDF related tools; tools for moving limit of 16 math alphabets. I typically have to access fonts into the T X world (including some Metafont E math fonts as if they were text fonts in order not to aspects), and combining T X with other languages E overflow that limit. Even worse, I’ve recently been ( and Python). On your own website2 you catego- encountering newer symbol packages that require rize things as packages, script, and documents. What LuaLAT X or X LAT X, while some older packages motivated you to create all these different tools? E E E break when using those TEX engines. Each new re- A SP: Most of my L TEX packages and programs were lease of some symbol package seems to introduce a written to satisfy some typesetting need I had. Then, new conflict with some other package. As a result, figuring that others might have the same need, I the symbol list has become almost completely un- polished the code, documented it, and released it to maintainable. I’ve begun work on a complete rewrite CTAN. that should be robust to those issues, but that effort It’s always interesting to see which packages is slow-going and is still many years away from being and programs have really caught on, and which usable. quickly faded into obscurity. In fact, even I get surprised when I look over my list of CTAN contri- DW : Please tell me your thoughts on the overall butions and find things I haven’t used in years and TEX infrastructure and whether you think it can be barely even remember writing. From what I can made better given practical limitations. tell, my savetrees package, which tries to squeeze A SP:TEX and L TEX have a thriving infrastructure a document into as few pages as possible, is wildly in terms of the sheer number of readily available popular with researchers trying to stay within a man- A L TEX packages and the great strides being made in dated page limit for publication; and attachfile, recent years enhancing the underlying TEX engine which facilitates embedding arbitrary files within a with improved support for system fonts and improved document, and hyperxmp, which lets one include a automation using Lua. large amount of metadata in a document, also seem A practical limitation is getting new users to to get a fair amount of attention. On the other hand, adopt the TEX ecosystem. Despite being only four spverbatim, which enables verbatim text to wrap years older than Microsoft Word, TEX has a far at spaces; listliketab, which typesets lists that more “old-school” feel to it. Yes, TEX installation arrange data in columns; and the newcommand script, has improved over the years; and yes, GUIs do which generates \newcommand templates for macros exist to simplify usage, obviate the need to learn with complex juxtapositions of required and optional control sequences, and provide word-processor-like arguments, apparently get little or no use. Heck, I A synchronous editing. However, (L)TEX’s lack of don’t think anyone has ever used dashrule, which integration is a huge shortcoming relative to a word draws dashed horizontal lines. processor. If a user wants to typeset a table in a DW : You may be too pessimistic about dashrule; particular form, does he/she use an ordinary tabular it’s recommended at http://tex.stackexchange. environment or load one or more of the array, com/a/125503 and is mentioned in many other places bigtabular, booktabs, btable, calls, colortab, on that website. colortbl, ctable, dcolumn, easytable, hvdashln, longtable, ltablex, makecell, mdwtab, multirow, DW A : Both the Visual L TEX FAQ and the Compre- polytable, sltables, stabular, supertabular, A hensive L TEX symbol list seem like they must have tables, tabls, tabu, tabularborder, tabularew, been enormous efforts. How have you gone about tabularht, tabularkv, tabularx, tabulary, creating each of these? threeparttable, threeparttablex, or xtab pack- SP: Indeed, the Visual LATEX FAQ required quite a ages? Even worse, many packages conflict with each bit of effort to create, and the Comprehensive LATEX other either explicitly (giving an error message) or Symbol List required substantially more. In both implicitly (screwing up some unrelated aspect of the cases, one big challenge was to incorporate mutually document in some hard-to-diagnose manner). Worse

David Walden TUGboat, Volume 38 (2017), No. 1 9

still, the set of conflicts can change from version to says the authors were able to get bytefield and version of any given package. PerlTEX to work without extra help. For PerlTEX, Another example of (LA)TEX’s lack of integration which lets users write LATEX macros in Perl, that’s relative to a word processor is that a word-processing especially encouraging. PerlTEX was extremely chal- document is stored in a single file that can easily lenging to develop and is therefore likely to be a lot be transmitted to colleagues. My bundledoc script more fragile than a typical LATEX tool. It requires helps with this on the LATEX side by bundling to- a lot of TEX trickery to process what could be con- gether all the separate document files, style files, sidered syntactically incorrect TEX but syntactically class files, graphics files, etc. into a single .tar or correct Perl from within TEX, and it takes a Com- .zip file, but usage is still a bit clunkier than what puter Science-y distributed-systems-style protocol to an integrated tool can provide. implement correct, two-way communication between Word processors have been improving their type- TEX and a Perl wrapper script given TEX’s limited setting quality, support for mathematics, support for ability to communicate with the outside world in a international scripts, logical structure, and other safe (i.e., not-\write18) and portable manner. It’s features that have traditionally lain in TEX’s wheel- great that PerlTEX works fine for Mertz and Slough house. For most users, word processors are good and that they were able to perform some interesting enough tools for the jobs they have. I think the and creative tasks with it. wrong approach is to try to turn (LA)TEX into a word processor. It lacks the foothold of, say, Microsoft DW : Do you still see a role for PerlTEX with LuaTEX Word and is unlikely ever to become a dominant form now available? of document interchange. Instead, (LA)T X infra- E SP: Not so much. LuaTEX deeply integrates Lua structure enhancements should focus on the system’s with the TEX engine while PerlTEX is more loosely core strengths: ease of making global, structural coupled. Consequently, there are things LuaTEX can changes to an entire document; ease of automation; do that PerlTEX can’t (e.g., directly manipulating and ready and convenient support for a variety of some of TEX’s internal representations). On the specialized typesetting requirements in areas such as other hand, I find PerlTEX’s \perlnewcommand and linguistics, mathematics, and natural sciences. \perlnewenvironment macros very convenient. Per- DW : Given you’ve built various PostScript, EPS, haps I should write a package that provides the anal- and PDF tools (such as purifyeps), do you have ogous \luanewcommand and \luanewenvironment thoughts on what might practically be done with macros . . . . (LA)TEX to make them more suitable for integrating with PDF et al.? DW : You’ve also developed lots of other tools, such SP: I guess I don’t have any grand vision for better as those listed on your personal website (readers: A see http://www.pakin.org/ scott/). Perhaps you integration of (L)TEX with the PDF world. That ~ also do not hesitate to build a new tool in the course said, native support for PDF/A-1a generation and 5 fully tagged PDF would be nice. The former guaran- of accomplishing your work at LANL . Can you speak tees a high degree of portability, and the latter facili- about tradeoff between (a) just doing what you have tates reflowing text on a tablet and improves mechan- to do to accomplish some primary task, and (b) first ical reading of a document to the vision-impaired. building a tool to help you with the primary task and then applying it to accomplish the task? DW : At the 2014 TUG annual conference in Port- land, Mertz, Slough and Van Cleave presented a SP: I write lots of tools, and I always learn some- paper3 that included a significant discussion of your thing new when I do. It’s always a good idea, though, bytefield package. Also, Mertz and Slough previ- to perform a task manually the first few times to 4 ously presented a lengthy discussion of your PerlTEX determine what aspects are suitable for generaliza- system. I am interested in how you feel about other tion and automation — and to convince yourself that people describing your work and whether they inter- the task is in fact something that gets performed acted with you as they wrote their papers. sufficiently often as to warrant building a tool for it. I suppose the following are a good set of questions SP: I’m always eager for people to use my tools. a tool-builder might ask himself before embarking It’s wonderful to know that I helped someone get the on developing a new tool or, in the of this typesetting they were looking for or automate some discussion, a new LAT X package: tedious task. E I was not contacted by the authors of the papers • Is the task sufficiently common as to warrant you cite above, but that’s probably a good sign; it building a tool for it?

Interview: Scott Pakin 10 TUGboat, Volume 38 (2017), No. 1

• Is the task sufficiently complex for users to be What’s a Professor of Neurology doing willing to install and learn a new tool rather A using LTEX? than perform the task manually? David B. Teplow, Ph.D. • Is the task sufficiently general for a tool to per- form it without having to be so parameterized Abstract that it becomes almost as difficult to learn and In the general biomedical and academic research use as it is to perform the task manually? communities, most people have never heard of LATEX. DW : Were any of these tools particularly more fun Students and professors in the humanities, social to work on? sciences, biological sciences, and clinical medicine who have heard of LAT X often don’t appreciate the SP: It’s hard to pick a single, most fun piece of E value of such a sophisticated and elegant typesetting LAT X development. PerlT X is the most sophisti- E E engine. Instead, as with most of the world, they cated LAT X-related tool I’ve ever created, and it was E succumb to the forces of the Dark Side (traditionally exciting when I finally got that to work. My three Microsoft Corporation) and use expensive, inflexible, standalone documents — The Comprehensive LAT X E closed source, and relatively primitive programs to Symbol List, The Visual LAT X FAQ, and How to E compose documents. They also suffer the continuing Package Your LAT X Package — all required a fair E frustrations of doing so. I discuss here my own amount of thought to produce, and I learned quite a journey out of the darkness and into the light of bit from each one. I guess the common thread is that 1 LAT X. tools, packages, and documents that were intellectu- E ally challenging to develop are more rewarding than 1 Introduction those that required only straightforward coding. My first exposure to document creation, like most DW : Thank you for taking the time to participate in in my generation, was in English class in elementary this interview. You are working on a lot of fascinating school. Documents all were hand written and one things. was graded on “penmanship.” As one got older, one was expected to use a typewriter to produce pro- [Interview completed 2017-02-05] fessional looking documents. It was not until the 80s, with the introduction of the IBM PC (personal Links computer) in 1981 and the Apple 128K 1 https://www.ctan.org/author/pakin 2 in 1984, that the average consumer could compose http://www.pakin.org/~scott/latex-stuff.html 3 https://www.tug.org/TUGboat/tb35-2/tb110mertz.pdf documents electronically and print them using line 4 https://www.tug.org/TUGboat/tb28-3/tb90mertz.pdf printers or dot matrix devices. I remember my ex- 5 https://ccsweb.lanl.gov/~pakin/ citement running WordPerfect or WordStar on my IBM PC and MacWrite on my Macintosh Plus (with 1 ⋄ David Walden MB of memory and a 20 MB disk drive large enough http://tug.org/interviews to use as a crane counterweight). One actually could “program” how individual letters, sentences, para- graphs, or document sections should look. This was done using keyboard commands embedded in the text. WYSIWYG GUIs came later and were seen as revolutionary. One no longer had to guess how their typescript would look. It was right there in front of you on the screen. Development of personal computers and soft- ware has continued during the almost four decades since a vision for personal computing occurred at IBM. The most important software principle was “do more and make it easier.” Unfortunately,

1 The reader is cautioned that what follows is my personal perspective on LATEX. This perspective is not meant to be, nor is it, a definitive review of LATEX and its uses. I ask the indulgence of TUGboat readers if they find any inaccuracies in this article and would be grateful if these inaccuracies were brought to my attention. TUGboat, Volume 38 (2017), No. 1 11

and particularly in the case of Microsoft Word, do- tremendous attention to detail and many, many it- ing more and making it easier actually meant “make erations during initial manuscript creation and the it more complicated, inflexible, and buggy.” When peer review process. Authors must use the same the Unix-based Mac OS X came to text processing platform during this process. It thus the Macintosh platform with its protected memory appeared that either my learned colleague and his and preemptive multitasking , software group would have to learn Word or I would have to programming errors only crashed the application in learn LATEX. use, not the entire computer and not that often. The I chose to be the one to learn a new document exception, of course, was Microsoft Word, which to preparation system. I did so for a number of reasons, this day can be counted on to crash at the least some practical and some personal. The practical rea- opportune moments, often making one’s prior work son is that professors tend to become ossified as they unrecoverable. age, which means that change can be difficult. It As a professor, I had to continually compose would be easier for me, as a new Assistant Professor, documents, be they notes, letters, grant applications, to learn a new system than it would for my senior or manuscripts to be published in academic journals. colleague, a distinguished Professor of Physics. The Text processing capability was mandatory and Word second reason was my high regard for the academic was the de facto standard for this purpose. This acumen of most physicists, which suggested that the meant that year after year, decade after decade, I, tools they used in their research, including those like others, had to suffer the frustrations inherent in for document preparation, likely would be powerful trying to get text processing “bloatware” to do what and elegant. As I mentioned above, the introduction one wanted it to do. These frustrations included, of the Unix-based Mac OS X operating system made among many, application crashes, the well known the Mac platform remarkably powerful because now “Word has insufficient memory” error messages when one could take advantage of the huge reservoir of one tries to save a file, difficulties embedding images expertise and software associated with Unix, which and maintaining their location during subsequent of course included LATEX. I quickly learned that the editing, problems formatting tables, bizarre place- LATEX source files were simple ASCII text files. I ment of equations constructed using MathType or could work on my Mac, either inside a LATEX GUI or Equation Editor, and an inability to stop the pro- in Terminal, while my colleagues could use their PCs gram from “helping” you by automatically changing and we could easily exchange files and be certain they formatting, word spelling, and other aspects of doc- would compile,2 regardless of platform. This elimi- ument creation. nated the continuing problem of format alterations These computing and composition experiences in Word files caused by file movement between Mac made clear a desperate need for a better method of and PC platforms. I was tremendously impressed document composition. Enter LATEX. with the professional layouts of our manuscript af- ter source file compilation. For the first time in my A 2 How I met LTEX and why I fell in love academic life, I could create manuscripts that, es- with it sentially, were already typeset. They were beautiful. My first exposure to LATEX occurred in the context Finally, from the perspective of a science nerd, I of a collaborative effort to understand the mechanis- found the prospect of learning what essentially is a tic bases of Alzheimer’s disease. The collaboration programming language to be very exciting. integrated biochemical and computational studies of As I became more adept at using LATEX, I re- protein aggregation. My laboratory carried out the alized that it provided many capabilities that were biochemistry work while the computational studies superior to those of standard word processing pro- were done by physicists. When our studies were com- grams. One of the biggest headaches in the composi- plete, we discussed how and where to publish our tion of scientific manuscripts is the need to change results. I had assumed that our manuscript would figure and table numbers if such items are added be composed using Word, which I suggested to my or deleted from manuscript drafts. One can do this physicist colleagues. To my surprise, the leader of manually if one is particularly attentive to detail, the physics group, a world authority in the field of or automatically using search and replace functions. statistical physics, told me that he did not know However, this is time consuming and often results what Microsoft Word was! All word processing in in multiple figures or tables having the same num- his group was done using LATEX, which I had never ber, which is confusing — especially to peer reviewers heard of. The composition and publishing of scien- tific manuscripts is an arduous process that requires 2 Assuming no trivial coding errors existed.

What’s a Professor of Neurology doing using LATEX? 12 TUGboat, Volume 38 (2017), No. 1

and editors who decide if your manuscript will be vexing, stopping the program from adding new text accepted for publication. Enter the LATEX \label{} to the end of an existing list. The fine control of command! What an easy and elegant way to en- the list environments in LATEX eliminates these prob- sure that any editorial changes result in automatic, lems. Similar advantages exist with respect to table accurate renumbering of figures and tables. creation. I am an experienced Word user (unfortu- I was equally, if not more, delighted by BibTEX, nately), but I still can’t figure out how to format and especially after struggling with EndNote for so many align tables in a reasonable amount of time. decades. I could now create a single library and for- I find that figure and caption placement can be mat my bibliography using pre-existing bibliography problems both for word processor and LATEX users. style .bst files — no more hassles with constantly One also encounters figures that mysteriously change having to edit EndNote output styles. I could edit their positions within a document. In Word, these my library in any or use one of the many problems are exacerbated by the fact that figures reference management programs available. I’ve used and captions are entered independently. JabRef and BibDesk, among others, and find JabRef A particularly useful. 3 How I learned LTEX The use of pre-existing class and style files il- As we all know, LATEX, in essence, is a program- lustrates the power, ease of use, and time efficiency ming language. Its code may be less complicated 3 of the LATEX platform. If I am required to use a than C++, Fortran, Objective-C et al., but it nev- particular class for a publication, I simply download ertheless requires the user to create source code that it from the web or get it from the publisher (as I instructs a compiler how to produce a properly ren- did for the ltugboat class used for this article). I dered document. One of the beauties of LATEX is can compose my source file without any concerns that a new user need not know anything to begin about it being properly rendered. Of course, as TUG- using LATEX other than how to open a . file in a boat readers well know, and as neophyte LATEX users text processor. This was how I began the learning rapidly learn, TEX and its derivatives are designed to process, by simply editing the text within the source enable writers to focus on the content of their work files created by my collaborators. It was easy to as opposed to its formatting. I no longer have to learn how to encode underlined, italicized, or bolded spend time carefully reading document formatting text. After all, how hard is it to “escape” the obvious instructions from a publisher or agency to whom I “bf” abbreviation for bold font and type \bf?4 In am submitting a grant application and then convert- the process of assimilating this simple syntactical ing these instructions into an acceptably formatted information, one begins to get a sense of how LATEX Word document. The class and style files do it all programming works and this sense then provides a for me. framework for adding new skills to one’s repertoire. Experienced computer users know that it is most “Environments” then are encountered that require time efficient to operate your computer by leaving learning how they are parameterized and about what your fingers on the keyboard, as opposed to con- can and cannot be done within them. At this point, stantly having to manipulate a mouse or other input the neophyte LATEX user needs to begin studying the device. This is no more evident than when one is language more deeply. creating mathematical formulas. Although Equa- I found myself doing what any self-respecting tion Editor and MathType are useful point-and-click academic would — I bought . The first two are formula creation applications that interface seam- well known in the TUG community, namely Guide to lessly with Word, one must invoke either one and LATEX by Kopka and Daly and The LATEX Compan- then click, click, click . . . to create the formula, which ion by Mittelbach and Goossens. These two volumes then is inserted, often with bizarre vertical alignment became my “go to” references for questions. I also within text lines, into the document. In addition, it found First Steps in LATEX by Grätzer, LATEX Line is common to find that these formulas are rendered by Line by Diller, and Learning LATEX by Griffiths improperly once the file has been typeset by a pub- and Higham to be useful. Scientific publications usu- lisher. When I create formulas in LATEX, I can do ally contain tables and figures. In the beginning, as so without lifting my hands off the keyboard and I began creating my own .tex files, it was simple to I do not experience any subsequent formatting or copy and paste a figure environment from a file of rendering errors. my collaborators and just insert the path to my own Anyone who has tried to create lists using stan- 3 Including Fortran 4, which I used a half century ago! dard word processors likely has encountered problems 4 Interestingly and ironically, I just now learned how to with indentation, nesting of list elements, and most escape the backslash so all the following text was not bold!

David Teplow TUGboat, Volume 38 (2017), No. 1 13

figure. This got me started. I also cut and paste Mac and MacOS, PC and Windows, terminals and table environments. However, to gain more expertise ⋆nix). This typically involved a tex→dvi→pdf com- in managing these environments, I added Typesetting pilation and conversion process. One also could Tables with LATEX by Voß, and The LATEX Graph- produce output files in other formats, including post- ics Companion by Goossens, Rahtz, and Mittelbach, script, html, or rtf, but pdf was the most useful for to my “go to” references. These days, however, I collaborations and submission of manuscripts to most rarely consult these references, not because they are journals. These processes were not onerous in na- uninformative, but because so much detailed infor- ture, but they were burdensome and time-consuming. mation is available on the web. I routinely access For those used to WYSIWYG document composition, tex.stackexchange if I need help, download pack- this need to first compile the source code before see- age manuals, or access other sources found through ing the finished work product was a bit off-putting. web searches. It’s remarkable how many preamble However, with the advent of three-panel application lines, environments, minipage formats, and other interfaces (file directory, source file, rendered output) bits of code one can simply cut from web pages and and automatic file compilation, users can immedi- paste into their source file to achieve a particular ately see the results of their work. This has been an typesetting goal without any pre facto syntactical important development because it has streamlined knowledge. the document preparation process for the average I find “playing” with LATEXtobealotoffun. It’s computer user, eliminating the need to understand often a challenge to render and position text, figures, the source file→compiler→output file process. and tables in a specific way. I like trying different My initial LATEX front end was TeXShop, which things and seeing the output. I might switch between provided a simple, useful method for compiling source standard figure and wrapfigure environments, use files and viewing their output. As one who enjoys minipages, or try other methods to achieve a particu- determining if newly developed or updated applica- lar document rendering. The process of self-directed tions might offer an easier or more powerful user investigation provides rich rewards in terms of better experience, I also have used , TeXworks, understanding how LATEX works and how to ma- TeXnicle, Texpad, TeXstudio, and Latexian, as well nipulate output, as opposed to memorizing how to as web-based document creation and compilation en- perform a single task. One is able to develop an gines like Overleaf (formerly writeLaTeX) and Share- intuition that facilitates learning and accelerates the LaTeX. LYX is unique among these front ends in process of problem solving. that its default document view hides the source code from the user and its interface looks more like the 4 HowIuseLATEX icon-based interfaces of non-TEX-based word proces- “If you got a terminal, you can use LATEX.” sors. It also requires the user to port the output file This certainly is true for those who are ⋆nix (Unix, to a different application (e.g., ) to et al.) savvy or love the command line. How- view the rendered output. I found this type of GUI ever, the majority of the world’s computer users to be an unhappy medium between the extremes of interact with their computers through GUIs. A ma- document preparation, i.e., using a terminal or using jor advance for the general LATEX community, one a standard word processor (e.g., Word). that made the use of these programs much more I am composing this document using Texpad, attractive to the average computer user, was the which is my current favorite. A helpful feature of introduction of GUI front ends to LATEX compilers. Texpad and other programs is their handling of com- Users were able to run LATEX by pointing and clicking pilation errors. Error and output logs are instantly with their mice. No knowledge of ⋆nix commands available for user review either within the main ap- and syntax were required. What was required, both plication window itself or by a simple click on an for command line users and GUI users, were multiple icon. In addition, the user is provided the means steps before a finished document could be viewed. to rapidly edit offending syntax simply by clicking For academicians, for whom extensive referencing on a particular error message in the message viewer, is required, the process included triple compilation which then moves the focus of the keyboard to the (LATEX→BibTEX→LATEX) so that references were offending line of code. This saves a lot of time during numbered correctly and a bibliography was created. the error correction process. Other features of these Multiple steps also were required to produce an out- front ends that are particularly useful are code com- put file that could be easily shared with others who pletion, flash bulb-like highlighting of beginning and might be relatively computer illiterate or worked us- ending characters (e.g., curly braces), and syntax ing different platforms and operating systems (e.g., highlighting.

What’s a Professor of Neurology doing using LATEX? 14 TUGboat, Volume 38 (2017), No. 1

To further facilitate document creation, and to other data entry methods, as well as supplant many deal with the progressive memory loss experienced aspects of application and system control.6 by Professor Emeriti, I also create a variety of pre- Where then do these facts leave the LATEX com- ambles, tables, and figure environments and store munity as a whole? I suggest, in the future, that them in a special directory. I then can simply cut and the community will continue to thrive, as it is now. paste the code into new documents without having to There are myriad reasons for this, many of which remember any special syntax that I might have used have been discussed above. The most important in the past. For example, as a professor, I am asked of these is that for many applications, especially in to compose many different kinds of recommendation mathematics, physics, and , LATEX is a letters, including those for undergraduates, graduate superior document preparation system.7 Given this students, postdoctoral fellows, different professorial fact, those who choose to prepare their own docu- ranks, etc. To do so, I have created a directory in ments using LATEX, but who also work in the larger which boilerplate letters for each type of recommen- world of Word and other document preparation ap- dation exist. When I need a template, I can rapidly plications, must implement strategies for interfacing access these pre-made files. This has made compo- these two “worlds.” sition of new letters trivial. The same strategy is The specific strategies depend on a number of used for grant application preambles, be they for the factors, the most important of which are how the National Science Foundation, the National Institutes master document is to be prepared and what the of Health, or other agencies. final output file format must be. The first factor depends primarily on whether document preparation A A 5 Using LTEX in a non-LTEX world is done by a single person or in the context of a Readers of this article already know, and likely much collaboration. The second generally is dictated by better than I, how powerful, flexible, and efficient the requirements of the end-user of the document, LATEX is. These are some of the reasons we choose e.g., a publisher. Publishers specify the file types to use this document preparation system. Unfortu- accepted for publication, which increasingly include nately, the rest of the world either is not aware of PDF. The beauty of LATEX is the facile compilation the existence of LATEX or is precluded from using it of the source code as a PDF file, which renders moot due to restrictions on how document preparation is the original document preparation system. This PDF to be done. The latter restriction usually is imposed output also circumvents problems with providing on employees to ensure company-wide consistency documents to those working with computer hardware in document preparation, which is a reasonable con- or OSs different from one’s own. cern. Establishing a standard application for docu- If manuscripts can be submitted for publication ment preparation allows diverse groups of people to using one of many file types, e.g., .tex, .doc, or seamlessly exchange documents.5 .docx, and the manuscripts present collaborative Microsoft Word has become the de facto stan- work, the decision about source file type can be dard document preparation application. There are pre-determined among collaborators, usually using a many reasons for this, all of which can be debated metric based on ease of group composition. Practical among computer users, businesses, the general pub- considerations also may factor into this decision. For lic, educators, sociologists et al., but one of the key example, if the contributing author, the one who is reasons, vis-à-vis why LATEX is not a standard, is responsible for the actual compilation of the man- that Word uses a GUI as opposed to the command uscript and its submission for publication, is not A line interface of LATEX. This makes Word easier to familiar with LTEX, then Word often becomes the learn for the vast majority of computer users, who default document preparation application. However, are not capable of using the command line for doc- if I am the contributing author and I want to prepare ument preparation or simply may not want to do the manuscript using LATEX, I can do so by adding so. As a realist, I do not expect this situation to files from my collaborators into my .tex source file. change. I also think it unlikely that proselytizing for The easiest way to do this is to ask for .txt files. Sur- LATEX converts will be particularly effective, espe- prisingly, I often encounter collaborators who don’t cially in a world in which OUIs (“oral user interfaces”) appear destined to supplant keyboard, mouse, and 6 In fact, there is no reason, theoretically, why such OUIs could not be implemented for source file creation in LATEX. 5 7 Of course, though seamless in theory, cross-platform It should be noted that LATEX is not restricted to these (MacOS vs. Windows) document preparation and management fields. It has been used effectively in a broad range of fields, using Microsoft Word (or PowerPoint) remains problematic including philosophy, economics, theology, the law, and neu- and vexing in practice. rology.

David Teplow TUGboat, Volume 38 (2017), No. 1 15

know how to create .txt files and instead provide references downloaded from the web, especially in .doc or .rtf files. These then must be converted the case of EndNote. I automatically examine each into plain text. downloaded reference to ensure that the bibliography Conversion can be done automatically using a created by BibTEX or Endnote is an exact rendering variety of programs or web-based conversion utilities, of the reference as originally published. After hav- although I have found that the fidelity of conversion ing done this for so many decades, this process has often is lacking. Post-conversion processing of the re- become almost autonomic. sulting text file thus is required to remove hidden or The fundamental principle guiding my cross- special characters that create serious or fatal errors world collaborations is “LATEX takes anything and during LATEX compilation. I have found that utilities Word takes nothing.” This means that if a manu- that clean up text, e.g., by removing extra spaces, script is composed in LATEX, I can take content from carriage returns, tabs, or forwarding characters, are essentially any file type provided by a collaborator especially useful in this regard. Once clean, I then and incorporate it into my source file. In contrast, if execute a second post-conversion process, usually manuscript composition is to be done in Word, then using global find-and-replace functions, to make sure, LATEX is not used at all. among other things, that quotation marks will be rendered properly (i.e., converting “ and ” into `` and 6 Concluding remarks ’’), percentage symbols are escaped (% to \%), Greek Among the community of computer users who are characters are encoded properly, and one-, two-, and free to choose their hardware, software, and style of three-em will appear correctly. These conver- use, adherence to their choices may have the flavor of sions can be done quite rapidly, after which the plain religious fanaticism. This long has been true in the text can be pasted into the source file. Additional Mac community, not even considering Apple’s efforts edits, which usually are minor, then are done in the to portray Mac users as “cool,” “with it,” or “differ- source file after compilation if error messages are ent.” I am a long-time Mac fanatic, not because of displayed or rendering problems exist. such superficial characterizations but rather because “Cross-world” bibliography creation and man- of my recognition of a superior operating system agement is a bit more cumbersome, if one defines and how it makes my computational efforts easier cumbersome as an author needing more than one and more efficient. My extensive experience with library. I maintain two comprehensive reference li- document processing systems has led me to the same braries, one in .bib format and one in EndNote recognition with respect to LATEX. I look forward to format (.enlp). In collaborative work in LATEX, a time when this recognition will be universal. the collaborators agree about whose library will be used and simply upload it to a shared directory con- Acknowledgement taining the manuscript source file. This is trivial. The author gratefully acknowledges Dr. Eric Hayden If I must incorporate citation markers from Word (UCLA) for helpful comments on this manuscript. documents, regardless of their provenance (Word, , Mendeley), then I do so manually. This ⋄ David B. Teplow, Ph.D. requires a significant amount of program switching Professor Emeritus A ↔ (LTEX JabRef), but with the powerful search ca- Department of Neurology pabilities of library management software, and pa- David Geffen School of Medicine at UCLA tience, the process is straightforward. It should be 635 Charles E. Young Drive South mentioned that neither world is free of typographical Los Angeles, CA 90095 problems within rendered bibliographies. Surpris- USA ingly, special symbols, capitalizations, and especially dteplow (at) mednet dot ucla dot edu Greek characters, are usually not coded properly in http://teplowlab.neurology.ucla.edu/

What’s a Professor of Neurology doing using LATEX? 16 TUGboat, Volume 38 (2017), No. 1

Typographers’ Inn in page layout and like the seasons: while many journals do still use cen- Peter Flynn tered titling in the body font, many do not, opting Layouts instead for anything from flush-left sans-serif bold to a shaded block rotated 90◦ positioned at the left- The three main default document classes in LAT X E hand edge (as in Figure 2). (book, report, and article) implement a consistent page layout with conservative features: • centered title block or title page; March 10, 2017 • wide set and wide margins; The Communications of the TEX Users Group TUGboat Volume 38, Number 1, 2017 • centered, narrower Abstract in smaller type, Layo

indented; Peter Flynn The three main default document classes in LATEX (book, • report, and article) implement a consistent page layout with justified text; conservative features: • centered title block or title page; indented, unspaced paragraphs; wide set and wide margins; centered, narrower Abstract in smaller type, indented; • justified text; bold sectional divisions, widely-spaced; indented, unspaced paragraphs; bold sectional divisions, widely-spaced; • heavily-indented lists with wide spacing; Typographers’ Inn heavily-indented lists with wide spacing; non-hanging footnotes; floating tables and figures with caption positioning • non-hanging footnotes; dependent on caption text quantity; same-size type in block quotations with independent indentation; • floating tables and figures with caption position a single typeface throughout (). At the time LATEX was written (1985), these defaults were dependent on caption text quantity; already quite conservative, and have been described as ‘based on then-common conventions for scientific publishing’ • [4]. I recently came across an article a relative wrote in the same-size type in block quotations with 1950s [7] and it could almost have been formatted with independent indentation; LATEX’s defaults. Fashions in page layout and design change like the seasons: while many journals still use centred titling in the body font, • a single typeface throughout many do not, opting instead for anything from flush-left sans-serif bold to a shaded block rotated 90° positioned at (Computer Modern). the left-hand edge. Economy in paper means narrower margins (unfortunately A meaning even wider set, unless two columns are used); At the time LTEX was written (1985), these defaults Abstracts can be positioned in a block to a corner or a margin; text can be set ragged right; indentation can be zero, were already quite conservative, and have been de- with a between paragraphs; sectional divisions can be centered, wrapped, indented, or otherwise reformatted; lists can be tighter-spaced and barely indented; footnotes hang; scribed as ‘based on then-common conventions for block quotations are in smaller type and unindented; scientific publishing’ [5]. I recently came across an sans-serif is used for headings, and even occasionally for the article a relative wrote in the 1950s—it could al- most have been formatted with LATEX’s defaults (see

Figure 1). A Figure 2: Re-envisioning some of LTEX’s defaults

Many publishers and journals have written their own document classes which can be downloaded (some are included with TEX Live), and many helpful people have written classes and packages which pro- vide alternative layouts (the memoir and koma-script bundles are excellent examples).1 You can of course go the whole hog and employ a to draw up a suitable set of (possibly corporate) , and then get them implemented as LATEX classes by one of the TEX consultants listed at the back of every issue of TUGboat. However, for the users who just want to create simple layouts of their own, here are some guidelines to current practice that can be used. After all, if LATEX were to be written today, what defaults would we want? 1 I tried to introduce one myself (vulcan) many years ago [1], which was a compendium of packages and modifications, Figure 1: 1950s journal style [4] but it required more resources than I had available at the time.

Peter Flynn TUGboat, Volume 38 (2017), No. 1 17

Titling Redefine the \maketitle command to put the title, author, date, and other metadata where you want it. Margins Reset margins with the geometry package. Abstract Redefine the abstract environment to control the font size and positioning. Justification This is still the standard for books but ragged right is less formal and has been popular in wordprocessors for decades. Spacing The parskip packages turns off indenta- tion and uses space between paragraphs instead. This is a popular office-document format. Sections The sectsty and titlesec packages let you change the styling of headings. In justified text, Figure 3: Unusual line-breaking in a heading (Book set headings to ragged right to avoid - of Common Prayer, 1549, fragment, courtesy ation and justification (H&J) problems. The Society of Archbishop Justus) Lists Use the enumitem package to restyle all types of lists, not just enumerated ones. Footnotes The footmisc package (and others) pro- This example provides us with two insights into vide alternative layouts for footnotes. the minds of the 16th-century compositor and page Tables and figures Caption styling can be changed designer (if they were two separate people): with the ccaption package and others. 1. that he felt it necessary to expand ‘The Con- Block quotations Redefine the quotation envi- tentes’ by adding ‘of this Booke’ (perhaps ‘Con- ronment to get rid of the first line indent, and tentes’ alone was not yet established); to change the font size. 2. that he felt it was perfectly normal for a word Use X LE ATEX to get a much wider and which needed to be hyphenated to be continued more easily-accessible choice of typefaces [3], but in a different size and even a different typeface even with pdflatex, there is a substantial range on the second line. A available (see the LTEX Font Catalogue tug. We do live in a different worlde. dk/FontCatalogue). If you have mathematical content your selection is more limited. References I haven’t mentioned the letter class. It’s something [1] Peter Flynn. The vulcan Package — A Repair Patch A of an anomaly, although it too implements what was for LTEX. TUGboat, 20(3):208–213, Sep 1999. a fashionable layout in the days of the typewriter: a http://tug.org/TUGboat/tb20-3/tb64flynn.pdf. vertically-centered document (that is, equal amounts [2] Peter Flynn. Typographers’ Inn—Formatting TUGboat of white-space above and below). I’m not aware of and centering. , 33(1):8–9, Jan 2012. anywhere using this layout today, and restyling it is http://tug.org/TUGboat/tb33-1/tb103inn.pdf. TUGboat much harder than with the other classes. However, [3] Peter Flynn. Typographers’ Inn. , http://tug.org/TUGboat/ the koma-script bundle mentioned above provides a 37(3):266, Dec 2016. tb37-3/tb117inn.pdf. very adaptable alternative. [4] Thomas George Flynn. Electronic Organs. Go forth, etc... Institution of Electrical Engineers Students’ Afterthought Quarterly Journal, 25(98):113–118, Dec 1954. A [5] musarithmia. What is the name of LTEX’s default Just after the last Typographers’ Inn hit the streets, A style and why was it chosen for LTEX? — (answer). I spotted another example (see Figure 3) of a centered tex.stackexchange.com, 272607(1), Oct 2015. http: heading broken unusually [2, 3]. In the early centuries //tex.stackexchange.com/questions/272607. of printing, it wasn’t considered ‘bad’; in fact it occurs frequently on title pages. ⋄ Peter Flynn In a narrow measure, long headings are going to Textual Therapy Division, cause H&J problems because they are typically set Silmaril Consultants 2 in a much larger size than the body copy. Cork, Ireland 2 Phone: +353 86 824 5333 Your Editor-in-Chief, Barbara Beeton, and your Produc- tion Manager, Karl Berry, will know this only too well from peter (at) silmaril dot ie TUGboat. http://blogs.silmaril.ie/peter

Typographers’ Inn 18 TUGboat, Volume 38 (2017), No. 1

Review and summaries: The History of phy had begun to supplant print itself, because text Typographic Writing — The 20th century display and reading increasingly shifted from paper Volume 1, from 1900 to 1950 to computer screen, a phenomenon now noticed by nearly all readers and publishers. Charles Bigelow In the 20th century, typography was also trans- Histoire de l’Ecriture´ Typographique — le XXi`eme formed by cultural innovations that were strikingly si`ecle; tome I/II, de 1900 `a1950. Jacques Andr´e, ed- visible to readers. In a profusion of new styles, move- itorial direction. Atelier Perrousseaux, Gap, France, ments, and polemics, a plethora of avowedly rev- 2016, http://tinyurl.com/ja-xxieme. The book olutionary “-isms” challenged traditional tenets of is in French. Volume 2 covers the years 1950 to 2000, typography in zealous efforts to reformulate, aban- to be reviewed later. don, or replace long-held principles of typographic organization and expression. Some of these cultural movements hearkened back to an idealized typographic past, while others pointed to an idealized future. Our typography today is a mix of such memories versus desires: old and new, traditional and modern, potential and practical, obsolete and avant-garde. There have been relatively few books on ty- pography that provide deep analysis of its cultural transformations, knowledgeable explanations of its technological progression, and copious illustrations to accompany both aspects. That is why this book is a milestone in the scholarship and appreciation of modern typography. Totaling 522 well-illustrated pages in two volumes of essays by a group of typographic experts under the editorial direction of Jacques Andr´e[1], the books provide an impressive perspective on the typographic art, culture and technology of the past century. [2] Instead of an overview of the whole book, this review of the first volume gives partial summaries and comments on each of the chapters, This is done for two reasons. First, the book is in French, so the short, mini-summaries may help English-language readers get some idea of the contents and significance of those The 20th century saw the three most transformative various chapters that may be of particular interest. innovations in typographic technology after Guten- Second, because each author writes with different berg’s invention of alphabetic movable type five cen- expertise, perspective, and literary style, these mini- turies earlier. Each innovation by turns increased summaries may give some hint of the variety of styles speed, reduced cost, and increased efficiency of text and sensibilities in the essays. The book deserves an composition. First came keyboard-driven hot-metal English edition, but it is hoped that these notes may composing machines like Linotype and Monotype; at least point to what is contained therein. invented in the late 19th century, these achieved com- Here are the chapters of Volume 1. mercial dominance in the early decades of the 20th century, supplanting most hand-set type. Next came Alan Marshall: Preface (Pr´eface) phototype — electro-optical photographic composi- The 20th century was one of the most eventful peri- tion; invented in the 1940s, phototype replaced most ods in the history of typography, influenced by two hot-metal typesetting by the 1970s. Lastly came major changes, the mechanization of typesetting and digital typography; invented in the 1960s, it replaced the diversification of the use of print. The former most metal and photo typesetting by the year 2000. advanced typography for reading, while the latter Typesetting occurs prior to print, so these technolog- transformed typography for seeing. The selection and ical changes went mostly unnoticed by readers. By production of typefaces for mechanized composition the end of the millennium, however, digital typogra- concentrated mainly on traditional type forms that

Charles Bigelow TUGboat, Volume 38 (2017), No. 1 19

are nearly subliminal in extended texts, but for pro- Art Deco was (and still is) an aesthetic family that motion of goods and dissemination of publicity in the encompassed several different but somehow related increasingly mass-market 20th century, super-liminal visual styles. Understanding Art Deco visual rela- type styles were created to arrest, shock, intrigue, se- tionships is a bit like grappling with Wittgenstein’s duce, and persuade readers of short commercial mes- remarks on family resemblance — is there a single sages. As technology and usage changed, traditional core element or a set of overlapping similarities? methods did not entirely disappear; hand-set display Whatever its visual core, Art Deco influenced poster types, for example, were often used in conjunction art, architecture, signage, advertising, and typogra- with mechanized composition of longer texts. phy and characterized the then-modern era of the 1. Matthieu Cortat: The flowering of the 1920s and 1930s, between the two great wars. De- Modern (La floraison de la modernit´e) spite diversity within the style, multiple connections From beginnings in the late 19th century English can be traced among its apparently disparate forms. Arts & Crafts movement and French lithographic Of particular typographic note are Art Deco type- poster lettering, new typographic styles emerged, faces by designers who are better known today for especially the flowing, floral, and youthful styles more sober creations, including Morris Fuller Ben- gathered under the banner of Art Nouveau, which ton, Rudolf Koch, Imre Reiner, Robert Middleton, exercised international influence on lettering and and Dick Dooijes. There are also notable designs typography, often in contrast to traditional typogra- by artists firmly within the Art Deco genre such as phies of France and Germany. The botanical style A. M. Cassandre. Unlike the Art Nouveau types, of Art Nouveau is a recurrent theme in this essay, many forms of Art Deco continue to be used today. which ends with an olfactory metaphor: that when Jacques Andr´e: First Interlude: the avant-garde moved on to other styles, Art Nou- The sociology and revival of a type style: veau typography faded into obsolescence, leaving stencil (Pause: Sociologie et renouveau d’un only occasional whiffs of a flowery perfume in its caract`ere: les pochoirs) wake. (This reviewer recommends a whiff of Jacques This absorbing, often amusing, and copiously illus- Guerlain’s “Apr`es l’Ond´ee” (After the Rain Shower), trated exposition proceeds from a hand silhouette the quintessential Art Nouveau perfume, composed in palaeolithic cave painting to the analytic logic of in 1906 but still in production and regarded as one form and counter-form in letter shapes; from spray- of the greatest fragrances of all time.) painted graffiti to labels on gunny sacks and letters on 2. Roxanne Jubert: Signs of the avant-garde: wine barrels; from slogans on walls to road markers; the alphabet between construction, system, from signs cut in metal to stencil-like typefaces by art and (Signes des avant-garde: Auriol, Jacno, and other 20th century type designers. l’alphabet entre construction, syst`eme, 4. Nelly Gable and Christian Paput: art et utopie) Perennity of punches and matrices This lucid yet congenial exposition, reminiscent of (P´erennit´edes poin¸cons et matrices) the essays of Roland Barthes, analyses the explosion A clear and beautifully illustrated treatise on type of diverse avant-garde movements in Europe, includ- punch-cutting, emphasizing the tools and techniques ing Futurism, De Stijl, Dadaism, Constructivism, still used today at the French Imprimerie Nationale. Bauhaus, New Typography, and their effects on ty- For five and a half centuries [3], punch-cutting has pographic forms and organizations. The structuralist been at the core of every era of typography, practiced approach of the essay effectively elucidates implicit by a tiny group of skilled artists whose exquisitely (and sometimes explicit) aesthetic and semiological precise work has rarely received public recognition, philosophies of the avant-gardists with their arrest- first because it was necessarily executed in miniature ingly visual modularization and segmentation of ty- (like the 10 point type you are reading now) and was pographic images, their construction of experimental usually anonymous (apart from in-group knowledge alphabets, and their integration of typography, ge- of a few typographic cognoscenti) because type was ometry, and . Even the best English made in service of the arts of literature and knowl- discussions of avant-garde typography are rarely this edge. Stanley Morison wrote that typography is only interesting. accidentally aesthetic, “for the enjoyment of patterns 3. Roxanne Jubert: The Art Deco Letter: is rarely the reader’s chief aim.” This applies as well variety, stylization, play, and contrast to the jewel-like intricacy of finished punches. In (La lettre Art D´eco: vari´et´e, stylisation, jeu, this chapter, the methods, tools, and techniques of contraste) cutting and proofing punches, and of striking and

Review: The History of Typographic Writing — The 20th century; vol. 1 20 TUGboat, Volume 38 (2017), No. 1

justifying matrices, are precisely described and ex- 6. Manuel Sesma: Return to historical plained, coupled with clear photographs by Nelly and neo-historical typefaces (Retour aux Gable and Daniel Pype. Among its side-revelations caract`eres historiques et n´eo-historiques) are the names of the principal French punch-cutters Revival and practice of past letterforms is tradi- who worked at the Imprimerie Nationale, Deberny & tional in Asian calligraphy. In the Italian Renais- Peignot, and other organizations in the 20th century. sance, Humanist handwriting revived Carolingian Thus, artists who worked mostly in obscurity are court handwriting of six centuries earlier and be- rescued to some extent from anonymity. A photo came the model for the first roman and italic types. of punches bearing the punch-cutters’ own identi- Arts and Crafts printers revived older types using fying stamps furthers the cause. Little has been photographic enlargements from books and hand published on punch-cutting, and even less is still in punch-cutting. Augmented by pantographic punch- print, so this excellent chapter especially merits an engraving, revivals achieved commercial success in English translation and republication, perhaps as an the 20th century, especially with revivals of types offprint. [4] cut by Claude in the 16th century (or derivatives cut by Jean Jannon in the 17th century 5. Christian Laucou: Technical innovations but misidentified as those of Garamond). These re- from 1900 to 1945 (Les innovations techniques, vivals were marketed under the names “Garamond,” de 1900 `a1945) “Garamont,” “Granjon,” “Estienne,” “Sabon,” and In the Internet era, we may believe that electronic others, causing this essay to call the phenomenon innovation travels at a faster speed than ever be- “garamonomanie” (perhaps “Garamonomania” in En- fore, but this essay demonstrates the dizzying pace glish). Questions about whose types were actually of mechanical innovation in typesetting at the start revived as Garamond’s resulted in intriguing typo- of the 20th century. Typography was, after all, the graphic scholarship by Jean Paillard in 1914 and dominant information technology of that era. Even Beatrice Warde (writing as Paul Beaujon) in 1926. [5] the of names of typesetting inventions is The Peignot foundry types “Cochin” and “Nico- enough to write rhyming poetry to accompany the las Cochin” were based on elegant lettering by 18th clatter of machines like Barotype, Diotype, Franco- century engravers Charles-Nicolas Cochin and son. type, Intertype, Linotype, Monotype, Nebitype, Ro- The Peignot Cochin types became fashionably pop- totype, Stringertype, Teletype, Typar, Typograph, ular in France and were imitated by foundries else- Typomeca, Typostereotype and more. Engineer- where. ing drawings, particularly of matrices and mecha- In the U.S., (ATF) pro- nisms, illustrate the ingenuity devoted to turning duced successful revivals by designer Morris Fuller keystrokes into print, a process that continued to be Benton and printer-scholar Henry Lewis Bullen, in- reinvented throughout the century in other technolo- cluding Bodoni, Jenson (called Cloister), (Fry’s) gies, even as metal-based composition approached , , and the Garamond that ignited near-extinction. Garamonomania. Frederic W. Goudy often took Re- naissance models as inspiration but imbued them Jacques Andr´e: Second Interlude: with his own artistic sensibility. Goudy Old Style Louis Jou, an idiosyncratic brilliance from ATF, with additional versions by M. F. Benton, (Louis Jou, un marginal g´enial) has remained popular through every major change in An appreciation of the typographic work of Louis typesetting technology. Goudy also drew “Garamont” Jou, an engraver, typographer, type designer and for American Monotype. fine book printer-publisher whose work combined Revivals were also produced by the Bauer and the richness, variety, and elegance of Renaissance Stempel foundries in Germany and Linotype in Eng- typography with the exuberance of Art Nouveau, land, Germany, and the U.S. In mechanical compo- enhanced by his own inventiveness in ornamental sition, the best known series of revivals came from lettering and layout. A friend of Apollinaire, Dufy, the English Monotype corporation. Under the direc- Cocteau, and other literary and artistic luminaries tion of Frank Hinman Pierpont and with the advise- of his time, Jou, who was born in 1881 and died ment of Stanley Morison, Monotype revived types in 1968, “came too late to achieve the glory of his by Jenson, Aldus, Arrighi, Garamond, Van Dijck, English equivalent, William Morris but too early to Fournier, Baskerville, , Bodoni, and others, and use digital type, which would have enabled him to also produced original faces by designers with classi- play more with fonts and compose his books with cal affinities: by , Romulus by Jan the perfectionism of an aesthete.” van Krimpen, and Dante by Giovanni Mardersteig.

Charles Bigelow TUGboat, Volume 38 (2017), No. 1 21

Though waxing and waning at times, type revivals Donald G. Paterson in Minnesota conducted legibil- continued through the rest of the 20th century. ity studies, the last of these continuing through the first half of the century. Although most typeface 7. Manuel Sesma: Lead again development followed traditional faith in the trained Encore le plomb ( ) eye of the designer, legibility research did influence As the European typographic industry strove to re- the design of a few popular typefaces for specific pur- cover after World War II, an exuberant flowering of poses. The enduringly popular Century Schoolbook, imaginative typefaces emerged from French designers originally designed by Morris Fuller Benton for a and typefoundries with an inventive sense of graphic textbook publisher, drew upon Roethlein’s earlier style termed “La Graphie Latine” (“Latin Typog- research. Linotype’s “Legibility Group” was at one raphy”). These spirited French typefaces brimmed ˆ time used in more than half of all newspapers in with inspiration: Paris, Flash, Ile de France and the United States. It included several closely related Champs Elys´ees by Enric Crous-Vidal; Choc, Banco, designs (Ionic No. 3, Excelsior, Opticon, and Corona) Mistral, Calypso, and Antique Olive by Roger Ex- that were influenced by Century Schoolbook and un- coffon; Jacno by Marcel Jacno; Ondine and Phoebus published legibility research by Linotype. Not all by Adrian Frutiger. Though revolutionary in style, legibility studies were reliable. . L. Pyke skepti- these faces were produced as lead foundry types. [6] cally remarked, “Four times as many writers have Mistral and Calypso were “tours de force,” challeng- measured legibility as have defined it. Three out of ing the constraints of metal type. In the 1950s and every four writers have been attempting to measure 1960s, expressive French designs differed markedly something the exact nature of which they have not from the sober, grotesque-style sans-serifs at the paused to examine.” [7] core of Swiss typography and its allied international modernism that favored -based bureaucratic reg- Paul-Marie Grinevald: Third Interlude: ulation over charismatic expression. But, as a philo- Survey of historians of typography sophical complement to effervescence in letter design, Aper¸cu des historiens de la typographie French writing and thinking on type also featured ( ) acutely rational reflections on the logic of typography, This is a rare essay in typographic historiography: a as seen in the typeface classification system devised history of histories of typography. It includes social histories of printing such as Elizabeth Eisenstein’s by Maximilien Vox and adopted as a standard by The Printing Press as an Agent of Change, Lucien the Association Typographique Internationale as the Febvre & Henri-Jean Martin’s The Coming of the Vox-ATypI system, and in the numeric naming sys- Book The Gutenberg Galaxy tem for typeface weight, width, and posture devised , Marshall McLuhan’s The Medium is the Message by Adrian Frutiger for his pioneering Univers neo- and . Recognizing that grotesque produced by the Paris foundry Deberny & typography is only the most recent form of writing, the chapter cites Jack Goody’s anthropological trea- Peignot, for both phototype and foundry type. tises on writing and society, ancient and modern, in 8. Charles Bigelow: Legibility and The Domestication of the Savage Mind (the title an typography: research in the first half of in-joke on a structuralist treatise by French ethnolo- the 20th century (Lisibilit´eet typographie: les gist Claude Levi-Strauss) and The Logic of Writing recherches durant la premi`ere moiti´edu xxe si`ecle) and the Organization of Society. By the first decade of the 20th century, literacy On the forms of letters and typefaces, this survey rates in France, England, Germany, and America touches on Euclidean letter constructions by Luca had soared to more than 90 percent due to national Pacioli, Albrecht D¨urer, Geoffrey Tory, and others in expansions of free, public education. The vast in- the 16th century, on the refined Cartesian geometry creases in literacy fueled the printing and marketing of type forms developed circa 1693–1702 by savants industries but raised concerns about typeface legibil- Jean-Paul Bignon, Jacques Jaugeon, and Sebastian ity in reading education, ocular health of children, Truchet, which led to the creation of the Roman and the physiology and psychology of reading. Emile´ du Roi, the French royal typefaces. Valuable essays Javal in France and Edmund Burke Huey in America on type and history, to mention a few of the many pioneered reading research. Shortly afterwards in cited, include: in the 18th century, Pierre-Simon New York, Barbara Roethlein (with font assistance Fournier’s Manuel Typographique and the chapter from Morris Fuller Benton) conducted one of the “Caract`ere” in the Diderot Encyclop´edie; in the 19th earliest psychological studies comparing type legibil- century, Talbot Baines Reed’s A History of the Old ity. Elsewhere, Richard L. Pyke in England, Gerrit English Letter Foundries; in the 20th century, Daniel Willem Ovink in Holland, and Miles Tinker with Berkeley Updike’s Printing Types: Their History,

Review: The History of Typographic Writing — The 20th century; vol. 1 22 TUGboat, Volume 38 (2017), No. 1

Forms and Use — A study in survivals, Marius Au- ticed before 1470, when Nicolas Jenson, a master of din’s Histoire de l’Imprimerie par l’Image and La the French mint who had studied the infant art of Somme Typographique, Harry Carter’s A View of typography in Mainz, gave up minting for printing Early Typography, Fernand Baudin’s L’Effet Guten- and opened his shop in Venice. berg, John Dreyfus’ Into Print, Alan Marshall’s Du [4] The chapter’s bibliography includes Counterpunch plomb `ala lumi`ere, and other recent works. Pre- by Fred Smeijers, now out of print but an entertaining ceding volumes from Perrousseaux in the series on and informative book that combines the author’s Histoire de l’Ecriture:´ Typographique must also be efforts to learn punch-cutting, including a history and mentioned: De Gutenberg au XVIIe si`ecle, by Yves explanation of the tools and techniques, comparisons Perrousseaux; Le XVIIIe si`ecle (two volumes), also of hand work to computer work, the creating of new by Yves Perrousseaux; and Le XIXe si`ecle fran¸cais type designs inspired by models from the golden age by Jacques Andr´eand Christian Laucou. of typography, and comments on other topics arising The book ends with an extensive general bib- during the author’s story. A good short essay, not liography as well as bibliographies specific to each in the bibliography, is Paul Koch’s “The Making of chapter, totaling 412 references in all, to works in Printing Types”, translated from German by Otto W. French, English and German. These are followed by Fuhrmann, in The Dolphin: A Journal of the Making indexes of typefaces, typographers, and typographic of Books, No. 1, pp. 24–57. Illustrations by Fritz topics. Kredel. The Limited Editions Club, New York, 1933. Notes [5] See: ‘Paul Beaujon’ (Beatrice Warde), ‘The Gara- [1] The general editor, Jacques Andr´eis a French mond types: 16th and 17th century sources consid- computer scientist with an intense interest in ty- ered’, The Fleuron, 5, 1926, pp. 131–79. A recent pography. He organized the first academic confer- review of Garamond scholarship is James Mosley’s ence on the integration of computer science with “Garamond or Garamont”, Typefoundry Blog, Apr. 1, typography, “La Manipulation des Documents”, in 2011. http://typefoundry.blogspot.com/2011/ Rennes, France in May, 1983, and organized the 04/garamond-or-garamont.html later international “Raster Imaging and Digital Ty- [6] The title of this chapter and the bravado of the de- pography” (RIDT) conferences. He has published papers on T X, and readers of TUGboat may know signers may remind fans of American western movies E The Magnificent his reviews and articles including “Father Truchet, of a memorable line in the classic Seven the typographic point, the Romain de Roi, and , delivered by Steve McQueen: “We deal in tilings” (TUGboat issue 20:1, 1999) and “The Cas- lead, friend.” setin project — Towards an inventory of ancient types [7] A short talk on this chapter was delivered at the and the related standardised encoding” (24:3, 2003). TEX Users Group meeting in Toronto, Ontario, on Notable are his translations and re-interpretations July 27, 2016. Legibility research lost academic pop- of selected print works, such as “Petits jeux avec ularity in the middle of the century, but scientific des ornements”, a translation into French with digi- reading research was revived in the 1970s and 1980s, tal re-composition of ornamental patterns by Swiss principally in three areas: eye movements in read- typographer Max Calisch in Kleines Spiel mit Or- ing, researched by G.W. McConkie, Keith Rayner, namenten (Berne, 1965), and an electronic revival and Andrew Pollatsek, among several others; psy- of P.-S. Fournier’s Manuel Typographique (Barbou, chophysics of reading, researched by Gordon E. Legge 1764). http://jacques-andre.fr/japublis/ and others; various practical studies comparing type- [2] These two volumes are the latest in a series on faces, by Cyril Burt, Bror Zachrisson, E.C. Poulton, “Typographic Writing” from Atelier Perrousseaux, a Dirk Wendt, Herbert Spencer, Linda Reynolds, and French publisher of typography books. The series, in others. several successive volumes, begins with Gutenberg and thence covers the next six centuries. The term Disclosure: As seen above, the reviewer contributed “typographic writing” in the title affirms that typog- a chapter to this book (but receives no monetary raphy is the latest form of writing in a long history compensation). He has known the general editor over of literacy. All of the books in the series are well more than three decades of friendly mutual interest worthwhile. in digital typography. [3] Gutenberg’s method of making type in the 1450s remains shrouded in mystery, but the technique of ⋄ Charles Bigelow punch and matrix was probably developed and prac- http://lucidafonts.com

Charles Bigelow TUGboat, Volume 38 (2017), No. 1 23

SILE: A new typesetting system 2 SILE’s Component Parts Simon Cozens One of the advantages of writing a typesetting sys- tem in 2012 rather than in 1982 is that most of Abstract the hard work is already done for you. As we have SILE is a new typesetting system, influenced by mentioned, core typesetting algorithms are readily TEX but written from scratch in Lua. While still available; Unicode, together with its standard an- in the early stages of development, it holds po- nexes and technical reports, describes good solutions tential as a typesetting system designed for unsu- to many of the problems of multilingual data rep- pervised automated typesetting, especially in non- resentation; OpenType fonts and shaping engines Latin scripts. SILE can be obtained from http: help with the layout of complex scripts; embedded, //www.sile-typesetter.org/. interpreted languages won out over macro processors; and the world has effectively standardised on PDF as a document format. A bird’s eye view of SILE is shown in fig. 1. 1 Introduction Text is consumed, and is reordered according to the In 2012, I wrote a typesetting system by mistake. Unicode Bidirectional Algorithm [9]. Then each run As part of my work for a small publishing com- of text, together with its font, language, direction pany, I wrote a simple Perl script to automate the and other settings, is passed to the HarfBuzz [1] production of book covers. However, I soon discov- shaping engine. HarfBuzz returns a stream of ered that the typesetting of the back cover blurb IDs and metrics, which are then assembled into a was unacceptable without proper justification. I list of nodes, either by language-specific processors ported Bram Stein’s JavaScript version [8] of the or by the default Unicode processor. The nodes are original TEX justification algorithm [5] to Perl. Since fed to the familiar H&J algorithms and collected into there was already a Perl implementation [4] of TEX’s vboxes, vboxes into frames, frames into pages, and hyphenation algorithm [6], I added support for hy- pages are finally output as PDF. phenation at the same time. The choice of Lua as an implementation lan- Now I had something which could reliably type- guage hinged on a number of factors; obviously there set paragraphs to PDF . . . well, you can probably are some benefits to using a language which is famil- guess the rest. Adding a page builder was the ob- iar to a pre-existing community of typesetting soft- vious next step, and soon penalties, skips, glues ware engineers, although I have no strong desire to and the rest followed. The project was rewritten in ‘convert’ anyone! But there are also benefits to using JavaScript, and then finally in Lua. an interpreted language for implementation: first, Why does the world need another typesetting system? Of course, it doesn’t. But sometimes it’s a good idea to reinvent the wheel; that’s how we Text get better wheels. If we never reinvented wheels in Font selection the software industry, this journal would be called Bidi processing (fontconfig / troffboat. And a friend who works in Bible type- (ICU) Mac native) setting let me know about a number of things that current automated typesetters can’t do well — col- umn balancing with multi-page lookbehind and grid Shaping typesetting; layout of parallel polyglots across page () spreads; and so on — which gave me a number of goals. Language support Because of these goals and my own interest in non-Latin scripts, SILE has developed a focus on multilingual typesetting, particularly with complex Line/page breaking and minority scripts, and the unsupervised layout of (Knuth algorithms) large, complex documents. SILE will see a 1.0.0 re- lease when it is capable of taking a Unified Scripture PDF generation XML [7] Bible translation and an appropriate class libtexpdf file, and producing a print-ready Bible of quality ( ) equivalent to that of a human typesetter. Even if I never achieve it, I’m having fun trying. Figure 1: SILE’s component parts

SILE: A new typesetting system 24 TUGboat, Volume 38 (2017), No. 1

\SILE{}.registerCommand("tableofcontents:item", function (options, content) \SILE{}.settings.temporarily(function () \SILE{}.settings.set("typesetter.parfillskip", \SILE{}.nodefactory.zeroGlue) \SILE{}.call("tableofcontents:" .. options.level .. "item", {}, function () \SILE{}.process(content) \SILE{}.call("dotfill") \SILE{}.typesetter:typeset(options.pageno) end) end) end)

Figure 2: Lua code to typeset a TOC entry

Lua is designed as an embedded language, which makes sense — with so much done by third-party means that SILE can provide a complex text lay- libraries, there is relatively little left for SILE to do out system for embedding within other applications. by itself. (For instance, there is a SILE preview plugin for the font editor.) It also means that any area 3 Input formats, packages and classes of SILE’s operation can be overridden or extended, not just those with pre-defined hooks. For instance, Just like the output system, SILE’s input system the grid typesetting package works by overriding the is modular. The first input format implemented leading calculation; similarly, when setting Japanese for SILE was XML — the idea being that SILE is to text on a hanmen grid, there is no need to apply full be used to typeset data produced by other software, best-fit paragraph composition — it’s fine to replace such as translation databases, rather than documents the Knuth-Plass algorithm with a simple first-fit line constructed by hand; XML is both an easy format breaker for speed. to parse and an easy format for other software to SILE XML SILE’s also means that every- output. But while needs to ingest , for thing is pluggable. I tried a number of different PDF whatever reason people wanted to hand-generate SILE SILE libraries while developing SILE; the first versions documents, and so added a parser for a used [2], but Cairo’s PDF surface is fairly lim- simple, TEX-like input format. ited, and does not allow for the generation of PDF The TEX-like format is only superficially TEX- annotations, links and outlines — not to mention any like. It is, essentially, simply another way of rep- of the tagged and structured markup required for resenting an XML tree structure. These two SILE accessible — so I started looking for alterna- documents are equivalent: tives: Haru, PoDoFo and others. Since the output \begin{foo} system has a well-defined interface, I could easily Text Text test a new PDF generation library by slotting a new \bar[this=that] output implementation in place. Similarly, SILE’s \end{foo} regression test system works by plugging in a custom outputter which produces a textual representation The implementation of and is, of instead of a PDF; this can then be compared against course, up to the user. In this sense, SILE is similar the expected results using diff. to an XML stylesheet processor: alongside a doc- Incidentally, the PDF library I settled on was ument must come a set of processing expectations both an old one and a new one: I extracted the which define how the tags will be typeset. SILE’s PDF generation backend from dvipdfmx and made \define command provides an extremely restricted it available as a library–libtexpdf. This was the only macro system for implementing simple tags, but you PDF generation system I could find which allowed are deliberately forced to write anything more com- me to address glyphs by ID, and also to add arbitrary plex in Lua. (Maxim: Programming tasks should PDF operators to the output. be done in programming languages!) For example, Apart from C interfaces to HarfBuzz, ICU (the the command to typeset a table-of-contents item is Unicode support library), fontconfig and libtexpdf, implemented by the code in fig. 2. This expects a the core of SILE comprises a little under 5,000 lines of command of the form: Lua code. (10% of which is made up of a somewhat \tableofcontents:item[level=2,pageno=3] literal port of TEX’s line breaking algorithm.) This {Something}

Simon Cozens TUGboat, Volume 38 (2017), No. 1 25

and passes the text and page number separated by local swap = \SILE{}.nodefactory.newVbox({}) swap.outputYourself = function(self,typesetter) leaders to the command which styles a level 2 TOC typesetter.frame.direction = entry; this command, which is more easily imple- typesetter.frame.direction == "LTR-TTB" mented with a \define at the SILE level, will in and "RTL-TTB" or "LTR-TTB" turn set the appropriate font size, style and so on. typesetter.frame:() Lua code is loaded into SILE as packages or end classes, similar to LATEX — classes define the layout and key formatting expectations for tags, while pack- \SILE{}.typesetter.boxUpNodes = function(self) ages provide additional functionality. Classes can be local vboxlist = inherited (in the object-oriented programming sense) \SILE{}.defaultTypesetter.boxUpNodes(self) from other classes; SILE comes with a number of local nl = {} basic document classes but the expectation would be for i=1,#vboxlist do that each substantial document project would define nl[#nl+1] = vboxlist[i] if nl[#nl]:isVbox() then its own class. nl[#nl+1] = swap Since classes can be loaded even before the docu- end ment is opened, they can do things such as providing end a new input format. The markdown class does just return nl this, implementing a parser and providing processing end expectations for Markdown documents. Naturally there are not currently anything like Figure 3: The boustrophedon package, abridged. as many packages for SILE as for TEX derivatives. But fig. 3 is (an abridged version of) my favourite. This implements boustrophedon text by overriding Another pertinent example is that of many south- the typesetter’s function for turning horizontal lists east Asian languages which are written without inter- into vertical lists. After the default implementation, word spaces but which line break between graphical the vertical list is inspected, and a custom whatsit syllable clusters, the clusters being determined by (swap) is inserted after every vbox. When the whatsit morphological analysis. SILE’s support for Javanese is output, the typesetter’s direction is reversed: if uses a Parsing Expression Grammar [3] to detect syl- the previous line was left-to-right, the next line will lable boundaries and insert penalties into the node be right-to-left, and vice versa. stream to specify potential break points. Access to SILE’s programmability leads itself to experi- ICU means that language-specific casing rules (such mentation and implementation of new technologies; as the Turkish i/I˙ and ı/I combinations) are correctly support for OpenType color fonts was added as an applied. external package in 85 lines of code, and rudimentary SILE does not assume any default directionality, support for OT fonts with SVG outlines has recently meaning that left-to-right typesetting is not priv- been added. ileged over right-to-left processing. Indeed, sup- porting Mongolian, which is traditionally written top-to-bottom and left-to-right, is simply a matter 4 The language support system of telling the typesetter about the new direction: While Harfbuzz and Unicode provides a lot of what \thisframedirection{TTB-LTR}. SILE needs to support complex scripts, different lan- Figure 4 demonstrates SILE’s multi-script ca- guages have different typographic conventions. For pabilities; notice how SILE has respected the typo- instance, correctly typesetting Japanese is not a mat- graphic conventions of each script, and how the RTL ter of inserting line break opportunities between ev- texts ( and Hebrew) have been reordered ac- ery pair of characters; Japanese kinsoku-shori rules cording to the conventions of mixed directionality stipulate that some punctuation characters cannot typesetting. In the source file, each text is marked up start lines and others cannot end lines. Addition- with its language so that SILE can select the appropri- ally, characters are generally set on a fixed grid, ate set of rules, but the bidi reordering is performed but spacing is reduced around and . by default and requires no additional markup. These language-specific typesetting conventions are encoded in SILE’s language support system, which 5 Frames assembles the stream of glyphs from the shaper into In our overview of SILE’s component parts, we men- nodes, giving SILE a chance to implement hyphen- tioned in passing that vboxes are assembled into ation points, line breaking opportunities and so on. frames and frames are assembled into pages. Frames

SILE: A new typesetting system 26 TUGboat, Volume 38 (2017), No. 1

7 Challenges remaining While SILE has been used successfully to produce a َﺣ ّﻮاﻣﺘﻲ ُﻣ ْﻤ ِﺘﻠﺌﺔ .My hovercraft is full of eels Իմ սաւառնակս օձաձկներով լեցն -number of print books and articles, it is still not a fin ِﺑ َٔﺎ ْﻧ َﻘﻠَ ْﻴﺴﻮن է: আমার হভারা কুঁেচ মাছ-এ ভরা হেয় গেছ ished product. The development team is very small; I’m the primary developer, with Caleb Maclennan ကန်ေတ်ရဲ ေလစးယ်မှ ငးှင့်ေတွအြပည့်ှေန 我的氣墊船裝滿了鱔⿂ ჩმ ხომლ and Khaled Hosny as notable contributors. Devel- ပတယ်။ opment happens on github and we are very open სჰრო ლშ სს ლ Το to issues and pull requests. However, there are a .number of challenges remaining הרחפת שלי Χόβερκράφτ μου είναι γεμάτο χέλια मेरी मँडराने वाली नाव सपमीन से भरी The lack of a Windows distribution is currently מלאה בצלופחים ह ᐅᒥᐊᕐᔫᑉ ᐳᓪᓕᓕᒫᐸᒐ ᑕᑦᑕᕐᓂᖅ ᐊᒻᒪᔭᖅ 私 hampering adoption; the pushback routine (which のホバークラフトは鰻でいっぱいです សុទ䮒 disgorges the vertical list back onto the horizontal ែតឣន䮅ងេពញទូកបះេយើង ។ 내 호버크라프트 list after every frame break, in case the next frame 는 장어로가득차있어요 എെ പറും- has a different width) is a perennial source of mind- boggling bugs; and currently we lack a good solution േപടകം നിറെയ വ്ളാുകളാണ് මාෙ වා for moving between multi-column and single-column පා යානෙ ආඳ ඇතஎ மிதைவ layout and back again, which is a blocker for serious நைறய வலா மீக Bible typesetting. 1 We are also still working out how best to use SILE. For instance, I initially anticipated that the Figure 4: SILE’s multi-script capabilities frames feature could be used to solve all kinds of layout challenges — drop caps, wrapping text around floated figures and so on. After some investigation we are areas on the page where text is to be set. The have found that frames are better suited to page-level frames for a page are generally defined by the docu- layout, and other solutions such as nested vboxes ment’s class, but can be modified dynamically. For and custom packages work better for altering layout instance, footnotes are generally implemented by within a frame. As more packages are developed, placing a zero-height frame at the bottom of the idiomatic use of the system will become more clearly main content area. As footnotes are placed on a defined. page, the footnote frame expands and the content I am often asked about typesetting of mathe- frame shrinks. This allows for interesting layout pos- matics. My usual glib answer is that there is not very sibilities: in a two column layout, the footnotes can much mathematics in the Bible! However, I would be placed at the end of the second frame, or across like to see an implementation of math typesetting SILE the bottom of two frames, or in a separate area of for . The current plan is to find a way to call the page altogether. out to MathJax to perform the layout computations, SILE Frame layouts are generally specified relatively and have lay out the resulting nodes. How- SILE rather than absolutely; for instance, fig. 5 shows the ever, ’s development is essentially driven by user frame declarations of the standard book class. The requests; I don’t need math for the kind of books dimensions %pw and %ph refer to percentage of page I’m typesetting, but if this is something you need, I width and page height respectively. would be glad to help you implement it!

6 Various neat hacks 8 Conclusion SILE packages implement a number of interesting I have deliberately avoided making comparisons be- ideas; in no particular order: best-fit page breaking; tween SILE and TEX derivatives in this article, at- access to OpenType font features; parallel polyglot tempting to introduce SILE on its own merits. In layout (see fig. 6); justification alternates (rewriting a sense there is no comparison. TEX is an incredi- the text to improve justification); font fallback on bly mature and stable code base with a large and missing glyphs; grid typesetting; Japanese vertical vibrant community; SILE is new, fast-moving and typesetting and ruby (furigana) support; automatic buggy, with few active developers. But I believe that, generation of font specimens; a BibTEX-like bibliog- with time and development, SILE has the potential raphy manager implemented at runtime within the to provide better output than TEX for complex au- typesetter; support for producing Structured and tomated layout of non-Latin documents. It’s also Tagged PDFs. really fun to mess about with!

Simon Cozens TUGboat, Volume 38 (2017), No. 1 27 content = { page runningHead left = "8.3%pw", right = "86%pw", top = "11.6%ph", bottom = "top(footnotes)" content }, runningHead = { left = "left(content)", right = "right(content)", top = "top(content)-8%ph", bottom = "top(content)-3%ph" }, footnotes = { left = "left(content)", right = "right(content)", height = "0", bottom = "83.3%ph" }, folio = {

left = "left(content)", right = "right(content)", footnotes folio top = "bottom(footnotes)+3%ph", 1 bottom = "bottom(footnotes)+5%ph" } Figure 5: Frame layout in the standard book class

References [1] Behdad Esfahbod. HarfBuzz. http://harfbuzz.org/, June 2016. [2] Bryce Harrington. PDF surfaces. 1 Εἰ ὖ ῷ Therefore, if you have been さて、あなたがたは、キリス https://www.cairographics.org/manual/ Χῷ, ἄω ῖ, raised with Christ, keep トと共に復活させられたの seeking the things above, ですから、上にあるものを cairo-PDF-Surfaces.html, April 2016. ὗ ὁ Χ ἐ ἐ - where Christ is, seated at 求めなさい。そこでは、キ the right hand of God. [3] Roberto Ierusalimschy. Lua parsing expression ᾷ ῦ ῦ · リストが神の右の座に着い ておられます。 grammars. http://www.inf.puc-rio.br/ 2 ἄω ῖ, Keep thinking about things 上にあるものに心を留め、 ~roberto/lpeg/, September 2015. above, not things on the 地上のものに心を引かれな ἐ ῆ ῆ. earth, いようにしなさい。 [4] Alex Kapranoff. Text::Hyphen. http:

3 ἀ ἡ for you have died and あなたがたは死んだので //search.cpan.org/perldoc?Text::Hyphen, your life is hidden with あって、あなたがたの命は、 ω ὑῶ Christ in God. October 2015. キリストと共に神の内に隠 ῷ Χῷ ἐ ῷ ῷ· されているのです。 [5] Donald E. Knuth and Michael F. Plass. 4 ὅ ὁ Χ - When Christ (who is your あなたがたの命であるキリ Breaking paragraphs into lines. Software — life) appears, then you ストが現れるとき、あなた ωῇ, ἡ ω ὑῶ, too will be revealed in がたも、キリストと共に栄 Practice and Experience, 11(11):1119–1184, 1981. ὑῖ ὐῷ - glory with him. 光に包まれて現れるでしょ [6] Franklin Mark Liang. Word Hy-phen-a-tion ω ἐ ῃ. う。 by Com-put-er. PhD thesis, Department of 5 ¶ Νώ ὖ So put to death what- だから、地上的なもの、す ever in your nature be- なわち、みだらな行い、不潔 ἐ ῆ ῆ, - longs to the earth: sex- Computer Science, Stanford University, 1983. な行い、情欲、悪い欲望、 ἀ ual immorality, impurity, shameful passion, evil de- および貪欲を捨て去りなさ http://tug.org/docs/liang/. ἐ , sire, and greed which is い。貪欲は偶像礼拝にほか [7] United Bible Societies. Unified Scripture XML. , ἥ ἐ ἰ- idolatry. ならない。 ω, https://ubsicap.github.io/usx/, 2016.

6 ᾿ ἃ ἔ ἡ ὀ ῦ Because of these things これらのことのゆえに、神 [8] Bram Stein. TEX line breaking algorithm in the wrath of God is com- の怒りは不従順な者たちに ῦ [ἐ ἱ ῆ ing on the sons of disobe- JavaScript. https://github.com/bramstein/ 下ります。 ἀ]. dience. typeset, April 2016. 7 ἐ ἷ ὑῖ - You also lived your lives あなたがたも、以前このよ in this way at one time, うなことの中にいたときに [9] The Unicode Consortium. UAX #9: , ὅ ἐῆ when you used to live は、それに従って歩んでい among them. Unicode bidirectional algorithm. http: ἐ · ました。 //unicode.org/reports/tr9/, May 2016.

⋄ Simon Cozens Figure 6: A parallel triglot: different scripts, different Worldview Center for Intercultural Studies column widths, different font sizes St Leonards, Tasmania Australia simon (at) simon-cozens dot org http://www.simon-cozens.org

SILE: A new typesetting system 28 TUGboat, Volume 38 (2017), No. 1

BaskervilleF To bring his ideas to fruition required making his own printing machinery, his own ultra-smooth, pressed pa- Michael Sharpe per and his own high quality ink. It is understandable Abstract that his business was not greatly successful as a com- mercial enterprise, and he stands as an exemplar of the BaskervilleF, where F may stand ambiguously for either aphorism about making a small fortune as a printer Free or Fry’s, is derived from Libre Baskerville, and and type founder.1 Following his first production of an attempts to move away from its web font design toward edition of a work of Virgil, he was appointed (1758) as a font of more traditional Baskervillian appearance. printer to the Cambridge University Press and in the Its model is the Baskerville from the American Type course of the next fifteen years published about fifty Foundry (ATF) in the early twentieth century, which in classic volumes. His greatest publication is thought to turn was loosely based on Fry’s Baskerville, and had a be his folio Bible (1763), made according to his highest new italic designed afresh by Morris Fuller Benton. standards. 1 Baskerville’s life and work Baskerville seems to have been unusually progres- sive for his time, a free thinker though much of his John Baskerville (1706–1775) was born to a poor family work involved religious texts, and did not marry his in Birmingham but his talents became apparent early. housekeeper, and, finally, mistress and business part- He received basic schooling and worked for a period as ner, Sarah Eaves, until very late in life. (Zuzana Licko’s a writing master before turning to what made him quite font Mrs. Eaves is based on Baskerville but with softer wealthy, creating and operating a business that japanned features.) furniture. (Japanning involved multiple layers of heat At the time, the English printing community did treated, highly polished lacquer. The process was de- not give Baskerville much credit for his innovations. veloped as a European response to a similar Japanese His rivals spread stories about the sharpness of his ser- metal lacquering process which had become very pop- ifs and the excessive contrast being a danger to the eyes ular. Birmingham was the center of the industry in and even with the then-primitive state of fake news England. Success in the business at the upper end re- and social networking, these views took a firm hold. quired meticulous attention to be paid to the fine detail Foreign printers, however, such as Benjamin Franklin, of every aspect of the manufacturing process. We see Giambattista Bodoni and Pierre Simon Fournier were remnants of the japanning method in older electrical highly impressed by his designs, which led to the de- transformers, whose windings bear layers of insulating velopment of the “modern” style, for which Baskerville shellac built up in a similar manner.) is labelled a “transitional” font. Following Baskerville’s In his mid-forties, Baskerville moved away from death in 1775, his wife sold all his machinery, punches the japanning business back to his roots and started a and matrices to Beaumarchais in Paris for £3700, hav- firm devoted to high-quality printing. He was wealthy ing found no one in Britain willing to make an offer, enough to not have to be concerned about making such was the popularity of Caslon. These were used money from bread-and-butter jobs and could focus by Beaumarchais in his massive effort, requiring the on high-end projects. At that time William Caslon purchase of three paper mills, to print in Germany the was the dominant figure in English typography. His complete works of Voltaire, then banned from publi- eponymous font was wildly popular both in England cation in France. The surviving punches and matrices and America (U.S. Constitution!) but derivative, being were eventually donated back to Cambridge University based on other old-style fonts that had been available in the early twentieth century. Baskerville has continued for many years, carried to some calligraphic extremes. to be a French favorite, being used as the text font in Baskerville’s idea for a typeface that would reflect many of their mainstream mathematical publications. his ideals of stately, sober perfection was released in By 1765, Baskerville appears to have tired of the 1757. In contrast to the playfulness and asymmetries of printing business and later abandoned it entirely. In old-style fonts, his designs relied on simplicity of form 1768, a punch-cutter named Isaac Moore, who worked and a strict attention to detail. The characteristics, new for a Bristol print foundry owned by Joseph Fry, cut an to that era, were: imitation of Baskerville that did not require the highest • very regular glyphs, with few embellishments; level of equipment, paper and ink. It is now considered • curved strokes that are close to circular, at least in that Fry’s Baskerville, as it is now called, has more in the roman and bold; common with later fonts such as Bell, Bulmer and Scotch • sharply cut serifs; Roman. In 1923, Morris Fuller Benton designed for • the axis of rounded forms became almost vertical; • high contrast (ratio of thickest to thinnest strokes). 1 It being essential to first possess a large fortune.

Michael Sharpe TUGboat, Volume 38 (2017), No. 1 29

American (ATF) a revival of Fry’s Bas- worked set of inferior and superior figures at ap- kerville with a new italic to replace the original poorly proximately 60% of the size of its lining figures. thought-of version in Fry’s Baskerville. This version (The pre-built fractions, like ¾, were remade to appears in several of their catalogs, which have been use the larger figures, and the \textfrac macro scanned at high resolution by Raph Levien and are attempts to provide other fractions with attention available from TUG to interested parties. paid to appropriate spacing.) In 2012, Pablo Impallari and Rodrigo Fuenzalida • LB has only figures in its superiors. B adds supe- created a new web font, Libre Baskerville, that seems to rior upper and lower case letters, with eacute and be based on tracing the scans of the images above, as egrave the only accented superior letters. described in [KB01]. The x-height was increased, the • LB has no small caps. All four styles of B contain ascenders were shortened, and the contrast was lowered a Small Cap alphabet containing all characters in substantially, while the serifs and tails were thickened the T1 encoding. considerably. Their font was well done technically (very • An LY1 encoding is provided. This may be of in- good spacing and kerning) but did not look especially terest principally to Scandinavian users who wish close to Baskerville, in my opinion. to have access to the fj and ffj ligatures, for ex- 2 BaskervilleF ample, in typesetting ord. (There is no room left in the T1 encoding for these ligatures.) The other In discussions with Karl Berry at the TUG meeting in unusual ligatures available in LY1 are fb ( ), fh Toronto, 2016, I expressed my interest in making a () and fk (). version of Baskerville more attuned to the interests of As otf versions of the fonts are provided, they traditional T X users, and Karl later supplied me with E may be used directly in Unicode T X by means of a wealth of information about doing this starting from E the fontspec package. The baskervillef package Raph Levien’s scans.2 Remaking the fonts from scratch provides baskervillef.fontspec, a file specifying the lacked appeal, and once I examined Libre Baskerville names of the relevant otf files. It is loaded automat- closely, I saw that much could be achieved by undoing ically by fontspec, so it suffices to include in your their transformations to web fonts—reducing the x- preamble: heights, increasing the ascender heights, sharpening the serifs and hollowing out the glyphs to raise the contrast \usepackage{fontspec} \setmainfont[Ligatures=TeX]% and reduce the heaviness. Wherever possible, I kept {baskervillef} the side-bearings the same so that the new spacings and A kernings were as similar as possible to those of Libre Usage under LTEX has several options that are spelled Baskerville. out in detail in the package documentation. For math typesetting to accompany BaskervilleF, 2.1 Additions one may use the package newtxmath with the option In reworking Libre Baskerville, abbreviated below to LB, baskerville. For instance: to BaskervilleF, abbreviated below to B, there were some \usepackage{baskervillef} major additions, listed here. \usepackage[baskerville,vvarbb]{newtxmath} \usepackage[cal=boondoxo,frak=boondox]{mathalfa} • LB provides no bold italic style—B adds one. Al- though most users most likely make little use of Some sample output: bold italic in text, apart perhaps from titles in some A Simple Central Limit Theorem: packages, it is essential for producing a proper bold Let X1, X2, be a sequence of i.i.d. random variables with ··· math italic alphabet. mean 0 and variance 1 on a probability space Ω, F, Pr . Let ( ) • LB had only one normal sized figure style, propor- 2 y e t 2 tional lining.3 B contains four such styles, adding N y ≔ − / dt, tabular lining, tabular oldstyle and proportional ( ) ¹ √2π −∞ lining, the default being tabular lining, which is n S ≔ X . needed for proper mathematical figure spacing. n k Õ1 • LB has superior and inferior figures at just 40% Then of the size of its lining figures. B contains a re- S Pr n y N y n 2 It is a pleasure to acknowledge Karl’s encouragement and very  √n ≤  −−−−→→∞ ( ) useful technical feedback throughout this project. or, equivalently, for f C R , ∈ b( ) 3 In the original Baskerville, all figures were oldstyle, a.k.a. low- t2 2 ercase figures. Lining figures, the much more common form now, ∞ e− / Ef Sn √n f t dt. were not introduced until several years after Baskerville’s death. / −−−−→n ¹ ( ) √2π  →∞ −∞

BaskervilleF 30 TUGboat, Volume 38 (2017), No. 1

BaskervilleF is provided with a theorem font, a version of italic having upright punctuation and lining Bask figures, which is, in my opinion, more suitable than or- Bask: dinary italic for theorem statements and the like. I have BaskervilleF Monotype Baskerville abused the NFSS standards by setting \textsl to point The Monotype italic is substantially more delicate than to the theorem font rather than a real slanted variant. BaskervilleF’s italic. This is rather handy because we are then not limited to using the theorem font only in those theorems where Bask the styles using appropriate declarations are in force. Bask: BaskervilleF ITC NewBaskerville 3 Comparison to other Baskerville fonts The ITC NewBaskerville italic, on the other hand, shown 3.1 Other free Baskerville fonts with matching x-height, is heavier, has lower cap-height and ascender height, and its lower-case letters are a bit The following illustrates some of the differences be- wider, but the family resemblance to BaskervilleF is tween BaskervilleF on the left and its parent, Libre Bas- apparent. kerville on the right. (BaskervilleF has been rendered at Finally, here is Storm Baskerville, the most authen- four times natural size and Libre Baskerville at 3.6 times tic revival of the original Baskerville, at the same x- natural size, so as to match cap-heights.) height. Though it’s not obvious at even the moderate magnifications displayed below, the design details in Bask:Bask these fonts are truly remarkable. BaskervilleF Libre Baskerville The sharper serifs, higher contrast and shorter x-height of BaskervilleF is quite apparent. Baskerville120 Baskerville120-Italic Had we instead matched x-heights, the compari- In metal type, the Baskerville of Deberny & Peignot son would be: was from matrices made using Baskerville’s original punches, while that of (1913) is said Bask:Bask [SB88] to be a reproduction of Fry’s Baskerville. The BaskervilleF Libre Baskerville samples below were scanned from 30pt sources and so have thinner strokes than normal body text. This time, the cap-height and ascender height of Libre Baskerville are clearly much less those of BaskervilleF. If we compare BaskervilleF against Baskervaldx with matched x-heights weBask get: Bask: Deberny & Peignot Baskerville BaskervilleF Baskervaldx As is apparent, Baskervaldx is heavier, lower contrast, and more spread out horizontally.

3.2 Commercial Baskerville fonts The next two comparisons involve the commercial font Stephenson Blake Fry’s Baskerville Monotype Baskerville, available on the Mac as a system font. 4 Bibliography Bask [KB01] Karl Berry, Making outline fonts from bitmap Bask: images. TUGboat, 22:4 (2001), 281–285. BaskervilleF Monotype Baskerville http://tug.org/TUGboat/tb22-4/tb72berry.pdf The Monotype roman has different glyph widths (note [SB88] James Sutton and Alan Bartram, An Atlas of in particular the lower bowl of its B, which is less promi- Typeforms. Wordsworth Editions, Ware (1988). nent than in other Baskervilles), but is otherwise a fairly good match to BaskervilleF in terms of weight, contrast Michael Sharpe ⋄ and spacing when magnified by 106.5%. http://ctan.org/author/id/sharpe

Michael Sharpe TUGboat, Volume 38 (2017), No. 1 31

Programming LATEX — A survey of Other books are listed at the UK TUG FAQ: documentation and packages http://www.tex.ac.uk/FAQ-latex-books.html Brian Dunn 3 Electronic books Abstract Provided with the TEX distribution: A ε A survey of documentation sources and packages The Not So Short Introduction to LTEX 2 : A Covers introductory material, customizations, useful for LTEX programmers. and a simple package. [7] (texdoc lshort) A 1 Introduction LTEX 2ε: An unofficial reference manual: Reinventing the wheel may be useful if you think A thorough but concise reference manual for that you can do it better. Worse, though, is not even LATEX 2ε, available in several languages. [8] being aware that the wheel has already been invented (texdoc -l latex2e-help) in the first place, which can be an embarrassing LaTeX WikiBook: waste of time. Such can be the case both for a new An online book, includes information about cre- A LTEX programmer who isn’t aware of the many ways ating LATEX packages and classes. things may be done, but also for someone, the author https://en.wikibooks.org/wiki/LaTeX A included, who learned LTEX many years ago but TEX by Topic, A TEXnician’s Reference: may have missed some of the recent advancements A reference for TEX. This may be useful for in package code and documentation. understanding the source code of LATEX pack- A wealth of information is available, not only in ages, many of which are quite old and written print and online, but also directly embedded in the in low-level TEX. [9] (texdoc texbytopic) typical LATEX distribution. The following is meant to be a broad overview of some of today’s resources 4 Symbol references A for LTEX programmers. These are lists of the LATEX commands which produce (The latest version of this document is available symbols. in the docsurvey package.) A Comprehensive LTEX Symbol List: A 2 Printed books More than 14,000 symbols and LTEX commands. [10] (texdoc symbols-letter) Even in an electronic/online era, printed books still (texdoc symbols-a4) have the advantage of being able to be opened for reference without taking up space on the screen. Every symbol (most symbols) defined Printed books also provide extended discussion of by unicode-math: useful topics, have extensive human-edited indexes Unicode math symbols. [11] which are more useful than a simple document-wide (texdoc unimath-symbols) search function, and some are also available in elec- 5 FAQs tronic format. UK TUG FAQ: A LTEX: A Document Preparation System: A A wide-ranging list of frequently-asked ques- The classic introduction to LTEX, in continuous tions. [12] (texdoc letterfaq) reprint for decades. [1] (texdoc newfaq) A Guide to LTEX: A Visual LTEX FAQ: An introduction and more advanced material, Click on a visual element to learn how it is including an extensive reference guide. Fourth programmed. [13] (texdoc visualFAQ) edition: 2004. [2] A More Math into LTEX: 6 Accessing embedded documentation Updated to a fifth edition in 2016. [3] A large amount of documentation is included in a A LTEX Beginner’s Guide: TEX distribution. Most can be accessed with the An overview with numerous examples. [4] texdoc program. Use texdoc -l name to select A LTEX Cookbook: from many choices of matching package, file, or pro- More examples. [5] gram names. In some cases the same document is A The LTEX Companion: available in both letter or A4 paper sizes, or in several Provides extended discussion and examples of languages. the inner workings of LATEX and numerous useful The program kpsewhich may be used to find packages. Second edition: 2004. [6] out where a file is located. kpsewhich filename

Programming LATEX 32 TUGboat, Volume 38 (2017), No. 1

searches for and returns the path to the given file- CTAN to see what topics are shown for it. Selecting name. these topics then shows you related packages. [16] kpsewhich can also return directories, such as: 9 Packages kpsewhich -var-value TEXMFROOT kpsewhich -var-value TEXMFDIST A number of packages are especially useful for LATEX kpsewhich -var-value TEXMFLOCAL programmers: xifthen: Some package authors choose not to include the Conditionals. source code in the package documentation. To view the source code: etoolbox: A wide range of programming tools, often avoid- 1. To locate and read a package’s .sty file: ing the need to resort to low-level TEX. kpsewhich package.sty etextools: Usually these files have their comments removed, Adds to etoolbox. Strings, lists, and more. so it is better to use the .dtx file instead. xparse: 2. The .dtx file is usually available, and will have Define macros and environments with flexible the package’s source code. argument types. kpsewhich package.dtx environ: The comments are not yet typeset and so will Process environment contents. not be as easily read. arrayjobx, fifo-stack, forarray, forloop, xfor: 3. To typeset the documentation with the source Programming arrays, stacks, and loops. code, copy the .dtx file and any associated im- iftex: age files somewhere local and then look for Detect TEX engine. \OnlyDescription in the source. This com- ifplatform: mand tells the ltxdoc package not to print the Detect operating system. source code. xstring: 4. Remove \OnlyDescription, then process the String manipulation. .dtx file with pdflatex package.dtx. Barring unusual circumstances, this will create a new keyval, xkeyval, kvsetkeys: documentation .pdf file with the package source Key/value arguments. code included. pgfkeys, pgfkeyx: Another form of key/value arguments. 7 Source code kvoptions: The source code for LATEX 2ε itself is also included Key/value package options. in the distribution. expl3: A A The LTEX 2ε sources: LTEX3 programming. Occasionally useful for figuring out how some- l3keys, l3keys2e: thing really works. [14] (texdoc source2e) Key/value for LATEX3. A List of internal LTEX 2ε macros CTAN topic macro-supp: useful to package authors: An entire topic of useful programming macros. A list of the core LATEX macros, each of which is linked to the source code. [15] 10 Creating and documenting packages (texdoc macros2e) 10.1 Packages and programs

8 Comprehensive TEX Archive Network Documentation for those interested in creating their own package or class: The Comprehensive T X Archive Network (CTAN) E A provides a master collection of packages. A search How to package your LTEX package: function is available, which is useful when you know A tutorial. [17] (texdoc dtxtut) A the name of a package or its author, and a list of LTEX 2ε for class and package writers: topics is also provided. There are so many topics, Programming a package or class. [18] however, that finding the right topic can be a problem (texdoc clsguide) in itself. One useful method to find what you are The doc and shortvrb packages: looking for is to search for a related package you may Packages for documenting packages. [19] already know about, then look at its description on (texdoc doc)

Brian Dunn TUGboat, Volume 38 (2017), No. 1 33

The DocStrip program: [5] LATEX Cookbook, Stefan Kottwitz, Packt The program which processes .dtx and .ins Publishing, 2015, ISBN-13 9781784395148, files to generate documentation and .sty files. http://latex-cookbook.net/ [20] (texdoc docstrip) [6] The LATEX Companion, Frank Mittelbach, Michel Goossens, Johannes Braams, David Carlisle and 10.2 Articles Chris Rowley, second edition, Addison-Wesley, Related articles from TUGboat: 2004, ISBN 0201362996. [7] The Not So Short Introduction to LAT X 2ε, Rolling your own Document Class: Using LAT X E E Tobias Oetiker, https://ctan.org/pkg/lshort to keep away from the Dark Side: [8] LAT X 2ε: An unofficial reference manual, article E An overview of the class. [21] George D. Greenwade, Stephen Gilmore, Good things come in little packages: Torsten Martinsen, and Karl Berry, An introduction to writing .ins and .dtx files: http://home.gna.org/latexrefman How and why to create your own .dtx and .ins [9] TEX by Topic, A TEXnician’s Reference, Victor files. [22] Eijkhout, Addison-Wesley UK, 1991, ISBN How to develop your own document class— 0201568829, http://eijkhout.net/texbytopic/ our experience: texbytopic.html A comparison of developing class vs. package [10] The Comprehensive LATEX Symbol List, Scott files. [23] Pakin, https://ctan.org/pkg/comprehensive [11] Every symbol (most symbols) defined by 11 Online communities unicode-math, Will Robertson, English forums: https://ctan.org/pkg/unicode-math [12] UK TUG FAQ, UK TEX Users Group, TeX — LAT X Stack Exchange: E http://www.tex.ac.uk/ Almost any question has already been [13] The Visual LATEX FAQ, Scott Pakin, asked, and a quick web search will find https://ctan.org/pkg/visualfaq answers, ranked by vote. [14] The LATEX 2ε Sources, Johannes Braams, David http://tex.stackexchange.com/ Carlisle, Alan Jeffrey, Leslie Lamport, Frank A LTEX Community: Mittelbach, Chris Rowley, and Rainer Sch¨opf, A traditional forum with quick replies to https://ctan.org/pkg/source2e your questions. [15] List of internal LATEX 2ε Macros useful to http://www.latex-community.org/ Package Authors, Martin Scharrer, German forums: https://ctan.org/pkg/macros2e [16] Comprehensive T X Archive Network (CTAN), TeXwelt: E https://ctan.org http://texwelt.de/wissen/ [17] How to Package Your LATEX Package, goLaTeX: Scott Pakin, https://ctan.org/pkg/dtxtut http://golatex.de/ A A [18] LTEX 2ε for class and package writers, LTEX3 Newsgroup: comp.text.tex Project, https://ctan.org/pkg/clsguide [19] The doc and shortvrb packages, Frank ⋄ Brian Dunn Mittelbach, https://ctan.org/pkg/doc bd (at) bdtechconcepts dot com [20] The DocStrip program, Frank Mittelbach, Denys http://bdtechconcepts.com Duchier, Johannes Braams, Marcin Woli´nski, and Copyright 2017 Brian Dunn Mark Wooding, https://ctan.org/pkg/docstrip [21] Rolling your own Document Class: Using References LATEX to keep away from the Dark Side, A Peter Flynn, TUGboat 28:1 (2007), pp.110–123, [1] LTEX: A Document Preparation System, Leslie Lamport, second edition, Addison Wesley, 1994, http://tug.org/TUGboat/tb28-1/tb88flynn.pdf ISBN 0201529831. [22] Good things come in little packages: An [2] Guide to LAT X, Helmut Kopka and Patrick W. introduction to writing .ins and .dtx files, E TUGboat Daly, fourth edition, Addison-Wesley, 2004, ISBN Scott Pakin, 29:2 (2008), pp.305–314, 0321173856. http://tug.org/TUGboat/tb29-2/tb92pakin.pdf [3] More Math Into LAT X, George Gr¨atzer, 5th ed., [23] How to develop your own document class— E TUGboat Springer, 2016, ISBN 3319237950. our experience, Niall Mansfield, 29:3 (2008), pp. 356–361. http://tug.org/TUGboat/ [4] LAT X Beginner’s Guide, Stefan Kottwitz, Packt E tb29-3/tb93mansfield.pdf Publishing, 2011, ISBN 1847199860.

Programming LATEX 34 TUGboat, Volume 38 (2017), No. 1

CTAN goes 2.0 — New community features add one or more stop words. The stop words are and more checked when a new guest book entry is submitted. The entry is automatically deleted when a stop word Gerd Neugebauer is found. Abstract As a result, I observed that trash was reduced but did not vanish completely. It’s an arms race and The portal of the Comprehensive T X Archive Net- E I am certain that it will continue. Thus it became work (CTAN) is continuously improving. Additional clear that something has to be done to avoid a similar features for the personalized interaction with the effect for the community features. portal and the contribution to its contents are now publicly available. This allows — among other fea- tures — registered and authenticated users to rate packages and leave comments on them. In addition, CTAN announcements are now avail- able on the portal and via RSS feeds. Figure 1: The login and registration (“Join”) links 1 Introduction

In the Web context the magical number is 2.0. This 2.2 Registration and login is originated in the term Web 2.0 as coined by Eric Knorr in 2003 [Kno03]. It is associated with the CTAN has had a strict security and privacy policy enrichment of the user experience by community since its beginnings. As one consequence we have https functions. The community member is not only a pure activated an encrypted communication via consumer but can contribute to the Web content. some time ago. The new community features follow CTAN is based on the principle of contribution of this spirit. We take care of your data and you have material and participation of community members on control over the information presented about you on the level of packages. Anyone can upload a package to the Web. CTAN. The CTAN team helps to ensure consistency One change is visible on each page: the links to and a high quality of the information provided in the page for login and registration (“Join”). They the catalogue of packages. This aims not only at appear in the upper right corner of each page, as shown in figure 1. direct online use but also at the production of TEX To get started you have to register a new account distributions like TEX Live and MiKTEX. With the new features of the CTAN portal we to gain access to the community features. We collect enter the era of Web 2.0. Community members are a few pieces of information during the registration now enabled to contribute information to CTAN as process. You can choose a nearly arbitrary account well. First of all, this information augments the name. If all privacy guards are active then only this package description with rating and commenting of alias will be seen on the Web portal. Nevertheless packages. Thus it allows other members to benefit we prefer attributions to you with your real name. from the experiences with packages shared on the Thus it needs to be given. At least the CTAN team CTAN portal. wants to know who the members are. Finally you need a working email address. This is used during 2 CTAN taken personally the registration process to verify that you can be From the start, CTAN has been built with user man- reached if required — for instance if you forgot your agement and login capabilities. Until now, I have password. used this feature as the only user for managing the Two things are used to identify a user: the first portal. The registration has been deactivated and is the account name and the second is the email the login page hidden. address. Thus the portal tries to avoid different accounts being created with identical account names 2.1 Experiences with the guest book or email addresses. The CTAN portal has had a guest book since its A few more settings can be made on the regis- relaunch in 2012 [Neu13]. Soon spammers found tration page to get things right immediately. After this page and started to pollute the entries. I have you have submitted the registration an email will manually deleted offending entries — sometimes quite be sent to the email address you have entered. It quickly. Nevertheless it was annoying. contains a confirmation link to a page where you can Thus I have added a list of stop words to the set up your initial password and activate the account. portal. Whenever I delete a guest book entry I also Now you can log in and participate.

Gerd Neugebauer TUGboat, Volume 38 (2017), No. 1 35

A few situations deserve special treatment. It account name. It is your unique identifier for the appears obvious that a user name already in use system. Once chosen during registration it cannot cannot be chosen. If you enter an email address be altered. Thus choose wisely. which is already in use, you cannot register a second You can see there statistics about your ratings. account for it. This is most probably the case when There you can find a link to the complete list of you have forgotten that you had already registered. your ratings and comments. With two clicks you Just login — or request a password renewal if you’ve can reach a particular package page. There you can forgotten that as well. revise your rating and your comments at any time The login is fairly simple. You can use the link and as often as you like. on each page to get to the login page. Alternatively if you request a private page without being logged 2.4 More preferences for you in you are automatically redirected to the login page Any community member has had a small set of set- first. tings used even without being logged in. This consists The login uses your account name and your mainly of the selection of the skin — the appearance password. The password is not known to the CTAN of the Web pages. Some time ago, this was aug- team and cannot easily be uncovered. Remember mented by the option to disable hyphenation and the our privacy policy — we try to protect your privacy. selection of the language. This has been requested If you happen to forget your account name or particularly because the cut-and-paste operation has password you can request an email with a reminder revealed insufficient support of the UTF-8 character or a link to a page which allows you to choose a new encoding by several programs. This leads to mys- password. terious unprintable characters for the hyphenation You can even decide to delete your account on marks in pasted text. CTAN. In this case you cannot login to this account The selection of the skin and the hyphenation any more and the information gathered by the system flag are stored locally in the browser. Thus they is deleted. can be used without login. On the other hand, they are bound to a single browser and cannot be shared 2.3 Your personal dashboard between different computers or devices. You have a personalized starting page — called a These choices can now be found on the settings dashboard. It is accessible exclusively to you. No- page. This page provides access to additional settings body else sees this page. This page is usually shown if the member is logged in. The complete group immediately after you log in. A sample is shown in of settings about your account and privacy can be figure 2. found there too. Notably, most of the fields from the registration can be modified here.

2.5 Your public account page Each registered community member has a /home page as the URL /home/account. This /home page shows all information about the account which has been approved by the user. Currently the public account page is similar to the dashboard (see figure 3). But this might change in the future.

2.6 Identifying package authors The strict privacy policy of CTAN prevents an au- thor’s email address from being shown prominently on the Web. The CTAN team does not have the capacity to extend the information about authors with a flag signaling the agreement of the author Figure 2: A sample dashboard to pass on their email address. Nor do we have the capacity to get such an agreement from each of the From your dashboard you can see which data is more than 2000 authors. stored for your account. Nearly everything can be Authors are usually interested in getting feed- modified at any time. The only fixed value is the back on their packages. Thus in most cases it is

CTAN goes 2.0 — New community features and more 36 TUGboat, Volume 38 (2017), No. 1

upload an update of one of your packages becomes rather simple: • Login • Select the package from the list of your packages • Press “Upload” • Fill in the version number, announcement text, and select the file to be uploaded • Press “Submit contribution” and you are done With these simplifications, authors can be fur- ther encouraged to upload their package develop- ments to CTAN.

3 Sharing your experience — Rating and Figure 3: A public account page commenting packages The user rating of products can be a good source of information. We see this kind of feedback on many not hard to find an email address in a “readme” file, online shops. A visitor can get an impression of the the package documentation, or even the source code. experiences of other users. Now we carry this over Now an author is also enabled — and encouraged — to the packages on CTAN. to provide his email by registering as a CTAN com- munity member and establishing a link to the CTAN 3.1 New building blocks on package pages author which should already be in place. Thus pack- Each package has a page on CTAN which presents age users can more easily find the email address and the data gathered in the catalogue about this pack- get in contact with the author. age. For instance, the package biblatex is asso- The association works via the email address of ciated with the page https://www.ctan.org/pkg/ a contributor known to the CTAN team. If a user biblatex. registers an account with the same email address then When looking at the package pages in recent he is asked to establish an association. For instance, years, they may have seemed a bit underpopulated. I have chosen the account name “gene”. In the CTAN This is fixed now. More information and functionality catalogue someone named me “neugebauer”. Since is in place. An example can be seen in figure 4. the email addresses were identical, the system has offered me the possibility to establish an association and I did it. Now a link is on my /author page pointing to my /home page and vice versa. This additional association between package au- thors and CTAN accounts allows visitors to find the email address of an author more quickly. Of course, the publication of the email address remains under the control of the contributor.

2.7 Package upload simplified Package upload is one place where a contributor can profit from having a CTAN login. As you may already know, the upload form is pre-filled with the data from the last visited package page. This means that if you navigate to a page which is related to a package then this information is kept during the current browser session. The page can be the package page under /pkg/... or a package-related page in the tex-archive/ tree. When you are logged in, your name and email address is filled additionally. Thus the procedure to Figure 4: New features on package pages

Gerd Neugebauer TUGboat, Volume 38 (2017), No. 1 37

On this page you can find three new sections. nouncements have been published via the mailing The “Community Comments” lists the com- list [email protected] for a long time. This mail- ments and ratings of the CTAN community members. ing list is run by DANTE e.V. Anyone interested The section “Rating Profile” shows some statistics can subscribe to receive the email via the adminis- about the average rating, the number of votes and tration page, https://lists.dante.de/mailman/ the distribution of the votes. The section “My Rat- listinfo/ctan-ann. ing” allows you to rate the current package or modify Newsgroups supplement this service. For in- your previous rating. This functionality is available stance the newsgroup comp.text.tex receives the to authenticated members only. announcements from the mailing list. The aim of the CTAN team is to avoid abuse and nonsense content. Thus we do not allow anonymous 5.1 Gmane is dead — Long live CTAN ratings and comments. As a side effect this policy Gmane has been a good and reliable way to access allows you to review your rating and adapt it to your many mailing lists. When it went down at the end of current experiences with the most recent version of June 2016 we felt that there was a gap to be filled — the package. at least for CTAN and the TEX world. With the end When you enter the rating for a package you of Gmane, there was no good way to learn of changes are asked for several fields. First is the number via a news feed. This functionality is now provided of stars — more is better. You can enter a textual by the CTAN portal. comment. It contains whatever you have to say but is optional. Finally you are asked to rate yourself. This provides an indication for the readers on how deeply you are involved with the package. By the way, it is legitimate for an author to rate their own package. Even this can provide insights for readers. In figure 4 you see the sections with a few ratings and comments. The packages await your contribution with ratings and comments.

4 CTAN and JavaScript — Supporting old-fashioned ways Nowadays the Web is nearly unusable without Java- Script. This creeps into CTAN as well. CTAN uses Figure 5: Announcements on the CTAN home page JavaScript, but sparsely. Nevertheless the 2.0 fea- tures make use of JavaScript. You will not be able to The CTAN home page (see figure 5) now shows see or use much without JavaScript enabled — don’t the four most recent announcements on ctan-ann. even try. In addition, a link to a page with a larger list is Recently a complaint reached me about the use provided (see figure 6). On this page you can find of JavaScript on the archive browser pages. Since the orange buttons for “Atom” and “RSS”. They are some directories are huge it can take some time links to the respective feeds. Currently the formats to render the directory listing. In order to show Atom 1.0 and RSS 2.0 are supported. You can enter some kind of progress the implementation uses an these URLs in the feed reader of your choice to read asynchronous AJAX call — i.e. JavaScript — to get them. the data while a CTAN banner is rotating. If Java- Maybe you are interested in single packages Script was not available the banner rotated forever only. In this case you can navigate to the respective since no attempt is made to load the data. package page. If there have been announcements for This has been fixed. A page without JavaScript this package, you can again find the four most recent is used automatically — it may take slightly longer ones listed and a link to a page with more, and again before the browser shows a reaction. At least the the orange buttons for “Atom” and “RSS” with the basic functionality of browsing the archive directory links for the newsfeeds. and searching can be used without JavaScript now. 5.2 Activity diagrams — sort of 5 Feeds from the Lion — News on CTAN On the package page you can sometimes find a dia- The TEX world is constantly evolving. New and gram with (sort of) spectral lines. The idea was to updated packages can be found on CTAN. The an- visualize the activity of the package development in

CTAN goes 2.0 — New community features and more 38 TUGboat, Volume 38 (2017), No. 1

6.1 The light on the horizon With the new possibility of identifying users, we are able to approach more functionality. Things which should not be allowed anonymously can be opened for community members or package authors. We can envision allowing package authors to see and edit the catalogue entry for their package. For instance the description and the topics might be made accessible in this way. Nowadays this informa- tion is maintained by the CTAN team. Anyone can submit suggestions for improvements by sending an email. But such a process might be offered on the portal as well. Figure 6: The announcements page For any user, one can envision lists on the home page containing links to packages of interest or doc- umentation. For the user this list acts as a personal some way. The only information available at CTAN library. These can be taken into account when rating are the announcements. Thus the announcements a package. One could consider making such lists are shown in this diagram (see figure 7). public. Thus lists of packages for special interests This diagram can be misleading in several sit- could be maintained by the community. uations. The association of an announcement to a Another possibility would be to make the com- package relies on a heuristic which tries to identify munity features themselves configurable for an au- the package name in the announcement text. This thenticated user. If someone does not like the rating heuristic works fairly well for recent announcements and commenting, then this could be disabled. But I but may fail for older ones or announcements for suspect this configuration would not be often used. several bundled packages. 6.2 It’s your turn to contribute to www.ctan.org In this article, you have seen some of the new com- munity features of the CTAN portal. Now it is up to you to make best use of it. Visit the CTAN portal, register, and start rating the packages you know best from your daily use. Please share the wealth of your experiences with some of the packages on CTAN and make the portal more fruitful for others. Enjoy www.ctan.org and keep on TEXing.

Figure 7: Announcements spectral lines References [Kno03] Eric Knorr. 2004 — The Year of Web Services. Some of the packages are mirrored to CTAN CIO, December 15 2003. http://www.cio. automatically. In this case no announcement may com/article/2439869/web-services/ appear on ctan-ann. The authors can ask the CTAN 2004--the-year-of-web-services.html. team — via email — to publish an announcement any- [Neu13] Gerd Neugebauer. CTAN: Relaunch of way. But this option is rarely used. the Web Portal. TUGboat, 34(1):6–9, The upload form offers the choice to upload 2013. http://tug.org/TUGboat/tb34-1/ a package without announcement. If the uploader tb106neugebauer.pdf. selects this option then no announcement is sent and consequently no spectral line is shown. ⋄ Gerd Neugebauer Im Lerchelsb¨ohl 5 6 The road ahead 64521 Groß-Gerau, Germany gene (at) gerd-neugebauer dot de The CTAN portal is evolving. And features can be www.gerd-neugebauer.de added, modified, or even removed entirely.

Gerd Neugebauer TUGboat, Volume 38 (2017), No. 1 39

An introduction to the LATEX Table 1: Suggestions for marker prefixes. cross-referencing system Object Prefix Object Prefix Thomas Thurnherr Chapter ch Figure fig Section sec Table tab Abstract Subsection ssec List item itm A One of the most powerful features of LTEX is the Appendix app Equation eqn cross-referencing system. It allows referencing num- bered structures, such as headings, figures, tables, or equations anywhere in the same document. Impor- within the \caption macro, because the caption pro- tantly, references are automatically updated by the duces the figure or table number. Placing a \label system whenever necessary. This article provides an before the numbered object almost certainly will pro- overview of the referencing system and introduces duce the wrong reference. The same might happen several packages that extend it. if the \label is placed too far after the numbered 1 Introduction object. LATEX provides a referencing system that allows ref- 4 Generating/updating references erencing almost any numbered object in the same A document generally requires two typesetting runs document. To do that, the system implements the to generate reference numbers. Behind the scenes, \label and \ref macros. The \label macro sets the system collects all markers in an aux meta-file a marker that uniquely identifies a numbered ob- while typesetting the document once. It then reads ject, which can then be referenced through the \ref this aux file to update references during the second macro. The \pageref command is less frequently run of typesetting. Whenever references cannot be used. It prints the page number of the labeled ob- generated correctly by the system, double question ject. An example is provided below, where a marker marks (??) are produced in the output document. sec:intro is added to a section. This marker is If references are not updated correctly after re- then used in the next section to refer to the previ- typesetting, a quick look through the log file might ous section. Assuming that “Introduction” is the help identify the problem. The next section (5) de- first section in the document, \ref{sec:intro} just scribes warnings related to the referencing system. prints the number: ‘1’. A \section{Introduction}\label{sec:intro} 5 LTEX warnings related to the % Content referencing system It is not uncommon to see warnings related to the \section{Methods} referencing system in the log file. Two kinds of In section \ref{sec:intro} on page warnings may arise from ill-defined markers: \pageref{sec:intro} we introduced ... 1) There were undefined references. 2) There were multiply-defined labels. 2 Specifying a label or marker The first is due to a missing marker that is referenced, The system imposes no restrictions on the format whereas the latter is due to a marker that is defined of a marker. However, it is common practice to more than just once. Multiply-defined labels can add a prefix + (:) to every marker. A prefix happen when the author copies a piece of code, such helps the author to identify the kind of object that as a figure environment, and forgets to replace the is referenced. For example, to reference a figure a marker with a unique name. possible marker might be \label{fig:schema}. Ta- ble 1 shows prefix suggestions for the most frequently 6 Packages extending the referencing referenced numbered objects. Although it is good system practice to use a prefix, these are merely suggestions There are numerous packages that extend the LATEX and an author is free to choose a different set of cross-referencing system. Here, I provide a brief in- prefixes or omit them altogether. troduction to varioref, cleveref, hyperref and xr/xr-hyper. I chose these particular packages be- 3 Placement of labels cause I think each of them extends the referencing Ideally, the \label is placed right after the numbered system in a unique and comprehensive way. In gen- object to be labeled. For floating environments such eral, these packages do not redefine the functions as figure or table, \label has to be placed after or of the standard referencing system, but define new

An introduction to the LATEX cross-referencing system 40 TUGboat, Volume 38 (2017), No. 1

macros with a slightly different and beneficial be- ticularly useful for scientific articles, where supple- havior. Therefore, the standard behavior of \label, mentary materials are often provided together with \ref and \pageref is not affected by using these the main text. The package allows referencing sup- packages. plementary figures and tables in the main text. To do that, the external document has to be defined by 6.1 The varioref package \externaldocument{filename} in the preamble of The varioref package [4] extends the basic refer- the main text. If the external tex file is in a different encing system with slightly more sophisticated com- folder, the path has to be added to the file name. mands. \vref combines \ref with \pageref to print With that, markers defined in the external document the number of the referenced object together with can be referenced in the main text. To produce the page number. If the referenced object is on the correct number, external documents need to be the same page, the page number is omitted. The typeset whenever they are changed. \vpageref macro extends this idea to \pageref. If \documentclass{article} the referenced object is on the same page, the output \usepackage{xr} says: “on this page”. Otherwise, the output shows \externaldocument{supplementary-materials} the page number. Finally, the package provides the \begin{document} \vrefrange and the \vpagerefrange commands to See supplementary figure \ref{fig:abc}. print a range of numbers and page numbers when \end{document} multiple references are provided. To create hyperlinks to referenced objects in ex- 6.2 The cleveref package ternal documents with hyperref, load the xr-hyper Often, the author mentions the type of objects that package instead of xr. is referenced in the text. For example, a figure could 6.5 Package loading order be referenced as follows: “This is shown in figure 1”. The \ref macro only prints the number of the refer- As all of these packages affect the behavior of the ref- enced object. This is where the cleveref package erencing system, loading multiple packages may give [1] comes in. It automatically recognizes the type rise to conflicts. To omit these, packages need to be of object that is referenced and prints the reference loaded in the right order, namely: 1) xr/xr-hyper, accordingly. For this purpose, the package provides 2) varioref, 3) hyperref, and lastly 4) cleveref. the \cref command. Similar to the varioref pack- 6.6 The showlabels package age, it also implements macros to print the page number of a referenced object (\cpageref) and a Finally, I would like to mention the showlabels range of objects or page numbers (\crefrange and package [3], which shows all markers in the margins \cpagerefrange). of the output document (PDF). This package is extremely useful to keep track of markers in long 6.3 The hyperref package documents, with a large number of labels. The main function of hyperref [2] that is related to the cross-referencing system is to make references References clickable. Clicking a reference navigates the reader [1] cleveref — Intelligent cross-referencing. to the page where the referenced object resides. For https://www.ctan.org/pkg/cleveref. that, it is sufficient to load the package in the pream- [2] hyperref—Extensive support for hypertext in ble. Moreover, the package defines the \autoref A LTEX. https://www.ctan.org/pkg/hyperref. macro, which is equivalent to \cref in the cleveref [3] showlabels — Show label commands in the package. It prints the type of reference together with margin. https://www.ctan.org/pkg/ the reference number. The package implements a showlabels. plethora of other functions not necessarily related to the cross-referencing system. A discussion of these is [4] varioref — Intelligent page references. out of the scope of this article. Nevertheless, I highly https://www.ctan.org/pkg/varioref. A recommend browsing the package documentation to [5] xr—References to other LTEX documents. learn more about what you can do with the package. https://www.ctan.org/pkg/xr.

6.4 The xr/xr-hyper packages ⋄ Thomas Thurnherr The eXternal References xr package [5] allows refer- thomas.thurnherr (at) gmail dot com encing objects in external documents. This is par- http://texblog.org

Thomas Thurnherr TUGboat, Volume 38 (2017), No. 1 41

How to use basic color models in LATEX where model is gray, rgb or cmyk and specifi- cation is described in §§ 4, 6, 7. Behzad Salimi 2. Global definition: use the \definecolor com- Abstract mand: This article provides a quick reference guide for new \definecolor{color1 }{rgb}{n1,n2,n3} or experienced users on how to use the five basic \definecolor{color2 }{cmyk}{n1,n2,n3,n4} LATEX color models. We describe the color packages, then use these custom colors with the syntax the primary syntax, and examples of how to include above: colored text (or objects) in a document. In this ar- {\color{color1 }text in color1} ticle, we do not attempt to include a comprehensive \textcolor{color2 }{text in color2} coverage of all the options and features in the basic See examples in the next section. color models; instead, the intent is to help the in- terested authors start learning (and using) the color 3 Basic color model syntax in the shortest time possible. The predefined colors for the basic color model are used without any model specification. The eight pre- 1 Basic color models defined color names are black, blue, cyan, green, The default basic color models supplied with stan- magenta, red, white, yellow. Syntax: dard LATEX installation provide an extensive range \textcolor{red}{\textbf{Sample text in red}} of colors that are easy to use for colored text or re- Sample text in red verse color highlighted text. {\color{cyan}\textbf{Sample text in cyan}} The five standard color models in LATEX are: Sample text in cyan § model color names must load Another example: 3 basic predefined a or b {\color{magenta} color changes 4 gray gray a or b \textcolor{blue}{can be nested 5 usenames predefined b \textcolor{red}{in all} } {\color{green}color models.}} 6 RGB arbitrary a or b 7 CMYK arbitrary a or b color changes can be nested in all color models. a: \usepackage{color} 4 Gray scale model b: \usepackage[usenames]{color} The gray scale model is a variable scale gray and it In the basic and usenames color models, colors takes only one number from 0=black to 1=white (as and their corresponding names are predefined, so they appear on white paper). only those predefined color names are available. In The base color name in this package is fixed as the rgb and cmyk models, a custom color of user- gray; however, various shades can be defined using specified name with infinite variation of color hue the base name gray. For example: can be specified (mixed). In the gray model, shades \newcommand{\gry}[1]{\textcolor[gray]{0.70}{#1}} of gray are specified. \definecolor{gray1}{gray}{0.50} 2 Syntax for colored text Syntax: The syntax for using colored text in all color models \gry{Sample text in 0.75 gray} above is one of two equivalent forms: Sample text in 0.75 gray \textcolor{gray1}{Next text in 0.50 gray} 1. {\color{name}text in color} Next text in 0.50 gray 2. \textcolor{name}{text in color} where name is either a predefined or user-specified 5 ‘usenames’ color model color name in one of the color models. The \color In the LATEX usenames color model, there are 68 pre- command may make extra vertical space in some defined color names; see Table 1. This color package environments such as tabular; in such cases, use must be loaded with the ‘usenames’ option: \textcolor command. \usepackage[usenames]{color} To specify a user-defined color in gray, rgb or Syntax: cmyk color models, the syntax may be a local or \textcolor{BrickRed}{text color in BrickRed} global definition: text color in BrickRed 1. Local definition: {\color{RoyalPurple} text in RoyalPurple} \textcolor[model]{specification}{text} text in RoyalPurple

How to use basic color models in LATEX 42 TUGboat, Volume 38 (2017), No. 1

\colorbox{Fuchsia}{\textcolor{white}{% colors can be “mixed” in any proportion; each pa- colorbox Fuchsia}} rameter must be between 0.0 and 1.0 but they need colorbox Fuchsia not add to 1.0. The three base colors themselves You can create an alias for a predefined color name, can be selected with red={1,0,0}, green={0,1,0}, for example: blue={0,0,1}. \definecolor{ogrn}{named}{OliveGreen} The syntax is \textcolor{ogrn}{ogrn is OliveGreen} 1. Define a color locally, usually for one-time use: ogrn is OliveGreen {\color[rgb]{n1,n2,n3}text} \textcolor[rgb]{n1,n2,n3}{text} Table 1: The 68 standard colors known to dvips Example: (not pdfLATEX). {\color[rgb]{0.8,0.1,0.8} Sample rgb color} Apricot Aquamarine Sample rgb color Bittersweet Black 2. Define a new color name: Blue BlueGreen \definecolor{color1}{rgb}{n1,n2,n3} BlueViolet BrickRed {\color{color1}text} Brown BurntOrange Example: CadetBlue CarnationPink \definecolor{teal}{rgb}{0.0,0.5,0.5} Cerulean CornflowerBlue \textcolor{teal}{Sample teal in rgb model} Cyan Dandelion Sample teal in rgb model DarkOrchid Emerald ForestGreen Fuchsia 7 CMYK color model Goldenrod Gray The subtractive primaries cyan, magenta, and yellow Green GreenYellow are the complements of red, green, and blue, respec- JungleGreen Lavender tively; that is, they are subtracted (like filters) from LimeGreen Magenta rgb for the range of full light (white) {0,0,0,0} to no Mahogany Maroon light (black) {1,1,1,1}. The cmyk (cyan-magenta- Melon MidnightBlue yellow-black) model is a more complex color model Mulberry NavyBlue that takes four parameters — one value for each of OliveGreen Orange cyan, magenta, yellow, black. The four colors OrangeRed Orchid can be “mixed” in any proportion; each parame- Peach Periwinkle ter must be between 0.0 and 1.0 but they need not PineGreen Plum add up to 1.0. The four base colors themselves are ProcessBlue Purple selected with cyan={1,0,0,0}, magenta={0,1,0,0}, RawSienna Red yellow={0,0,1,0}, black={0,0,0,1}. RedOrange RedViolet The syntax is analogous to that in §6: Rhodamine RoyalBlue RoyalPurple RubineRed 1. Define a color locally, usually for one-time use: Salmon SeaGreen {\color[cmyk]{n1,n2,n3,n3} text } Sepia SkyBlue \textcolor[cmyk]{n1,n2,n3,n3}{text} SpringGreen Tan Example: TealBlue Thistle {\color[cmyk]{0.2,0.7,0.1,0.2} Turquoise Violet Sample cmyk text} VioletRed White Sample cmyk text WildStrawberry Yellow 2. Define a new color name: YellowGreen YellowOrange \definecolor{clr1}{cmyk}{n1,n2,n3,n4} {\color{clr1}text} Example: 6 RGB color model \definecolor{brk}{cmyk}{0.2,0.7,0.3,0.3} In the rgb (red-green-blue) color model, the pri- \textcolor{brk}{Sample cmyk color model} maries are additive; that is, the contribution of each Sample cmyk color model base color is added to obtain the range from black (no light) {0,0,0} to white (full light) {1,1,1}. The 8 Advanced, specialized color models rgb color model takes three parameters — one value The basic color models mentioned above generally for each of the red, green, blue colors. The three suffice for most basic (and some complicated) color

Behzad Salimi TUGboat, Volume 38 (2017), No. 1 43

applications in text or text objects. If you need (or Even a brief discussion of xcolor’s capabilities is want) to use a more specialized color feature not beyond the scope of this article, so we refer the in- easily done in basic color models, you can browse terested reader to the full xcolor documentation. the description of the color packages on the CTAN My favorite graphics and plotting package to page http://ctan.org/topic/colour which lists use in LATEX, , loads the xcolor package over 40 different packages for special applications; automatically. Need we say more? some of these applications extend the basic models, 9 Concluding remarks and suggestions some introduce new capabilities. Perhaps the most versatile and advanced pack- The command \pagecolor changes the background age based on the LATEX basic color model is the color of the entire page until another \pagecolor xcolor package, which extends the capabilities of command is seen. Use \nopagecolor to change the color with a variety of shades, tones, tints, and background color back to normal. There are a num- arbitrary mixes of colors, plus additional features. ber of additional color packages available to color Among the many capabilities of xcolor are: specific environments or create special effects. Color, when used sparingly and effectively, can • arbitrary tints of predefined (custom) colors make a significant impression on the reader (or con- • complete tools for transformation between eight sumer) in technical publications (or advertisements). color models However, it is counterproductive if used improperly • complement color specification (−red=not red) or excessively. The only exception is perhaps color • color by wavelength used for “art”. While it is tempting (and fun) to use a multi- • define color series tude of colors in a paper or document, it may be • alternating row colors in tables wise to bear in mind the following facts and ideas: • global/local color definitions (to save memory) • Ask yourself, is it necessary to use color? • invoke color specification within pstricks op- • The appearance of color is different on a moni- tions, e.g., tor vs. paper, on different monitors and printers, \psset{linecolor=[rgb]{0.3,0.5,0.7}} and to different or color-impaired viewers. • Pastel colors just never look nice on a white To load the xcolor package, you must include in background. your document: \usepackage[options]{xcolor} • What looks nice on the author’s printer may not look as nice on the reader’s printer. The base (predefined) set of named colors in • Most color graphs or charts reproduce badly on xcolor is: a monochrome printer or copier; therefore, they black blue brown cyan darkgray gray lose their effectiveness. green lightgray lime magenta olive • Color effects, if included, should be used mini- orange pink purple red teal violet mally to enhance clarity only, and to aid in com- white yellow munication of detailed, complex information. Additional color names can be loaded with package • In most professional publications, all special ef- options. fects including color should be used sparingly. The color definition syntax in xcolor is similar • If you are compelled to use colored text to aid to that in color, but with extended syntax allowing the reader, first consider using other “normal” for expressions. One of the commands to assign a text formats such as enumerate, itemize, italics, name to a custom color specification is: bold face; even these formats should be used \definecolor[type]{name}{model-list}{spec-list} sparingly and consistently. Example: • Standard LATEX “documentclass” styles provide \definecolor{red}{rgb/cmyk}{1,0,0/0,1,1,0} automatic (and appropriate) font selection for defines color name red in rgb or cmyk model de- all title, sectioning, and text environments. pending on which model is currently set. Two of the packages related to xcolor: ⋄ Behzad Salimi xcolor-material Defines the 256 colors from Ridgecrest, CA USA the Google Material Color Palette. quadratures (at) gmail dot com xcolor-solarized Defines the 16 colors from https://sites.google.com/site/ Ethan Schoonover’s Solarized palette. quadratures/

How to use basic color models in LATEX 44 TUGboat, Volume 38 (2017), No. 1

SageMathCloud for collaborative document Multiple cursors for each user If a user creates editing and scientific computing multiple cursors using command- or alt-click, all cursors are visible to other users. Hal Snyder 3 Editing documents Abstract Nothing to install Because SMC is a cloud service, The open-source platform SageMathCloud (SMC) there is no software to install locally and projects lets users collaborate in real time on scientific com- are reachable from any device with an internet puting and authoring technical documents with stan- connection. Files can be compiled online to PDF dard LAT X tools. This article offers a survey of key E without the need for local installation of LAT X features, presenting SMC as a unique, unified plat- E software. form for teachers and researchers to be productive in today’s mixed software environments and interdis- Document history and backups Every edit (at ciplinary problem spaces. 2-second resolution) is recorded and stored in- definitely in SMC’s backend database. You can 1 Introduction browse the history using the TimeTravel view, All features of SageMathCloud are available as soon which also includes a mode showing exactly what as a free login is created. The following sections offer changed between two points in time (and who a tour of major features of SMC. made those changes). Figure 3 shows a Time- Travel view comparing two versions of a file. 2 Collaboration SMC stores several hundred read-only snap- SMC collaboration features apply to both static doc- shots of the complete filesystem state, which uments and executable files. Supported file types users can easily browse. This lets them recover include LATEX, Markdown, and HTML documents, older versions of files that might not have been as well as Sage worksheets, Jupyter notebooks, and edited via the web-editor (e.g., edited with vim Linux terminal sessions. or emacs via a terminal). Multiple users SMC has simultaneous real-time Preview SMC supports online preview, even for collaboration with no explicit limit on the num- documents that are 150 or more pages. It pro- ber of simultaneous users. Each user can cus- gressively refines the resolution of the preview tomize the color of their cursor. Figure 1 shows images and nearby pages. One of the SMC de- an example of a second user collaborating during velopers wrote the 2016 Cambridge University an edit session. Press book Numbers and the Riemann Work through network interruptions If your Hypothesis using SMC [2]. network connection temporarily fails, you can Forward and inverse search SMC supports continue editing as long as you want, and your inverse search, which means that by double- changes will be merged into the live document clicking on an area on a preview page, the cursor when you reconnect. in the text editor jumps to the corresponding Text and video chat SMC has text chat on location. Similarly, you can jump from a point the side of each document. Unlike most other in the text editor to the corresponding point in chat systems, you can include inline and display the preview via forward search. MathJax-compatible LATEX formulas and mark- Editor user interface SMC has a full-featured text down in the side chat. Users may edit any past editor for LATEX documents. It has horizontal chat message. Other collaborators are notified of and vertical split view, which lets you look at two messages via a bell in the upper right. Figure 2 points in the document simultaneously. SMC shows chat with LATEX beside file views. developers wrote a code folding mode (github. Video chat is available as well by clicking a com/codemirror/CodeMirror/pull/4498), so button in the side chat panel. one can easily toggle display of sections, sub- Course management SMC has an integrated sections, etc. Emacs, Vim, and Sublime key- course management system, which makes it easy bindings are supported along with many color to fully use LATEX with students in the context schemes. of teaching courses and workshops. For example, Customizable LATEX build system SMC fully you can create a document template with ques- supports processing very complicated LATEX tions, push it to all students, let them work on documents using custom build systems, includ- it, then collect it later, grade it, and return it. ing several LATEX engines — pdflatex, latexmk,

Hal Snyder TUGboat, Volume 38 (2017), No. 1 45

Figure 1: Editing .tex file, showing cursor of second user Harald.

Figure 2: Editable chat beside file views.

Figure 3: Edit history showing difference between two versions.

SageMathCloud for collaborative document editing and scientific computing 46 TUGboat, Volume 38 (2017), No. 1

and xelatex — with most packages preinstalled. have chat and TimeTravel and support LATEX Users can easily request additional packages (by mixed with code. Sage worksheets allow users clicking the help button), or install them them- to easily mix different languages and document selves in their local projects. The LATEX build formats in different cells of a single worksheet. command is fully customizable, and can involve Terminal sessions Any number of text-based ter- running arbitrary command sequences, since we minals may be opened to the underlying offer a full Linux environment. It is, for example, operating system, providing access to standard even possible to use GNU make to orchestrate Linux tools and command-line interfaces to pro- the full compilation via a Makefile. gramming languages. Dynamic content Our LATEX editing environment comes with SageTeX, which makes it easy to 5 Free and paid accounts add the output of Python (and SageMath!) com- Free accounts provide unlimited projects and collab- putations to any LATEX document. Note that orators, with 3GB of disk space per project. SMC the plots shown in Figure 2 are dynamically gen- charges for upgrades, including more disk space, CPU erated using SageTeX commands. The figure power, and outside network access, which makes it displays an excerpt from the example file for the possible to connect to the Internet from within a sagetex package by Dan Drake [1]. project in order to push and pull data to remote sites Besides SageTeX, SMC supports embedding (e.g., GitHub). For more about pricing, see https: R code via into LATEX documents. This //cloud.sagemath.com/policies/pricing.html technique is popular for generating documents with statistical and data science content. 6 Further study Spell checking In addition to normal spell check- The best way to learn more about SMC is to create a ing, SMC has TEX-aware spell checking. free account at https://cloud.sagemath.com and Other document formats Side-by-side edit- try it out for editing and programming. ing also supports HTML, Markdown, R Mark- There is a wealth of tutorial and reference infor- down, and formats, all of which support mation at the SMC wiki at https://github.com/ A sagemathinc/smc/wiki. real-time preview and inline and display LTEX. Figure 4 shows SMC compiling R Markdown. Articles about new features and system inter- nals can be found at the SMC blog, http://blog. Autocomplete The keyboard shortcut ctrl-space sagemath.com. Some of the information in this arti- autocompletes common LAT X commands. E cle appeared in the SMC blog posting [3]. 4 Scientific computing Source code is on GitHub at https://github. com/sagemathinc/smc. 4.1 Available software Languages SMC includes dozens of programming References languages and thousands of libraries and pack- [1] Dan Drake. dandrake/sagetex: embed ages, including computer algebra systems for code, results of computations, and plots theoretical mathematics, scientific packages for from the Sage mathematics software suite physical sciences and bioinformatics, and statis- (http://sagemath.org) into LAT X documents. tical and machine learning software for data sci- E https://github.com/dandrake/sagetex, ence. Here are some of the supported languages: 2017. [Online; accessed 2017-02-15]. Python, Sage, R, Julia, C, C++, Haskell, Scala. Packages and environments Popular packages [2] Barry Mazur and William Stein. and libraries are provided for each programming Prime Numbers and the Riemann Hypothesis. language. For Python, the entire Anaconda Cambridge University Press, 2016. suite is available. Sage alone includes symbolic [3] Hal Snyder. SMC for Collaborative LATEX and numeric packages, including NumPy, SciPy, Editing. http://blog.sagemath.com/latex/ matplotlib, Sympy, , Pari/GP, GAP, R, 2017/02/06/smc-for-latex.html, 2017. and Singular. See Figure 5. [Online; accessed 2017-02-14]. 4.2 Programming frameworks ⋄ Hal Snyder Interactive notebooks In the category of interac- Sagemath, Inc. tive notebook computing, SMC offers Sage work- hsnyder (at) sagemath.com sheets and Jupyter notebooks, both of which https://cloud.sagemath.com/

Hal Snyder TUGboat, Volume 38 (2017), No. 1 47

Figure 4: Compiling an R Markdown file in SMC.

Figure 5: Sage worksheet with LATEX in markdown, symbolic expressions, and units of measure.

SageMathCloud for collaborative document editing and scientific computing 48 TUGboat, Volume 38 (2017), No. 1

Producing HTML directly from LATEX — the programming text editor is usually more responsive lwarp package than a word processor. Another development is the large number of Brian Dunn markup languages now available, usually with a num- Abstract ber of options for output format. These systems are based on plain-text markup using inline tags or se- The lwarp package allows LAT X to directly produce E quences of special characters, and thus share some HTML5 output, using external utility programs only of the advantages of LATEX. While these systems for the final conversion of text and images. Math are useful for smaller documents, cross-referencing may be represented by SVG files or MathJax. is limited (although the AsciiDoc syntax does offer Documents may be produced by LAT X, Lua- E full cross-referencing to figures and tables), much of LAT X, or X LAT X. A texlua script removes the E E E the customization is done at the back end, and the need for system utilities such as make and gawk, and syntax of special symbols tends to become rather also supports xindy and latexmk. Configuration is dense once things become complicated. LATEX has automatic at the first manual compile. the advantage of giving macros relatively readable Print and HTML versions of each document may names. coexist, each with its own set of auxiliary files. Sup- Great progress has been made in making LATEX port files are self-generated on request. more widely accessible. Online collaborative LATEX A modular package-loading system uses the editing websites now claim a million users and thou- lwarp version of a package for HTML when available. A A sands of institutions, and LTEX is also now available Several dozen LTEX packages are supported with A as a browser application [5]. If anything, LTEX these high-level source compatibility replacements. seems to be building momentum, even after all these A tutorial is provided to quickly introduce the decades. user to the major components of the package. 2 Why convert LATEX to HTML

A Unfortunately, modern publishing often involves sub- 1 Why LTEX mission and rounds of editing in Word format, con- Before attempting to justify yet another LATEX-to- version to an XML intermediate, then conversion HTML conversion package, it may be worth stepping yet again to a professional typesetting system, along back for a moment to consider LATEX itself. A quick with HTML or EPUB versions. Each of these stages web search for “LaTeX vs Word”, or some other may be performed by different groups of people in program, will return many web pages and discussion different parts of the world [6], most of whom are threads comparing the various programs and their not familiar with the technical content, and also by advantages. Things change, however, and many of imperfect algorithms whose programmers haven’t these discussions are now obsolete due to modern ad- thought of every possibility. (Example: An incorrect vances in each program’s capabilities. As examples, line break in a superscript, where a hyphen had been LATEX no longer has many problems dealing with used as a minus sign.) The resulting errors are often fonts, and LYX plus a number of integrated devel- beyond the author’s control — the final product hav- opment environments are now available, along with ing problems which were not present in the signed-off online collaborative-development websites [1, 2, 3, 4]. proof. Meanwhile, Word can typeset nice mathematics with While it is unrealistic to expect any of this to a LATEX-ish input and has improved in its typesetting change, there is a movement towards self-publish- and stability, and commercial page-layout programs ing [7, 8, 9, 10] which removes many of these problems have improved in their handling of large documents. while also providing the benefits of quick turnaround, Nevertheless, many of the traditional advantages print on demand, and the ability to make changes of LATEX still apply: the visibility, stability, and porta- or updates as needed. This requires the ability to bility of plain-text markup, regular-expression search create a professional-quality printed document in sev- and replace of both text and formatting commands, eral sizes (e-tablet included), which LATEX certainly easy revision control, the ability to handle large and can provide, but also the ability to create HTML or complex documents, extensive programming capabil- EPUB as well. Providing a high-quality PDF ver- ities, and the large number of user-supplied packages sion is better than asking the user to print from solving real-world problems. In many cases, it’s still HTML, whereas providing an HTML version provides faster to type a few arguments than it is to open a di- easy accessibility and some search-engine benefits. alog box and select and fill in entries, and a powerful Providing both is the best option.

Brian Dunn TUGboat, Volume 38 (2017), No. 1 49

Another application of LATEX-to-HTML conver- 4 Existing methods sion is the creation of an informational (non-interact- Several methods already exist for converting some ive) website. Many scientists, professors, and engi- A subset of LTEX into HTML. These are discussed in neers would benefit from having their own website on slightly more detail in the lwarp manual. which their own technical papers could be published, lwarp A The closest to in design principle is the and they could apply their pre-existing LTEX skills internet class by Andrew Stacey [16], an interesting not just to the documents but also to the website project which directly produces several versions of itself. markdown, and also HTML and EPUB. A There is also the TEX4ht project [17], which 3 Why LTEX is hard to convert uses LATEX itself to do most of the work, along with Modern HTML5 and CSS3 are quite capable, to the an external program to convert special codes into point where they can be used to produce technical HTML or several other formats. books [11]. Nevertheless, there are some practical A number of other projects use an intermedi- problems to overcome in order to create a good con- ate translation program to parse LATEX source and A version from LTEX to HTML. then convert it externally. See HeVeA [18], TTH One of the first issues is the difference between [19], GELLMU [20], LATEXML [21], plasTEX[22], individual printed pages versus the HTML concept LATEX2HTML [23], and TEX2page [24], most of which of an endless scroll of variable width. Footnotes can are found on CTAN. become endnotes, but \pageref refers to what, ex- GladTEX[25] may be used to insert LATEX math actly? Is \linewidth for the current screen size, or expressions into pre-existing HTML code. is it for a conceptual page size? The relationship be- For sake of completeness, it should be mentioned tween font size, image size, and screen size is broken, that there are plugins allowing the entry of LATEX there is no margin for marginpars, and text may be math expressions for Word [26, 27] and LibreOffice reflowed at any time. [28], as well as commercial page-layout programs. LATEX knows about stretchable space, which is not true of HTML.A \vfill is almost meaningless 5 Why another approach in HTML, and an \hfill is not much better. Nor do floating objects translate well, since there are no Nothing except LATEX truly understands LATEX. page breaks at which to place them. More to the point, it’s easier for LATEX to pro- Math in HTML has been a problem for years, gram HTML than for a third-party converter program and the MathML standard has not been adopted by to understand LATEX. A larger portion of LATEX and many browsers [12, 13, 14]. MathJax is nice and its associated packages can be parsed and converted getting better all the time, but requires JavaScript when LATEX itself does the work. Another advantage and web access or a local copy, possibly making it of staying with LATEX alone is that development of unacceptable for use in EPUB documents [15], and the core and additional packages can be done without it can be relatively slow. Drawing math as images requiring skills in an additional language. has its own limitations. Aside from display-related issues, another gen- 6 Development eral problem with converting LATEX to HTML is the A 6.1 AsciiDoc markup fact that LTEX does not use end delimiters for many of its syntactic units. A \section does not have an The initial inspiration for the lwarp package was the \endsection before the next \section, for example, internet class. Seeing that someone else had trained and beginning the next \section may first require LATEX to produce markup, it was decided to pro- closing several nested levels worth of currently open gram LATEX to generate the AsciiDoc markup syntax. subsections and paragraphs. Nor does \bfseries AsciiDoc has several advantages over other markup have a syntactically defined endpoint, and HTML/ languages, including improved cross-references, and CSS do not support state switching. its Asciidoctor variant generating modern HTML5 Finally, LATEX engines do not allow for the direct output. Using AsciiDoc as an intermediate syntax plain-text output of HTML tags and text content, lifted much of the conversion load from LATEX, while thus requiring some kind of PDF-to-text conversion, providing almost all of the functionality which would followed by some system to optionally split the results be required for a typical technical paper. Neverthe- into separate web pages of HTML, and also copy less, AsciiDoc just couldn’t represent many of the out any inline images which must be cropped and concepts commonly-used in LATEX. Tabular material converted for web display. and minipages were limited, and the toolchain was a

The lwarp package 50 TUGboat, Volume 38 (2017), No. 1

bit of a chore to handle. Thus, the need to program ending LATEX commands, each \chapter, \section, LATEX to directly produce HTML. etc. must first un-nest any previously nested sectional units up to its own level. A simple LIFO stack is 6.2 Low-level and high-level patches used to track section depths and closing tags. In most cases, code is patched at the lowest level The sectioning code is one area which was rewrit- possible, allowing for increased code compatibility ten for HTML output, rather than try to reuse some- and reuse. The process of finding the best place thing which is patched by so many packages. Section to patch code resulted in several waves of revisions, breaks may trigger a new HTML file, and automatic especially in the areas of floats, auxiliary files, and cross-referencing occurs as well. Formatting and package handling. paragraph handling depend on which kind of section Entire packages must be supported. User-level it is. macros, counters, and so on are intercepted and redirected or ignored as necessary. 6.7 Cross-referencing 6.3 Fonts and encodings While the LATEX and cleveref cross-referencing code A vector-based font must be used for pdftotext is used, additional referencing is required to track to convert the PDF to plain text. A roman face is HTML pages and id tags. Automatically-generated used in most cases, which preserves em-dashes with tags are used for each section and float, allowing pdflatex. The HTML tags are printed to the PDF cross-references to link to specific objects on each file in a monospaced font, and the quote marks must page. Indexing uses the xindy program to generate be upright quotes, but this breaks the em- in HTML tags. pdflatex. A LTEX can display many specialized glyphs which 6.8 Floats are not encoded and thus won’t be picked up by pdftotext. It may be possible to assign these us- The combination of caption, subcaption, and newfloat ing glyphtounicode.tex or newunicodechar. For packages is supported. These were chosen from many uses lualatex or xelatex will be preferred, among the many alternatives due to being commonly as pdftotext can use UTF-8 encoding. used, flexible, and kept up-to-date. Floats are gener- The chosen font will be visible in HTML when ated in place, as if they were declared [H]ere. Sup- rendering math as SVG images. port is provided for other packages, such as float, floatrow, capt-of, wrapfig, placeins, and the author’s 6.4 Page layout own keyfloat which can also support margin floats. While generating HTML, a very small font is used and the page layout is changed to allow generous mar- 6.9 Image generation gins. Both are to avoid overflow, which can become a problem with long HTML expressions. Ragged Math, picture environments, TikZ, and anything right is used to avoid hyphenation. The \linewidth else with graphic content may be placed inside a is set for a virtual six-inch wide document, which special lateximage environment. When this envi- solves problems where the user specifies a fraction of ronment is started, an HTML open comment tag is \linewidth for graphics images or tabular columns. generated, followed by a new page. The contents of the graphic environment are then drawn on the 6.5 Paragraph handling empty page, followed by yet another new page whose Each paragraph in HTML must be enclosed in an first line is an HTML closing comment tag. The opening and closing tag. To track paragraphs, the comment tags encapsulate any text contents of the \everypar hook triggers an action when a paragraph graphics page such that they are not displayed in starts, and \par is re-assigned to close paragraphs. the HTML page. Meanwhile, the page and image Flags are used to control whether to turn tag cre- numbers are written to a text file to be processed by ation on or off in certain circumstances. For example, lwarpmk, which later separates the PDF file into in- inside an HTML paragraph tags are not al- dividual graphics files, each of which is then cropped, lowed, but a
tag may still be used for something converted to SVG, and named, ready for inclusion in like a multiline caption. the final web page. Finally, HTML instructions are generated to load the resulting graphics file at that 6.6 Sectioning position in the web page. Paragraph and formatting HTML sectioning requires nesting and unnesting elements must be restored to their LATEX meaning LATEX sectional units. Since there are no section- during the creation of the graphic.

Brian Dunn TUGboat, Volume 38 (2017), No. 1 51

6.10 Math not in its own pane, which has both its advantages Math may be represented by SVG images using the and disadvantages, and this may be changed in the A future. To provide for “responsive ”, the lateximage environment, with the LTEX source em- bedded as HTML alt tags, or by using the MathJax sideTOC is moved to the top of the page when the script. display is narrow, and an additional Home button is placed at the bottom as well. 6.11 Graphics images 6.15 Package handling Graphics images may be included at a specified width and/or height, or as a fraction of \linewidth. When A major design decision was made regarding handling \linewidth is used, the assumed six-inch line is used the loading of additional packages. Some packages as well, and the final image size is fixed in HTML, may be used as-is, some must be ignored, and some along with a max-width CSS property to hopefully must be patched in some way to be usable for HTML. avoid requiring the user of a hand-held device to pan Furthermore, it would be best if these actions were across the image. separated from the lwarp core, interacted well with graphicx is emulated quite well, although the each other, and expandable by the user. A To provide all of this, lwarp intercepts both the HTML standard does not agree with LTEX about white space while rotating or scaling, so expect ugly \usepackage and \RequirePackage macros to first results when doing so. see if there is an lwarp-provided alternative package. If so, that version is used instead of the original. It 6.12 Minipages is up to the lwarp version of the package to either Minipages are created using inline-flex, a fairly totally ignore the original, or load the original with new CSS3 property which allows side-by-side mini- its options and then perform additional patches or pages with a vertical alignment. Unfortunately, a other actions afterward. minipage inline with a paragraph of text cannot Several dozen packages are already supported by work since HTML does not allow a block inside a lwarp, including some of the most commonly used in paragraph, so the minipage then goes onto its own all major categories. For packages which lwarp does line. Furthermore, a

cannot be used inside not yet handle, the user may apply the print-only a , so lwarp disables minipages inside spans, environment or macro to encapsulate things which although \newline or \par can be used to create a do not apply to HTML. The user may also wish to
tag. create a custom package for lwarp to use, containing For those cases where the user may wish to have nullified macros and environments, along with any an HTML minipage without a fixed width, the new booleans, counters, and lengths which may be used command \minipagefullwidth declares that the in the source code. Such a package should be named following minipage may be the natural width of its lwarp-packagename.sty contents, up to the full width of the display. During and then lwarp will use it whenever the document print output, the minipage will still use its assigned calls for packagename.sty while creating HTML. width. 7 Using lwarp 6.13 Tabular The following is an overview of the configuration and Tabular material is a challenge, no matter the syntax. use of lwarp. Major advances have been made in sim- This is one area where lwarp had to totally replace the plifying this process, including the above-mentioned original code rather than try to patch the existing. package handling code. As a result, the user may sim- Data arrays in the computer-science sense had to ply add the lwarp-newproject and lwarp packages to be used to track column types, as well as actions the code at the correct place, compile the document for \>, \<, and \@. Border-generation logic had to once in the traditional way, and then immediately be created. As of this writing vertical rules are not use the lwarpmk utility for further print or HTML supported, but booktabs are, except for trim options versions. which would be very hard to do in CSS. 7.1 Project setup — lwarp-newproject 6.14 Navigation Previous versions of lwarp required the user to copy In an attempt to avoid resorting to JavaScript, a or link a number of configuration files and scripts, “sideTOC” has been developed. This is a subset of and also modify a makefile. the table of contents which appears at the side or Recent improvements include the use of auto- top of each web page. At present this sideTOC is matic detection of the TEX engine, operating system,

The lwarp package 52 TUGboat, Volume 38 (2017), No. 1

and jobname. These are written to a general config- filename of the homepage, and whether the latexmk uration file for the new lwarpmk program. lwarpmk utility should be used to compile, or whether lwarpmk is a utility used to compile print and HTML versions should detect changes and recompile by itself. of the document. lwarpmk is able to compile the printed or HTML Furthermore, the lwarp-newproject package is version of the document, process the for the provided, to be loaded just before lwarp. This pack- printed or HTML version, request a recompile, pro- age writes various additional configuration and utility cess the lateximage files, clean the auxiliary files, files. Included are a project-specific configuration or process the PDF into HTML files (a subset of its file for the lwarpmk utility (thus allowing multiple functionality, intended to be used by a makefile if documents to reside in the same folder), a configu- desired). ration file for xindy, a number of . files, and a If a document name is provided, lwarpmk pro- fragment of JavaScript used to invoke MathJax. cesses that document according to its project-specific Also written is a new hprojecti_html.tex file, configuration file, otherwise it uses its general con- whose name is the project’s \jobname with _html figuration file to reprocess the last document. appended. This is a small file which simply sets a few Several utility programs are still required for options to select HTML conversion, then \input s the HTML conversion. pdftotext is used to convert the user’s document. In this way, a compile of the the PDF document into UTF-8 text. pdfseparate user’s document generates a print version, while a extracts individual graphic images from the PDF file, compile of the _html version generates an HTML pdfcrop crops these images, and pdftocairo is used version. Both versions and their auxiliary files co- to convert PDF images into SVG images. pdfcrop exist. The lwarp-newproject package is only active is provided as part of the TEX distribution, and when compiling the print version, and the configura- the rest are commonly-available utilities from the tion files are regenerated each time the print version project, and should be made available by is recompiled. Should the user wish to switch TEX the operating system’s package manager. engines, the approach is to remove the auxiliary files, then manually recompile the main document using 7.3 Customizing the HTML pdflatex, lualatex, or xelatex. This engine will Aside from the CSS files, additional customization then be used by the lwarpmk utility for future com- is provided by a number of user-adjustable settings piles of either the print or HTML version. The lwarpmk utility program is to be provided and macros. HTML files may be numbered or named, and as a LuaTEX executable by the TEX distribution, but it is possible that someone may wish to archive it a prefix may be applied to each file. The homepage may have its own name. Counters control the depth along with the project. For this purpose, an option of the sideTOC and the file division. for the lwarp-newproject package is available to cause a write of a local copy of lwarpmk. Files may be split by the strict sectioning depth level, or higher levels may be combined into one file. The CSS files include a master lwarp.css file which provides the essential functions and a basic For example, a part, its first chapter, and its first section may be combined into one file while further LATEX-ish style, along with optional CSS files for files are split at the section level until the next part a more formal or a more contemporary style. Also or chapter. created is sample-project.css, which shows how to The HTML lang attribute may be set for the load one of the provided CSS files and also provides CSS HTML description a place to make modifications. This file is to be document. The file and may be changed at each file split. renamed, as it will be overwritten by lwarp-newproject each time a print version is created. Programming hooks are provided for the top of the home page, the top of other pages, and the bot- 7.2 Compiling the document — lwarpmk tom of all pages. These are useful for logos, copyright notices, and contact information. Previous versions of lwarp relied on the make, gawk, Special environments and macros are provided grep and utilities. Fortunately, modern TEX distri- for functions which should be applied to only the butions provide the LuaT X program — an extension E printed or only the HTML versions of the document. of the Lua programming language. The use of Lua- TEX to provide the required utility functions eases issues of availability, installation, and portability. 7.4 Tutorial lwarpmk’s configuration file tells it the operating A tutorial is provided which quickly guides the user system, the TEX engine, the source \jobname, the through the setup of a document, compiling printed

Brian Dunn TUGboat, Volume 38 (2017), No. 1 53 and HTML versions, processing graphics images, gen- [12] Christian Lawson-Perfect, “Dark days erating math in SVG or MathJax format, customizing for MathML support in browsers”, The the HTML, using latexmk, switching the TEX engine, Aperiodical, 2013, http://aperiodical.com/ processing multiple documents in the same directory, 2013/11/dark-days-for--support- and cleaning the auxiliary files. in-browsers/ [13] Stephen Shankland, “Google subtracts ⋄ Brian Dunn MathML from Chrome, and anger multiplies”, bd (at) bdtechconcepts dot com CNET, 2013, https://www.cnet.com/news/ http://bdtechconcepts.com google-subtracts-mathml-from-chrome- Copyright 2017 Brian Dunn and-anger-multiplies/ [14] Neil Soiffer, “Microsoft cripples the display of math in IE10 & 11”, News, 2013, References http://news.dessci.com/microsoft- [1] ShareLATEX. https://www.sharelatex.com cripples-display-math-ie10-11 [2] Overleaf. https://www.overleaf.com [15] “EPUB3 Reading systems overview”, The MathJax Consortium, 2015, http://docs. [3] Authorea. https://www.authorea.com mathjax.org/en/latest/misc/epub.html [4] Papeeria. https://papeeria.com/ [16] Andrew Stacey, “latex-to-internet”, A [5] LTEX Base. https://latexbase.com https://github.com/loopspace/latex-to- [6] Forum topic. ResearchGate, “Why is LaTeX internet not used as an end-to-end solution in the [17] TEX4ht: LaTeX and TeX for Hypertext, publishing industry?”, 2013, http://tug.org/tex4ht https://www.researchgate.net/post/Why_ [18] HEVEA, http://hevea.inria.fr/ is_LaTeX_not_used_as_an_end-to-end_ solution_in_the_publishing_industry [19] TTH, http://hutchinson.belmont.ma.us/ tth/ [7] Open Education Database, “The Academic’s Guide to Self-Publishing”, 2014, [20] William F. Hammond, “GELLMU — http://oedb.org/ilibrarian/the- Introductory Survey”, http://www.albany. academics-guide-to-self-publishing/ edu/~hammond/gellmu/ [8] Dennis Meredith, Research Explainer, [21] LaTeXML — A LaTeX to XML/HTML/ “Self-Publishing Series”, 2013, MathML Converter, http://dlmf.nist.gov/ https://researchexplainer.com/ LaTeXML/ 2013/06/26/self-publishing-series-i- [22] plasTeX, http://tiarno.github.io/ making-the-decision/ plastex/ [9] Robert Ghrist, “Why I published my [23] LaTeX2HTML, http://www.latex2html. mathematics text print-on-demand via org/ https://www. ’s Createspace”, 2014, [24] Dorai Sitaram, TeX2page, https://ds26gte. math.upenn.edu/~ghrist/whyselfpublish. github.io/tex2page/ html [25] Martin Gulbrandsen and Sebastian Humenda, [10] Nicola L. C. Talbot, Dickimaw Books, GladTeX, https://humenda.github.io/ “Self-Publishing”, 2014, GladTeX/ http://www.dickimaw-books.com/ nonfiction/self-publishing/ [26] “LaTeX in Word”, https://github.com/ EngineeroLabs/latex_in_word [11] Sanders Kleinfeld, “Next-Generation Book Publishing: Of the HTML, by the HTML, [27] TeXsword, https://sourceforge.net/ for the HTML”, Digital Book World, 2014, projects/texsword/ http://www.digitalbookworld.com/2014/ [28] Roland Baudin, “TexMaths, a LaTeX next-generation-book-publishing-of- Equation Editor for LibreOffice”, http: the-html-by-the-html-for-the-html/ //roland65.free.fr/texmaths/

The lwarp package 54 TUGboat, Volume 38 (2017), No. 1

LATEX News

Issue 26, January 2017 Contents E A A Default encodings in X LTEX and LuaLTEX ε A -TEX 1 The default encoding in LTEX has always been the original 128-character encoding OT1. For Unicode based Default encodings in X LAT X and LuaLAT X 1 E E E TEX engines, this is not really suitable, and is especially problematic with X LAT X as in the major distributions A E E \showhyphens in X LE TEX 1 this is built with Unicode based hyphenation patterns in the format. In practice this has not been a major The fixltx2e package 1 problem as documents use the contributed fontspec package in order to switch to a Unicode encoded font. The latexbug package 2 In this release we are adding TU as a new supported Updates to amsmath 2 encoding in addition to the previously supported encodings such as OT1 and T1. This denotes a Unicode Updates to tools 2 based font encoding. It is essentially the same as the TU encoding that has been on trial with the experimental An addendum to the release changes in 2015 2 tuenc option to fontspec for the past year. A A The X LE TEX and LuaLTEX formats will now default ε-TEX to TU encoding and lmr (Latin Modern) family. In the case of LuaLAT X the contributed luaotfload Lua module In LAT X News 16 (December 2003) the team announced E E will be loaded at the start of each run to enable the We expect that within the next two years, loading of OpenType fonts. A releases of LTEX will change modestly in order The fontspec package is being adjusted in a com- to run best under an extended TEX engine panion release to recognise the new encoding default that contains the ε-TEX primitives, e.g., ε-TEX arrangements. or pdfTEX. Note that in practice no font supports the full Unicode and also said range, and so TU encoded fonts, unlike fonts specified for T1, may be expected to be incomplete in various Although the current release does not ways. In the current release the file tuenc.def that require ε-TEX features, we certainly implements the TU encoding-specific commands has recommend using an extended TEX, especially made some basic assumptions for (for example) default if you need to debug macros. handling of accent commands, and the set of command names is derived from the command names used for For many years the team have worked on the basis the UTF-8 support in the inputenc package, restricted ε that users will have -TEX available but had not revisited roughly to the character ranges classically provided by the above statements formally. As of the January 2017 the T1 and TS1 encodings, but is part of a longer term A ε release of LTEX 2ε, -TEX is required to build the format, plan seen over recent releases to increase support for and attempting to build a format without the extensions A Unicode based TEX engines into the core LTEX support. will fail. If for any reason you need to process a document Practically, modern T X distributions provide the E with the previous default OT1 encoding, you may switch extensions in all engines other than the “pure” Knuth encoding in the usual ways, for example tex, and indeed parts of the format-building process ε already require -TEX, most notably some of the UTF-8 \usepackage[OT1]{fontenc} hyphenation patterns. As such, there should be no noticeable effect on users of this change. or you may roll back all the changes for this release by The team expect to make wider use of ε-TEX within starting the document with the kernel in future; details will be announced where they on end users in a visible way. \RequirePackage[2016/12/31]{latexrelease}

LATEX News, and the LATEX software, are brought to you by the LATEX3 Project Team; Copyright 2017, all rights reserved.

LATEX News #26

TUGboat, Volume 38 (2017), No. 1 55 E • \showhyphens in X LATEX The large delimiters around generalised fractions (for example in the \binom construct) did not work Due to the way X LAT X interfaces to font libraries, the E E in previous releases if using LuaTEX or X TE EX with standard definition of \showhyphens does not work. A OpenType math fonts. This is related to the lack of variant definition has been available in the contributed specific metrics for this use in the OpenType Math xltxtra package, however a (slightly different) definition table. In principle LuaT X has two additional A E for \showhyphens is now included in X LE TEX by default. named metrics to control the delimiters but these As usual this change will be undone if an earlier release are not initialised by default, and in X TE EX it does is specified using the latexrelease package. not seem possible to make them work at all. So for The fixltx2e package Unicode TEX systems, a new implementation of \genfrac is used at this release that uses A As described in LTEX News 22, the fixltx2e package \left\right internally but parameterised to give has become obsolete with the new update policy. spacing as close to the original as possible. The Since 2015 it has just made a warning and exited. In implementation in (pdf)TEX is unaffected. this release we have re-introduced all the code from A the original fixes in the 2014 LTEX but guarded by Updates to tools \IncludeInRelease{2015/01/01}. So for current The array package has been updated to fix a longstand- releases fixltx2e still just makes a warning but for old ing but previously unreported issue with unwanted releases, whether that is an old format, or a format with interactions between tables in the page head or foot and the version date reset via the latexrelease package, the the body of the page, as reported in PR tools/4488. fixes in the original fixltx2e will be applied. There is also an update to the LuaTEX support in bm. This improves the ability to run old doc- uments in a way compatible with contempo- An addendum to the release changes in 2015 rary formats. If you have a 2014 document In 2015 we announced the introduction of the roll-back/ that used \usepackage{fixltx2e} and you add roll-forward concept to manage bug fixes and additions \RequirePackage[2014/01/01]{latexrelease} and to core LAT X in a manageable way. We also announced latexrelease E process it with the current format then will at that time that we now incorporate all fixes from undo most changes made since 2014, but now when the fixltx2e into the kernel (as the old mechanism produced fixltx2e document includes it will act like a 2014 version problems instead of improving the situation). Refer to of the package and apply the code fixes, not just give a ltnews22.pdf for details. warning that the package is obsolete. One of the fixes from fixltx2e was for a glaring bug The latexbug package in \addvspace that was originally detected in the fixltx2e A mid-nineties and back then added to the support As explained in more detail at the LTEX Project 1 package. In certain situations \addvspace would result website a new package, latexbug, has been produced in a page/column break below the baseline of the last to help produce test files to accompany bug reports on A line. As a result documents using \flushbottom would the core LTEX distribution. This is being published show a clear misalignment (even more prominent when separately to CTAN at the same time as this release. typesetting in two-column mode). By using the latexbug package you can easily check Starting with release 2015/01/01 this is now finally that the packages involved in the test are all part of fixltx2e A corrected already in the kernel and not only in . the core release. The LTEX project can not handle In nearly all circumstances this will either make no bug reports on contributed packages, which should difference to existing documents, or it will locally be directed to the package maintainer as given in the improve the visual appearance of that document without package documentation. changing anything on other pages. However, by the Updates to amsmath nature of the change it is also possible that there are further non-local changes to the page breaks due to the The amsmath package has two updates at this release. different break positions introduced by the fix. • The spacing to the left of the aligned and Thus, for documents that have been written before gathered environments has been fixed: the 2015 and that should be preserved unchanged at all spurious thin space is no longer added by default. costs you may have to add Package options control this to revert to the \RequirePackage[2014/01/01]{latexrelease} original behaviour where required; see the amsldoc at the top of the document, to roll back the format to a guide for further details. date before the policy change. 1https://www.latex-project.org/bugs/

LATEX News #26 56 TUGboat, Volume 38 (2017), No. 1

LATEX3 News Issue 10, November 2016

There has been something of a gap since the last Automating expl3 testing A LTEX3 News, but this does not mean that work has As well as developing l3build for local use, the team not been going on. The Team have been working on a have also set up integration testing for expl3 using the number of areas, many of which reflect wider take-up Travis-CI system. This means that every commit to the of expl3. There have also been a number of significant A A LTEX3 code base now results in a full set of tests be- new developments in the LTEX3 “sphere” in the last ing run. This has allowed us to significantly reduce the two years. number of occasions where expl3 needs attention before being released to CTAN. Automated testing has also enabled us to check that l3build: Testing LATEX packages expl3 updates do not break a number of key third-party packages which use the programming environment. Testing has been an important part of the work of the Refining expl3 team since they assumed maintenance of LATEX over twenty years ago. Various scripts have been used over Work continues to improve expl3 both in scope and ro- that time by the team for testing, but these have until bustness. Increased use of the programming environ- recently not been set up for wider use. ment means that code which has to-date been under- With the general availability of LuaTEX it is now explored is being used, and this sometimes requires possible to be sure that every TEX user has a pow- changes to the code. erful general scripting language available: Lua. The The team have extended formal support in expl3 to team have used this to create a new general testing cover the engines pTEX and upTEX, principally used system for TEX code, l3build. This is designed to be by Japanese TEX users. This has been possible in part used beyond the team, so is now available in TEX Live due to the l3build system discussed above. Engine- and MiKTEX and is fully documented. Testing using dependent variations between pdfTEX, X TE EX, LuaTEX l3build makes use of a normalised version of the .log and (u)pTEX are now well-understood and documented. file, so can test any aspect of TEX output (e.g., by us- As part of this process, the “low-level” part of expl3, ing \showbox) or its algorithms (by displaying results which saves all primitives, now covers essentially all in the .log). primitives found in all of these engines. The code in expl3 is now entirely self-contained, load- Part of the remit for creating l3build was to enable ing no other third-party packages, and can also be the team to work truly cross-platform and to allow loaded as a generic package with plain T X, etc. These testing using multiple T X engines (earlier systems E E changes make it much easier to diagnose problems and were limited to a single engine, normally ε-T X). The E make expl3 more useful. In particular it can be used as new testing system means we are in a much stronger a programming language for generic packages, that then position to support a variety of engines (see below). It can run without modifications under different formats! has also enabled us to give useful feedback on develop- The team have made a range of small refinements ment of the LuaT X engine. E to both internals and expl3 interfaces. Internal self- As well as the core capability in testing, l3build also consistency has also been improved, for example re- provides a “one stop” script for creating release bun- moving almost all use of nopar functions. Performance dles. The script is sufficiently flexible that for many enhancements to the l3keys part of expl3 are ongoing common LATEX package structures, setting up for cre- and should result in significantly faster key setting. As ating releases will require only a few lines of configura- keyval methods are increasingly widely used in defining tion. behaviours, this will have an impact on compile times In addition to the documentation distributed with for end users. l3build, the project website [1, publications in 2014] contains some articles, videos and conference presen- Replacing \lowercase and \uppercase A tations that explain how to use l3build to manage and As discussed in the last LTEX3 News, the team have test any type of (LATEX) package. for some time been keen to provide new interfaces

LATEX3 News, and the LATEX software, are brought to you by the LATEX3 Project Team; Copyright 2016, all rights reserved. TUGboat, Volume 38 (2017), No. 1 57 which do not directly expose (or in some cases even A new \parshape model use) the TEX primitives \lowercase and \uppercase. As part of the development of l3galley, Joseph Wright We have now created a series of different interfaces that has proposed a new model for splitting up the functions provide support for the different conceptual uses which of the \parshape primitive into three logical elements: may flow from the primitives: • Margins between the edges of the galley and the • For case changing text, \tl_upper_case:n, \tl_ paragraph (for example an indented block); lower_case:n, \tl_mixed_case:n and related • language-aware functions. These are Unicode- Cut-out sections running over a fixed number of capable and designed for working with text. They lines, to support “in place” figures and so forth; also allow for accents, expansion of stored text and • Running or single-paragraph shape. leaving math mode unchanged. At present some of There are additional elements to consider here, for the interface decisions are not finalised so they are example whether lines are the best way to model the marked as experimental, but the team expect the length of shaping, how to handle headings, cut-outs at core concept to be stable. page breaks, etc. • For case changing programming strings, \str_ upper_case:n, \str_lower_case:n and \str_ Globally optimized of documents fold_case:n. Again these are Unicode-aware, Throughout 2016 Frank Mittelbach has worked on but in contrast to the functions for text are not methods and algorithms for globally optimizing the context-dependent. They are intended for caseless pagination of documents including those that contain comparisons, constructing command names on-the- floats. Early research results have been presented at fly and so forth. BachoTEX 2016, TUG 2016 in Toronto and later in • For creating arbitrary character tokens, \char_ the year at DocEng’16, the ACM Symposium on Docu- generate:nn. This is based on the \Ucharcat ment Engineering in Vienna. A link to the ACM paper primitive introduced by X TE EX, but with the ideas (that allows a download free of charge) can be found on extended to other engines. This function can be the project website [1]. The site also holds the speaker used to create almost any reasonable token. notes from Toronto and will host a link to a video of • For defining active characters, \char_set_active_ the presentation once it becomes available. eq:NN and related functions. The concept here is The framework developed by Frank is based on the that active characters should be equivalent to some extended functionality provided by LuaTEX, in particu- named function, so one does not directly define the lar its callback functions that allow interacting with the active character. typesetting process at various points. The algorithm that determines the optimal pagination of a given doc- Extending xparse ument is implemented in Lua and its results are then used to direct the formatting done by the T X engine. After discussions at TUG 2015 and some experimen- E At the current point in time this a working proto- tation, the team have added a new argument type, e type but not yet anywhere near a production-ready (“embellishment”), to xparse. This allows arguments system. However, the work so far shows great poten- similar to T X primitive sub- and superscripts to be E tial and Frank is fairly confident that it will eventually accepted. Thus become a generally usable solution. \DeclareDocumentCommand\foo{e{^_}} {\showtokens{"#1"}} Looking forward \foo^{Hello} world The LuaTEX engine has recently reached version 1.0. will show This may presage a stable LuaTEX and is likely to re- "{Hello}{-NoValue-}". sult in wider use of this engine in production docu- ments. If that happens we expect to implement some of At present, this argument type is experimental: there the more complex functionality (such as complex pagi- are a number of models which may make sense for this nation requirements and models) only for LuaTEX. interface. References [1] Links to various publications by members of the A LTEX Project Team. https://www.latex-project.org/publications. 58 TUGboat, Volume 38 (2017), No. 1

A Attempting to add additional features such as frames A key/value interface for generating LTEX floats — the keyfloat package and continued floats hits the limit of nine parameters for a TEX macro, requiring that new features use Brian Dunn some kind of change-state macros instead. Attempt- Abstract ing to support rows of floats or subfloats only makes things more complicated still. The keyfloat package provides a key/value user inter- A key/value system solves the problem of adding face for quickly creating figures with a single image more features, does not require much additional typ- each, figures with arbitrary contents, tables, sub- ing, is a more self-documenting syntax, and allows a floats, rows of floats, floats located [H]ere, floats in shared syntax with subfloats and groups of floats as the [M]argin, and floats with text [W]rapped around well. Thus, the keyfloat package. them, using a consistent syntax for all. Key/value combinations may specify a caption 2 The keyfloat package and label, a width proportional to \linewidth, a keyfloat fixed width and/or height, rotation, scaling, a tight Using , the previous example becomes: or loose frame, an \arraystretch, a continued float, \keyfig{w=3in,c=A Figure,l=fig:somelabel} additional supplemental text, and an artist/author’s {filename} name with automatic index entry. When used with The \onefigure general case becomes: the tocdata package, the name also appears in the List of Figures. \keyfig*[loc]{w=width,t={add’l text}, Floats may be placed into a multi-row environ- sc=shortcap,cstar=caption, ment, and are typeset to fit within the given number l=label}{filename} of columns, continuing to the next rows as necessary. 2.1 Macros and environments Nested sub-rows may be used to generate layouts such as two small figures placed vertically next to keyfloat provides macros and environments to create one larger figure. figures and floats: Subfloats are supported by two environments. \keyfig*[hloci]{hkeysi}{himagei} As an example, a typical command to include a A figure with an image. figure with a framed image of half \linewidth could be: \keyfigbox*[hloci]{hkeysi}{hcontentsi} A figure with arbitrary contents. \keyfig*[hbp]{f,lw=.5,c={A caption}, l={fig:label}}{image} \keyparbox*[hloci]{hkeysi}{hcontentsi} A “figure” without a caption, useful to place 1 A problem with floats uncaptioned text inside a group. When including a figure with a graphics image into a \keytab*[hloci]{hkeysi}{htabulari} document, the user typically enters something such A table. as: keyfigure*[hloci]{hkeysi} \begin{figure} A figure environment. \centering keytable*[hloci]{hkeysi} \includegraphics[width=3in]{filename} A table environment. \caption{A Figure} \label{fig:somelabel} 2.2 Groups of floats and subfloats \end{figure} Floats may be gathered into groups, as well as gath- When doing that often enough, it makes sense to ered into a subfloat, using these environments: factor the common code: keyfloats*[hloci]{h#colsi} \onefigure[3in]{filename}{A Figure} A group of rows and columns of floats. {fig:somelabel} keysubfigs*[hloci]{h#colsi}{hkeysi} Expanding the capability of \onefigure via the A figure containing a group of rows and columns xparse package can lead to the general case of: of subfigures. \onefigure*[loc](width){filename} keysubtabs*[hloci]{h#colsi}{hkeysi} (add’l text) A table containing a group of rows and columns [shortcap]{caption}*[label] of subtables.

Brian Dunn TUGboat, Volume 38 (2017), No. 1 59

2.3 Margin float An image. The tufte-book class offers margin floats. These are A \keyparbox used if they are available, otherwise keyfloat provides describing something. its own: \raggedright text With several marginfigure[hoffseti] Figure 1: First in a paragraphs. A figure environment placed into the margin. group margintable[hoffseti] A table environment placed into the margin. An image. Another image 2.4 Arranging floats Figure 2: Figure 3: Rows and columns of floats are created by enclosing Third in a Fourth in \keyfig and friends inside a keyfloats environment. group Table 1: Seventh in a The number of columns is given, and the floats are a group group dynamically arranged across each row, with leftovers Another distributed evenly on the last row. These may be An image. ABC image DEF nested (Figures 1 to 5, and Table 1). Figure 4: Figure 5: Fifth in a \begin{keyfloats}{2} Sixth in a group \keyfig{lw=1,f,c={First in a group}, group l=fig:firstinrow, tl={\cs{raggedright} text} }{image} \keyparbox{}{\centering An image. A \cs{keyparbox} describing something. \par With several paragraphs.} (c) Third sub- \begin{keyfloats}{2} figure \keyfig{lw=1,c={Third in a group}, An image.

image (d) Fourth sub-

l=fig:thirdinarow}{image} Another \keyfig{lw=1,c={Fourth in a group}}{image2} figure \keyfig{lw=1,c={Fifth in a group}}{image} Some text AB \keyfig{lw=1,c={Sixth in a group}, (a) First subfig- Lots of lots of lots of lots of text. CD l=fig:sixthinrow}{image2} ure (b) Second sub- \end{keyfloats} An image. figure \keytab{c={Seventh in a group}, l=tab:seventhinrow} (e) Fifth subfig- {\testwidetable} ure \end{keyfloats} Figure 6: Subfigures Subfloats are arranged into rows and columns in a similar manner (Fig. 6). Notice that fig. 6(d) is a foreign table inside a figure. \keyfig{lw=.5,f,c={Fifth subfigure}, \begin{keysubfigs}{3} l=fig:fifthsubfig}{image} {c=Subfigures,l=fig:subfigs} \end{keyfloats} \keyfig{lw=1,f,c={First subfigure}, \end{keysubfigs} l=fig:firstsubfig,t=Some text}{image} \keyfig{lw=1,f,r=90,c={Second subfigure}, l=fig:secondsubfig, t=Lots of lots of lots of lots of text.} 2.5 Placement of floats {image2} Floats or groups of floats may be placed [H]ere, \begin{keyfloats}{1} in the [M]argin, with text [W]rapped around them \keyfig{lw=1,f,c={Third subfigure}, (wrapfig with optional placement), or with the usual l=fig:thirdsubfig}{image} [htbp] placement combinations. \keytab{c={Fourth subfigure}, Starred floats may be used to create two-column l=fig:fourthsubfig}{\testtable} floats.

The Keyfloat Package 60 TUGboat, Volume 38 (2017), No. 1

Another An image. An image. image

(a) Artist’s First Work Commentary about the work. Mr. First Last III (b) Artist’s Second Work About the . Prefix First Last, Suffix Figure 7: An artist’s work Some fully-justified text just for illustrative purposes, in case you have a use for long explanations. This text may be the full \linewidth in size. 2.6 Options controlled by key/values Multiple paragraphs of text are allowed. Most of the keys are one or two letters long, allowing Figure 8: Artist’s collection them to be entered quickly. Continued floats are available to repeat the pre- vious float’s number. tl={Commentary about the work.}} Tabular \arraystretch may be set per table. {image2} An image inside a figure may be sized, rotated, \end{keysubfigs} and placed inside a tight, loose, or custom frame. Boxes of arbitrary contents may be sized and framed. 2.7 Customizations Along with a fixed width or height, contents may also be sized as a fraction of \linewidth. Doing User-redefinable macros are provided for tight and so allows them to automatically scale appropriately loose frames. A loose frame is meant to add a bit of as they are moved into or out of groups of floats or margin around the object, such as a closely cropped subfloats. diagram, and is the usual case. A tight frame is useful Additional descriptive text may be placed inside around a photograph, giving a visual definition to A the float with left/right/center alignments, and an its edge. The user must set a certain LTEX length artist/author’s name may be added as well (Fig. 7): for each type of frame, equal to the total width of each frame and margin. These lengths are used to \keyfig{ft,lw=1, compute the final size of the float contents. ap=Mr.,af=First,al=Last,as={~III}, The caption package is used by keyfloat, and tc={\textit{About the illustration.}}, customized caption settings may be used for figures, c=An artist’s work,l=fig:artist}{image} tables, subfigures/tables, and wrapped figures/ta- bles. Subfloats may be used to create a collection As usual, \floatsep and \dblfloatsep may (Fig. 8): be used to spread out the floats on the page. \begin{keysubfigs}{2}{ 2.8 Examples c=Artist’s collection, l=fig:artistcollection, The keyfloat documentation has more than thirty t={Some fully-justified text just examples demonstrating code fragments and the cor- for illustrative purposes, in case you responding results, as well as solutions for several have a use for long explanations. special cases, such as frames using mdframed and This text may be the full \cs{linewidth} fancybox. in size. \par ⋄ Brian Dunn Multiple paragraphs of text are bd (at) bdtechconcepts dot com allowed.}, http://bdtechconcepts.com ap=Prefix,af=First,al=Last,as={, Suffix} } Copyright 2017 Brian Dunn \keyfig{lw=1,c=Artist’s First Work} {image} \keyfig{lw=1,c=Artist’s Second Work,

Brian Dunn TUGboat, Volume 38 (2017), No. 1 61

Glisterings: Hanging; Safety in numbers There is no one ideal value for the \mkern; a ‘good’ value depends on whether the set variable is Peter Wilson upright (e.g., Ω) or slanted (e.g., B) and whether or A glisterin mornin aften draws tae rain. not it has a super- or subscript. Basically it comes down to what you think is most appropriate. In my Anonymous view I prefer the following: The aim of this column is to provide odd hints or Upright variable (e.g. Ω) \closureG[0]{}, small pieces of code that might help in solving a \closureH[0]{}, \closureL{0}{0}{}, which problem or two while hopefully not making things are all equivalent to \overline{} worse through any errors of mine. Slanted variable (e.g., B) \closureG[3]{}, \closureH[-3]{}. We must indeed all hang together, or most I think that \closureL{0}{3}{} and assuredly, we shall all hang separately. \closureL{3}{0}{} are close but not quite as Spoken at the signing of the Declaration good. Something like \closureL{1}{2} would of Independence, Benjamin Franklin seem to give a better result. 1 Hanging As the old saying goes, ‘Yer pays yer money and takes yer choice’. 1.1 Overhangs Rui Maciel asked about a notation for the closure of 1.2 Paragraphs in equations a set, saying that [8]: ‘Cooch’ wrote [2]: When I need to refer to the closure of a set I In a number of the chapters for one of my books, tend to use the \bar{} command, So, considering I ‘define’ a series variables, generally embedded in the set Ω then the closure of that set would be: the form ¯ $\bar{\Omega}$ -> Ω variable = text to define the variable However, I’ve noticed that when the symbol used to reference a given set also has a superscript then Ω¯s For example (the page I’m currently staring at) doesn’t look very good. I’ve also tried \overline{} $\phi^{rst}_{i-1,i}$= the probability that instead but it appears even worse a particle in state \emph{r} at time $\overline{\Omega^{s}}$ -> Ωs. \emph{i}-1 and state \emph{s} at time Enrico Gregorio recommended [3]: \emph{i} is in state \emph{t} at time \emph{i}+1. \newcommand*{\closureG}[2][3]{% {}\mkern#1mu\overline{\mkern-#1mu#2}} . . . I want to force the RHS of the expression to ‘wrap’ while Bill Hammond said [5] that he found the follow- and be indented after the first sentence, to the right ing to work better, also noting that he used amsmath: of the equal sign. So, that the above looks like: \newcommand*{\closureH}[2][3]{% $\phi^{rst}_{i-1,i}$= the probability that \overline{{}\mkern#1mu#2\mkern-#1mu}} a particle in state ... In each case the optional argument is the value In other words, something analogous to a ‘hanging of an \mkern (in mu) applied to the overline to move indent’ after the first line, but where the indentation it sideways; the default is 3. is relative to where the equal sign falls. Dan Luecking felt [7] that there should be two There were several responses to this and for controls over the overline —one to shift the line the following, in order to save space and make the (which is provided by the previous macros) and a sec- examples easier to read, I have defined ond to adjust the length of the line — and suggested \newcommand*{\mathdef}{\phi^{rst}_{i-1,i}=} the \closureL macro. \newcommand*{\textdef}{the probability that %% \closureL{right shift}{trim}{symbol} a particle in state $r$ at time $i-1$ \newcommand*{\closureL}[3]{% and state $s$ at time $i$ is in state \mkern#1mu\mkern#2mu $t$ at time $i+1$.} \overline{\mkern-#1mu \mkern-#2mu #3% \newcommand*{\smath}{D_{n}=} \mkern-#2mu \mkern#1mu}% \newcommand*{\stext}{the definition of the \mkern#2mu\mkern-#1mu} variable as used herein.} Table 1 shows the results of applying the three All the respondents disagreed with the use of \emph closure macros to a variety of variables with a range to indicate a math variable. As Enrico Gregorio of kerns, along with the result of a vanilla \overline. said [4]:

Glisterings: Hanging; Safety in numbers 62 TUGboat, Volume 38 (2017), No. 1

Table 1: Various closures ∗ ∗ ‘closure’ Ω Ω Ωs B B Bs ∗ ∗ \overline{...} Ω Ω Ωs B B Bs ∗ ∗ \closureG[-3]{...} Ω Ω Ωs B B Bs ∗ ∗ \closureG[0]{...} Ω Ω Ωs B B Bs ∗ ∗ \closureG[3]{...} Ω Ω Ωs B B Bs ∗ ∗ \closureH[-3]{...} Ω Ω Ωs B B Bs ∗ ∗ \closureH[0]{...} Ω Ω Ωs B B Bs ∗ ∗ \closureH[3]{...} Ω Ω Ωs B B Bs ∗ ∗ \closureL{-3}{-3}{...} Ω Ω Ωs B B Bs ∗ ∗ \closureL{-3}{0}{...} Ω Ω Ωs B B Bs ∗ ∗ \closureL{-3}{3}{...} Ω Ω Ωs B B Bs ∗ ∗ \closureL{0}{-3}{...} Ω Ω Ωs B B Bs ∗ ∗ \closureL{0}{0}{...} Ω Ω Ωs B B Bs ∗ ∗ \closureL{0}{3}{...} Ω Ω Ωs B B Bs ∗ ∗ \closureL{3}{-3}{...} Ω Ω Ωs B B Bs ∗ ∗ \closureL{3}{0}{...} Ω Ω Ωs B B Bs ∗ ∗ \closureL{3}{3}{...} Ω Ω Ωs B B Bs

Don’t use \emph{i} for representing a vari- and results in: able: it’s simply $i$; notice also the difference rst between $i-1$ (i − 1) and \emph{i}-1 (i-1); φi−1,i = the probability that a particle in state r at the second one is definitely wrong. time i − 1 and state s at time i is in state t 1 i Lars Madsen said [9] that he normally used at time + 1. \begin{equation*} Jean-François Burnol presented [1] the following \phi^{rst}_{i-1,i}= macro: \parbox[t]{}{\raggedright the probability that a particle in state $r$ \newcommand{\start}[1]{% at time $i-1$ and ...} \setbox0=\hbox{#1}% \end{equation*} \hangindent\wd0% \noindent\box0} which, with hlengthi = 0.8\columnwidth results in \start{$\phi^{rst}_{i-1,i}$= }\textdef rst φi−1,i = the probability that a particle in state r rst φi−1,i= the probability that a particle in state r at at time i − 1 and state s at time i is in time i − 1 and state s at time i is in state t state t at time i + 1. at time i + 1. Enrico Gregorio provided [4] the following envi- Jean-François’ \start macro is a T X version ronment: E of the LATEX kernel’s command \@hangfrom, which \newenvironment{qdesc}[1]% the memoir class provides as a user-level macro {\par\addvspace{\medskipamount} \hangfrom{text} by copying the original definition: \sbox{0}{$#1$ }\dimen0=\textwidth \advance\dimen0 by -\wd0 \newcommand{\hangfrom}[1]{% \noindent\usebox{0} \setbox\@tempboxa\hbox{{#1}}% \begin{minipage}[t]{\dimen0}}% \hangindent \wd\@tempboxa% {\end{minipage} \noindent\box\@tempboxa} \par\addvspace{\medskipamount}} \hangfrom{} puts text in a box and makes a which applied to the example as hanging paragraph of the following material (some- \begin{qdesc}{\mathdef} what like a description item). Applying this: \textdef \hangfrom{$\mathdef$ }\textdef \par \end{qdesc} \hangfrom{$\smath$ }\stext 1 equation* is from the amsmath package

Peter Wilson TUGboat, Volume 38 (2017), No. 1 63

rst What I’ve done is: φi−1,i = the probability that a particle in state r at time i − 1 and state s at time i is in state t 13. Purposely blank. at time i + 1. But is there something else that is more universal? Heiko Oberdiek responded [10] with a univer- Dn = the definition of the variable as used herein. sal solution by changing the definition of \@arabic, As the last example shows, each ‘definition’ is which is the underlying LATEX macro for typesetting treated individually. If it is required that, say, several the value of a counter in arabic form: definition texts should be aligned in a set of defini- \makeatletter tions then using one of the tabular environments \newcommand*{\safe}{% could be an advantage. For example: \renewcommand*{\@arabic}[1]{% \ifnum##1=13\relax Using \texttt{tabular} \\ 12a% \begin{tabular}{lp{0.7\columnwidth}} \else $\mathdef$ & \textdef \\ \ifnum##1=-13\relax $\smath$ & \stext \\ -12a% \end{tabular} \else \expandafter\@firstofone\expandafter{\number##1}% Using \texttt{tabularx} \\ \fi \begin{tabularx}{\linewidth}{lX} \fi}} $\mathdef$ & \textdef \\ \makeatother $\smath$ & \stext \\ \end{tabularx} Following the \safe declaration every setting ‘13’ will be typeset as ‘12a’. Using tabular To save space in the following examples I have rst φi−1,i = the probability that a particle in defined: state r at time i − 1 and state s at \makeatletter time i is in state t at time i + 1. \newcommand*{\setlistctr}[1]{% Dn = the definition of the variable as used \setcounter{\@listctr}{#1}% herein. \protected@edef\@currentlabel Using tabularx {\csname p@\@listctr\endcsname rst \csname the\@listctr\endcsname}} φi−1,i = the probability that a particle in state r at time i − 1 and state s at time i is \makeatother in state t at time i + 1. which can be used to reset the enumerate list counter. Dn = the definition of the variable as used Applying Heiko’s suggestion to an enumerate herein. list as: Standard enumeration: Some of the suggestions require a length to be \begin{enumerate} specified for the definition text while others auto- \item One \par matically use all the available space. It is really a \ldots \setlistctr{11} matter of individual preference which is most suited \item Twelve for a particular desired outcome. \item Thirteen \item Fourteen \end{enumerate} It was a bright cold day in April, and the clocks were striking thirteen. ‘Safe’ enumeration: \begin{enumerate}\safe George Orwell Nineteen Eighty-Four, \item One \par \ldots \setlistctr{11} 2 Safety in numbers \item Twelve Gordon Haverland posted [6] to the texhax mailing \item Thirteen list: \item Fourteen I don’t suppose there is some easy way to deal \end{enumerate} with superstitions in LATEX? I looked around CTAN the result is: a bit and nothing jumped out at me. Standard enumeration: I suspect the company I am doing work for is superstitious, or customers are. But I ran across 1. One an enumerated list where there is no 13th element. ...

Glisterings: Hanging; Safety in numbers 64 TUGboat, Volume 38 (2017), No. 1

12. Twelve \item Thirteen \item Fourteen 13. Thirteen \end{enumerate} 14. Fourteen \item Two \par ‘Safe’ enumeration: \ldots \setlistctr{11} \item Twelve 1. One \item Thirteen ... \item Fourteen 12. Twelve \end{enumerate} 12a. Thirteen Standard enumeration: 14. Fourteen 1. Including a ‘skipit’ enumeration: However Gordon had explicitly mentioned the (a) One enumerate list and I thought that perhaps something ... specific for that would suit. To that end I defined (l) Twelve the \skipit macro that ensures that the counter in (n) Thirteen an enumerate skips the value ‘13’, and the macro A (o) Fourteen \fixitem to append it to the end of LTEX‘s internal \@item macro. 2. Two \makeatletter ... \newcommand*{\skipit}{% 12. Twelve \if@nmbrlist 13. Thirteen \ifnum12=\csname c@\@listctr\endcsname \refstepcounter\@listctr 14. Fourteen \fi \fi} References \let\old@item\@item [1] Jean-François Burnol. Re: Variable definitions / \newcommand{\fixitem}{% indenting on = sign. comp.text.tex, 25 March \def\@item[##1]{\old@item[##1]\skipit}} 2011. \makeatother [2] cooch17. Variable definitions / indenting on = An example of this approach is: sign. comp.text.tex, 25 March 2011. ‘skipit’ enumeration: [3] Enrico Gregorio. Re: Math notation for the closure \begin{enumerate}\fixitem of a set? comp.text.tex, 30 March 2011. \item One \par [4] Enrico Gregorio. Re: Variable definitions / \ldots \setlistctr{11} indenting on = sign. comp.text.tex, 25 March \item Twelve 2011. \item Thirteen [5] William Hammond. Re: Math notation for the \item Fourteen closure of a set? comp.text.tex, 16 April 2011. \end{enumerate} [6] Gordon Haverland. [texhax] superstitions. texhax ‘skipit’ enumeration: mailing list, 23 April 2011. 1. One [7] Dan Luecking. Re: Math notation for the closure ... of a set? comp.text.tex, 19 April 2011. 12. Twelve [8] Rui Maciel. Math notation for the closure of a set? comp.text.tex, 30 March 2011. 14. Thirteen [9] Lars Madsen. Re: Variable definitions / indenting 15. Fourteen on = sign. comp.text.tex, 25 March 2011. With a second level list, though, you might not [10] Heiko Oberdiek. Re: [texhax] superstitions. texhax get what you expect: mailing list, 23 April 2011. Standard enumeration: \begin{enumerate} ⋄ Peter Wilson \item Including a ‘skipit’ enumeration: 12 Sovereign Close \begin{enumerate}\fixitem Kenilworth, CV8 1SQ UK \item One \par herries dot press (at) \ldots \setlistctr{11} earthlink dot net \item Twelve

Peter Wilson TUGboat, Volume 38 (2017), No. 1 65

A search in TUGboat archives produces again only The optimal value for \emergencystretch one hit: In [13], p. 139, the following statement is Udo Wermuth made: “However, a sound rule of thumb is to set it to 1 em (based on the primary text font); this value, strange as it may seem, appears equally suitable for Abstract both wide and narrow measures.” (His “pragmatic approach” can result in high values for \tolerance.) As a reaction to authors using very high values for Of course a single value cannot always solve the integer parameter \tolerance in their texts in- the problem and make T X find line breaks without stead of rewriting them if T X creates overfull lines, E E overfull lines. It might nevertheless be seen as an up- Donald E. Knuth introduced in T X 3.0 the dimen E per bound on what is seen as tolerable for the visual \emergencystretch and a third pass for T X’s line- E output. A value of 5 pt appears to be small but in breaking algorithm. The parameter should only be a line with only one stretchable interword space it used in an emergency situation but such a situation creates a hole in the text as it stretches the space to can occur, for example, if a typist cannot change twice its maximal value in cmr10. Therefore, what- the text written by an author and T X produces E ever value for the parameter \emergencystretch is overfull lines. Then this parameter comes to the res- used, the output should be checked to see if it does cue although the output might not look good, as not create awful looking lines. The author of a text spaces can spread much more than before. This ar- should think about a textual change before eliminat- ticle tries to find all factors that have an impact ing overfull lines with \emergencystretch. on the value of \emergencystretch. Besides pure theory, experiments are performed and the impact Here is a short overview of the structure of factors are briefly discussed. this article: Section 2 sketches briefly and somewhat vaguely aspects of glue and establishes the nota- tion that helps to write about spaces and stretch- 1 Introduction ability. Section 3 presents an experiment with many Since its introduction with TEX 3.0 in 1989 [8, p. 327] overfull lines and shows how they can be removed the parameter \emergencystretch has asked for at- by assigning appropriate values to the dimension tention as no hints about useful values are given in \emergencystretch. The situation is analyzed from the article. Of course, it could be used to avoid awful a theoretical point of view in section 4. Section 5 ap- lines in a better way than before: “[P]eople [... ] tried plies the formula created in section 4 to some cases of to do this by setting \tolerance = 10000, but the experiment 1 and presents numerical results as well result was terrible because TEX would tend to con- as ideas for TEX macros to do the calculations. The solidate all the badness in one truly horrible line.” So next three sections look at the various parameters its usage is a “better way to avoid overfull boxes, for that occur in the formula for \emergencystretch people who don’t want to look at their documents stated in section 4. The theoretical results are ex- to fix unfeasible line breaks manually.” tended in section 9 and applied to a second exper- The TEXbook describes this dimen [3, p. 107] iment in section 10. Removing overfull lines is only and gives its default value in the plain format, 0 pt. one application of \emergencystretch; another is I assume that — whatever research went into the discussed in section 11. The last section summarizes design and the implementation — the idea remains the results and gives a rule of thumb for the calcu- that authors should rewrite their texts if they cannot lation of \emergencystretch. be broken by TEX. The dimen is an instrument for people who have to work with a text which cannot 2 Notational conventions be changed by them. A paper about the dimension \emergencystretch The number of relevant publications about this should explain the material that is able to stretch or parameter appears to be very small. In the first years shrink: glue. Therefore the basic principles of glue in after its introduction the LAT X3 group looked for E texts and in math mode are reviewed first. To handle volunteers to make experiments with the parameter all the different forms a consistent notation for num- [12, p. 511]. But it seems that no one has published bers, dimensions, and skips is needed. So let’s start such experiments or research. A check with several with some notational conventions and definitions. well-known textbooks to find a hint about useful settings and not merely the description of this pa- Conventions. I use the following notation for vari- rameter resulted in just one hit: In [1], p. 333, it is ables and functions; variables are written in lower- written that “a likely value seems to be around 5 pt.” case, functions in uppercase letters:

The optimal value for \emergencystretch 66 TUGboat, Volume 38 (2017), No. 1

1. math italic Latin for dimensions, the most fre- Gǫ(σ, W) is the finite glue that stems from the input quently used variables and functions; W for white space, given that the space factor is 2. numbers are written with Greek letters; σ at the start of the input; 3. boldface Latin is used for glue, i.e., a triple of Sǫ(T) represents all finite glue contained in T. dimensions, for example, g = (g◦, g+, g−) for ◦ The first three functions should be clear enough glue, that has the natural width g with the from the given description. They are easily com- ability to stretch by g+ and to shrink by g−; puted by TEX. The last two functions compute glue. 4. boldface Greek is used for pairs of numbers and Together with the fourth function they are explained triples of such pairs. and precisely defined in the next subsections to- A typewriter font is used for the input: String gether with a few more specialized functions. variables are written in uppercase and single com- The rest of this section describes and defines mand or character input get letters in lowercase. these functions; skip to section 3 if you are not in- When glue is added the values of the corre- terested in the details. sponding components are added; multiplication and Glue in paragraphs. In general an input T can division by an integer is also done by multiplying be seen as a sequence of text parts Tκ, which do not or dividing each component by that integer. These have any author-entered glue except if it is already operations are represented in TEX by the commands set, for example, in an \hbox, and input Wκ that \advance, \multiply, and \divide for skips. represents the glue w◦ plus w+ minus w−: Some important elements receive fixed names: κ κ κ T = T0W0T1W1 ... Tω−1Wω−1Tω. ( ) e is the value of \emergencystretch; ∗ The text elements T contain more than char- f denotes the \fontdimen ν of the current font; κ ν acters that are typeset, for example, T X control se- h stands for the \hsize; E quences, implicit kerns, mathematics, or boxes. An k represents a kern; assumption is made: The input can be processed m is the current value of \mathsurround at the unconditionally, that means control sequences like end of a formula, i.e., at the math-shift charac- \if, \unkern, etc. are resolved and token lists are ter that ends the math mode; expanded. This is not a real restriction but avoids o is the value by which an overfull line is too wide; subcases and is reasonable for user input. Each en- ǫ specifies the environmental condition that ex- tered white space sequence is related to a glue item plains how spaces get their width (see below); Wκ = wκ,1wκ,2 ... wκ,µκ , whose elements might be not τ represents the value of \tolerance; only spaces but also penalties and dimens from a π stands for a penalty; kern or a math-on/math-off switch. For example, ◦ + − l = (l , l , l ) is the \leftskip; the author might have entered an italic correction r = (r◦, r+, r−) is the \rightskip; wκ,1 and then a space wκ,2: The natural width of the s = (s◦, s+, s−) represents the \spaceskip; ◦ glue item wκ is the sum of the kern and the natu- ◦ + − x = (x , x , x ) stands for the \xspaceskip; ral width of a space. Penalties are also allowed in z = (0 pt, 0 pt, 0 pt) is the zero glue; in the plain Wκ, though they are not white space. Then a kern format it is called \z@skip; followed by a is covered by the description too. Z = (0, 0) is the pair of two zeros. If leaders are used then the skip part is listed as Important functions are: glue input, since the box part just fills the created white space with some pattern [3, p. 223]. W(T) is the width of the input T with an unspec- ified stretch or shrink amount; otherwise the The glue function. A function is needed to find a subscript “nw” or “mt” are used for the natu- unified way to write about finite glue in a text. TEX ral width and the maximal tight width, resp.; has several mechanisms to deal with it [3, pp. 75– L(S&T) stands for the change of width that the con- 77] which result in many different cases in equations catenation of S and T differs from the sum of the about glue. Therefore, the environmental condition, individual widths because of ligatures or kern- called ǫ, is introduced. It is a number defined as ing, i.e., Wnw(ST) = Wnw(S)+Wnw(T)+L(S&T); 0, s = z = x; Φ(T) returns the value of the space factor that is 1, s = z = x; ǫ := 6 active at the end of input T;  2, s = z = x;  6 Ω(T) stands for a triple of pairs — each pair gives  3, s = z = x. 6 6 the amounts of stretchability and shrinkability So ǫ = 0 means that the normal interword spaces are  of one of the three infinite glue orders in input T; used, odd values stand for a nonzero \xspaceskip,

Udo Wermuth TUGboat, Volume 38 (2017), No. 1 67

Nonzero \(x)spaceskip setting So it requires several cases to define a function alters not relevant that returns the glue value for any glue item w when the space factor σ is applied under the environmen- \hskip tal condition ǫ: \hglue ~ (f2, σf3/1000, 1000f4/σ), \quad w is sfglue, ǫ < 2, σ < 2000; \qquad  (s◦, σs+/1000, 1000s−/σ), \  \enskip  w is sfglue, ǫ = 2;  ◦ + −  (s , σs /1000, 1000s /σ), \!   w is sfglue, ǫ = 3, σ < 2000;  \;  (f2 + f7, σf3/1000, 1000f4/σ), \>   w is sfglue, ǫ = 0, σ 2000; \space  ◦ + − ≥ \,  (x , σx /1000, 1000x /σ),  \mskip  w is sfglue, ǫ is odd, σ 2000; math  ≥ space  (f2, f3, f4), mode only  factor aware  w is eaglue, not sfglue, ǫ < 2;  ◦ − Figure 1: Input methods in plain T X for glue  (s , s+, s ), E G (σ, w):= influenced by nonzero \(x)spaceskip (shaded area) ǫ  w is eaglue, not sfglue, ǫ 2;  ◦ − and glue that is space factor-aware (lower left area)  (w , v+, v ), ≥ w is explicitly entered glue,  and values 2 and 3 signal that the \spaceskip is  \hskip or the like;  − −  v+ := w+ and v := w if they nonzero.   are finite, otherwise 0 pt; TEX knows several kinds of white space. Some   (k, 0 pt, 0 pt), are aware of the environment, while others ignore it;   w is a kern or mkern with width k; let’s call the former kind eaglue. For example, the   (m, 0 pt, 0 pt), normal spaces, the control word \space, the con-   w is a math-shift character; m trol space and the tie belong to eaglue but author-   is the value of \mathsurround; entered white space through \hskip is not eaglue.   (0 pt, 0 pt, 0 pt), Further, normal spaces and control spaces are differ-   w is ignored or not white space. ent as the first is affected by the space factor before   the white space [3, p. 76]. To distinguish between As usual the three components of Gǫ(σ, w) have the ◦ + − these two kinds of eaglue the first one is called sfglue names Gǫ (σ, w), Gǫ (σ, w), and Gǫ (σ, w). in the following discussion. Before the sum of the individual parts of Wκ = Figure 1 gives an overview of the different kinds wκ,1wκ,2 ... wκ,µκ can be built, one technicality needs of finite glue, including muglue which is used only in to be addressed: The value of \spacefactor can be math mode. The TEX control sequences for infinite changed. When wκ,0 is the empty string, the def- glue, such as \hfil, are not listed, since such glue is inition is collected by the function Ω described below. Tech- µκ nically, not only glue counts, although all values are Gǫ(Φ(Tκ) , Wκ) := Gǫ(Φ(Tκwκ,1 ...wκ,ι−1) , wκ,ι). ι=1 treated as glue in this discussion. A user can enter X an explicit kern with the italic correction, or TEX To state the amount of stretchability or shrink- inserts the value of \mathsurround when it reads a ability of the input T of the model of eq. ( ) in one math-shift character. function, the following summations are necessary:∗ It is possible to have several glue items in a se- ω−1 ω−1 + − quence; sometimes this second glue is ignored and Gǫ (Φ(Tκ) , Wκ) and Gǫ (Φ(Tκ) , Wκ). sometimes it counts: Two \hskips create glue in κ=0 κ=0 which each component is the sum of the correspond- X X This looks very complicated, but is a simple ing values of the skips, but two normal spaces count function if the default settings of plain T X are usually only as a single space. When white space is E considered. In this case only a counting of spaces placed in a sequence the space factor must be con- and punctuation marks in a single line L is necessary sidered for all items. For example, in :\hglue0pt if the author hasn’t entered \hskips. Let plus1pt \space\space the last \space is still influ- enced by the space factor that occurs after the colon. νc(L) := number of occurrences of character c in L

The optimal value for \emergencystretch 68 TUGboat, Volume 38 (2017), No. 1

and define an extension for more than one character mode are a different topic, not handled in this arti- ω cle; see [3], pp. 195–197.) L L νc1 ...cω ( ) := νcκ ( ). When TEX operates in math mode the space κ=1 X factor and normal spaces have no meaning: TEX in- The counts of the “relevant” punctuation marks, i.e., serts the spacing according to its own rules. those punctuation marks not preceded by an upper- In math mode TEX typesets the formulas in case letter, not at end of line, and not followed by styles. Eight styles are defined: the four basic styles a control space or tie, and the plain TEX settings are scriptscript style SS, script style S, text style give total stretchability and shrinkability: T , and display style D, each with two versions [3, 5 3 pp. 140–141]. They are usually sorted as ν (L) + ν,(L) + ν;(L) + 2ν:(L) + 3ν.?!(L) f3, ′ ′ ′ ′ 4 2 SS < SS < S < S < T < T < D < D  4 2 1 1 so that it makes sense to represent them by the num- ν (L) + ν,(L) + ν;(L) + ν:(L) + ν.?!(L) f4, 5 3 2 3 bers 0 to 7. Inside the formulas TEX operates with where ν (L) numbers the spaces that are not pre- atoms. There are thirteen types, but only eight are ceded by a relevant punctuation mark in L. Note the important for spacing as the others are transformed terms f3 and f4, which are \fontdimens 3 and 4, are into these eight (see [3], p. 158 and Appendix G). replaced by s+ and s− if ǫ = 2. Again the types are sorted Infinite glue. Inspired by [4, 822], infinite glue is Ord < Op < Bin < Rel written as a triple of pairs of§ numbers. Each pair < Open < Close < Punct < Inner represent one of the three orders of infinite glue: fil, < Over < Under < Acc < Rad < Vcent fill, and filll. So the amount of infinite glue in g is so that the numbers 0 to 12 can be assigned to the Ω(g) = (Ω1(g), Ω2(g), Ω3(g)) and each pair has two − atoms. The names stand for atoms of types ordinary, numbers: Ω (g) = (Ω+(g), Ω (g)). ι ι ι large operator, binary operator, relation, opening, For example, the glue specification g = \hskip closing, punctuation, inner, overline, underline, ac- χ pt plus 2α fil minus β fill has two different cented, radical, and vcenter; examples of atoms for orders of infinite glue, therefore− Ω (g) = (2α, 0), 1 the first eight types are given in Fig. 2, first column. Ω (g) = (0, β), and Ω (g) = Z. 2 − 3 Note, however, it is not the symbol that counts but To define for T of eq. ( ) ∗ its usage: In $+1$ the ‘+’ is not a binary operator Ω(T) = (Ω1(T), Ω2(T), Ω3(T)) and therefore not of type Bin.

a definition of Ωι(T) for 1 ι 3 is needed. With In math mode TEX doesn’t use single fonts but ≤ ≤ family α, if w contains the amount α font triples combined in a ; there are up to + 16 families. A triple of fonts consists of a font for Ωι (w) := of infinite stretchability of order ι ( 0, otherwise normal text symbols, one for subscripts, and one for sub-subscripts; the first font is called the \textfont. α, if w contains the amount α − In plain T X, family 1 contains the math italic let- Ω (w) := of infinite shrinkability of order ι E ι ters, family 2 the math symbols, and family 3 large ( 0, otherwise symbols. The fonts in families 2 and 3 need special Ω ι(Wκ) when Wκ = wκ,1wκ,2 ... wκ,µκ is defined as \fontdimen parameters but only one of them is of + − Ωι(Wκ) = (Ωι (Wκ), Ωι (Wκ)) interest for our glue concerns: \fontdimen6 of fam- t2 µκ µκ ily 2’s \textfont (named f6 ), the quad width of + − := Ωι (wκ,χ), Ωι (wκ,χ) the font, plays an important role. It is used to con- χ=1 χ=1 ! vert the muglue, which is measured in mu, into glue X X t2 so that measured in pt: 1 mu = f6 /18. + − As mentioned above, T X inserts glue in math Ωι(T) = (Ωι (T), Ωι (T)) E ω−1 ω−1 mode and ignores normal white space but, of course, + − an author can explicitly enter \hskip or \kern or := Ωι (Wκ), Ωι (Wκ) . κ=0 κ=0 ! \mskip or \mkern commands; the latter two use X X muglue. In the model ( ) each explicitly entered glue ∗ Glue in math mode. TEX is often used to type- is represented by a Wκ but inserted glue in math set mathematics, so the glue that is present in math mode does not create such a glue token. The in- mode should be analyzed too. Only inline formu- put Tκ may contain material in math mode which las are treated here. (Overfull lines in display math stretches or shrinks because of glue inserted by TEX.

Udo Wermuth TUGboat, Volume 38 (2017), No. 1 69

Insert the specified glue after Atom And for t, T(T) is computed in a similar way: if it is followed by an atom of type ω 7 Ex.Atomtype0 1 2 3 4 5 6 7 T(T) := µ(χ, 3α, T )t [α 0, 1, 5, 7 ] κ ∈ { } n1 m t n κ=0 χ=4 a Ord 0 X X Op 1 n1 n1 t n + µ(χ, α3, T )t [α 0, 1, 4, 7 ] . κ ∈ { } + Bin 2 m m m m plain P At least with the defaults of TEX, the = Rel 3 t t t t split into three functions makes some sense as only ( Open 4 M(T) can stretch and shrink; T(T) cannot shrink 1 ) Close 5 n m t n and N(T) can neither stretch nor shrink. For the ap- : Punct 6 n n n n n n n plications of this paper the shrinkability and stretch- 1 1 2 Inner 7 n n m t n n n ability is of interest, so the function N(T) is never 1 applied in styles 0–7; otherwise 4–7 only used as long as \thinmuskip is not changed. Again this looks more complicated than it is in Figure 2: TEX’s space table [3, p.170], with examples for the atoms order to cover all theoretical aspects: M(T) counts the number of Bin atoms in text and display style There are three amounts of glue that TEX in- and this number is multiplied by 2m. Similarly, T(T) serts into formulas: counts the number of Rel atoms that don’t follow a n is the glue created by the command Punct atom; this count is multiplied by 2t. The iden- tification of the relevant atoms is easily described for \mskip\thinmuskip in pt, i.e., it is ′ muglue expressed in pt; the styles T and T that appear in paragraphs if the m is like n but \medmuskip is used; style isn’t explicitly changed with \displaystyle: t is like n but \thickmuskip is used. A Bin or Rel atom is typeset in text style if it is nei- ther raised nor lowered with respect to the baseline. What type gets inserted is determined by the To capture inserted glue at a line break the glue space table shown in Fig. 2. Most glue is inserted ′ ′ function is extended to math mode. In styles 4–7, only in styles T , T , D , and D. TEX inserts a penalty after Bin and Rel atoms to The glue of these three types is inserted around create an opportunity to break formulas. selected atoms only if certain conditions are met. So m, m is a Bin atom in styles 4–7 G (σ, m) := first a counting of atom pairs is defined: ǫ t, m is a Rel atom in styles 4–7. µ(χ, α1α2, T) := number of times that the atom  sequence α1α2 occurs in style χ Summary: Glue in the input. In the model ( ) inside text T. the infinite glue is captured by Ω(T). ∗ The notation (a.k.a. Iverson’s convention) The finite glue of explicitly entered glue W that 1 statement is true follows the input T is Gǫ(Φ(T) , W). Three functions [ statement ] := 0 statement is false are defined to represent the finite glue that TEX in- T helps to describe the gluen inside math mode in ( ) serts into input which contains material in math T T M T N T with three functions. ∗ mode: ( ), ( ), and ( ). Therefore: ω 7 Sǫ(T) := finite glue in T N(T) := µ(χ, α1, T )n [α 0, 1, 5, 7 ] ω−1 κ ∈ { } κ=0 χ=0 = G (Φ(T ) , W ) + T(T) + M(T) + N(T) X X ǫ κ κ κ=0 + µ(χ, 10, Tκ) X when T = T W T W ... T − W − T as defined in ( ). 7 0 0 1 1 ω 1 ω 1 ω  Of course, S (T) = (S◦(T),S+(T),S−(T)). ∗ + µ(χ, α7, T )n [α 0, 1, 5 ] ǫ ǫ ǫ ǫ κ ∈ { } χ=4 X 3 An experiment + µ(χ, 6α, Tκ)n [α 0, 1, 3, 4, 5, 6, 7 ] ∈ { } I use a well-known text [3, p. 24] for the first exper- + µ(χ, 7α, T )n [α 0, 4, 6, 7 ] . κ ∈ { } iment. The text is typeset with a smaller \hsize  than the column width in order to produce over- m  The formula for looks only at styles 4–7: full boxes. Then the value of the dimension parame- ω 7 ter \emergencystretch is increased up to the point M(T) := µ(χ, 2α, T )m [α 0, 1, 4, 7 ] κ ∈ { } where an overfull box disappears. κ=0 χ=4 X X For example, when \hsize = 100 pt, five over- + µ(χ, α2, Tκ)m [α 0, 5, 7 ] . full boxes are produced. Then the value of the dimen ∈ { }  The optimal value for \emergencystretch 70 TUGboat, Volume 38 (2017), No. 1

\emergencystretch is increased in steps of 0.1 pt, iv) \emergencystretch: left 11.1 pt, right 11.2 pt and at \emergencystretch = 1.5 pt TEX is able to Once upon a time, Once upon a time, typeset the text with only two overfull lines. in a distant galaxy in a distant galaxy An experiment starts with a boldface line show- called O¨o¸c,¨ there lived called O¨o¸c,¨ there lived ing the number of the experiment for reference and a computer named R. J. a computer named it ends with this end-of-experiment marker: . Drofnats. R. J. Drofnats. Experiment 1: TEX definitions Mr. Drofnats—or Mr. Drofnats—or \hsize=100pt \overfullrule=1pt “R. J.,” as he preferred “R. J.,” as he preferred TEX input to be called—was hap- to be called—was hap- Once upon a time, in a distant galaxy called piest when he was at piest when he was at \"O\"o\c c, there lived a computer named work typesetting beau- work typesetting beau- R.~J. Drofnats. tiful documents. tiful documents. During the experiment seven overfull lines oc- Mr.~Drofnats---or ‘‘R. J.,’’ as he preferred to be called---was happiest when he was at work cur. Five exist at the beginning, and two are created typesetting beautiful documents. during the experiment. We’ll name the five cases a) to e); the overfull line that is created in the first T X output E paragraph is referenced by b′), the other by d′). i) \emergencystretch: left col. 0.1 pt, right 0.2 pt The result of the experiment is captured in the Once upon a time, Once upon a time, following summary, stating in the first line the num- in a distant galaxy called in a distant galaxy called ber of the experiment and its parameters and in the O¨o¸c,¨ there lived a com- O¨o¸c,¨ there lived a com- second line the measured values for the dimension puter named R. J. Drof- puter named R. J. Drof- \emergencystretch. Values separated by a nats. nats. mean: The resolution of one overfull line created an- Mr. Drofnats—or “R. Mr. Drofnats—or “R. other, which was resolved with the second value. J.,” as he preferred to J.,” as he preferred to Experiment 1 continued: Results be called—was happiest be called—was happi- a) parameters; b) used \emergencystretch when he was at work est when he was at work 1a): \hsize=100 pt typesetting beautiful doc- typesetting beautiful doc- b): 9.3pt 9.3pt/11.2pt 1.5pt 0.2pt/1.5pt 1.5pt uments. uments. A few dimensions. TEX reports by how much the ii) \emergencystretch: left 1.4 pt, right 1.5 pt overfull lines are too wide. Once upon a time, Once upon a time, W(called) = 25.00005 pt juts 5.88911 pt (1a) in a distant galaxy called in a distant galaxy called ¨ ¨ W(Drof-) = 22.94449 pt juts 2.13905 pt (1b) O¨o¸c, there lived a com- O¨o¸c, there lived a com- W(‘‘R.) = 15.13892 pt juts 12.36128 pt (1c) puter named R. J. Drof- puter named R. J. Drof- W(happiest) = 36.7223 pt juts 2.33350 pt (1d) nats. nats. W(doc-) = 18.61115 pt juts 10.61136 pt (1e) Mr. Drofnats—or “R. Mr. Drofnats—or J.,” as he preferred to “R. J.,” as he preferred where W(text) stands for the width of text as de- be called—was happi- to be called—was hap- fined in the previous section. For a single word or est when he was at work piest when he was at word fragment this is always the natural width, i.e., typesetting beautiful doc- work typesetting beau- there is no stretching or shrinking. When we explic- uments. tiful documents. itly mention that the natural width of a text with white space is computed then we use the subscript iii) \emergencystretch: left 9.2 pt, right 9.3 pt “nw” with W . Once upon a time, Once upon a time, As mentioned above, later two more lines be- in a distant galaxy called in a distant galaxy come overfull: O¨o¸c,¨ there lived a com- called O¨o¸c,¨ there lived W (R. J.) = 21.38892 pt juts 1.97240 pt (1b′) puter named R. J. Drof- a computer named R. J. nw W(work) = 21.13893 pt juts 2.08344 pt (1d′) nats. Drofnats. Mr. Drofnats—or Mr. Drofnats—or The overfull lines are resolved by various means: “R. J.,” as he preferred “R. J.,” as he preferred in a) and c) only stretchability is needed, in d) a ′ to be called—was hap- to be called—was hap- word gets hyphenated, d ) is similar to a) and c) but piest when he was at piest when he was at some fixed width material is added at the left side work typesetting beau- work typesetting beau- of the line, variable sized material is added to b), in ′ tiful documents. tiful documents. b ) variable sized material is moved to the next line,

Udo Wermuth TUGboat, Volume 38 (2017), No. 1 71

and e) is similar to that but a word is hyphenated As was noted above TEX can get rid of an over- instead of breaking at glue. full line in many different ways. It is too complex In order to have all dimensions at hand for to handle all the cases at once. It is better to start later calculations, here are the values of the mate- with a simple model. Therefore, let’s make the fol- rial moved to the next line in cases with hyphenation lowing assumption: The overfull line is changed only and the material added to some lines at the left: by moving material to the next line. In other words, no new material is added to the previously overfull Wnw(a com) = 26.11116 pt is added (2b) ′ W(est) = 12.27779 pt is moved (2d) line, so that only the cases a), b ), c), and d) of W(pi) = 8.33336 pt is added (2d′) experiment 1 are considered in this section. Wnw(tiful doc-) = 40.00009 pt is moved (2e) A formula for \emergencystretch. The badness is a heuristic based on the amount by which the The badness values. With the help of the param- available spaces have to shrink or to stretch in order eter \tracingparagraphs, the badness values of the to make the line fill a predefined length. Sometimes line-breaking algorithm can be found [14]. The lines the formula for the badness is stated as of the paragraph without using \emergencystretch stretch 3 and the paragraphs at the right of runs i) to iv) have used ability in the line shrink the following badness values: 100 (4) ×  stretch  7, *, 15, *, 0 and *, 17, *, 171, *, 0 (3) available ability in the line  shrink  7, *, 15, *, 0 and *, 15, 190, *, *, 0 (3i) but this is only an approximation [3, p. 97]. (Of 7, *, 15, *, 0 and 184, 17, 0, 113, 2, 0 (3ii) course, the same word in the numerator and de- nominator must be selected.) It’s not only that the 7, 198, 0, *, 0 and 4, 17, 0, 15, 2, 0 (3iii) badness is always an integer 10000, but the com- 7, 136, 0, 200, 0 and 3, 17, 0, 11, 2, 0 (3iv) putation given in 108 of [4]≤ computes it without § The symbol stands for the infinite badness the “need to squeeze out the last drop of accuracy.” of the overfull lines.∗ Such a line has the fitness class The section further states that the routine is “capa- tight [3, p. 97]. Finite badness values of lines contain- ble of computing at most 1095 distinct values.” For ing glue that shrinks are written with a bar above the purpose of the heuristic this computation is suf- them. In this way all fitness classes can be identified. ficient. Nevertheless it should be remembered that In this list the badness values for lines in the the badness value is not computed by a continuous fitness classes very loose and loose change to lower function as the formula might suggest. values when the \emergencystretch increases. The As the case of an overfull line is analyzed, for- values of some decent lines change too and then it mula (4) is used for the stretchability of a line. Let is known that the white space in such a line has to β be the badness, u the dimension of used stretch- stretch. Only tight lines and decent lines, in which ability, a the available stretchability in the line, and the glue shrinks, keep a constant badness value. As e the value of \emergencystretch. Then for e large indicated by the bar the 7 and the 2 in (3iv) belong enough to remove the overfull line to decent lines in which the glue shrinks. u 3 β 100 . But the “real” badness values obtained with ≈ a + e \hbadness [14, p. 367] in the last run are   ′ Of course, a + e = 0 pt. But to see an impact of 7, 4660, 7, 10000, 0 and 1264, 17, 0, 206, 2, 0. (3iv ) \emergencystretch6 a line must have some stretch- ability, i.e., a > 0 pt. 4 Some theory The badness of a line is difficult to estimate. As mentioned, it can be seen in the data written to the Do we need to perform this stepwise increment in log file if \tracingparagraphs is set to 1. order to obtain the values for \emergencystretch, The badness β of a non-overfull line is a fraction or is there a way to compute the values? of the \tolerance τ > 0; so for ϕ with 0 ϕ 1 First, let’s think about infinite glue. TEX throws the equation ≤ ≤ an error if it finds infinite shrinkability in a para- β = ϕτ graph. Infinite stretchability in a line makes it nearly holds. Replacing the left hand side of the approxi- impossible to generate an overfull line as T X can E mation with the right hand side of the equation gives break at any glue, penalty or hyphenation possibil- u 3 ϕτ u ity. Therefore, in this analysis all glue in the text is ϕτ 100 or 3 assumed to be finite. ≈ a + e 100 ≈ a + e   r

The optimal value for \emergencystretch 72 TUGboat, Volume 38 (2017), No. 1 and if ϕ = 0 At the left side of Fig. 3 some input L of width 6 100 Wmt(L) is typeset, with \leftskip at the left, then e 3 u a. (5) ≈ ϕτ − it is followed by glue g of width gmt at a place with r Therefore three values a, u, and ϕ must be found to a certain \spacefactor Φ(L) and some material M get an approximation of e to resolve a given overfull that contains no breakable glue and that is followed line. In such a line ϕ > 0, of course. by \rightskip. The width of the material is named As stated here, the values are not obvious to Wmt(M). The white space in the texts, the glue and calculate or even to guess but they can be factored the skips on both sides are shrunk to their maximum to a level which allows estimation of their values. as the line is overfull and therefore it is maximally The values a and u can be computed from trace tight; this is indicated by the subscript “mt” to W output shown by TEX but not when an overfull line and other variables. The length of the line at the is reported — this is discussed later. left is the sum of the \hsize h (it may be the width of a \parshape or a \hangindent) and the amount The plan for the analysis. It’s probably best that the line is too wide, let’s call it o. to look at the situation when the overfull line gets The right hand side contains also some infor- the right amount for \emergencystretch so that a mation. The natural width of the three items in the ◦ ◦ break creating an acceptable line occurs. Therefore line, l +Wnw(L)+r , must be smaller than h because the first question is: Where can TEX break a line? of the following observation: TEX would not create On p. 96 of [3], five cases are listed. A line break an overfull line if the stretchability in the line would might be at allow a break at the glue g; at the left the amount of stretchability was too small to resolve the problem. 1. glue if a non-discardable item (not glue, kern, ◦ ◦ penalty or a math switch) appears before the The width l + Wnw(L) + r can only stretch to the glue; width h with the help of e, so it must be smaller 2. a kern if it is followed by glue; than the width l + W(L) + r. 3. a math-off if it is followed by glue; The available stretchability of the resolved 4. a penalty; overfull line (the right side of Fig. 3) lies in the 5. a hyphen, either inserted by TEX or an explicit stretchability of the two glue items l and r and in hyphen present in the text. the stretchability of the text L. All these elements were named in section 2: The available stretchabil- The first three items are combined in this analy- ity on the right hand side of Fig. 3 is the sum of the sis into one case (named “break at glue”) using the stretchability of the \leftskip, l+, of the text L, definitions made in section 2. The glue might be en- + + Sǫ (L), and of the \rightskip, r : tered by the author or it is inserted by TEX after a + + + binary operation or a relation in math mode. Num- a = l + Sǫ (L) + r . (6) ber 4 can also be added except when the penalty is The used stretchability is the next difficult- not followed by glue. So the second case is a break af- to-guess value. As explained above in the right hand ter a penalty that is not followed by glue. The third side of Fig. 3 the text is typeset with some amount case represents number 5, the discretionary break. of stretch. This is the used stretchability u. So the following equations hold: Case 1: Break at glue. A before and after com- ◦ ◦ parison of the line contents shows the situation when h = l + W(L) + r = l + Wnw(L) + r + u. the overfull line gets the right amount for the dimen- This leads to an equation for u: u = h l◦ + ◦ − sion \emergencystretch so that a break at the last Wnw(L)+ r . But it is too soon to stop here. A term breakable white space can occur. like Wnw(L) is so content-dependent that it should + In the following analysis, we assume the input L be analyzed further. In (6) the value Sǫ (L) is used. doesn’t start and the input M doesn’t end with glue This is more or less the number of spaces in L. It that can be dropped at the beginning or end of a is an important characteristic and not dependent on line. Such glue is ignored by TEX and it makes the all elements of the input L. Wnw(L) is different, as description much easier if such glue isn’t present in hardly any other text will have the same width as L. the first place. Ok, the analysis continues and the equation for the right hand side is reordered lmt Wmt(L) gmt Wmt(M) rmt l W(L) r ◦ ◦ l + Wnw(L) + r = h u. h o → h − The left hand side gives another equation Figure 3: Resolve overfull line with break at glue h + o = lmt + Wmt(L) + gmt + Wmt(M) + rmt .

Udo Wermuth TUGboat, Volume 38 (2017), No. 1 73

where Wmt(L) typesets the text L with the mini- Using the bracket notation of section 2, an ab- mal amount of white space as explained above. Of breviation for the case when the line break occurs ◦ − ◦ − course, lmt = l l and rmt = r r . For the sec- at glue is defined − L − L − L ond term the equation Wmt( ) = Wnw( ) Sǫ ( ) Γ := [break occurs at glue] holds. And g = G◦(Φ(L) , g) G−(Φ(L) −, g) with mt ǫ − ǫ the function Gǫ of section 2. so that the cases 1 and 2 can be combined: − − − − When all these equations are applied to the u = Wnw(M) Sǫ (M) o l Sǫ (L) r ◦− − −− − − (8) equation of the left hand side it becomes: + G (Φ(L) , g) G (Φ(L) , g) Γ. ◦ − − ◦ ǫ − ǫ h + o = l l + Wnw(L) S (L) + G (Φ(L) , g) − − ǫ ǫ  − ◦ − Case 3: Break at hyphen. Another form of re- Gǫ (Φ(L) , g) + Wmt(M) + r r −◦ ◦ − − − − moving an overfull line is given in Fig. 5. Here the = l + Wnw(L) + r l Sǫ (L) r ◦ −− − − material that sticks out in the overfull line is not + G (Φ(L) , g) G (Φ(L) , g) + W (M) . ǫ − ǫ mt moved completely to the next line. It is a discre- Now the first three summands are replaced by h u − tionary break and only the fragment of width W(M) from the equation of the right hand side: is moved; material with width W(K′) is kept on the − − − h + o = h u l Sǫ (L) r line together with the hyphen character of width − ◦ − − −− + G (Φ(L) , g) G (Φ(L) , g) + W (M) . W(-). (The format plain TEX assigns the value of ǫ − ǫ mt The goal is reached if u is moved to the left side and \defaulthyphenchar to \hyphenchar. Here W(-) o to the right: is used instead of W(\char\hyphenchar\font).) As − − − the characters of a font can interact through liga- u = Wmt(M) o l Sǫ (L) r ◦ − − − − − tures and kerns, the sum of the two widths is not + G (Φ(L) , g) G (Φ(L) , g). ǫ − ǫ necessarily the width of the concatenated strings. All values except Wmt(M) are known and the width of The notation L(S&T) is used to denote the change the material M that is moved to the next line is much of width (compared to the sum) either through a lig- easier to estimate than the value of u, especially if ature or kern when the strings S and T are concate- it is of fixed width. Otherwise the material that is nated, i.e., Wnw(ST) = Wnw(S) + Wnw(T) + L(S&T) moved contains one or more ties. As Wmt(M) is the as explained in section 2. width of the material with all white spaces shrunk ′ ′ l W (KM) r l W(K ) L(K &-) W(-) r to maximum the following equation with the natural mt mt mt − → width Wmt(M) = Wnw(M) Sǫ (M) can be applied to h o h the result. In total this gives− = − − − − u = Wnw(M) Sǫ (M) o l Sǫ (L) r l W(L-) r ◦ − − − − − (7) + G (Φ(L) , g) G (Φ(L) , g). ǫ − ǫ h Case 2: Break at penalty. As mentioned above Figure 5: Resolve overfull line with break at hyphen the only situation that must be considered here is a break at a penalty that is not followed by glue. If the discretionary break occurs at an explicit Let’s call the penalty π; it separates inputs L and M hyphen then K = K′-; otherwise, K = K′. The dis- such that no kerning or ligatures must be taken into tinction can be handled via the abbreviations account. Θ := [the line ends with an inserted hyphen] lmt Wmt(L) π Wmt(M) rmt l W(L) r Ξ := [the line ends with an explicit hyphen] h o → h to avoid long statements in bracket notation in the formulas. Figure 4: Resolve overfull line with break at penalty Using the first abbreviation the widths of K and The resulting line at the right in Fig. 4 looks K′ fulfill the following equation: identical to the right hand side in Fig. 3. So (6) holds Wnw(K) + L(K&-) + W(-) Θ = without a change. The first difference occurs when ′ ′ (9) W (K ) + L(K &-) + W(-) . the formula for the left hand side is written down; nw  ′ now the summand gmt disappears. Or one can say Note that K might end in a hyphen, for example, if the glue g of Fig. 3 must be replaced by z and all the break occurs at an em-dash, and therefore the ′ formulas stay the same. Therefore the equation for summand L(K &-) is important. u becomes The available stretchability comes from the − − − − u = W (M) S (M) o l S (L) r . \leftskip, the \rightskip, and the text K′. But nw − ǫ − − − ǫ − The optimal value for \emergencystretch 74 TUGboat, Volume 38 (2017), No. 1 as Fig. 5 shows, the concatenation of this string to- (3iii), (3iv), (3ii), and (3i) which show the badness gether with the fixed width hyphen is L- and there- values after the overfull line disappears for the cases fore all the stretchability comes from L, the text that a), b′), c), and d), resp. That ϕ is sometimes less remains in the line: Equation (6) is still valid. than 1 in experiment 1 can be explained by the fact The used stretchability requires a bit more that the increment for the stretchability was done complicated equivalence of the left and right hand in steps by 0.1 pt instead of 1 sp. side equations that were discussed in case 1. Figure 5 For example, if, let’s say, 0.00001 pt is needed together with an application of (9) gives as additional stretchability when eι has already been ◦ ◦ applied, the situation can be described by the follow- h = l + Wnw(L-) + r + u ◦ ′ ′ ◦ ing approximation using τ = 200: = l + Wnw(K ) + L(K &-) + W(-) + r + u 3 ◦ ◦ u + 0.00001 pt = l + Wnw(K) + L(K&-) + W(-) Θ + r + u 200 100 , ≈ a + e + 0.00001 pt or  ι  ◦ ◦  but l + W (K) + r = h L(K&-) + W(-) Θ u. 3 nw − − u + 0.00001 pt α 100 The left hand side gives  ≈ a + e + 0.1 pt  ι  h + o = lmt + Wmt(KM) + rmt is computed with the strategy of experiment 1 where = lmt + Wmt(K) + L(K&M) + Wmt(M) + rmt eι+1 = eι + 0.1 pt. If we divide the left side of the ◦ ◦ − − − second equation by the left side of the first equation, = l + Wnw(K) + r l Sǫ (K) r − − − and the right side of the second equation by the right + L(K&M) + W (M) . mt side of the first equation, the quotients are With the equation for the right hand side and with − − 3 α a + eι + 0.00001 pt Sǫ (K) = Sǫ (L) this equals . 200 ≈ a + e + 0.1 pt h + o = h L(K&-) + W(-) Θ u  ι  −− − − − With a + eι = 5 pt the quotient on the right hand l S (L) r + L(K&M) + W (M) − − ǫ −  mt side is (5.00001 pt/5.1 pt)3 0.983 = 0.941192, so and therefore with W (M) = W (M) S−(M) ≈ mt nw ǫ that α 188. And with a + eι = 10 pt α gets no − − − − ≈ u = W (M) S (M) o l S (L) r larger than 194. nw − ǫ − − − ǫ − L(K&-) + W(-) Θ + L(K&M) . Again, this argument is only valid if a > 0 pt, − as otherwise T X cannot make use of the additional The last step is to remove the reference to K. E  stretchability, i.e., if the line has no place to stretch When the hyphen is inserted L(K&-) = L(L&-) and additional stretchability cannot change the output. L(K&M) = L(L&M). If the hyphen is explicit, then L(K&M) = L(L-&M). Using Ξ the equation for u can The result. With ϕ = 1 and equations (6) and (11) be stated without K as the optimal value of the dimen \emergencystretch − − − − u = W (M) S (M) o l S (L) r e is given for the abovementioned cases by nw − ǫ − − − ǫ − + L(L&M) L(L&-) W(-) Θ (10) 3 100 − − − − − − e Wnw(M) Sǫ (M) o l Sǫ (L) r + L(L-&M)Ξ. ≈ τ − − − − −  r ◦ −  + G (Φ(L) , g) G (Φ(L) , g) Γ Combining the cases. The equations (8) and (10) ǫ − ǫ can be combined: + L(L&M) L(L&-) W(-) Θ − − − − − − u = Wnw(M) Sǫ (M) o l Sǫ (L) r ◦ − − −− − − + L(L-&M)Ξ  + Gǫ (Φ(L) , g) Gǫ (Φ(L) , g) Γ − (11) l+ S+(L) r+  + L(L&M) L(L&-) W(-) Θ − − ǫ − − −  (12) + L(L-&M)Ξ + + +  if l + Sǫ (L) + r > 0 pt. and (6) is used in all three cases for a. 5 Numerical calculations The factor ϕ. Two of the three variables have been transformed into “simpler” forms (6) and (11); at Approximation (12) looks rather complicated with least they are simpler to estimate. its many parameters but some of them are zero when The value ϕ can be set to 1 with the following others are nonzero. Several parameters are deter- reasoning: The overfull line is removed as soon as mined by the font used and some are specified via possible, so the maximum allowed stretchability will the line-breaking parameters. Here are the relevant be used that results in the badness τ. See the data in values for the situation of experiment 1.

Udo Wermuth TUGboat, Volume 38 (2017), No. 1 75

1. First, the environmental condition ǫ is 0, mean- case a) case b′) case c) case d) ing that the font-related parameters have to be 15. (end of) L = galaxy named or happi used. These have the following values in cmr10: 16. Φ(L) = 1000 1000 1000 n/a ◦ 1a. \fontdimen2 = f2 = 3.33333 pt 17. g = f2 f2 f2 n/a − 1b. \fontdimen3 = f3 = 1.66666 pt 18. g = f4 f4 f4 n/a + 1c. \fontdimen4 = f4 = 1.11111 pt 19. Sǫ (L) = 3f3 2f3 f3 2f3 − 1d. \fontdimen7 = f7 = 1.11111 pt 20. Sǫ (L) = 3f4 2f4 f4 2f4 1e. and it means that s = z as well as that x = z. The text M is shown by TEX in the message The \tolerance equals 200 in plain TEX when about the overfull line, but the value Wnw(M) must the emergency pass is performed so be either measured or guessed. For experiment 1 the 3 3 2. 100/τ = √0.5 0.794. values have been documented in (1) and (2). ≈ ′ Thep plain format leaves both \leftskip and case a) case b ) case c) case d) \rightskip zero. M = called R. J. “R. est + − 3. l = z, i.e., l = 0 pt and l = 0 pt 21.Wnw(M)/pt=25.00005 21.38892 15.13892 12.27779 + − − 4. r = z, i.e., r = 0 pt and r = 0 pt 22. Sǫ (M) = 0 f4 0 0 23. L(L&M) = n/a n/a n/a 0 pt Two values can be determined for all cm fonts: 5. L(T&-) = 0 pt for all T not ending in a hyphen, Although 23 parameters have been listed, yet 6. L(S-&T) = 0pt for any text S and all T not more are involved which are hidden in other param- beginning with a hyphen. eters. One is the set of \sfcodes for all the charac- − A hyphen has no kerning with any other character ters, which are used in the calculation of Sǫ () and + and ligatures are built only with other . But Sǫ (). Another is the font size (or the width of the a hyphen is never inserted when explicit hyphens are characters), which is important for Wnw(M). present to break the line. As mentioned above, a and u can be derived The width of a hyphen in cmr10 is: from the trace data written by TEX, but only af- ter the overfull line has been resolved. The output 7. W(-) = 3.33333 pt. from \tracingoutput can be used: The sum of the The following parameters are not used in the stretchability of a line gives a and the multiplica- calculations as no math typesetting occurs in the tion with the glue set value computes u ([3], p. 75 experiment. Nevertheless the values are given for and p. 79, resp.). The values are listed in lines A and completeness: B, their product u rounded up to five places is given t2 8. \fontdimen6\textfont2 = f6 = 10.00002 pt in C. as the \textfont2 is cmsy10; case a) case b′) case c) case d) 9. \medmuskip = (4 mu, 2 mu, 4 mu) and therefore A. stretch/pt = 4.99998 3.33332 1.66666 3.33332 m = (4, 2, 4) 10.00002/18 pt which gives the × B. glue set = 3.59998 5.49165 2.33325 1.31664 glue (2.22223 pt, 1.11111 pt, 2.22223 pt); C. A B/pt =17.99983 18.30543 3.88873 4.38878 10. similarly, \thickmuskip = (5 mu, 5 mu, 0 mu) ∗ D. a/pt (6) = 4.99998 3.33332 1.66666 3.33332 so t = (5.55557 pt, 5.55557 pt, 0 pt). E. u/pt (11) =17.99963 18.30541 3.88875 4.38874 The next parameters depend upon the content F. e/pt (12) 9.286 11.196 1.4198 0.15 of the line and the type of the break. The value of o ≈ G. e/pt ex. 1 = 9.3 11.2 1.5 0.2 is shown by TEX in the message about the overfull line. From this message the possible type of break, The calculated values in line F agree with the i.e., Γ, Θ, or Ξ can be determined. stepwise measured data in row G. In the rest of this case a) case b′) case c) case d) article, the computations round up the value of e to 11. o/pt = 5.88911 1.97240 12.36128 2.3335 one decimal place; a higher precision is not needed. 12. Ξ = 0 0 0 0 Macros. When the parameter \showboxbreadth is 13. Θ = 0 0 0 1 large enough, say 100 for lines with 60–70 characters, 14. Γ = 1 1 1 0 the complete overfull line is written by TEX to the Then L and Φ(L) as well as two values of the log file and there all stretch and shrink values of the glue g = (g◦, g+, g−) where the break occurs if Γ = 1 glue can be found. But since the glue set ratio is are calculated. The values of the Sǫ function can be reported as 1.0 in an overfull line, only the value counted by the method described in section 2. of a can been− determined from the message.

The optimal value for \emergencystretch 76 TUGboat, Volume 38 (2017), No. 1

Nevertheless, macros can be written to make font, \leftskip, etc., some macros are writ- the calculation from the message shown. In this sub- ten that can be called before the first macro to section a brief description for the design of a set of specify different values. macros based on (12) is given. Except for the cube root the calculation uses This makes it easy to find e for the original five only simple arithmetic, which is available in TEX. cases of overfull lines in experiment 1: For the cube root I use the formula 3 α3 + β Case a): 9.3 pt Case c): 1.5 pt α + β/(3α2). The number of parameters makes the≈ Case b): 10.7 pt Case d): 0.2 pt p calculations a little bit complicated but TEX can do Case e): 5.6 pt it, especially as it knows all the font parameters, and for the two created overfull lines: the \tolerance, and the width of strings. A set of ′ ′ Case b ): 11.2 pt Case d ): 6.7 pt macros can be designed that receives the data about the moved and the kept material, the type of the although the theory of section 4 does not apply to ′ expected line break, and the overhang to perform the cases b), e), and d ). So their computed values the calculation to get e. do not agree with the measured ones. Usually only five values must be specified as parameters or by macro names — three of them are 6 Line-breaking parameters displayed by T X and two are known by the user. E In the approximation (12) for e many different val- The other parameters can be calculated by T X, al- E ues are used, and it seems useful to discuss some of though a user should be able to change them. them. As \tolerance plays a very prominent rˆole, The following four macros are used, for exam- and is the only parameter with a non-linear rela- ple, to compute the value of \emergencystretch in tionship to \emergencystretch, the group of line- case a) of experiment 1: breaking parameters is analyzed first. 1. \dataEtextM(called) 2. \dataEtextL(in a distant galaxy) The \tolerance. The dimen \emergencystretch 3. \breakEglue(1000) was introduced to avoid large values of \tolerance. 4. \calcEoverhang(5.88911pt) The latter is more of a document-wide parameter, 1. The first macro receives the text M. It allows the while the former should be applied to a single para- − calculation of Wnw(M) and Sǫ (M). graph. An increase of \tolerance in order to lower 2. The second macro gets the text L and it deter- the value of \emergencystretch is therefore not a + mines its stretch and shrink units Sǫ (L) and good idea: Tight lines cannot become tighter and − Sǫ (L). loose lines benefit from \emergencystretch. Now a is known and for u only the three terms When (5) is written as a function of the param- which are multiplied by Γ, Ξ, and Θ as well as eter \tolerance for an overfull line o are missing. 3 − f(ξ) = √100u ξ 1/3 a, ξ > 0, 3. One of the following five macros is called to − specify the type of break: it is a monotone decreasing function as in a situation a) \breakEhyphen, with an overfull line u > a > 0 and its derivative is b) \breakEexhyphen, < 0. For ξ the limit is a. As usual, values → ∞ − c) \breakEmath with a parameter for the atom above 10000 are of no use in the application and the (Bin or Rel) after which the break occurs, and \emergencystretch cannot be a negative distance. a glue specification for user-entered glue, With ξ0 = 100, which is the plain TEX default d) \breakEotherglue — used when the glue is, value of \pretolerance, the function value f(ξ0) is for example, an \hskip — which gets the three u a > 0 pt so there must be a ξ1 for which the func- ◦ + − − 3 dimen values g , g , and g ; or it is a break tion becomes zero. This is ξ1 = 100(u/a) , which with glue z at penalty and is the approximation for the badness. Or in other ′ e) \breakEglue that has one parameter: Φ(L). words: With the real badness values, as in (3iv ), Now u + o is known. the required \emergencystretch is 0 pt. The value 4. The last macro receives the value o as param- f(τ) computes the right hand side of (5) so it is the eter. It calculates u, the factor with the cube additional stretchability e that is needed to resolve root and determines e rounded up to one deci- the overfull line. mal place. A concrete numerical example might help to un- 5. All macros use the plain TEX defaults for their derstand this better. For case d) the values u = calculation. As mentioned above, to change the 4.38878 pt and a = 3.33332 pt were stated above.

Udo Wermuth TUGboat, Volume 38 (2017), No. 1 77 e in pt the initial situation (“Drofnats” cannot be hyphen- ated) but the data for \emergencystretch doesn’t change, as the following experiment shows. Its re- fb′) 15 sults are found by the procedure used in experi- ment 1. fa) Experiment 2: Description Suppress hyphenation of words that start with an up- percase letter. 10 TEX definitions \uchyph=0 Result (experiment 1 vs. experiment 2) a) parameters; b) used \emergencystretch 5 1a): \hsize=100 pt b): 9.3pt 9.3pt/11.2pt 1.5pt 0.2pt/1.5pt 1.5pt fc) 2a): \uchyph=0 b): 9.3pt 9.3pt/11.2pt 1.5pt 0.2pt/1.5pt 1.5pt fd) The next two experiments show that the penal- 0 ties \hyphenpenalty and \exhyphenpenalty act as 0 100 200 300 switches. The badness of an overfull box is reported \tolerance ξ as 1000000 [3, p. 229]. An overfull line is so bad in Figure 6: Graphs of function f for the cases TEX’s opinion that no finite setting for the hyphen- discussed in section 4 ation parameters should make a difference.

3 Experiment 3: Description As √100 4.642 the function becomes All penalties are set to the maximum finite value and all ≈ − f (ξ) = 20.37091 ξ 1/3 pt 3.33332 pt. demerits are set to a high value. d) − The other three cases a), b′), and c) have simi- TEX definitions lar formulas. The graphs of all four functions are \hyphenpenalty=9999 \exhyphenpenalty=9999 drawn in Fig. 6. It shows the typical curve of these \linepenalty=9999 \finalhyphendemerits=1000000 functions: A small ξ has a high value but the func- \adjdemerits=1000000 \doublehyphendemerits=1000000 tion values drop quickly as ξ is increased. This ef- Result (experiment 1 vs. experiment 3) \emergencystretch fect slows down and a larger ξ reduces the required a) parameters; b) used 1a): \hsize=100 pt \emergencystretch by only a small amount. The b): 9.3pt 9.3pt/11.2pt 1.5pt 0.2pt/1.5pt 1.5pt value of ξ = τ = 200 gives e. 3a): \...penalty=9999 and \...demerits=1000000 Hyphenation. In the context of the removal of b): 9.3pt 9.3pt/11.2pt 1.5pt 0.2pt/1.5pt 1.5pt overfull lines the assumption was made that the hy- The situation is different when hyphenation is phenation of words is a valid option. This might completely suppressed, since the final result of ex- not always be the case. There are several primi- periment 1 contains hyphenated words. tive TEX commands that prevent hyphenation com- Experiment 4: Description pletely or for certain words only: The assignment of Hyphenation of all words is suppressed. 10000 to the penalty \hyphenpenalty and its com- TEX definitions panion \exhyphenpenalty suppresses hyphenation \hyphenpenalty=10000 \exhyphenpenalty=10000 completely as does the assignment \hyphenchar = Result (experiment 1 vs. experiment 4) 1. And \uchyph = 0 suppresses hyphenation of − a) parameters; b) used \emergencystretch words that start with an uppercase letter. All these 1a): \hsize=100 pt settings influence the possibility of hyphenating cer- b): 9.3pt 9.3pt/11.2pt 1.5pt 0.2pt/1.5pt 1.5pt tain words and therefore the values that are available 4a): \hyphenpenalty=\exhyphenpenalty=10000 to remove overfull lines with \emergencystretch b):9.3pt 9.3pt/11.2pt 1.5pt 15.2pt 5.6pt might increase. If hyphenation is suppressed only Γ The necessary values for e are found with (12) can be 1, Θ and Ξ must be 0 in (12). when only the break at glue or penalty is considered The commands act like switches, not continu- although TEX will still show hyphenation points in ous functions. As the final result of experiment 1 the messages for the overfull lines. Note: case e) is doesn’t hyphenate a word which starts with an up- now covered by (12); the computation at the end of percase letter, the switch \uchyph = 0 only changes section 5 gives e.

The optimal value for \emergencystretch 78 TUGboat, Volume 38 (2017), No. 1

7 Character- and font-related parameters Case d) vanishes and the cases d′) and e) do not change as the added material is more important than Some of the parameters of (12) are directly related the change in the stretchability of the spaces. to the properties of characters. Among them are the \sfcode and, closely related, the \spacefactor. The \sfcodes. A plain TEX control sequence that But the largest group of parameters in (12) are re- changes the \sfcodes of the punctuation marks .? lated to the font used; for example, there are the !:;, is \frenchspacing. It makes a space after \fontdimen 2, 3, 4, and 7 and the ligtable entries a punctuation mark equal to a normal space for any L(L&-), L(L&M), and L(L-&M). And with Wnw(M) text T; let’s call this space g. But in our cases its the width of a character string occurs. Some of the use will not change anything because there are so listed values can be changed by an author with the few punctuation marks in the text: three commas help of TEX; others must be handled as constants. and seven periods. The space factor of the periods The \spacefactor. The integer \spacefactor is has no influence on the text as two of the seven an important characteristic for horizontal mode and periods are at the end of the paragraphs, two are the \sfcode assigned to each character modifies it. followed by a tie which resets the value to 1000, and (The assignments are made by INITEX and the for- three follow an uppercase letter so that the value is mat, so the \sfcode is not directly a font-related pa- changed from 999 to 1000. And the three commas − − are never part of an overfull line. rameter.) In (12) the four parameters Sǫ (M), Sǫ (L), + Therefore, experiment 1 can be treated as if the Sǫ (L), and Φ(L) are affected by all of these. In this subsection the relation of \spacefactor to the for- command \frenchspacing was given and so the − − + + mula for \emergencystretch is analyzed; a TEX equalities Sǫ (L) = ν (L)g and Sǫ (L) = ν (L)g command to change the \sfcodes is discussed in hold. Approximation (12) can be stated as a func- the next subsection. tion of ξ = ν (L), the number of spaces in L: Experiment 5: Description 3 100 − + Set \spacefactor = 1200 if it is 1000 before a space. g(ξ) = g + g ξ − r τ ! TEX definitions \def\1{\ifnum\spacefactor<1200 \count255=1200 3 100 − − − + Wnw(M) Sǫ (M) o l r \else \count255=\spacefactor τ − − − − r ◦ − \fi \spacefactor=\count255 }  + g g Γ − T X input E + L(L&M)  L(L&-) W(-) Θ Once\1 upon\1 a\1 time,\1 in\1 a\1 distant\1 − − + + galaxy\1 called\1 \"O\"o\c c,\1 there\1 lived\1 + L(L-&M)Ξ l r .  − − a\1 computer\1 named\1 R.\1~J.\1 Drofnats. It is a linear equation with negative slope. For 3 − Mr.\1~Drofnats---or\1 ‘‘R.\1 J.,’’\1 as\1 he\1 plain TEX and cmr10 100/τ g + g+ 2.43 pt. ≈ preferred\1 to\1 be\1 called---was\1 happiest\1 So each space gives a relief of this amount when the p when\1 he\1 was\1 at\1 work\1 typesetting\1 command \frenchspacing is active. beautiful\1 documents. Let’s perform a concrete calculation to find the Result (experiment 1 vs. experiment 5) value of the intercept. For case d) three other terms a) parameters; b) used \emergencystretch are nonzero: Wnw(M) = 12.27779 pt by (2d), o = 1a): \hsize=100 pt 2.3335 pt by (1d), and as Θ = 1 L(L&M) L(L&-) b): 9.3pt 9.3pt/11.2pt 1.5pt 0.2pt/1.5pt 1.5pt W(-) = 0 pt 0 pt 3.33333 pt = 3.33333− pt, so− 5a): \spacefactor=1200 instead of 1000 0.794 (12.27779− 2−.3335 3.33333)− pt 5.2491 pt. b): 8.3pt 8.3pt/10.5pt 1.5pt 0.0pt/1.5pt 1.5pt × − − ≈ Similar equations can be created for the other As expected, the increase by 20% of the stretch- three cases of section 4, as shown in Fig. 7 (next ability per space reduces the required value for the page). A small dot on the lines shows how many \emergencystretch. As 0.2f = 0.2 1.66666 pt = 3 × spaces are present in that case. As a parameter to g 0.333332 pt the values of cases a) and b) with three this gives the value of e because no other input can spaces can be up to 1 pt smaller and this is what ≈ stretch or shrink. These spaces must additionally the experiment shows. Of course the amount in the stretch; each space widens by \emergencystretch resolved line is stretched to its maximum and the divided by the number of spaces in the line. additional stretchability is used to its maximum too. ′ For case b ) with two spaces it is only 0.7 pt The \fontdimens. The \fontdimen parameters are ≈ and case c) stays at 1.5 pt as no space was changed. read by TEX from a font’s tfm file. Although they

Udo Wermuth TUGboat, Volume 38 (2017), No. 1 79 e in pt L(C&l) when letter l follows input of column C C 0.55556 pt 0.27779 pt 0.27779 pt 0.55554 pt a− v− w y j b vwxy cdeoqj 15 g a) c c k gb′) f f i l ff i l g j 10 h b t u v w y k a c e o m b t u v w x y n b t u v w x y 5 o vwxy cdeoqj p vwxy cdeoqj gd) t w y u w

gc) v a c e o 0 w a c e o 0 1 2 3 4 5 y a e o number of spaces ξ Figure 8: Measured and kerning values Figure 7: Graphs of function g for the cases of lowercase letters in cmr10 discussed in section 4 seem to be a “mistake” [2, p. 322], but rather an can be changed by an author, this is not recom- optimization [11]. mended except in very unusual situations. I consider them to be constants. Here is a list for several fonts: 8 Paragraph shape parameters f cmr10 cmbx10 cmr12 cmtt10 ν The last group of parameters in (12) is formed by l 2 3.33333 pt 3.83331 pt 3.91663 pt 5.24995 pt and r, the \leftskip and the \rightskip. Some- 3 1.66666 pt 1.91666 pt 1.95831 pt 0.0 pt times these skips are used only with their natural 4 1.11111 pt 1.27777 pt 1.30554 pt 0.0 pt width, for example, in the command \narrower but 7 1.11111 pt 1.27777 pt 1.30554 pt 5.24995 pt in (12) only the stretchability and shrinkability of 6 10.00002 pt 11.49994 pt 11.74988 pt 10.4999 pt the glue counts. The \fontdimen parameters change when dif- It might have been a surprise that the dimen- ferent sizes of the same font are used, as shown in sion \hsize has no influence on the required value the column for cmr12 compared to the values for of \emergencystretch. At least there is a basic re- cmr10. For the Computer Modern fonts the rela- lationship between the two as tions f3 = f2/2, f4 = f2/3, and f7 = f4 seem to optimal value of \emergencystretch hold except for the monospaced font cmtt10. But 0 1. ≤ value of \hsize ≤ it is better to express this relationship in terms of Therefore, the parameter \hsize is also analyzed. f6, the quad width, also known as 1 em: f2 = f6/3, f = f /6, f = f /9, and f = f /9. 3 6 4 6 7 6 No influence: \hsize. Of course, a change of the The ligtable. The values must be treated as con- \hsize means different line breaks and that influ- stants. For the font cmr10 L(L&-) = L(L-&M) = 0 pt ences other parameters. Often overfull lines go away as explained in section 5. The dimension L(L&M) can when the \hsize is changed. In this sense this di- be taken from Fig. 8. The values are small but they mension has influence. But when a concrete line- can be negative or positive. breaking situation is given — which is the precondi- The easiest way to get the values is to look at tion for the analysis that leads to (12) — it doesn’t the property list of a font, which can be generated have any influence. from the tfm file with the utility TFtoPL [7]. But In the next experiment a “comparable” line- note, sometimes letter pairs might have more than breaking situation for a larger \hsize is used. By one entry, for example, in cmr10 two values for the “comparable” I mean a situation in which the line letter pair “ka” are specified [6, p. 37]. The first value breaks are the same as with the previous \hsize. counts, as explained in [5, p. 317]; so it does not Therefore the content must be changed: Each line

The optimal value for \emergencystretch 80 TUGboat, Volume 38 (2017), No. 1 gets more or less in its middle part a rule with a overfull lines. But with an \hsize of 108 pt case a) length equal to the increment of \hsize. returns. Experiment 6: Description Experiment 7: Description The \hsize is increased by 40 pt. As input, an instru- Change the \hsize to 108 pt and typeset the text ragged mented version of the text of experiment 1 is used: In right. each line the control symbol \0, which represents a 40 pt T X definitions long rule, is added before one word. E \hsize=108pt \raggedright TEX definitions \hsize=140pt \def\0{\hbox to 40pt{\hrulefill}} TEX output Once upon a time, TEX input in a distant galaxy called o = 2.33217 pt Once upon \0a time, in \0a distant galaxy O¨o¸c,¨ there lived a com- called \"O\"o\c c, there \0lived a computer \0named R.~J. Drofnats. puter named R. J. Drof- nats. Mr.~Drofnats\0---or ‘‘R. J.,’’ as \0he preferred Mr. Drofnats—or to be \0called---was happiest when \0he was at “R. J.,” as he preferred work \0typesetting beautiful documents. to be called—was happi- est when he was at work TEX output Once upon a time, typesetting beautiful in a distant galaxy called o = 5.88911 pt documents. O¨o¸c,¨ there lived a com- Result (experiment 1 vs. experiment 7) puter named R. J. Drof- o = 2.13905 pt a) parameters; b) used \emergencystretch nats. 1a): \hsize=100 pt Mr. Drofnats —or “R. o = 12.36128 pt b): 9.3pt 9.3pt/11.2pt 1.5pt 0.2pt/1.5pt 1.5pt J.,” as he preferred to 7a): \hsize=108 pt and \raggedright be called—was happiest o = 2.3335 pt b): 0.6 pt when he was at work The theory developed in section 4 applies as typesetting beautiful doc- o = 10.61136 pt all the different space types were included in the uments. analysis; (12) computes the value: 0.6 pt. Result (experiment 1 vs. experiment 6) a) parameters; b) used \emergencystretch 9 More theory \hsize ′ 1a): =100 pt Three cases of experiment 1 remain: b), d ), and e). b): 9.3pt 9.3pt/11.2pt 1.5pt 0.2pt/1.5pt 1.5pt In these cases text is not only moved to the next 6a): \hsize=140 pt with instrumented content b): 9.3pt 9.3pt/11.2pt 1.5pt 0.2pt/1.5pt 1.5pt line but the preceding line hands over new mate- rial to the previously overfull line. This changes the As expected, the experiment generates the iden- picture completely as one of the basic elements on tical values for eliminating overfull lines. which the theory of section 4 is based is no longer Ragged-right setting. As mentioned above the true: The line that appears after applying the mini- \fontdimen values should only be changed in very mal \emergencystretch is no longer stretched to its unusual situations; an example is given in [3], p. 355. maximum. See (3ii) for the case e) where the new ′ If a change of the interword space is required the in- badness is 2 and the white space shrinks as (3iv ) ternal glue registers \spaceskip and \xspaceskip shows. I doubt that there is a precise approxima- can be used as explained in section 2. An applica- tion to calculate e from the output that contains tion occurs when text is typeset ragged-right with the overfull line only if new material is added to the the help of a stretchable \rightskip. line. ′ The plain macro \raggedright initializes the As the cases b) and b ) show, it can happen that ragged-right settings: an overfull line is transformed into another overfull \def\raggedright{\rightskip=0pt plus2em line before the computed \emergencystretch re- \spaceskip=.3333em \xspaceskip=.5em\relax}. solves the original problem. And the newly created The interword spaces are fixed and the \rightskip overfull line needs a larger additional stretchability has a large value of stretchability: 2 em is 12f3 in than the original one. Therefore a second calculation cmr10. So it is not surprising that the text of ex- of e is sometimes necessary. The repeated applica- periment 1 can be typeset ragged right without any tion of the theory developed in section 4 is required.

Udo Wermuth TUGboat, Volume 38 (2017), No. 1 81

A procedure. Compute with (12) all values for the So the lines L−ωM−ω, L−ω+1M−ω+1, ... , L0M0, in overfull lines. Use the smallest value and apply it to which the last line is overfull, are transformed into the paragraph. For the selected overfull line and the the lines L−ω, M−ωL−ω+1, ... , M−1L0. other overfull lines the following possibilities exist. Some of the new lines must stretch to benefit 1: Text is moved from the overfull line to the next from e; let the index sequence κ−µ, ... , κ0 represent line, no material comes from the previous line. the indices of lines that stretch. We have to calculate This scenario was analyzed in section 4. There an eκι for all of these lines — although except for one the problem is solved for the selected overfull they might not be overfull — to stretch them by the line. Two results are possible: expected amount. The maximum dimension of these i) The computed value e works and no other calculations is sufficient for \emergencystretch in- overfull line is created — success. The cases stead of the originally calculated e0 to make all tran- a), b′), and c) belong to this scenario. Other sitions happen. overfull lines might disappear too, this hap- Therefore two formulas are needed. One that ′ computes e from the transition L M M− L ; it pens in the cases d ) and e). 0 0 0 → 1 0 ii) The computed value e works for the selected can only give a useful result if M−1L0 stretches. The line, but a new overfull line is created. This is second formula computes the required amount of the case d); the procedure must be repeated. \emergencystretch that is needed to transform a non-overfull line into another: L M M − L . 2: Text is moved from the selected overfull line κι κι → κι 1 κι and new material is added to it. The computed The computation is valid only if Mκι−1Lκι stretches. value e, which would work for the original line, The first formula. Figure 9 shows how the cases is not relevant to the changed line. that were discussed in section 4 change when new i) The overfull line is gone and no other overfull material is added to the right side. Note the new line is created — success, but a smaller value material N might end in glue. It must be the empty of e might be successful too. No case of this string if L stands for the first line of a paragraph. So kind occurs in experiment 1. there is no problem with an \indent or \noindent. ii) The overfull line is gone, but a new overfull line is created. This is the case b). The pro- lmt Wmt(L) gmt Wmt(M) rmt l W(NL) r cedure must be repeated. h o → h The procedure terminates as either the number of overfull lines is decreased or the new overfull line l W (L) π W (M) r l W(NL) r occurs later in the paragraph. mt mt mt mt The remaining cases of experiment 1 are han- h o → h dled by this procedure. The only scenario that must be looked at further is 2i) as in other cases at most lmt Wmt(KM) rmt l W(NL-) r the procedure must be restarted. h o → h The main question is: Why is some new mate- rial moved to the overfull line? Of course, TEX can Figure 9: Resolve overfull line with new material use the value of \emergencystretch to stretch one or more previous lines with less text so that it finds The right hand sides must stretch and they line breaks which avoid the overfull line. must need \emergencystretch, i.e., each real bad- ness ̺ must be greater than τ to benefit from the The missing scenario. This scenario is described following theory. more formally in order to have a clear definition. As As only the right hand sides change, all equa- the way in which the lines are broken, i.e., whether tions for the left hand sides developed in section 4 at glue, at penalty, at an explicit hyphen, or at an are still valid. In the equations for the right hand inserted hyphen, is not important in the following sides the input L must be replaced by NL. The equa- discussion that part is ignored. Assume that the tion Wnw(NL) = Wnw(N) + L(N&L) + Wnw(L) shows line L0M0 is overfull and the method of section 4 that only two new terms occur in these equations; has computed e0. But when \emergencystretch is the equation is valid as L doesn’t begin with ignored set to that value the former overfull line doesn’t be- spaces as explained above. come L0 but M−1L0. Let ω be the first preceding Equation (6) changes to line that has not received− material from its previous + + + line; such a line must exist as the first line of the a = l + Sǫ (NL) + r + + + + (13) paragraph qualifies. = l + Sǫ (N) + Sǫ (L) + r .

The optimal value for \emergencystretch 82 TUGboat, Volume 38 (2017), No. 1

Equation (10) is no longer valid, now the computa- Summary. Two new summands are added com- tion is: pared to (10), and all the formulas can be combined h = l + W(NL) + r as in section 4 to get the equivalent of approxima- ◦ ◦ tion (12): = l + Wnw(NL) + r + u ◦ ◦ = l + Wnw(L) + r + Wnw(N) + L(N&L) + u. 3 100 − − − e Wnw(M) Sǫ (M) o l r The equations for the left hand sides stay the same ≈ r τ − − − −  − and with the techniques of section 4 the equivalent S (L) W (N) L(N&L) − ǫ − nw − of (8) is: ◦ − − − − − + Gǫ (Φ(L) , g) Gǫ (Φ(L) , g) Γ u = Wnw(M) Sǫ (M) o l Sǫ (L) r − − − − − − + L(L&M) L(NL&-) W(-) Θ Wnw(N) L(N&L) − − − ◦ − − + G (Φ(L) , g) G (Φ(L) , g) Γ. + L(L-&M)Ξ  ǫ − ǫ The first two cases are handled; the last one + + +  +  l Sǫ (N) Sǫ (L) r is not difficult but the argument must involve the − − − − (14) ′ strings K and K . One more figure might help: if ̺ > τ and if there is stretchability in the line, i.e., ′ ′ l+ + S+(N) + S+(L) + r+ > 0 pt. lmt Wmt(KM) rmt l W(NK ) L(NK &-) W(-) r ǫ ǫ h o → h The second formula. Now the situation changes = completely as — to speak in the terms that we have l W(NL-) r been using — the left hand side is not overfull. h Case 1: Break at glue. Let’s look at the situation Figure 10: Break at hyphen and add new material again in the form of a simple picture, Fig. 11, the companion of Fig. 3. NK The replacement of (9) must deal with and l W(L) g W(M) r l W(NL) r NK′. The relationship becomes h → h Wnw(NK) + L(NK&-) + W(-) Θ = ′ ′ Figure 11: Break at glue and add new text Wnw(NK ) + L(NK &-) + W(-) and for the right hand side the new formula is ◦ ◦ As before the text N might end in a glue item; the h = l + Wnw(NL-) + r + u glue g might be user-entered or T X-inserted. ◦ ′ ′ ◦ E = l + Wnw(NK ) + L(NK &-) + W(-) + r + u Much of the information from the above Fig. 3 ◦ ◦ = l + Wnw(NK) + L(NK&-) + W(-) Θ + r + u is lost. But on both sides the badness values are now ◦ finite, and as observed in the previous subsection for = l + Wnw(N) + L(N&K) + Wnw(K)  ◦ the first formula, the right hand side must stretch; + L(NK&-) + W(-) Θ + r + u further, it must stretch so much that the additional so ◦ ◦  stretchability of \emergencystretch is required. In l + W (K) + r = h L(NK&-) W(-) Θ u nw − − − other words: The real badness ̺ of the right hand W (N) L(N&K) . side must be larger than \tolerance. The glue of − nw −  The equation for the left hand side remains valid the left side has no restriction, i.e., it can shrink, and its first three summands are replaced by the stretch or use its natural width. To distinguish the right hand side of the previous equation: common variable names for the right and the left sides the subscripts ρ and λ are used for a and u. h + o = h L(NK&-) + W(-) Θ u − −− − − The right hand sides have been analyzed for Wnw(N) L(N&K) l S (K) r  ǫ the first formula and the value aρ is given by (13); − − − −− − + L(K&M) + Wnw(M) Sǫ (M). as before, both sides give an equation for h: − ◦ ◦ The final rearrangement involves the replacement of h = l + Wnw(N) + L(N&L) + Wnw(L) + r + uρ. K by L as was done before. ◦ ◦ ◦ L L g M − − − − = l + Wnw( ) + Gǫ (Φ( ) , ) + Wnw( ) + r u = Wnw(M) Sǫ (M) o l Sǫ (L) r − − − − − + δuλ. W (N) L(N&L) − nw − The factor δ 1, +1 represents the fact that + L(L&M) L(NL&-) W(-) Θ ∈ {− } − − the value uλ has to be added if the line on the left + L (L-&M)Ξ.  stretches otherwise it must be subtracted.

Udo Wermuth TUGboat, Volume 38 (2017), No. 1 83

The equations can be rearranged to find the Summary. The previous equation can be applied equation for u : to ( ). The result isn’t shown here as all cases can ρ ∗∗ uρ = Wnw(M) Wnw(N) L(N&L) + δuλ be combined directly as before into one equation. ◦ − − The approximation of e for the second formula is + Gǫ (Φ(L) , g). 3 The finite badness values allow to write the fol- e 100/τ W (M) W (N) L(N&L) + δu ≈ nw − nw − λ lowing approximations (compare to (5)):  ◦ p + Gǫ (Φ(L) , g)Γ u 3 ρ ρ 100 ρ or u 3 (a + e). ≈ a + e ρ ≈ 100 ρ + L(L&M) L(NL&-) W(-) Θ  ρ  r − − As above ρ = τ to get the minimal e: + L(L-&M)Ξ  e 3 100/τ u a . ( ) ≈ ρ − ρ ∗∗ l+ S+(N) S+(L) r+ − − ǫ − ǫ − Therefore p (15) + + + + 3 100 if ̺ > τ and l Sǫ (N) Sǫ (L) r > 0 pt. e Wnw(M) Wnw(N) L(N&L) + δuλ − − − − ≈ r τ − −  ◦ 10 A second experiment + Gǫ (Φ(L) , g) The theory is completely developed. The following l+ S+(N) S+(L) r+ − − ǫ − ǫ − experiment contains aspects not seen before, for ex- if stretchability is present in the line. ample, an overfull line in math mode and a break at The term δu could be analyzed further, but λ an explicit hyphen, and it shows a complete cycle to that leads to a lot of subcases. I think it is best to get rid off all overfull lines in a paragraph according keep it in the formula. to the theory of section 9. Case 2: Break at penalty. This case is handled Experiment 8: Description exactly like the previous one. If Γ is introduced, as Combine both paragraphs of experiment 1 and add a in section 4, then the combined equation becomes sentence with mathematics. Reduce \hsize by 2 pt. 3 100 T X definitions e Wnw(M) Wnw(N) L(N&L) + δuλ E ≈ r τ − − \hsize=98pt  ◦ + G (Φ(L) , g)Γ ǫ TEX output + + +  + l Sǫ (N) Sǫ (L) r . Once upon a time, in − − − − a distant galaxy called Case 3: Break at hyphen. Again the formula for O¨o¸c,¨ there lived a com- a is given by (13). ρ puter named R. J. Drof- e 9.1 pt by (12) ′ ′ 1 l W(KM) r l W(NK ) L(NK &-) W(-) r nats. Mr. Drofnats— ≈ h → h or “R. J.,” as he pre- ferred to be called—was e 1.8 pt by (12) = 2 ≈ l W(NL-) r happiest when he was at work typesetting beau- e 4.1 pt by (12) 3 ≈ h tiful documents. In one e4 4.1 pt by (12) iπ ≈ Figure 12: Break at hyphen and add new text text he proved e +1 = e5 0.6 pt by (12) 0. ≈ The right hand side was analyzed above for the As in experiment 1 there are five overfull lines. first formula and the left hand side gives the equa- To remove them the procedure of section 9 that is tion: based on the results of section 4 can be used. As ◦ ◦ h = l + Wnw(K) + L(K&M) + Wnw(M) + r + δuλ. described, e5, the smallest of the five values, can Therefore be applied first, which of course resolves the last ′ u = W (M) W (N) + L(K&M) L(N&K ) overfull line and only this line. Then the application ρ nw − nw − of the next smallest value, e2, resolves the second L(NK&-) + W(-) Θ + δu − λ and fourth overfull lines and transfers the third one and with the replacement of K by L as it was done  into a new overfull line. And so on. for the first formula it becomes But with the formulas of the previous section u = W (M) W (N) L(N&L) ρ nw − nw − the maximum value can be used directly and if it is L(NL&-) L(L&M) + W(-) Θ − − too large the value can be corrected; so the largest + L (L-&M) Ξ + δuλ.  value e1 is assigned to \emergencystretch.

The optimal value for \emergencystretch 84 TUGboat, Volume 38 (2017), No. 1

Experiment 8 continued: TEX definitions Experiment 8 continued: TEX definitions \emergencystretch=9.1pt \emergencystretch=22.5pt TEX output TEX output Once upon a time, Once upon a time, e 8.2 pt by (15) 9 ≈ in a distant galaxy in a distant galaxy e10 7.7 pt by (15) ¨ ≈ called O¨o¸c, there lived called O¨o¸c,¨ there e11 15.4 pt by (15) a computer named R. J. e 9.6 pt by (12) lived a computer e ≈ 16.2 pt by (15) 6 ≈ 12 Drofnats. Mr. Drofnats— e 0.0 pt by (12) named R. J. Drofnats. e ≈ 0.0 pt by (14) 7 ≈ − 13 or “R. J.,” as he pre- Mr. Drofnats—or “R. ≈ − ferred to be called— J.,” as he preferred to was happiest when he be called—was hap- was at work typeset- piest when he was ting beautiful docu- at work typesetting ments. In one text he beautiful documents. proved eiπ + 1 = 0. In one text he proved iπ The value of e1 was too small to solve all prob- e + 1 = 0. lems; new overfull lines were created. This is the scenario 2i) of the procedure in sec- Note the value of e is given as 0.0 pt — an tion 9. The check with the four preceding lines of the 7 − impossible result. The reason lies in the content of previously overfull line shows that the value 16.2 pt the line. The space after “Mr.” in line 5 is entered as is sufficient to resolve this problem as the input a tie (see the TEX input of experiment 1) so the line “named ” is moved to that line. The output for the cannot be broken there. And “Drofnats---” can- \emergencystretch set to 16.2 pt isn’t shown as it not be hyphenated as it contains, in TEX’s view, an is identical to the version with 22.5 pt. explicit hyphen. Therefore the line break must occur Note the value e13 cannot be computed as the after the end-of-sentence period. With the theory of former overfull line is transformed into a line of bad- section 4 this results in a line that would contain ness 0. Formula (14) needs a line that stretches and only “Drofnats.”, i.e., the line has no stretchabil- has a real badness larger than \tolerance. ity. Therefore approximation (12) cannot compute a valid value for the \emergencystretch — expressed 11 Another application by the impossible value 0.0 pt. In [14, example 5], \emergencystretch — together But as the other line− reports a valid dimension with \looseness to have a trigger for a third line- e , this can be used in the next run to remove at 6 breaking pass — was used to remove a stack of hy- least this overfull line. phens. The first three lines of a paragraph end with Experiment 8 continued: TEX definitions an inserted hyphen. In the example the value of \emergencystretch=9.6pt \emergencystretch was set to the width of the TEX output string “Ar”, i.e., to 11.41669 pt to remove the stack. Once upon a time, The text is taken from [9]. in a distant galaxy Experiment 9: Description called O¨o¸c,¨ there lived Remove a stack of hyphens via \emergencystretch; first a computer named show the original line breaking and then give the addi- R. J. Drofnats. Mr. Drofnats— e8 22.5 pt by (12) tional stretchability the amount 11.4 pt. Force TEX to or “R. J.,” as he pre- ≈ use a third pass with the setting \looseness = 1. ferred to be called— TEX output was happiest when he So instead, I worked only at Stanford, at the Ar- was at work typeset- tificial Intelligence Laboratory with the very primi- ting beautiful docu- tive equipment there. We did have television cam- ments. In one text he eras, and my publisher, Addison-Wesley, was very proved eiπ + 1 = 0. helpful — they sent me the original press-printed There is still one overfull line. The value 9.6 pt proofs of my book, from which The Art of Com- was too small but line 5 now gives a usable value puter Programming had been made. The process in as two spaces occur in the line after a break at the the 60s ... end-of-sentence period. The value e8 removes the So instead, I worked only at Stanford, at the overfull line. Artificial Intelligence Laboratory with the very

Udo Wermuth TUGboat, Volume 38 (2017), No. 1 85 primitive equipment there. We did have television One question has not been addressed yet: Why cameras, and my publisher, Addison-Wesley, was is a minimal value useful? As explained in [14], and very helpful — they sent me the original press- observed in experiment 1, TEX uses the badness printed proofs of my book, from which The Art value computed from the available stretchability for of Computer Programming had been made. The its line-breaking decision and the stretchability that process in the 60s ... comes from \emergencystretch. High values for No overfull lines are output, but the second for- the latter assign to every stretchable line a low bad- mula of section 9 calculates e for a transition that ness value, and thus TEX starts to prefer stretched doesn’t involve overfull lines. Here are the values for lines in the paragraph during the line-breaking pro- the first three lines of the second paragraph of the cedure, resulting in an excess of spaced-out lines. above output: Everyone who wants to use a nonzero value for \emergencystretch should be aware that an ac- 1st line: e 0.0 pt by (15) 1 ≈ − ceptable value depends on the available glue in a 2nd line: e 6.9 pt by (15) 2 ≈ line — or in other words: the number of spaces in the 3rd line: e 0.0 pt by (15) 3 ≈ − line. A high average number of spaces in a text can So let’s try what happens when the value of the tolerate higher values of \emergencystretch. And dimen \emergencystretch is set only to 6.9 pt. a line break with an inserted hyphen is an advan- Surprise — nothing happens! The output looks tage. Although the following advice is not obeyed in identical to the first paragraph. Well, maybe it is all of the experiments in this article I recommend not that much of a surprise as one of the principles to apply a positive \emergencystretch only to a on which the derived formula (15) is based is vio- single paragraph at a time. lated: TEX does not have to avoid an overfull line, A rule of thumb. The accuracy with which e was and therefore it uses the line breaks that result in computed in this article is not required, though. the minimal sum of the line demerits. The total for This allows us to create a rule of thumb to make the text without the three hyphens is nearly 36,000 the theory useful in everyday applications. A close demerits higher than for the shown paragraph with look at (12) shows that many of the summands are 11.4 pt additional stretchability. Note that the ≈ zero or small if the plain TEX defaults and cmr10 second line, which determines the value of e, gets is used. Only four values are needed: a badness of 200 by (15), the default \tolerance. 1. the amount that the line is too wide: o pt, Either the penalty for hyphenation must be in- 2. the number of characters in M which are moved creased, for example, to 200 to compensate for the to the next line, value of \tolerance, or \emergencystretch must 3. the number of spaces in L, i.e., in the rest of the be increased because then the lines that stretch get line, lower badness values, as observed in experiment 1. 4. the type of break: glue, penalty, explicit or in- The correct amounts are not easy to determine. For serted hyphen. example, setting \hyphenpenalty to 128 solves the problem, or setting \emergencystretch to the min- The rule of thumb is not very simple, maybe it imal 10.9 pt to create the output as shown above, or is too complicated to be easily remembered: to 9.8 pt to get a solution that removes the three 4e (15 chars in M 11 spaces in L ≈ × − × hyphens but creates a new one. 3 o + 8 (RoT) − × 18 if a hyphen is inserted) pt. − 12 Final remarks Of course, if the number of spaces in L is zero, the In this article theoretical results show how to com- computed value for e makes no sense as the input L pute the optimal value for \emergencystretch in has no stretchability. For example, in experiment 1 the message the case when TEX produces an overfull line. Ap- proximation (12) is always successful as long as the Overfull \hbox (5.88911pt too wide) in paragraph line contains stretchability and (14) and (15) extend \tenrm in a dis-tant galaxy called| the result but need an additional condition: the bad- is shown and therefore o 5.89, 6 characters are ness of the new line must be larger than the given moved and three spaces remain≈ when “called” is \tolerance. (This condition is automatically ful- moved at a break at glue. Now use (RoT) to com- filled when (12) can be used.) The analysis provides pute 4e (90 33 17.67 + 8) pt = 47.33 pt and ≈ − − some insight into the factors that influence the value therefore e 11.8 pt. for the additional stretchability. The other≈ cases are treated in the same way.

The optimal value for \emergencystretch 86 TUGboat, Volume 38 (2017), No. 1

The results compared to the measured values of [4] Donald E. Knuth, TEX: The Program, Volume B experiment 1 are: of Computers & Typesetting, Boston, a) parameters; b) used \emergencystretch Massachusetts: Addison-Wesley, 1986 1a): \hsize=100 pt [5] Donald E. Knuth, The METAFONTbook, b): 9.3pt 9.3pt/11.2pt 1.5pt 0.2pt/1.5pt 1.5pt Volume C of Computers & Typesetting, Boston, RoT a): calculated values with the rule of thumb Massachusetts: Addison-Wesley, 1986 b): 11.8pt 10.8pt/13.7pt 4.9pt 1.4pt/4.4pt 6.2pt [6] Donald E. Knuth, Computer Modern Typefaces, All computed values are large enough to remove Volume E of Computers & Typesetting, Boston, the overfull line. Nevertheless there can be cases, for Massachusetts: Addison-Wesley, 1986 example, M is “WWW”, when the factor 15 might be [7] Donald E. Knuth, “The TFtoPL processor,” too small — although it looks as if the RoT computes in TEXware, Stanford Computer Science Report values that are often too large. The simplification STAN-CS-86-1097, Stanford, California: Stanford compared to (12), (14), and (15) comes with a price. University, 1986 (The first TFtoPL program was Aesthetics. The results given in this article are designed by Leo Guibas in the summer of 1978) rather technical, and do not consider any aesthetic ctan.org/pkg/texware aspects. Of course, aesthetics cannot be measured [8] Donald E. Knuth, “The New Versions of TEX and objectively, as different individuals will prefer differ- METAFONT,” TUGboat 10:3 (1989), 325–328; META ent aspects: hyphenation or not, justified or ragged- “Erratum: The New Versions of TEX and - FONT right text, etc. TUGboat Vol. 10, No. 3,” TUGboat 11:1 This paper is already too long to discuss this, (1990), 12; reprinted as Chapter 29 in [10], 563–570 tug.org/TUGboat/tb10-3/tb25knut.pdf but one more TEX parameter might be briefly men- tioned: \hfuzz. This has nothing to do with line- tug.org/TUGboat/tb11-1/tb27erratum.pdf breaking decisions, it is used to suppress the warn- [9] Donald E. Knuth, “CSTUG, Charles University, ing message for overfull lines, nothing more. As long Prague, March 1996: Questions and Answers with as an overfull line juts less than \hfuzz into the Prof. Donald E. Knuth,” TUGboat 17:4 (1996), 355–367; reprinted as Chapter 32 in [10], 601–624 margin, TEX does not output a warning message. The plain format sets \hfuzz to 0.1 pt. Note that tug.org/TUGboat/tb17-4/tb53knuc.pdf in section 10 the line preceding the overfull line, for [10] Donald E. Knuth, Digital Typography, Stanford, California: Center for the Study of Language and which e1 is calculated, is overfull by 0.02792 pt. It Information, CSLI Lecture Notes No. 78, 1999 is not mentioned by TEX as the value is less than 0.1 pt. Sometimes higher values, for example, 1 pt, [11] Jerry Leichter, “Re: Strange kern in cmr10,” are suggested. But an overfull line that is 1 pt too TEXhax Digest 89:70 (1989), 25 July 1989 wide is often easily detected by the eye. ctan.org/tex-archive/info/digests/texhax/89/ An author may change his text to improve aes- texhax.70.gz thetics but of course typesetting problems will al- [12] Frank Mittelbach, Chris Rowley, Michael Downes, ways be present. Whatever the author or typesetter “Volunteer work for the LATEX3 project,” TUGboat prefers or dislikes in a specific situation a manual in- 13:4 (1992), 510–513 tervention is sometimes necessary. Never forget: The tug.org/TUGboat/tb13-4/tb37mitt-l3.pdf visual output counts; it must always be checked, es- ctan.org/tex-archive/info/ltx3pub/vol-task. pecially when \emergencystretch is used. tex [13] Philip Taylor, “A Pragmatic Approach References to Paragraphs,” TUGboat 14:2 (1993), 138–140 tug.org/TUGboat/tb14-2/tb39taylor-para.pdf [1] Malcolm Clark, A plain TEX primer, Oxford University Press, 1992 [14] Udo Wermuth, “Tracing paragraphs,” TUGboat [2] Bogus law Jackowski, Piotr Strzelczyk and Piotr 37:3 (2016), 358–373 Pianowski, “GUST e-foundry font projects,” tug.org/TUGboat/tb37-3/tb117wermuth.pdf TUGboat 37:3 (2016), 317–336 ⋄ tug.org/TUGboat/tb37-3/tb117jackowski.pdf Udo Wermuth Babenh¨auser Straße 6 [3] Donald E. Knuth, The TEXbook, Volume A of 63128 Dietzenbach Computers & Typesetting, Boston, Massachusetts: Germany Addison-Wesley, 1984 u dot wermuth (at) icloud dot com The text of experiment 1 can be found in ctan.org/tex-archive/systems/knuth/dist/lib/ story.tex

Udo Wermuth TUGboat, Volume 38 (2017), No. 1 87

graphics The Treasure Chest awesomebox in graphics Add admonition blocks using FontAwesome icons. callouts in graphics/pgf/contrib Simple annotations and notes inside a TikZ picture. This is a selection of the new packages posted to karnaughmap in graphics/pgf/contrib CTAN (ctan.org) from November 2016–March 2017, Karnaugh maps in TikZ, with up to six variables with descriptions based on the announcements and and implicants. edited for extreme brevity. pst-shell in graphics/pstricks/contrib Entries are listed alphabetically within CTAN Seashells in 3D using PSTricks. directories. More information about any package scsnowman in graphics/pgf/contrib k can be found at ctan.org/pkg/pkgname. A few Snowman variants in Ti Z. stanli graphics/pgf/contrib entries which the editors subjectively believe to be in Structural analysis library for TikZ. of especially wide interest or otherwise notable are tikz-kalendar in graphics/pgf/contrib starred; of course, this is not intended to slight the Typeset calendars with TikZ. other contributions. tikzpeople in graphics/pgf/contrib We hope this column and its companions will People-shaped nodes, such as ‘chef’, for TikZ. help to make CTAN a more accessible resource to the ctan.org/topic TEX community. See also . Com- info ments are welcome, as always. * docsurvey in info Survey of LATEX documentation. [See article in ⋄ Karl Berry this issue of TUGboat.] tugboat (at) tug dot org forest-quickstart in info Introduction to forest, for linguistic trees. mendex-doc in info fonts Mendex index processor manual. arimo in fonts platexcheat in info A Arimo fonts (Arial-compatible), with LTEX support. Japanese translation of Winston Chang’s LATEX arphic-ttf in fonts cheat sheet, with additions. Chinese Arphic fonts in TrueType format. * undergradmath in info * baskervillef in fonts Cheat sheet for writing math in LATEX. Design similar to Fry’s Baskerville, with math support. [See article in this issue of TUGboat.] language/japanese gandhi in fonts A jlreq language/japanese Gandhi fonts, with LTEX support. in * gofonts in fonts Document class supporting Japanese text layout Go fonts designed by Bigelow&Holmes for the requirements. Go language project. [See item in this issue’s editorial.] macros/latex missaali in fonts A See also LTEX news items in this issue of TUGboat, Late medieval OpenType textura font. or latex-project.org/news. montserrat in fonts Montserrat fonts, with LAT X support. latexrelease,... in macros/latex/base E TU A paduak in fonts Use new encoding by default in X LE TEX and A OT1 TrueType font supporting the Myanmar script. LuaLTEX, instead of , among other changes ptex-fontmaps in fonts and fixes. CJK l3kernel,... in macros/latex/contrib Font maps and configuration for fonts and A (u)ptex, superseding jfontmaps. LTEX3 packages now support (u)pTEX, among tinos in fonts much other work. Tinos fonts (compatible with ), with LATEX support. macros/latex/contrib txuprcal in fonts apxproof in macros/latex/contrib Upright calligraphic based on txfonts. Defer proofs to an appendix. variablelm in fonts conv-xkv in macros/latex/contrib Font definitions for variable Latin Modern fonts. Support alternative key/value syntaxes. css-colors in macros/latex/contrib Define the 143 named web-safe colors.

macros/latex/contrib/css-colors 88 TUGboat, Volume 38 (2017), No. 1

delimset in macros/latex/contrib Declare sets of delimiters with adjustable sizes. macros/latex/contrib/biblatex-contrib dtxdescribe in macros/latex/contrib biblatex-archaeology in m/l/c/biblatex-contrib Additional object types in dtx files. Support for German humanities, especially the eqnalign in macros/latex/contrib German Archaeological Institute. Make the eqnarray environment behave like biblatex-arthistory-bonn in m/l/c/biblatex-contrib align. Support for art historians. fgruler in macros/latex/contrib Rulers on the page foreground or within text. fnspe in macros/latex/contrib macros//latex Math notation macros and shortcuts, developed luahyphenrules in macros/luatex/latex for FNSPE CTU in Prague. Loading patterns in lualatex independent of footmisx in macros/latex/contrib babel. footmisc with support for hyperref. novel in macros/luatex/latex grayhints in macros/latex/contrib Class for authors of original fiction, particularly Initial text in PDF form fields, via JavaScript. for print-on-demand. gtrlib-largetrees in macros/latex/contrib Library for genealogytree, aimed at large trees. macros//latex halloweenmath in macros/latex/contrib simple-resume-cv macros/xetex/latex Math symbols based on traditional Halloween in CV A iconography (pumpkins, witches, etc.). Simple resume/ template for X LE TEX. simple-thesis-dissertation in macros/xetex/latex iscram in macros/latex/contrib A Class for ISCRAM articles (International Conference Simple thesis/dissertation template for X LE TEX. unicode-bidi macros/xetex/latex on Information Systems for Crisis Response and in RTL RTL Management). Mixing and non- without markup. keyfloat in macros/latex/contrib Key/value interface for generating (sub)floats. support [See article in this issue.] fribidixetex in support lion-msc in macros/latex/contrib X TE EX preprocessor for supporting the Unicode Class for theses at the Leiden Instition of Physics. bidirectional algorithm. * lwarp in macros/latex/contrib gladtex in support A Convert LT X to HTML5. A E Python program to enable use of LTEX math in [See article in this issue.] HTML. mpostinl in macros/latex/contrib tlaunch in support Embed MetaPost figures in a LAT X 2ε document. E Windows GUI to run networked TEX Live. mucproc in macros/latex/contrib Class for “Mensch und Computer” conference contributions. numspell in macros/latex/contrib Spelling cardinal and ordinal numbers in several languages. oplotsymbl in macros/latex/contrib Unusual symbols used in scientific plots, etc. pxtatescale in macros/latex/contrib Graphics driver support for pTEX vertical direction scaling. pythonhighlight in macros/latex/contrib Highlighting Python code, based on listings. soup in macros/latex/contrib Generate alphabet soup (word search) puzzles. studenthandouts in macros/latex/contrib Manage and style student handout projects. wtref in macros/latex/contrib Namespaces and scopes for LATEX cross references. yaletter in macros/latex/contrib Flexible macros for letters, envelopes, label sheets.

m/l/c/biblatex-contrib/biblatex-archaeology TUGboat, Volume 38 (2017), No. 1 89

Book review: More Math Into LATEX, covers hyperlinks, and also includes a chapter on pre- 5th edition by George Gr¨atzer sentations and a chapter introducing TikZ. Part V on Customization covers writing your own commands, in- Jim Hefferon cluding list environments. Finally, in Part VI, Professor Gr¨atzer discusses things most relevant to Long Docu- George Gr¨atzer, More Math Into LATEX, 5th edition. ments, such as BibTEX and MakeIndex, as well as tables Springer. 609 pp. Paperback, US$67.99. ISBN 978- of contents, etc. 3319237954. The appendices include symbol tables for mathe- matics as well as for text, which I found useful almost im- mediately. I noted that contact information for the TEX Users Group is also included, with a suggestion that the reader may want to join. That’s great to see, of course. The longest Part of the book, nearly two hundred pages, and the one that will be the most often-thumbed is the second one, Text and Math. This Part also typifies the feel of the entire book. It is filled with information. The chapter names will give you a sense of the extensive coverage: Typing text, Text environments, Typing math, More math, and Multiline math displays. Just as one instance, there is a table with all of the font family switching commands. I can never remember the darn things and so right away onto that page went a sticky note, to ease finding it next time, in the heat of writing. This Part is also filled with examples. I find that Although More Math Into LATEX by George Gr¨atzer is in working with students learning LATEX, they start from a classic, I happen not to have studied it. So with the examples. The ones given in More Math Into LATEX are appearance of the fifth edition, I grabbed the chance. I ones that come up in practice, which gets these students was not disappointed. started, and also conveys to them that LATEX is something The audience for this book is professionals such as they will find useful. That’s very well done. working mathematicians or graduate students. The pre- Professor Gr¨atzer also gives advice, tips. There are sentation is organized, thorough, and clear. The coverage documents in the LATEX world where in my opinion the is wide: certainly not everything about LATEX is in here author moves past suggestions and into intrusiveness. but it does cover, or at least provide a pointer to, the Not so here. While I didn’t find that every tip I read great majority of what an author would want to know accords with my own sense of best practice, I did find to prepare a journal article, a book, or a presentation. that they are all reasonable. A technical book must balance being an introduction One thing about this Part, and about the book as against being a reference. Professor Gr¨atzer finesses the a whole, is its good sense of where users have problems. question by having a first chapter called Short course. Anyone who has spent time in online TEX forums knows This gets a beginner up and running. The rest of the that there are themes to the questions that people ask. book is suitable for dipping into when you have a specific More Math Into LATEX does a fine job heading off these problem, although you absolutely can read it as well. questions, before they become a frustration. This seems to me to be an excellent approach. Cer- There are many major LATEX packages that the book tainly if a graduate student preparing to write a thesis does not cover. Just as one example, I’ll cite SIunits were asked to first master a six hundred page technical (http://ctan.org/pkg/siunits) as something that a work, that would be discouraging. But here the short person may well find useful in preparing professional course is forty pages, eminently reasonable. The student technical documents and that I don’t find here. But no could, in an afternoon, read the introduction, become fa- book can cover everything, and Professor Gr¨atzer is wise miliar with the rest, and produce a first document or two. not to try. The subject is just too extensive, and so this It is an approach that expects that the reader is busy is not a deficiency. working on something else and I suspect most readers This is an excellent choice, for an individual or for will be grateful for it. an institutional library. It spans a great deal of the More Math Into LATEX has six Parts, and seven subject of LATEX and does so without losing the reader. appendices. First is the short course mentioned above. And, with this latest edition, it is up to date with recent Then comes the heart of the book, Text and Math. I’ll developments. This classic continues on. talk more about this below. Part III, Document Struc- ture, discusses such things as front and back matter, and ⋄ Jim Hefferon also the amsart class. Then Part IV on PDF Documents jhefferon (at) smcvt dot edu

Book review: More Math Into LATEX, 5th edition by George Gr¨atzer 90 TUGboat, Volume 38 (2017), No. 1

Book review: The Noblest Roman: rapher: his fame among book artists became, as A History of the Centaur Types of Bruce another great typographer and Rogers’ rival, Stan- Rogers by Jerry Kelly and Misha Beletsky ley Morison called it, “a BR cult”. The quotation below by Joseph Blumenthal, beautifully typeset by Boris Veytsman Jerry Kelly for the Book Club of California edition Jerry Kelly and Misha Beletsky, The Noblest Roman: of The Noblest Roman, well describes the opinion of A History of the Centaur Types of Bruce Rogers. professionals about Centaur: David R. Godine, Publisher, Boston. 2016. 128 pp. Hardcover, US$45.00. ISBN 978-1-56792-582-1.

Kelly and Beletsky quote similar praise for the font by such masters as D. B. Updike and Robert Bringhurst. The history of fonts and font design is an im- Interestingly enough, this acclaim among artists, portant part of our heritage. The TEX community, as often happens, did not translate into commercial in a tradition started by Knuth, appreciates the fine success. As the authors note, during the entire pro- aspects of typography, and has always been keenly duction run of Monotype Centaur from 1929 to 1980 interested in fonts. only 754 sets of matrices were sold — fifty times less The Centaur font by Bruce Rogers is a classical than Times New Roman and ten times less than font created at the beginning of the last century Monotype Garamond. The font is not well known by based on the immortal designs by Nicolas Jenson the general public. Maybe this is why we do not have in the 15th century. The first full version of this free Centaur digital fonts for use with TEX; certainly font was cast in 1915. The book by Jerry Kelly and such fonts would be a great contribution to the TEX Misha Beletsky is a tribute to the centennial of this typographic arsenal. typographic treasure. The authors note that the high regard for Cen- There are poets’ poets and painters’ painters: taur among typographers created many legends about the writers and artists who foremost influenced their its history. The incomplete and often unreliable colleagues and inspired their creativity. Bruce Rogers recollections by Bruce Rogers himself, amplified by probably deserves the title of typographers’ typog- other narrators, lead to a situation where “little can

Boris Veytsman TUGboat, Volume 38 (2017), No. 1 91

be taken at face value”. Kelly and Beletsky took small illustrations and captions for larger illustrations great pains to check details using archives, letters in text: and other little explored sources. They performed a great service in elucidating the true story of Centaur. The book explores the relations between Rogers and his employees and contemporaries, the evolution of the design, and many interesting details, such as the attempt to create a version of the font for the Justowriter typesetting typewriter (1948). While the book text is very interesting, its il- lustrations are truly superb. The Noblest Roman reproduces many pages of books typeset with Cen- taur. Below is the page from a book designed by Hermann Zapf:

To tell the truth, I am not sure why other notes, such as bibliographic references, are relegated to the back of the book rather than being typeset in the margins as well. The book is typeset in Centaur (of course!) using three recent digital revivals of the font: the body text in the font by Jerry Kelly, the captions in the version by Toshi Omagari (used for the first time in this book), and displays in Monotype Centaur. The body text is justified with ragged right marginalia. The publisher, David R. Godine, is well known for his books of highest quality, also often mentioned Besides comprehensive type samples, The No- in these TUGboat review pages. blest Roman includes a list of books typeset with the I thoroughly enjoyed this book and heartily rec- original Centaur as well as detailed notes, a bibliog- ommend it to typophiles in the TEX community. raphy and a carefully compiled index. ⋄ Boris Veytsman The book is beautifully typeset by Jerry Kelly, Computational Materials Science whose work has been reviewed several times before Center, MS 6A2 in these pages. It is a masterpiece of the typographic George Mason University art. The book is printed in two colors, with black Fairfax, VA 22030 USA and red marginal notes. The marginalia contain borisv (at) lk dot net succinct biographies of typographers of this time, http://borisv.lk.net

Book review: The Noblest Roman: A History of the Centaur Types . . . by Jerry Kelly and Misha Beletsky 92 TUGboat, Volume 38 (2017), No. 1

Book review: Track Changes by tems (e.g., and WriteRoom) in spite of the Matthew G. Kirschenbaum “hegemony” of Microsoft Word. While there is a soci- ological slant to the book, anyone who (a) has lived David Walden through the era of the development of interactive Matthew G. Kirschenbaum, Track Changes: editors and word processors or (b) who is a reader A Literary History of Word Processing. of fiction (particularly genre fiction), will find in the The Belknap Press of Harvard University book many authors, books, and systems to remember Press, 2016, xvi+344 pp. Hardcover, US$29.95. and a plethora of previously unknown information. ISBN 978-0674417076. The book’s style falls somewhere between cre- ative non-fiction and an academic monograph. It is not based on a few characters used to drive a narra- tive ahead (like most books by, e.g., Tracy Kidder and Michael Lewis); rather, it’s a collection of stories about hundreds of individual authors. Although it has 80 pages of notes and the chapter titles appear to be working on moving along an academic thesis, the book is easy and fun to read. Knuth and TEX are mentioned once in the book, on page 30 where author Neal Stephenson is de- scribed as transcribing his Baroque Cycle, originally drafted longhand, into TEX using Emacs; then, when the publisher wanted to typeset the book in the QuarkXPress, Stephenson wrote a conversion pro- gram in Lisp.2,3 Perhaps the longest of the hundreds of authors mentioned in the book is the story of author Len Deighton’s adoption of early word pro- cessing technology (i.e., IBM’s MT/ST system). The book also has a nice index of systems and author names, which lets one see if one’s favorite author is mentioned in the book or to look up history on an early word processing system such as WordStar. Track Changes is a pretty useful reference book as well as being fun reading. I am glad to have a copy. In the Acknowledgments section of Matthew Kirsch- To get a better feel for Track Changes, you can enbaum’s Track Changes, he notes that in December “Look Inside” on the book’s Amazon page. Also take 4 2011 he gave a lecture on his research at the New a look at the author’s website to see other essays and York Public Library, and a New York Times reporter videos as he continues his work at the intersection wrote about his interest in the history of word pro- of the literary and the digital worlds. I am finding it cessing.1 The resulting “burst of publicity [flooded all quite fascinating. At minimum, I can recommend his inbox] with tips, anecdotes, contacts, and sugges- borrowing Track Changes from your library. tions”. Much of this helped the author develop his Notes book; and, although the book is now published, the 1 author says that “this is still very much an active Jennifer Schuessler, “The Muses of Insert, Delete and Execute”, 2011-12-26, tinyurl.com/times-schuessler project, and I’d be grateful to hear from any readers 2Somewhat irrelevant aside: If you have not read Stephen- who have additional information”. son’s In the Beginning was the Command Line, I highly The author is a professor in the English De- recommend it still, even though it is now quite dated: http: //cryptonomicon.com/beginning.html partment of the University of Maryland who “is a 3 I am wondering about other fiction authors who may have devoted scholar of all things digital and literary”. In used TEX et al. to do their composing. If you know of any, you this book he studies the steps and impact on their might communicate what you know to author Kirschenbaum writing of authors moving from pens or typewriters (see the last sentence of the first paragraph). 4https://mkirschenbaum.wordpress.com/ to word processors, from the earliest word processing kludges of equipment before word processing was ⋄ David Walden really available as a product and continuing through walden-family.com/texland writers who cling to “boutique” word processing sys-

David Walden TUGboat, Volume 38 (2017), No. 1 93

Book review: Manuale Calligraphicum. Examples of Calligraphy by Students of Hermann Zapf, David Pankow, ed. Boris Veytsman Manuale Calligraphicum. Examples of Calligraphy by Students of Hermann Zapf, David Pankow, ed. RIT Cary Graphic Arts Collection; Rochester, 2016, 60pp, ill. Hardcover, paper over boards with vellum spine. US$195.00.

Figure 1: Kris Holmes’s contribution

Figure 2: Steven Skaggs’s contribution

For ten years, from 1979 to 1988, Hermann Zapf Graphic Arts Collection curator Steven Galbright, taught summer master classes on calligraphy at the and artists’ biographical sketches. It was designed by Rochester Institute of Technology. This book is a renowned typographer Jerry Kelly. The spartan title tribute to him by his former students. It contains page and Kelly’s Rilke typeface of the text contribute nineteen specimens—or, rather, nineteen pieces of to the general impression of a tasteful book. It is calligraphy art by Larry and Marsha Brady, Annie Ci- printed on a letter press by Bradley Hutchinson on cale, Rick Cusick, Claude Dieterich A., Reggie Ezell, Hahnem¨uhle paper with vellum spine in 325 copies. Peter Fraterdeus, Kris Holmes, Jerry Kelly, Peter The book was designed as a luxury item, thus Noth, Marcy Robinson, Ina Saltz, Steven Skaggs, its rather steep price. Still, since the Web version John Stevens and Julian Waters. A TEX user prob- of this review is going to appear before 2016 holiday ably knows some of these names from DEK’s 3:16 season, it might give you a gift idea for a calligraphy Bible Texts Illuminated, and, of course, from the lover dear to you. Lucida fonts by Bigelow and Holmes. However, I On the other hand, I wonder whether RIT Cary would argue that calligraphy by itself is important Graphic Arts Collection might consider a trade edi- for anybody interested in the philosophy behind TEX tion of this book: it might benefit many students of and METAFONT. One of the origins of our letters is calligraphy and fonts. the art of scribes, who for centuries developed the ⋄ technique of combining legibility and beauty using Boris Veytsman pen and ink (another being the stone cutters making Systems Biology School and Computational Materials the monumental inscriptions). A careful study of cal- Science Center, MS 6A2 ligraphy helps open the world of good typesetting — George Mason University and is enjoyable in itself. Fairfax, VA 22030 Besides the illustrations the book has an intro- borisv (at) lk dot net duction by David Pankow, a foreword by RIT Cary http://borisv.lk.net

Book review: Manuale Calligraphicum, David Pankow, ed. 94 TUGboat, Volume 38 (2017), No. 1

Seminar review: Presenting data and Tufte discussed both sides of a presentation: the information by Edward Tufte, point of view of a presenter, and the point of view of November 9, 2016, Arlington, VA an audience. There was plenty of advice on both how to show information and how to understand what Boris Veytsman was shown — and recognize when the presenter is not Edward Tufte, a prominent advocate of beauty and forthright with the truth. clarity in data presentation, is rather well known This leads to another dimension of the semi- to the TEX community. There are several packages nar, one which was rarely mentioned explicitly, but on CTAN inspired by his ideas, for example, tufte- definitely was present: the moral dimension. Tufte latex and sparklines. Tufte’s essay about the cogni- explained how to show the story behind the data, tive style of PowerPoint (2003) was quoted by many always assuming this was a true story. It was not TEXnicians at that time (I must say, however, that only that he did not teach how to mislead the audi- we now have TEX tools quite capable of reproducing ence and conceal the truth; rather, his methods are PowerPoint style). His web site (edwardtufte.com) not compatible with such subterfuge (more on this and Twitter (@EdwardTufte) have been sources of below). Data presentation as practiced by Tufte is many interesting ideas and beautiful pictures. not a neutral trade, which can be used for any goal, For quite some time, I have wanted to attend his being it telling the truth or telling lies. Honesty is seminar (edwardtufte.com/tufte/courses), and hardwired in the approach. this November my employer (Harris Corp.) kindly The seminar used projections, videos and music. agreed to pay for it. (Disclaimer: this review reflects The current jargon suggests the word “multimedia”. only my personal opinion, and does not necessarily However, this word now often means some haphaz- reflect opinions of my employer, other Harris employ- ardly selected fragments joined together in a more ees or officers. This review cannot be construed as or less arbitrary . Unlike those “multimedia an endorsement or recommendation by Harris or any presentations”, this one embedded the non-speech el- other corporate entity.) ements with tact and taste, creating an organic whole. Despite a rather steep price ($420.00, which Perhaps the closest analogy would be a theater play includes four books by Tufte in paperback editions, set by a good director, rehearsed to perfection and coffee & tea, but does not include parking or lunch), skillfully executed. Indeed, Tufte’s presentations are the big ballroom of the Hyatt at DCA airport was one person shows. It is strange that among the arts packed. This is a good sign: there is an interest in discussed by the author (typography, painting, music, high quality data presentation by the public. literature) the thespian art was not mentioned — it The presentation itself, as a matter of course, would seem to be very relevant to the ideas espoused followed Tufte’s recommendations. It started with in the seminar. an hour of silent reading, it emphatically did not use While it is impossible to write here about all slides with bullets, and it did not assume that the the topics raised by Tufte, I would like to mention attention span of the audience was close to that of a several of them, which, in my opinion, would be of a two year old. Many of the topics covered would be special interest to the readership of TUGboat and familiar to those who have read Tufte’s books: from the TEX community. the famous map by Charles Joseph Minard to the Tufte spent much time advocating high resolu- beautiful examples of the “small multiples” graphs. tion of information. One of his villains, mentioned There were also many new topics, including a very in- several times during the course, was the famous teresting analysis of the styles of Web sites. Despite “rule of seven ± two”, which prescribes no more my previous knowledge of Tufte’s ideas, the presen- than about seven chunky sentences on a presentation tation turned out useful for me: it is one thing to page. Tufte thinks that audience can grasp complex read about the general principles, but quite another ideas and flowing texts. He says that the best ex- thing is to see them in action. ample of a high resolution information medium is Edward Tufte did not limit himself to typogra- a classic printed page. This strikes a chord with us phy or . Rather, he showed a holistic TEXnicians, brought up in the traditions of classical approach to the presentation of data and informa- typography as embodied by TEX design. tion. He talked about such things as preparation Tufte brought with him a couple of rare books before the presentation, ways to deal with anxiety to demonstrate these traditions and inherent innova- and technology malfunction, and many other topics tion: one by Galileo (Istoria e dimostrazioni intorno that are important for a successful practitioner, but alle macchie solari, Rome, 1613) with small images often overlooked. embedded in the text, and a second by Oliver Byrne

Boris Veytsman TUGboat, Volume 38 (2017), No. 1 95

(The Elements of Euclid, London, 1847) with 3D Still, there was a topic of the seminar which left cutouts of stereometric bodies. For some bibliophiles a mixed aftertaste for me. Namely, Tufte several the opportunity to see these books alone might well times exhorted the audience to produce high quality justify the cost of admission. presentations. This was done in a way that seemed Another important topic of the seminar was to imply that the common low quality presentations providing the audience of a presentation multiple are caused by the laziness of the practitioners. This paths through the data. The common low resolution is definitely not the complete case. The high quality presentation assumes a single path followed by the display Tufte espouses requires a huge amount of audience, bullets being stepping stones across the thought. While they are immensely satisfying for sea of information. The high resolution presentation the producer and very useful to the audience, they espoused by Tufte assumes the audience members require a most valuable resource: the work of an may choose different paths through the data and extremely skilled professional. Therefore they are reach their own conclusions, perhaps unforeseen by insanely expensive to make. In many corporate envi- the presenter. The recommended way of starting the ronments, where an incessant stream of (necessarily presentation with a period of silent reading actively low quality) presentations is expected, Tufte’s ideas encourages this approach. are a losing proposition. In a sense, Tufte’s exhorta- There are two aspects to this approach. First, tions in the Hyatt ballroom could be taken as similar it seems to be surprisingly close to the Free Soft- to a motivation speech by a renowned haute cuisine ware philosophy. One of the fundamental purposes chef to an audience of fast food cooks. Of course of is to give anyone the ability to mod- these cooks would be happy to work on something ify and combine programs in new ways, sometimes better than greasy burgers. However, they are not not foreseen by the original authors. Tufte applies in the position to decide: the menu is determined by this principle to data. Like Free Software users, his their managers, and ultimately by the customers. If audience is expected to be active participants rather we want to change the bleak landscape of corporate than passive consumers fed with pre-digested pieces presentations, we need to change corporate culture, of information. It is not coincidental that Tufte including the expectations of upper management and made highly complimentary remarks about the re- individual choices of the information producers and producible research movement, which is an analog consumers. It seems this would also imply rather of Free Software in the data world. fundamental changes in our society. At any rate, Second, as mentioned above, this approach is shaming the overworked practitioners, in my opinion, inherently incompatible with misleading and manip- would not help. ulation. A manipulator wants the audience to reach Nonetheless, there is a role for us TEXnicians, the pre-defined conclusions, and carefully constructs especially those who are in the business of writing the path to them, avoiding anything which might packages. Obviously our tools cannot do the creative accidentally reveal the truth. The last thing a ma- thinking for the presentation producer. However, nipulator wants is to let the audience engage in an there is much mundane work, which we can and independent analysis. While reproducible research should make much easier, leaving the practitioner and high resolution presentation were not specifi- free to be creative. Many common tools today subtly cally designed to prevent data manipulation, it is (or not so subtly) nudge the users in the direction an inherent feature of these approaches. Similarly, of making poor presentations. It is possible (albeit while Free Software was not specifically designed to difficult) to make tools nudging the users to make prevent backdoors in software, backdoors are not better ones. compatible with it. A seminar like this one could be an inspiration It should be said that Free Software was promi- and a source of ideas for this effort. Thus I would nent in the recommendations spelled out in the course recommend it for TUG members. handouts. Besides T X, Tufte mentioned R, which E ⋄ is used by many T Xnicians. By the way, there are Boris Veytsman E Systems Biology School and several R packages inspired by Tufte: for example, Computational Materials ggthemes includes a Tufte theme and Tufte plots Science Center, MS 6A2, such as range frames are part of the ggplot2 frame- George Mason University, work. (There is a detailed review of these packages Fairfax, VA 22030 by Lukasz Piwek at motioninsocial.com/tufte.) borisv (at) lk dot net http://borisv.lk.net

Seminar review: Presenting data and information by Edward Tufte, November 9, 2016, Arlington, VA 96 TUGboat, Volume 38 (2017), No. 1

Die TEXnische Komödie 4/2016–1/2017 Die TEXnische Komödie 1/2017 Bogusław Jackowski, Piotr Strzelczyk, Die TEXnische Komödie is the journal of DANTE e.V., Piotr Pianowski, GUST e-foundry font projects; the German-language T X user group (dante.de). E pp. 13–52 (Non-technical items are omitted.) [Published in TUGboat 37:3.] Die TEXnische Komödie 4/2016 Philipp Pilhofer, Der Satz kritischer Editionen Rainer-M. Fritsch, Koch- und Backrezepte mit LATEX und reledmac [Typesetting critical sammeln mit KOMA-Script [Collecting cooking editions with LATEX and reledmac]; pp.53–66 recipes with KOMA-Script]; pp. 42–49 Preparing the final ready-to-print version of A common problem: At some point one has a critical edition is a complex task. This article collected a couple of dozen cooking recipes on paper presents a way to meet the highest requirements and amended them with written notes. But when by using LATEX with the packages reledmac and one wants to make the recipe, it does not match the reledpar. This approach offers many possibilities present cooking routine, or the recipe is wrong. regarding a flexible workflow. The open file formats easily allow further processing, for example a digital Rainer-M. Fritsch A , TextMate 2–LTEXing unter edition. MacOS [TextMate 2—LATEXing under MacOS]; pp. 50–56 Uwe Ziegenhagen, Wie man einen eigenen There is hardly a more emotional topic than the TEX Live-Mirror aufsetzt [How to setup your own choice of the “right” editor. Some rely on Emacs or TEX Live mirror server]; pp.67–71 NAS Vim, others use more TEX-centric editors like , In this article I show how (network attached TEXmaker, TeXShop, etc. storage) can be used to set up a private TEX Live mirror server. Norbert Preining, Build- und Testing k Infrastruktur für TEX Live [Build- and testing Christine Römer, Strukturbäume mit Ti Z k infrastructure for TEX Live]; pp.57–61 [Structure trees with Ti Z]; pp.72–78 Every year European and non-European TEX A supplement to my article on the forest pack- enthusiasts meet in Bachotek, Poland, for BachoTEX. age. The friendly atmosphere and reduced options to es- Herbert Voß, Im Netz gefunden [Found on the cape allow for intensive discussions and progress in net]; pp.79–81 developing new TEX features, as well as reducing On various mailing lists, web portals and news- the beer cellars. This year I was able to attend for groups one always finds helpful tips and tricks around the first time since my migration to Japan and used A (L )TEX. This time: the time to discuss proposals with other team mem- • bers (Mojca Miklavec und Arthur Reutenauer) for a The value ranges of \escapechar, \newlinechar, \endlinechar in various TEX Live testing infrastructure. TEX engines Rolf Niepraschk, Schreibmaschinenschriften – • Creating a reference on an equation inside eine Betrachtung [Typewriter fonts — a review]; \lstinputlisting pp. 62–66 Within the last few years the supply of high- A quality fonts for LTEX has increased. Partly this is [Received from Herbert Voß.] due to new TEX compilers like LuaTEX and X TE EX, and partly due to many new or updated fonts released under free licenses. TUGboat, Volume 38 (2017), No. 1 97

Zpravodaj 2015/3–4, 2016/1–4 Luigi Scarso, Projekt SWIGLIB [The SWIGLIB project]; pp. 47–61 Editor’s note: Zpravodaj is the journal of CSTUG, [Printed in TUGboat 36:1.] 10.5300/2016-1-4/47 the T X user group oriented mainly but not entirely E Marek Pomp, Dobře dokumentované statistické to the Czech and Slovak languages (cstug.cz). výpočty [Well-documented statistical calculations]; Zpravodaj 2015/3–4 pp. 62–77 Petr Sojka, Úvodník [Editorial]; p. 97 The paper describes the usage of the literate pro- Three papers in this issue are introduced to the gramming paradigm in the environment of statistical Sweave kind readers. computations. In particular, the package for writing documents with the assistance of the statis- Martin Pecina, Knížky jsou mánie jako každá tical program R is presented. 10.5300/2016-1-4/62 jiná [Books are an obsession like any other]; pp. 98–103 Vít Novotný, Sazba textu označkovaného The author describes his approach to prepare v jazyce Markdown uvnitř TEXových dokumentů the typographic design of a book. He focuses on [Rendering Markdown inside TEX documents]; the topics of choosing a typeface and size, and the pp. 78–93 overall design. 10.5300/2015-3-4/98 The article describes a new package for plain TEX derivatives that enables the direct inclusion of Antonín Jeřábek, ISBN a online publikace Markdown- into TEX documents. The [ISBN and online publications]; pp. 104–109 author describes their motivation for the creation of The paper briefly reviews the history of ISBNs, the package and its inner workings. The usage of the from the initial purpose of assigning ISBNs to printed package is explained through examples. 10.5300/2016- publications, describing the development of this num- 1-4/78 ber from 8-digit through 9- and 10-digit up to the presently used 13-digit number. The new environ- Michal Hoftich, Elektronické knihy a systém ment of the ISBN system, connected with the revival TEX4ebook [E-books and the TEX4ebook system]; of electronic book publication — offline and online — pp. 94–105 is described, followed by the three conditions ac- This article describes the process of conversion of cepted within the ISBN community which an e-book a TEX document to an e-book using the TEX4ebook must fulfill to get an ISBN. World-wide problems system. Concrete examples of configuration and caused by assigning ISBNs to online publications are caveats are provided. 10.5300/2016-1-4/94 mentioned, too. In conclusion, the paper gives brief Dávid Lupták, Sadzba bibliografie podľa guidelines for Czech publishers for assigning ISBNs normy ISO 690 v systéme LATEX [Typesetting to online publications. 10.5300/2015-3-4/104 bibliographies compliant with the International A Luigi Scarso, Dvě užití SWIGLIB: Standard ISO 690 in LTEX]; pp. 106–120 GraphicsMagick a [Two applications The preparation of bibliographic references and of SWIGLIB: GraphicsMagick and Ghostscript]; citations compliant with the international standard pp. 110–119 ISO 690 is required by many institutes, not limited [Printed in TUGboat 36:3.] 10.5300/2015-3-4/110 to Czech and Slovak academia. However, the type- setting of bibliographies conforming to the respective Zpravodaj 2016/1–4 A standard is not yet supported in the LTEX document Petr Sojka, Úvodník staronového předsedy preparation system. The biblatex-iso690 package has [An introductory word by the once and future been revised and improved to fully meet the require- president]; pp. 1–6 ments of the international standard and thus greatly This editorial discusses CSTUG’s past and future, simplifies the typesetting of bibliographies for all membership issues and shaping the organization in kinds of information resources. 10.5300/2016-1-4/106 the Internet era, together with changes related to Peter Wilson, Mělo by to fungovat V–Cykly C the publishing of Zpravodaj STUG. [It might work. V — loops]; pp. 121–127 C Go forth and participate in STUG to make the This paper shows how to process strings, charac- bright future of T X&Friends a reality! You can! A E ter by character, in LTEX. The paper also describes Bogusław Jackowski, Piotr Strzelczyk, the LATEX macro \@for and shows its application for Piotr Pianowski, Fontové projekty e-písmolijny typesetting tables. 10.5300/2016-1-4/121 GUST [GUST e-foundry font projects]; pp. 7–46 [Printed in TUGboat 37:3.] 10.5300/2016-1-4/7 [Received from Michal Růžička.] 98 TUGboat, Volume 38 (2017), No. 1

Eutypon 36–37, October 2016 Pablo Garc´ıa-Risueno,˜ Apostolos Syropoulos and Natalia` Verges´ , On new Eutypon is the journal of the Greek TEX Friends ideograms for Physics and Chemistry; pp. 33–39 (http://www.eutypon.gr). The svrsymbols package and its accompanying Linus Romer, The evolution of the Miama font provide access to new symbols (or ideograms) typeface; pp. 1–6 for use in texts in Physics and Chemistry. The ratio- At the beginning of 2016, the free typeface nale for the creation of the package is presented and Miama Nueva was released along with a correspond- discussed. Also, the development model employed is briefly described. (Article in English.) ing LATEX package. This article describes how the typeface has evolved over the years. Dimitrios Filippou,TEXniques: (a) Vignettes, (Article in English.) dropcaps and other decorative designs; (b) PDF Giorgos Katsamakis, Eighteenth century files for . . . filing; pp. 41–44 utopias in Nikolaos Glykys’ dropcaps; pp. 7–14 This regular column shows (a) how to produce The dropcaps in books printed in Venice in the scalable images for book decoration, and (b) how to A pdfx Article 18th century, at the press of Nikolaos Glykys “of prepare PDF/A files with X LE TEX and .( in Greek. Ioannina”, are images of a world that never existed, ) but we can find some, 250 years later. (Article in Dimitrios Filippou, Book presentations; Greek with English abstract.) pp. 45–46 George D. Matthiopoulos, Adrian Frutiger: The following books are presented: (a) Jean-luc Trees, Maps, and Theorems Reshaping the post-war æsthetics of typographical Doumont, , Principiæ, art; pp. 15–26 Kraainem, Belgium 2009; and (b) George Gr¨atzer, Practical LAT X At a time when the photomechanical produc- E , Springer, Cham, Switzerland 2014. Article in Greek. tion of fonts and texts started exceeding the physical ( ) presence of metal type, Adrian Frutiger (1928–2015) was the first typographic designer to face decisively [Received from Dimitrios Filippou and creatively the new challenges, and it was he who and Apostolos Syropoulos.] actually shaped the æsthetic rules and technical im- plementation of phototypesetting. (Article in Greek with English abstract.) Apostolos Syropoulos, The digitization of the Frederika font; pp. 27–31 The Frederika typeface was designed by the fa- mous German designer Hermann Zapf around 1953, as the Greek complement of his own Latin Virtuosa font. Until recently, Frederika existed only in metal type. This article presents an overview of the digiti- zation of Frederika, and some basic characteristics of the new digital font. (Article in Greek with English abstract.) TUGboat, Volume 38 (2017), No. 1 99

TUG 12/31/2016 (vs. 2015) Revenue, Expense TUG financial statements for 2016 Dec 31,16 Dec 31,15 Klaus H¨oppner, TUG treasurer ORDINARY INCOME/EXPENSE Income The financial statements for 2016 have been reviewed MembershipDues 86,460 92,550 by the TUG board but have not been audited. As a ProductSales 5,801 5,736 US tax-exempt organization, TUG’s annual informa- ContributionsIncome 10,681 8,320 tion returns are publicly available on our web site: AnnualConference (699) 1,837 http://tug.org/tax-exempt. InterestIncome 575 484 AdvertisingIncome 315 320 ServicesIncome 1,176 2,616 Revenue (income) highlights TotalIncome 104,309 111,863 Membership dues revenue was down about $ 6,000 in Cost of Goods Sold 2016 compared to 2015. Product sales and other in- Membership Drive come categories were close to steady, with two excep- TUGboatProd/Mailing (24,896) (17,722) tions: The annual conference produced a small loss, SoftwareProd/Mailing (2,479) (3,200) while Contributions Income was up $ 2,000, mainly Postage/Delivery - Members (1,356) (2,147) due to a generous anonymous donation. Overall, Lucida Sales to B&H (2,263) (2,195) 2016 income was down 7%. MemberRenewal (384) (412) Total COGS (31,378) (25,676) Cost of Goods Sold and Expenses highlights, GrossProfit 72,931 86,187 and the bottom line Expense The TUG board felt it necessary to seek legal ad- Contributions made by TUG (2,000) (2,000) vice regarding the possible appeal by the suspended OfficeOverhead (14,934) (15,444) PayrollExpense (63,167) (63,256) president, incurring extraordinary expenses of about ProfessionalFees (13,878) $ 14,000, marked as Professional Fees. InterestExpense (50) DVD While we saved some money on production, TotalExpense (94,029) (80,700) TUGboat costs were up $ 7,000, partly due to many NetOrdinaryIncome (21,098) 5,487 color pages in the 2016 conference proceedings issue. The bottom line for 2016 was very negative: OTHER INCOME/EXPENSE about $ 21,100. Even disregarding the exceptional Prioryearadjust (1) (95) Professional Expenses the result was a loss of $ 7,200. NetOtherIncome (1) (95)

Balance sheet highlights NET INCOME (21,099) 5,392 TUG’s end-of-year asset total is down by around TUG 12/31/2016 (vs. 2015) Balance Sheet $ 11,200 (5.5%) in 2016 compared to 2015. Dec 31,16 Dec 31,15 Committed Funds are reserved for designated ASSETS projects: LATEX, CTAN, the TEX development fund, Current Assets and others (http://tug.org/donate). Incoming TotalChecking/Savings 193,913 205,581 donations are allocated accordingly and disbursed as AccountsReceivable 715 300 the projects progress. TUG charges no overhead for TotalCurrentAssets 194,628 205,881 administering these funds. LIABILITIES & EQUITY The Prepaid Member Income category is mem- Current Liabilities ber dues that were paid in earlier years for the current CommittedFunds 35,842 31,248 year (and beyond). The 2016 portion of this liabil- AdministrativeServices 4,017 1,528 ity was converted into regular Membership Dues in Deferred Contributions PrepaidMemberIncome 6,850 4,085 January of 2016. The payroll liabilities are for 2016 PayrollLiabilities 1,083 1,087 state and federal taxes due January 15, 2017. TotalCurrentLiabilities 47,792 37,948

Summary Equity Unrestricted 167,934 162,543 We ended 2016 with 67 less members than in 2015. NetIncome (21,098) 5,391 This was an important cause for the bottom-line loss, TotalEquity 146,836 167,934 and the board continues to work to reverse this trend. Ideas for attracting members are always welcome! TOTAL LIABILITIES & EQUITY 194,628 205,882 100 TUGboat, Volume 38 (2017), No. 1

TUG Business Boris Veytsman

TUG 2017 election

Nominations for TUG President and the Board of (Candidate for TUG President.) Directors in 2017 have been received and validated. I was born in 1964 in Odessa, Ukraine and have For President, Boris Veytsman was nominated. a degree in Theoretical Physics. I worked for vari- As there were no other nominees, he is duly elected ous sci-tech employers, including TEX consulting for and will serve for a two-year term. Google and contractor work with NASA. At present For the Board of Directors, the following 14 my main work is in aviation safety with Harris Cor- individuals were nominated: poration. I teach and do research at George Mason Karl Berry, Johannes Braams, Kaja Christiansen, University. I also do TEX consulting for a number Enrico Gregorio, Taco Hoekwater, Klaus H¨oppner, of customers, including FAO UN, US Government Frank Mittelbach, Ross Moore, Steve Peter, agencies, universities and publishers worldwide. My Arthur Reutenauer, Will Robertson, CV is at http://borisv.lk.net/cv/cv.html. Herbert Schulz, Michael Sofka, Herbert Voß. I have been using TEX since 1994 and have been There were more Board nominations than open posi- a TEX consultant since 2005. I have published a tions. Thus, an election ballot is required, in accor- number of packages on CTAN and papers in TUG- dance with the TUG election procedures (http:// boat. I have been a Board member since 2010 and tug.org/elecproc.html). This year, voting online Vice-President since 2016. I am an Associate Editor is strongly recommended, through the TUG members of TUGboat and support http://tug.org/books/. area, https://www.tug.org/members. (A printable Over the years I have done some thinking about ballot is also available there, or on request from the the future of TEX Users Group. In the old days if TUG office, if you wish to vote on paper.) you wanted tapes with TEX distributions or sought Terms for both President and members of the help, you joined TUG. Now things have changed: you Board of Directors will begin at the Annual Meeting. easily can download any distribution or ask questions. Board members Steve Grathwohl, Jim Hefferon, Thus the steady decline in our membership. While and Geoffrey Poore have decided to step down at the TEX is used by many people, TUG is shrinking. end of this term. On behalf of the Board, I wish to If we want to remain relevant, we need to con- thank them for their service, and for their continued sider our role in the new user community. I think participation until the Annual Meeting. there are several areas where TUG is needed: Statements for all the candidates are appended, 1. A point of contact for the community. The both for President and for the Board (order deter- most important things we are doing are our mined by lot). They are also available online, along conferences and TUGboat. We need to continue with announcements and results of previous elections. these and promote TUGboat for libraries. We The deadline for voting in the election is April 9, need to promote our Web site and make it more which is still some time away as this issue goes to useful for our community. press. The results will be announced on the TUG web site and in the electronic newsletter, as well as 2. Coordination and steering of technical, educa- the next issue of TUGboat. tion and outreach efforts. We have several work- ing groups (see http://tug.org/twg). I am ⋄ Barbara Beeton trying to jump-start Education and Accessibil- for the Elections Committee ity work groups. http://tug.org/election 3. Help with financing TEX-related efforts. Being a tax-exempt (in the US) 501(c)(3) organiza- tion, we are in an exceptionally good position to collect funds for various projects. We should remember that we serve not just our members, but the wide community of TEX users. We should actively promote TUG among the commu- nity and make easier the option to support TUG by volunteering or donating.

TUG 2017 election TUGboat, Volume 38 (2017), No. 1 101

I think we need to work to be relevant in the • For TEX and the TEX User Group changing world. If the TUG members trust me to – Co-founder and board member of the NTG, lead this effort, I would be greatly honored. the Dutch-speaking TEX User group – As chairman of NTG I have served on the Karl Berry board of directors in 1994/1995 as special director for the NTG – designer of a couple of PhD-theses – Original author of the babel language sup- (Candidate for TUG Board of Directors.) port system TEX biography: I served as TUG president from – Member of the LATEX3 team, author of one 2003–2011 and was a board member for two terms of the chapters in the LATEX Companion prior to that, and also subsequently. I am running – author, co-author or maintainer of a couple again for a position on the board. of publicly available LATEX packages and I co-sponsored the creation of the TEX Develop- classes ment Fund in 2002. I’m one of the primary system • Professionally administrators and webmasters for the TUG servers, and the production manager for our journal TUG- – System administrator for VAX/VMS and boat. Unix systems On the development side, I’m currently the edi- – Manager of a team of System administra- tor of TEX Live, the largest free software TEX distri- tors bution, and thus coordinate with many other TEX – Functional administrator of one of the large projects around the world, such as CTAN, LATEX, administrative systems of KPN (PTT Tele- and pdfTEX. I developed and still (co-)maintain com back then) Web2c (Unix TEX) and its basic library Kpathsea, – Project manager for various IT-projects Eplain (a macro package extending plain TEX), and within KPN for about 18 years other projects. I am also a co-author of TEX for – Consultant in the area of cyber security in the Impatient, an early comprehensive book on plain Industrial Control Systems since 2015 TEX, now freely available. I first encountered and Statement: In the last couple of years I have installed TEX in 1982, as a college undergraduate. Statement of intent: I believe TUG can best been coming back into the TEX-community. I would very much like to serve this wonderful community by serve its members and the general TEX community taking up a role in the board of directors of TUG. I by working in partnership with the other TEX user groups worldwide, and sponsoring projects and con- think TEX should and will be alive and well for many years to come, as the quality of typesetting that can ferences that will increase interest in and use of TEX. I’ve been fortunate to be able to work pro bono on be achieved by using TEX is still unsurpassed. TUG and TEX activities the past several years, and plan to continue doing so if re-elected. Kaja Christiansen

Johannes Braams

(Candidate for TUG Board of Directors.) I was born in Warszawa, Poland and live in the city of Aarhus, Denmark. I heard about TEX for the first time in the fall of 1979. In Palo Alto at the time, (Candidate for TUG Board of Directors.) I wanted to audit courses at Stanford and my top Biography: I encountered TEX and friends some- priority was lectures by Prof. Donald Knuth. That, time around 1985 when it was installed on our re- I was told, was not possible as Prof. Knuth was search VAX. It didn’t take long for me to get hooked on leave due to work on a text processing project... on LAT X and I started to think about and work E This project was TEX! Back home, it didn’t take on multilingual support, later to be known as babel. long till we had a runnable TEX system in Denmark. Besides that I have been active on quite a number I have served as a Board member since 1997, of activities: co-sponsored the creation of the TEX Development

TUG 2017 election 102 TUGboat, Volume 38 (2017), No. 1

Fund and have been the chair of TUG’s Technical Council since 1999. I am also a member of the Bur- Taco Hoekwater sary and Election committees and served as TUG vice-president from 2003–2011. I share system ad- ministrator’s responsibilities for the TUG server and TUG’s web site, and actively contributed to several earlier versions of TEXlive. Finally, I am a board member of the Danish TEX Users Group (DK-TUG) (Candidate for TUG Board of Directors.) and served as the president of DK-TUG in 2002– TEX biography: Taco Hoekwater (born in 1969 2011. in Netherlands) has been a ConTEXt user for two Statement: TEX and friends are the only soft- decades. He has been the first user of ConTEXt ware I know of that, after 30+ years, is not only alive outside of PRAGMA ADE and works in tight co- and well, but also the best typesetting system to pro- operation with Hans Hagen to develop TEX engines duce beautiful books and papers. In my rˆole as a and macros for ConTEXt ever since. He has been the member of the board, my special interests have been president of the Dutch language-oriented TEX users projects of immediate value to the TEX community, group (NTG) from 2009 until 2015 and was the main among them system administration, TEX Live and editor of the NTG’s magazine MAPS. He has been TUGboat. the maintainer of MetaPost for a number of years and a core participant in the LuaTEX development Enrico Gregorio team. He organised the first international ConTEXt User Meeting in Epen, Netherlands in 2007, and various other TEX- and ConTEXt-related conferences since. He was previously on the TUG board from (Candidate for TUG Board of Directors.) 2011 to 2015, and is the current president of the Biography: I am associate professor of Algebra ConTEXt user group (CG). since 1992, currently at the University of Verona Statement of intent: As a board member, I (Italy). hope to be able to promote future extensions and I’m active in TEX related matters since I started applications of Knuth’s amazing piece of software, loving it, which was around 1986. I’m the author of as well as raise awareness of ConT Xt outside its A E a LTEX programming book in Italian and a member current user base. of GuIT, the Italian TEX users group, which I also served as president and board member. Since 1996 I deliver a LATEX course at my Depart- ment, which is academically recognized and grants Klaus H¨oppner two credits to students who follow it and get their assignments approved. I am quite active at the tex.stackexchange.com site, being the highest reputation member, with the nickname egreg and also in the GuIT forum as egreg9. I have authored some LATEX packages and papers (Candidate for TUG Board of Directors.) for TUGboat and ArsTEXnica. Biography: I got a PhD in Physics in 1997. Personal statement: My main interest for the After several years in the control systems group of an TEX world is in developing good documentation and accelerator center in Darmstadt, I’ve been working at in promoting good style in document writing and an accelerator for cancer therapy in Heidelberg. My programming. first contact to LATEX was in 1991, using it frequently Supporting LATEX3 development should be one since then. of the important tasks for TUG in the next years. I have been preparing the CTAN snapshot on CD, distributed to the members of many user groups, from 1999 until 2002. I was the local organizer of TUG2015 and was heavily involved in the organi- zation of several DANTE conferences and EuroTEX 2005. I’ve been a member of the TUG board since

TUG 2017 election TUGboat, Volume 38 (2017), No. 1 103

2005 and was a member of the DANTE board un- Nevertheless the world has changed and is chang- til 2016, including terms acting as president, vice ing further and in that changing world user groups president, and treasurer. like TUG need to find their place and possibly rein- Statement: As in the past, I want to be the vent themselves by redefining and reshaping their voice of European users, in particular those who role. With my work on the TUG board I would like need characters with funny accents. TUG’s last year to help in that process and ensure a future for high was troublesome. The board had to make a hard quality typography as provided by TEX. decision. It’s up to you to decide whether it was right or wrong. Anyway, we have to look forward, coming back to a stable and constructive cooperation. TUG has an efficient office and a well-working board, Ross Moore against all blames. Looking at other user groups, that’s not too common. Renovation was an often mentioned goal regard- ing TUG. Renovation is fine, it just has to be per- formed by working with the developers of TEX dis- tributions and maintainers of TEX repositories and (Candidate for TUG Board of Directors.) web sites, not by blaming them for the work they do I would like to offer my services to the TUG in their spare time. I’ve seen many improvements in Board. Having been active in the TEX community the past, regarding the installation process of TEX for more than 20 years, writing code for packages, distributions (e.g. TEX Live) and in the user inter- my first TUG meeting was in 1997. Previously I’ve face of CTAN. The rather plain and simple layout of been a board member, but have taken a rest these TUG’s web pages may be improved, of course giving past 2 years. In January, Boris asked if I’d be willing the usability, especially for handicapped, the prece- to return; I was happy to say ‘yes’. dence over fanciness. However, the key information is Well, 2017 is likely to be a very important year there. The TEX community needs volunteers instead for the PDF format, hence for TEX, and for TUG of hot-air merchants. And the TUG board needs and other user groups around the world. Already constructive directors. I think the TUG conference on 18 January, a document “Information and Com- and AGM in Toronto created the base for a new start munication Technology (ICT) Final Standards and that shouldn’t be spoiled. Guidelines” was published into the US Federal Regis- ter, effectively becoming law. This affects “standards for electronic and information technology developed, Frank Mittelbach procured, maintained, or used by Federal agencies covered by section 508 of the Rehabilitation Act of 1973, as well as guidelines for telecommunications equipment [...]. These revisions [...] are intended to (Candidate for TUG Board of Directors.) ensure that information and communication technol- ogy covered by the respective statutes is accessible to I came in contact with TEX in the mid-eighties and usable by individuals with disabilities.” It speci- and over the years TEX, LATEX and typography in general became a very important part of my life. In fies that “authoring tools capable of exporting PDF 1990 I took over the maintenance and further devel- files must conform to PDF 1.7 [. . . ] and be capable of exporting PDF files that conform to PDF/UA-1.” opment of LATEX from Leslie Lamport and together with a small number of people (most notably David While documents produced by TEX-based soft- Carlisle, Chris Rowley and Rainer Sch¨opf at that ware are compatible with PDF 1.7, it is certainly time) we designed and implemented what became not the case that they conform to PDF/UA, which requires producing ‘Tagged PDF’. Thus if LAT X or LATEX2e in 1994 — the LATEX you still essentially use E today (even though it has undergone smaller modifi- other TEX-based software can be used within US cations and improvements through by now 25 further government agencies only as part of a processing releases). chain requiring other software to complete the final Despite all predictions made during the last document. This is not how we normally work with T X. Furthermore, the PDF 2.0 standard, also based decades, TEX and LATEX are alive and kicking as E proven by their (still?) strong use in various ways upon ‘Tagged PDF’, may appear as early as June. around the world. Over the past 8 years (or more), I have given talks at annual TUG meetings, demonstrating PDF

TUG 2017 election 104 TUGboat, Volume 38 (2017), No. 1

features that tagging allows, produced using an ex- years when, being a student of mathematics and tended version of pdf-TEX. Currently I’m working physics, I had to use it for typesetting reports. I on a set of LATEX macros that produce valid ‘Tagged was prompted to dive deeper because of my interest PDF’ documents satisfying the WCAG 2.0 Accessibil- in languages and writing systems, and soon got pas- ity standard. Examples, using different LATEX docu- sionate about it (see my entry in the TUG interview ment classes and built with the current pdfTEX, can corner for excruciating details). be found on my web page http://maths.mq.edu. Statement: Today, I am active in TEX develop- au/~ross/TaggedPDF/. These developments need ment as the maintainer of various packages and pro- to be enhanced to become de rigeur for the way we grams related to multilingual typesetting (polyglos- use TEX and LATEX, else there will be no new TEX sia, hyph-utf8, X TE EX), and I regularly give talks at users in years to come. As a Director of TUG, this conferences and write articles in journals. I have been outlines an agenda that I’ll be supporting. on the board of several TEX users groups, founded the ConTEXt group, and have contributed to promot- ing TEX which in my opinion is, still today, one of Steve Peter the best typesetting systems available. I am truly amazed at how vibrant our user community is. If I am reelected to the TUG board, I will do my best to represent that community in all its diver- sity. Our organisation has been through some hard times recently, and I want to help moving forward (Candidate for TUG Board of Directors.) and foster the use of TEX and Metafont in the 21st Biography: I am a linguist and publisher orig- century. inally from Illinois, but now living in New Jersey. I first encountered TEX as a technical writer docu- menting Mathematica. Now I use TEX and friends Will Robertson for a majority of my publishing work, and work with several publishers customizing TEX-based publishing systems. I am especially interested in multilingual typography and finding a sane way to typeset all of those crazy symbolisms linguists create. As if that (Candidate for TUG Board of Directors.) weren’t bad enough, I also design typefaces. (Do I My background is mechanical engineering, and know lucrative markets, or what?) having (finally) completed my PhD in magnetic lev- I got involved in TUG via translations for TUG- itation and vibration control in 2013, I am now a boat. I was on the TUG board of directors for several full-time lecturer at The University of Adelaide. My terms before becoming TUG president in 2011, serv- interest in LAT X was preceded by an interest in com- ing two terms, after which I returned to the board. E puter typesetting, and I came into LAT X in the midst Statement: The future of T X and TUG lies in E E of a general transition to Unicode. Early in X T X’s global communication and cooperation to promote E E life I wrote some LAT X code to aid the font-loading and sustain the amazing typographic quality associ- E process, and from there I became hooked and devel- ated with T X and friends. Projects such as LuaT X E E oped a number of LAT X packages, including fontspec show that there remains a dynamic and bright future E and unicode-math. After some time I also became for our preferred typesetting system. I am especially a member of the LAT X3 project, helping to develop interested in having TUG support projects (techni- E the expl3 programming language. cal and artistic) that will serve to bolster T X and E Although my day-to-day programming contribu- TUG’s visibility in the world at large. tions have diminished in recent years as my personal and professional responsibilities have increased, my Arthur Reutenauer passion and appreciation for TEX in all its forms only increases with the years. Personally, I see TEX as the only typesetting system worth using for most forms of document production, although I’m happy (Candidate for TUG Board of Directors.) for people to hold their own opinions on the matter. Biography: I first joined TUG in 2005 and have A I teach LTEX to our entire mechanical engineering been a member of the board for the past four years. honours project student cohort, and every year I My interest in TEX started during my university

TUG 2017 election TUGboat, Volume 38 (2017), No. 1 105

have overwhelmingly positive feedback on both its style and utility over what they’re used to. Michael Sofka As a member of the TUG Board of Directors, I would seek greater recognition for TEX from the world’s universities and technical companies. Recog- nition by way of TUG membership, of course, to allow the TUG organisation to flourish. In addi- tion, I would seek initiatives for younger users and (Candidate for TUG Board of Directors.) developers to engage with TUG, with an emphasis Biography: I have been a TEX user for nearly 30 on open discussion with the number of companies years, and a member of TUG for 28 years, including that now sell access to their online T X editors and E a term on the Board (2001–2005). My use of TEX document previewers. started as a programmer for a full service typesetting I believe that my immersion in the current tech- company writing macro packages for books, device nical landscape of TEX and friends gives me a view drivers for various laser typesetters. I continued of the TEX world that is both broad and deep. I using T X and LAT X in my work and personal life A E E would not sit on the TUG Board as a LTEX3 devel- after switching to IT in Academia. During this time oper, but rather as one who has a great wish to see A TEX and LTEX have changed tremendously, and I success across the whole T X world, from ConT Xt E E am continually amazed by the creativity of the TEX in its technical mastery, to eplain in its hackability, community. It is no exaggeration to say my continued A to LTEX in its rich ecosystem. TEX has a bright interest and membership in TUG derives from the future, and it would be an honour to contribute to delight of discovering new tools and techniques for that future as a member of the TUG Board. traditional and . Statement: TEX and TUG have come a long way from the days of half-inch tape distribution, CWEB, Herbert Schulz and the Berkeley Pascal compiler. The typesetting engines available have expanded and grown, and become far easier to install. The ways in which people find information about TEX has also changed. When (Candidate for TUG Board of Directors.) I joined TUG I was desperate for quality information. I’ve been using TEX since the mid-1980s; well, Through TUGboat articles, and many readings of except for several years in the mid- to late-1990s. The TEXbook, I learned how to program and write During that time period I received a great deal of using TEX. Today, the World Wide Web, through help from others as I tried to better understand the sites such as StackExchange, has become the first subtleties of using TEX, and later LATEX. After retir- source of information. Most people who use TEX ing in 2001 I decided to give back to the community and LATEX might not even be aware of the TEX Users and have helped put together MacTEX as well as Group, and the role it plays in funding and promoting MacTEXtras as well as help others on multiple (both the programs and packages they depend upon. Going Mac and non-Mac centric) on-line forums and email forward, TUG will grow and adapt to this new way lists. of sharing information, and explore new methods of I would like to become a member of the TUG attracting TEX users, whether it be through Web Board to further help develop on-line help through pages, sponsoring development, annual meetings, or the TUG Web Pages by gathering links to as many local conferences. I hope you will support me in on-line and up-to-date TEX, LATEX and Distribution being a part of that process. help locations along with descriptions of what they provide. I believe this would be one way to help increase TUG membership and speed up the learning curve for new users of TEX.

TUG 2017 election 106 TUGboat, Volume 38 (2017), No. 1

Herbert Voß

(Candidate for TUG Board of Directors.) I am retired from my job as a teacher for physics, mathematics and computer science at a so-called Gymnasium (higher education school), led by the Jesuit order. For more than ten years I am also a lecturer at the Free University of Berlin. I started with one course per year in scientific writing with LATEX and have now eight courses per year. I like reading and writing and created together with the publisher Lehmanns Media the so-called DANTE Edition, (LA)TEX books from members for members of DANTE, the German speaking TEX user group. For DANTE’s 25th anniversary I created a new edition of Victor Eijkhout’s book TEX by Topic which was also published in the DANTE series. I am very interested in creating an from a LATEX source, which is, of course, still not really easy. And my other major interest is “LATEX for beginners”: how can one minimize the problems of the installation of a TEX distribution and the troubleshooting when running (LA)TEX on source documents. Statement: I still believe that TEX has a future. With LuaTEX we have a great potential to keep TEX running and I think that TUG can play a major role to make this public to the rest of the world.

Comic by Randall Munroe (https://xkcd.com), licensed under CC BY-NC.

[ TUG 2017 [ [ 25th annual GUST [ joint conference [ 11th ConTEXt meeting [ Bachotek, Poland Butzbach-Maibach, Germany April 29–May 3, 2017 September 11–17, 2017 tug.org/tug2017 meeting.contextgarden.net/2017 TUGboat, Volume 38 (2017), No. 1 107

TEX Consultants

The information here comes from the consultants themselves. Peter, Steve We do not include information we know to be false, but we +1 732 306-6309 cannot check out any of the information; we are transmitting Email: speter (at) mac.com it to you as it was given to us and do not promise it is correct. Specializing in foreign language, multilingual, linguistic, and Also, this is not an official endorsement of the people listed technical typesetting using most flavors of TEX, I have typeset here. We provide this list to enable you to contact service books for Pragmatic Programmers, Oxford University Press, providers and decide for yourself whether to hire one. Routledge, and Kluwer, among others, and have helped nu- TUG also provides an online list of consultants at tug.org/ merous authors turn rough manuscripts, some with dozens consultants.html. If you’d like to be listed, please see there. of languages, into beautiful camera-ready copy. In addition, Aicart Martinez, Merc`e I’ve helped publishers write, maintain, and streamline TEX- Tarragona 102 4o 2a based publishing systems. I have an MA in Linguistics from 08015 Barcelona, Spain Harvard University and live in the New York metro area. +34 932267827 Email: m.aicart (at) ono.com Sofka, Michael Web: http://www.edilatex.com 8 Providence St. We provide, at reasonable low cost, LATEX or TEX page layout Albany, NY 12203 and typesetting services to authors or publishers world-wide. +1 518 331-3457 We have been in business since the beginning of 1990. For Email: michael.sofka (at) gmail.com more information visit our web site. Skilled, personalized TEX and LATEX consulting and program- ming services. Dangerous Curve I offer over 25 years of experience in programming, macro +1 213-617-8483 writing, and typesetting books, articles, newsletters, and the- Email: typesetting (at) dangerouscurve.org ses in TEX and LATEX: Automated document conversion; Pro- We are your macro specialists for TEX or LATEX fine typogra- gramming in Perl, C, C++ and other languages; Writing and phy specs beyond those of the average LATEX macro package. customizing macro packages in TEX or LATEX; Generating We take special care to typeset mathematics well. custom output in PDF, HTML and XML; Data format con- Not that picky? We also handle most of your typical TEX version; Databases. and LATEX typesetting needs. If you have a specialized TEX or LATEX need, or if you We have been typesetting in the commercial and academic are looking for the solution to your typographic problems, worlds since 1979. contact me. I will be happy to discuss your project. Our team includes Masters-level computer scientists, jour- neyman typographers, graphic designers, letterform/font de- Veytsman, Boris signers, artists, and a co-author of a TEX book. 46871 Antioch Pl. Sterling, VA 20164 de Bari, Onofrio and Dominici, Massimiliano +1 703 915-2406 Email: info (at) typotexnica.it Email: borisv (at) lk.net Web: http://www.typotexnica.it Web: http://www.borisv.lk.net Our skills: layout of books, journals, articles; creation of TEX and LATEX consulting, training and seminars. Integra- LATEX classes and packages; graphic design; conversion be- tion with databases, automated document preparation, cus- tween different formats of documents. tom LATEX packages, conversions and much more. I have We offer our services (related to publishing in Mathemat- about two decades of experience in TEX and three decades ics, Physics and Humanities) for documents in Italian, En- of experience in teaching & training. I have authored several glish, or French. Let us know the work plan and details; packages on CTAN, Perl packages on CPAN, R packages on we will find a customized solution. Please check our website CRAN, published papers in TEX related journals, and con- and/or send us email for further details. ducted several workshops on TEX and related subjects.

Latchman, David Webley, Jonathan 2005 Eye St. Suite #4 Bakersfield, CA 93301 2/4 31 St Andrews St +1 518-951-8786 Glasgow, G1 5PB, UK Email: david.latchman (at) texnical-designs.com 07914344479 Web: http://www.texnical-designs.com Email: jonathan.webley (at) gmail.com LATEX consultant specializing in the typesetting of books, I’m a proofreader, copy-editor, and LATEX typesetter. I spe- manuscripts, articles, Word document conversions as well as cialize in math, physics, and IT. However, I’m comfortable creating the customized packages to meet your needs. Call or with most other science, engineering and technical material email to discuss your project or visit my website for further and I’m willing to undertake most LATEX work. I’m good details. with equations and tricky tables, and converting a Word doc- ument to LATEX. I’ve done hundreds of papers for journals over the years. Samples of work can be supplied on request. 108 TUGboat, Volume 38 (2017), No. 1

Calendar

2017 Jun 9 – 12 SHARP 2017, “Technologies of the Book”. Society for the History of Authorship, March 26 TUG 2017, deadline for presentation Reading & Publishing. proposals. tug.org/tug2017 Victoria, BC, Canada. www.sharpweb.org/main Mar 30 – 31 Centre for Printing History & Culture, “From Craft to Technology and Jun 26–29 Book history workshop, Institut d’histoire Back Again: print’s progress in the du livre, Lyon, France. ihl.enssib.fr twentieth century”, Jul 5 – 7 The Fifteenth International Conference National Print Museum, Dublin, Ireland. on New Directions in the Humanities http://www.cphc.org.uk/events (formerly Books, Publishing, and Apr 9 TUG election, deadline for receipt of Libraries), “New Directions of the ballots. tug.org/election/2017 Humanities in the Knowledge Society”, Imperial College, London, UK. thehumanities.com/2017-conference TUG2017: TUG@BachoTEX 2017 Bachotek, Poland. Jul 30 – SIGGRAPH 2017, “At the ♥ of th Apr 29 – The 38 annual meeting of the Aug 3 Computer Graphics & Interactive Techniques”, Los Angeles, California. May 3 TEX Users Group, jointly with the th 25 meeting of GUST s2017.siggraph.org th and GUST’s 25 birthday. Aug 8–11 Digital Humanities 2017, Alliance of “Premises, predilections, predictions”. Digital Humanities Organizations, tug.org/tug2017 “Access/Acc`es”, McGill University, www.gust.org.pl/bachotex/2017-en Montr´eal, Canada. dh2017.adho.org Aug 23–27 TypeCon2017, Boston, Massachusetts. May 12 TUGboat 38:2 (proceedings issue), typecon.com submission deadline. Sep 1 TUGboat 38:3 (regular issue), submission th May 21 – 26 16 Annual Book History Workshop, deadline. Texas A & M University, th College Station, Texas. Sep 11 – 17 11 International ConTEXt Meeting, cushing.library.tamu.edu/programs/ “ConTEXt Gardening”, bookhistoryworkshop Maibacher Schweiz, Germany. meeting.contextgarden.net/2017 May 25 – 27 TYPO Berlin 2017, “Wanderlust”, Sep 23 DANTE 2017 Herbsttagung and Berlin, Germany. th typotalks.com/berlin 57 meeting, VHS, M¨onchengladbach, Germany. Jun 5–16 Mills College Summer Institute for www.dante.de/events.html Book and Print Technologies, Oakland, California. 2018 millsbookartsummer.org

Mar 2 TUGboat 39:1 (regular issue), submission deadline.

Status as of 15 March 2017

For additional information on TUG-sponsored events listed here, contact the TUG office (+1 503 223-9994, fax: +1 815 301-3568. e-mail: [email protected]). For events sponsored by other organizations, please use the contact address provided. User group meeting announcements are posted at lists.tug.org/tex-meetings. In- terested users can subscribe and/or post to the list, and are encouraged to do so. Other calendars of typographic interest are linked from tug.org/calendar.html. TUGBOAT Volume 38 (2017), No. 1 Introductory 5 Barbara Beeton / Editorial comments • typography and TUGboat news A 31 Brian Dunn / Programming L TEX—A survey of documentation and packages A • resources for writing L TEX packages and code 3 Jim Hefferon / President’s note • TUG news and reflections 34 Gerd Neugebauer / CTAN goes 2.0—New community features and more • user ratings and descriptions, activity reports, newsfeeds, and more A 10 David Teplow / What’s a Professor of Neurology doing using L TEX? A A • personal history and experiences of L TEX in a non-L TEX world 7 David Walden / Interview with Scott Pakin A • developer of many L TEX packages and other TEX-related tools Intermediate 87 Karl Berry / The treasure chest • new CTAN packages, November 2016–March 2017 18 Charles Bigelow / Review and summaries: The History of Typographic Writing—The 20th century • chapter-by-chapter summaries of this set of extended essays; volume 1 of 2 16 Peter Flynn / Typographers’ Inn • Layouts; afterthought A A 54 L TEX Project Team / L TEX news, issue 26, January 2017 A A • ε-TEX; default encodings in X LE TEX and LuaL TEX; \showhyphens; fixltx2e, latexbug, amsmath, tools A A 56 L TEX Project Team / L TEX3 news, issue 10, November 2016 • l3build; automating expl3 testing; \lowercase and \uppercase; \parshape model; global pagination 44 Hal Snyder / SageMathCloud for collaborative document editing and scientific computing • open-source web platform for real-time technical document collaboration A 41 Behzad Salimi / How to use basic color models in L TEX • tutorial on RGB, CMYK, grayscale color model usage, and more 28 Michael Sharpe / BaskervilleF • a revival of Fry’s Baskerville, adapted from Libre Baskerville A 39 Thomas Thurnherr / An introduction to the L TEX cross-referencing system • built-in commands and useful packages: cleveref, varioref, hyperref, xr[-hyper], showlabels Intermediate Plus 23 Simon Cozens / SILE: A new typesetting system • a new Lua typesetter using TEX algorithms, Unicode, and major libraries A 58 Brian Dunn / A key/value interface for generating L TEX floats—the keyfloat package • overview of features of this package for convenient float specifications A 48 Brian Dunn / Producing HTML directly from L TEX—the lwarp package A • modular and convenient system for producing HTML directly from L TEX 61 Peter Wilson / Glisterings: Hanging; Safety in numbers • overhangs; paragraphs in equations; superstitious enumerations Advanced 65 Udo Wermuth / The optimal value for \emergencystretch • thorough discussion of the theory and practice of the third pass of line breaking Reports and notices 96 From other TEX journals: Die TEXnische Kom¨odie 4/2016–1/2017; Zpravodaj 2015/3–4–2016/1–4; Eutypon 36–37 (October 2016) 89 Jim Hefferon / More Math Into LATEX, 5th edition, by George Gr¨atzer A • review of this new edition of a classic L TEX text 90 Boris Veytsman / The Noblest Roman: A History of the Centaur Types ... by Jerry Kelly and Misha Beletsky • review of this comprehensive history of the famous Centaur 93 Boris Veytsman / Manuale Calligraphicum, David Pankow, ed. • review of this beautiful collection of calligraphy by students of Hermann Zapf 94 Boris Veytsman / Seminar review: Presenting data and information by Edward Tufte • review of and reflections on this seminar by the renowned Edward Tufte 92 David Walden / Track Changes, by Matthew G. Kirschenbaum • review of this study of numerous authors’ stories of adopting writing software 106 Randall Munroe / File extensions (cartoon) 100 TUG Election committee / TUG 2017 election 2 Institutional members 99 Klaus H¨oppner / TUG financial statements for 2016 107 TEX consulting and production services 108 Calendar