TUGBOAT
Volume 37, Number 3 / 2016
General Delivery 255 President’s note / Jim Hefferon 256 Editorial comments / Barbara Beeton R.I.P. Kris Rose, 1965–2016; A book fair... and another passing; Some typography links to follow; Another honor for Don Knuth; A fitting memorial for Sebastian Rahtz; Second annual Updike Prize for student type design; Talk by Fiona Ross 259 Interview with Federico Garcia-De Castro / David Walden Typography 264 Typographers’ Inn / Peter Flynn Software & Tools 267 LuaTEX version 1.0.0 / Hans Hagen 269 LuaTEX 0.82 OpenType math enhancements / Hans Hagen Electronic 275 Introducing LaTeX Base / Gareth Aye Documents 277 Computer Modern Roman fonts for ebooks / Martin Ruckert Graphics 281 When (image) size matters / Peter Willadt Survey 284 A survey of the history of musical notation / Werner Lemberg Fonts 305 Colorful emojis via Unicode and OpenType / Hans Hagen 306 Cowfont (koeieletters) update / Taco Hoekwater and Hans Hagen 311 Corrections for slanted stems in METAFONT and METAPOST / Linus Romer 317 GUST e-foundry font projects / Bogusław Jackowski, Piotr Strzelczyk, Piotr Pianowski A L TEX 337 Localisation of TEX documents: tracklang / Nicola Talbot 352 Glisterings: Index headers; Numerations; Real number comparison / Peter Wilson Macros 357 Messing with endnotes / David Walden 358 Tracing paragraphs / Udo Wermuth Hints & Tricks 374 The treasure chest / Karl Berry Cartoon 376 An asterisk’s lament / John Atkinson Abstracts 377 Die TEXnische Kom¨odie: Contents of issues 2–3/2016 TUG Business 254 TUGboat editorial information 254 TUG institutional members 378 TUG 2015 election Advertisements 379 TEX consulting and production services News 380 Calendar TEX Users Group Board of Directors TUGboat (ISSN 0896-3207) is published by the Donald Knuth, Grand Wizard of TEX-arcana † ∗ TEX Users Group. Web: 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] boat U.S.A. 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] Institutional memberships +1 503 223-9994 Technical support for Institutional membership is primarily a means of Fax T X users: showing continuing interest in and support for T X +1 815 301-3568 E E [email protected] and the T X Users Group. It also provides a dis- E Web counted membership rate, site-wide electronic ac- Contact the http://tug.org/ Board of Directors: cess, and other benefits. For further information, http://tug.org/TUGboat/ see http://tug.org/instmem.html or contact the [email protected] TUG office.
Trademarks Copyright c 2016 TEX Users Group. Many trademarked names appear in the pages of Copyright to individual articles within this publication TUGboat. If there is any question about whether remains with their authors, so the articles may not 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. The following list TUGboat For the editorial and other material not ascribed to a of trademarks which commonly appear in particular author, permission is granted to make and should not be considered complete. distribute verbatim copies without royalty, in any medium, TEX is a trademark of American Mathematical Society. provided the copyright notice and this permission notice METAFONT is a trademark of Addison-Wesley Inc. are preserved. PostScript is a trademark of Adobe Systems, Inc. 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 [printing date: November 2016] translations of this permission notice itself. Lacking such approval, the original English permission notice must Printed in U.S.A. be included. “Editors are ghouls and cannibals.” Harriet Vane to Salcombe Hardy Dorothy L. Sayers Busman’s Honeymoon (A love story with detective interruptions) (1937)
COMMUNICATIONS OF THE TEX USERS GROUP EDITOR BARBARA BEETON
VOLUME 37, NUMBER 3 • 2016 PORTLAND • OREGON • U.S.A. 254 TUGboat, Volume 37 (2016), No. 3
TUGboat editorial board TUGboat editorial information Barbara Beeton, Editor-in-Chief This regular issue (Vol. 37, No. 3) is the last issue of the 2016 Karl Berry, Production Manager volume year. Boris Veytsman, Associate Editor, Book Reviews TUGboat is distributed as a benefit of membership to all current TUG members. It is also available to non-members Production team in printed form through the TUG store (tug.org/store), and William Adams, Barbara Beeton, Karl Berry, online at the TUGboat web site, tug.org/TUGboat. Online Kaja Christiansen, Robin Fairbairns, Robin Laakso, publication to non-members is delayed up to one year after Steve Peter, Michael Sofka, Christina Thiele print publication, to give members the benefit of early access. Other TUG publications Submissions to TUGboat are reviewed by volunteers TUG is interested in considering additional manuscripts for and checked by the Editor before publication. However, the publication, such as manuals, instructional materials, docu- authors are assumed to be the experts. Questions regard- mentation, or works on any other topic that might be useful ing content or accuracy should therefore be directed to the to the T X community in general. authors, with an information copy to the Editor. E If you have such items or know of any that you would Submitting items for publication like considered for publication, send the information to the Proposals and requests for TUGboat articles are gratefully attention of the Publications Committee at [email protected]. received. Please submit contributions by electronic mail to TUGboat advertising [email protected]. For advertising rates and information, including consultant The first issue for 2017 will be a regular issue, with a listings, contact the TUG office, or see: deadline of February 24, 2017. The second 2017 issue will be tug.org/TUGboat/advertising.html the proceedings of the TUG’17 conference (tug.org/tug2017). tug.org/consultants.html The third issue deadline is September 1. The TUGboat style files, for use with plain TEX and Trademarks LATEX, are available from CTAN and the TUGboat web site, Many trademarked names appear in the pages of TUGboat. and are included in common TEX distributions. We also ac- If there is any question about whether a name is or is not a cept submissions using ConTEXt. Deadlines, templates, tips trademark, prudence dictates that it should be treated as if it for authors, and more is available at tug.org/TUGboat. is. The following list of trademarks which commonly appear Effective with the 2005 volume year, submission of a in TUGboat should not be considered complete. new manuscript implies permission to publish the article, if METAFONT is a trademark of Addison-Wesley Inc. accepted, on the TUGboat web site, as well as in print. Thus, PostScript is a trademark of Adobe Systems, Inc. the physical address you provide in the manuscript will also TEX and AMS-TEX are trademarks of the American Mathe- be available online. If you have any reservations about post- matical Society. ing online, please notify the editors at the time of submission and we will be happy to make special arrangements.
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 Overleaf, 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 37 (2016), No. 3 255
A President’s note the class I require students to learn enough LTEX to do their homework. It is a professional standard Jim Hefferon in mathematics and I think it is to their benefit to Lots of things are happening in the TEX world, some know it. new and some older, some great to hear and some If you are interested in these issues, please join! otherwise. Membership drive continues Elections We are continuing our campaign Members Bring Members TUG This is an election year for TUG. There are ten seats . We ask all members to help spread up for a vote this year, including mine as President. the word about our community by inviting new indi- We invite nominations for these openings. I viduals and organizations to join. hope that you will consider serving if you are able. If you know someone who uses TEX and friends, It is a truism but it is nonetheless true that the work someone who is interested in high quality electronic doesn’t get done unless somebody does it. documents, then please urge them to consider joining The page tug.org/election/ has the full infor- TUG. mation. If you have any questions, please contact the On the TUG signup form at tug.org/forms/ election committee, whose address is on that page. current/memberapp.html, the first question is for The submission deadline, which will be strictly kept, new members: “Who invited you to join TUG?” We is February 1. acknowledge each such sponsor with a small gift, a postcard made by long-time TUG member Peter Conferences Wilson on his letterpress specially for this campaign Next year’s TUG conference will take place in con- (or, if preferred, any physical item from TUG store). junction with the yearly BachoT X conference. We Moreover, we will recognize participants in the cam- E TUGboat are excited to be joining the Polish group GUST to paign at the TUG meeting, in , and on the celebrate their 25th birthday. A big thank you to web site. At the end of 2016, we will also hold a them for agreeing to host! drawing and the person selected will receive a copy The dates are April 29–May 3, 2017 (note that of the limited edition book Manuale Zapficum: Typo- this differs from the midsummer time we have often graphic arrangements of the words by and about the used in the past). The monthly online TUG newslet- work of Hermann Zapf & Gudrun Zapf von Hesse ter and the web page tug.org/tug2017/ will have (2009). more information as it becomes available. Helping I’ve also just heard the dates and location for the We all benefit from the work of others, and that 11th International ConT Xt meeting have been set: E includes those of us in the T X world. If you are September 11–17, 2017 in Butzbach-Maibach, Ger- E able to give back a bit but are not sure how, you many. More information on this will be at meeting. could consider running for the TUG Board; see above. contextgarden.net/2017/. Alternatively, the technical committee maintain a New projects list of project ideas for anyone interested to tackle, at tug.org/help.html. Have a look; they are all We have activated two working groups. worthwhile. The PDF accessibility group addresses the very important work of implementing accessibility stan- Kristoffer Rose dards in TEX. It has a web page tug.org/twg/ We learned with sadness that Kris Rose has passed accessibility/ and mailing list lists.tug.org/ away in September. He is one of those people whose accessibility. You can direct a portion of your work has helped me personally. He was the author TUG donations, which are tax deductible in the US, of the widely used XY-pic package. And, he was to this group. a member of the TUG Board from 1997–2003, as The education working group is aimed at helping well as Vice President from 1997–2001. He was also to teach and promote TEX in schools and universities. a contributor to Debian. Barbara will say more The mailing is list lists.tug.org/edutex and the elsewhere in this issue but we were sorry to hear the freshly minted web site at tug.org/twg/edutex/. news and our thoughts go out to his loved ones. This second group is near to my heart. I would dearly like to see more undergraduates using TEX ⋄ Jim Hefferon and friends. I’m a mathematics professor and I Saint Michael’s College teach an introduction to proofs class. As part of jhefferon (at) smcvt dot edu
President’s note 256 TUGboat, Volume 37 (2016), No. 3
Editorial comments a week earlier, of Oak Knoll’s proprietor and guiding spirit of the Fest, Robert Fleck; nonetheless, the Fest Barbara Beeton went on as planned, following Bob’s admonition to R.I.P. Kris Rose, 1965–2016 his son Rob, “Hell no! We’ve already paid for it!” (Rob and his mother, Millie, intend to continue the Kristoffer Høgsbro Rose was a native of Denmark, work Bob started, Bob’s plans are solidly in place born 5 April 1965. He discovered computer science for the next several years.) when he was very young, and spent the rest of his life Oak Knoll is both a bookshop and a publisher, involved in this pursuit. He was an early contributor with a very specialized focus—books about books. to AUC-T X, and the author ofX -pic. E Y I first became familiar with Oak Knoll in the early In Aarhus in the mid-1990s, after receiving his years of TEX when I was looking for some of the degree from the University of Copenhagen, he was books listed in the bibliography of Don Knuth’s teaching at and working with the Basic Research in 2 Gibbs lecture, “Mathematical Typography”. In ad- Computer Science (BRiCS) center; he would from dition to the (very few) publications devoted to math time to time visit with Kaja Christiansen and have composition, the shop is full of publications about a chat. Kaja reports: fonts, composition and printing, bibliography, book- We’d talk TEX, XY-pic, Debian or Emacs, or he binding, papermaking, fine press books, . . . . A most would sit down and read my copies of TUG- valuable resource for information on the history of boat. In 1997 we happened to talk about TUG; type and printing. the same year I decided to join the board at Bob Fleck also recognized an interest in con- TUG’97. temporary hand-set and artists’ books, and in 1996 TUG encouraged the founding of the Fine Press Book As- Kris joined the board at the same time, and 3 was elected Vice President for a term through 2001; sociation (FPBA). The biennial Oak Knoll Fest he remained on the board until 2003. In addition to comprises a symposium on book-related topics as his TUG participation, he was active in the Debian well as a book fair where book-makers, most of them open source and free software community. FPBA members, exhibit their creations and works Also in 1997, Kris moved with his family from in progress. The array of books and ephemera to be Denmark to France, taking a teaching position at seen is dizzying in its variety. the École Normale Supérieur (ENS) de Lyon, from The topic for this year’s symposium was the which position he was invited in 2000 by IBM to join question: what are the most important criteria for a the TJ Watson facility in New York as a Research private press when selecting texts to print? While Scientist. It was at this point that he left the TEX this matter is undoubtedly secondary for most TEX community, but continued to be active in Debian. In users, the opinions and experience of the participants 2013, while still at IBM, he joined the adjunct faculty were interesting and enlightening for any active or of New York University, where he taught compiler prospective book collector. construction. In 2014, he left IBM to become a For anyone who loves books and is in the Del- research scientist in the financial industry, at Two aware vicinity around the beginning of October (in Sigma Investments, while continuing to teach at NYU, even-numbered years; it alternates years with the and becoming more active as a Debian contributor. Oxford Book Fair, in the UK), attending the Fest is Late in 2015 he was diagnosed with a very aggressive a recommended activity. form of leukemia, which took his life on 17 September 2016. He was far too young. Another honor for Don Knuth: the SIAM John von Neumann Lecture A book fair...and another passing On 12 July 2016, the John von Neumann Lecture The first weekend in October, my husband and I prize was awarded to Don Knuth “for his transfor- attended the Oak Knoll Fest XIX in New Castle, Del- mative contributions to mathematics and computer 1 aware, hosted by Oak Knoll Press. (Some attendees science”. Knuth delivered the associated prize lecture, at the 2001 TUG meeting, held at the University “Satisfiability and Combinatorics” on that day to the of Delaware, may remember my recommendation to visit the bookshop.) This book fair is held every 2 other year, and I look forward to it eagerly. So it Bulletin of the American Mathematical Society (new series), 1:2, 337–372 (March 1979), https://www.ams.org/ surprised and saddened me to learn of the death, just bull/1979-01-02/S0273-0979-1979-14598-1; republished in Digital Typography, pp. 19–65. 1 http://www.oakknoll.com 3 http://fpba.com TUGboat, Volume 37 (2016), No. 3 257
Some typography links to follow On the illegibility of street signs in New York, in verse: http://flip.it/HLIMY
How typeface designers made room in the New York Times for President Eisenhower’s long last name: http://www.theatlantic.com/technology/archive/2016/06/ eisenhower-and-the-skinny-s/486965/
Selections from the blog of St Brigid Press, in the Blue Ridge Mountains of Virginia: How type is made, in two parts: http://www.stbrigidpress.net/blog/how-type-is-made-part-1 http://www.stbrigidpress.net/blog/how-type-is-made-part-2 A letterpress lexicon, in (so far) three parts: http://www.stbrigidpress.net/blog/a-letterpress-lexicon-part-1 http://www.stbrigidpress.net/blog/a-letterpress-lexicon-part-2 http://www.stbrigidpress.net/blog/a-letterpress-lexicon-part-three The blog itself: http://www.stbrigidpress.net/blog
Videos from Type@Cooper — Lectures presented in conjunction with the Cooper Union typeface design program, in New York and San Francisco: https://vimeo.com/coopertype/videos Donald Knuth, “32 Years of Metafont” (Type@CooperWest talk): https://www.youtube.com/watch?v=0LR_lBEy7qU Announcements of upcoming lectures: http://coopertype.org/
annual meeting of the Society for Industrial and Ap- Second annual Updike Prize plied Mathematics (SIAM) in Boston, Massachusetts. for student type design SIAM This is the highest honor awarded by ; “the flag- On October 17, safely outside of the winter storm ship lecture recognizes outstanding and distinguished season,4 the award ceremony for the second annual contributions to the field of applied mathematical Updike Prize for student type design was held at the sciences and the effective communication of these Providence Public Library. The invited speaker was ideas to the community.” Dr. Fiona Ross of the University of Reading. Four finalists were announced, and their entries A fitting memorial for Sebastian Rahtz were on exhibit, along with information about the sources they had consulted for inspiration. Here are The Text Encoding Initiative (TEI) has announced their names, and the names of their typefaces. the creation of the Rahtz Prize for TEI Ingenuity. • Ithaka The prize is described in part as follows: June Shin, (First Prize) • SooHee Cho, The Black Cat The TEI Consortium has created the Rahtz • Cem Eskinazi, Mond Prize for TEI Ingenuity in memory of Sebastian • Erik Text Rahtz (13 February 1955–15 March 2016). The Íñigo López Vázquez, award is intended to honour Sebastian’s major A brief announcement is at https://pplspcoll. technical and philosophical contributions to the wordpress.com/2016/10/20/congratulations-to- TEI, and to encourage TEI innovation by the june-shin-winner-of-the-2016-updike-prize/, TEI community. and includes several related links. 4 The full announcement can be read at http: Last year’s presentation, on 19 February 2015, was ac- companied by a fierce snowstorm. The event was reported //www.tei-c.org/Activities/rahtz.xml; nomi- in my column in TUGboat 36:1, http://tug.org/TUGboat/ nations for the first award are due 1 April 2017. tb36-1/tb112beet.pdf. 258 TUGboat, Volume 37 (2016), No. 3
Talk by Fiona Ross matches the expectations of the culture whose lan- Fiona Ross is on the faculty of the University of guage it will be used to exemplify. So it was possible, Reading, where she lectures on non-Latin typeface with the enhanced capabilities of the filmsetter, to design in the MA Typeface Design program, and ignore the limitations that had heretofore restricted is curator of the Non-Latin Type Collection. (She the font design. UK is also an Associate Designer for Tiro Typeworks, The Linotype company held a collection of the organization which is polishing version 2 of the manuscripts and printed materials in the relevant STIX fonts.) Her talk, on the occasion of the Updike script, as well as having a branch in India with per- Prize ceremony, entitled “Collections-based research sonnel willing to supply not only more examples, but for contemporary typeface design — with special ref- also the expertise of native language speakers. To- erence to non-Latin scripts”, dealt with the resources gether, these resources fulfilled the three criteria that necessary when designing fonts for languages in which are required for development of a new font (besides one is not a native speaker, and how to make most the efforts of a skilled designer): relevance, signif- effective use of them. icance, and reliability. For Bengali, the available Dr. Ross used the Bengali script as her main materials covered a broad period as well as a signifi- example. Bengali has a long history, longer even than cant variety of likely applications. The staff of the Latin, with the oldest representations being carved office in India were enthusiastic about the project, in stone, and more recent, though still old, examples allowing work on the new font to be a true team ven- produced with a broad-edge pen that has the writing ture. Despite Dr. Ross’ lack of native competency in edge slanted in the opposite direction from that of the Bengali, the ability to ask the right questions and broad-edge pen used for italic script. Although the attention to the opinions of those native speakers Bengali script is strongly alphabetic, the glyphs are resulted in a product that was readily adopted by based on consonant clusters, with vowels relegated the major Bengali newspapers, and even today, more almost to diacritic status. The order of written than thirty years later, it is still the predominant phonemes is not necessarily the same as how the font used by the newspapers. phonemes occur in the spoken word. Wide elements The image below was kindly provided by Dr. at the top or (less frequently) bottom traditionally Ross to illustrate this report. It says, in Hindi overlap what occurs next to them; the overlap can transliteration, “Typographic Design” in Adobe De- occur on either side. The setting of these features in vanagari Regular and Bold, designed by Tim Hol- type is strongly influenced by what is possible with loway, Fiona Ross, and John Hudson. the available technology. Dr. Ross’ studies in Sanskrit prepared her for her first assignment at Linotype (UK), where she undertook to redesign the Bengali font for use with a filmsetter. The existing Linotype Bengali font was designed for use on a hot-metal typesetter, which had no real ability to kern adjacent characters. With- out this ability, the only alternative would be to Every slide illustrating Dr. Ross’ talk included provide ligatures, which for Bengali would increase the Bengali letter “ka” (Unicode U+0995) as an icon. the number of glyphs to several hundred; with a An inquiry elicited the information that “ka” is auspi- physical capacity of only 90 characters at a time, cious; this is the first glyph that she designs in every the Linotype was incapable of accommodating this script. requirement. For this reason, many shapes were re- On 17 July 2016, Dr. Ross presented a lecture stricted to a width narrower than tradition would on a related topic at Typographics 2016, held at dictate. But the desire for printed material (India The Cooper Union in New York City. A video of is still devoted to reading the daily newspaper) was that talk can be viewed at https://www.youtube. stronger than the requirement for typography that com/watch?v=3_MbN_pBuy0. In her slides, starting embodied traditional elegance. at 3:29, the iconic Bengali “ka” can be seen, usually The design of a new font, even for a new technol- in the lower left-hand corner. ogy, should not be simply a clone of an existing font, even if it is meant to fill the same niche. Especially if a new technology provides possibilities that were ⋄ Barbara Beeton not available under previous technologies, the op- http://tug.org/TUGboat portunity should be taken to create something that tugboat (at) tug dot org TUGboat, Volume 37 (2016), No. 3 259
Interview: Federico Garcia-De Castro David Walden
Federico conducting a composition of his at the 2015 MusicArte Festival in Panama
Erin Gallagher Pesa from our childhood years. (That is, mine and my Federico Garcia-De Castro is a composer of music, brother’s; Nicol´asis two years younger, and now a German philologist; he writes amazing poetry on passionate for chess, and a lover of TEX. the side, and I have set a couple of his poems to Dave Walden, interviewer: Please tell me a bit chamber works.) In those childhood archives I found about yourself. a small slip of paper, which had, written clearly in a Federico Garcia-De Castro, interviewee: I was child’s handwriting, some 10 lines of a program — in born and raised in Bogota, Colombia. I was a pretty BASIC. This discovery, and some things it made us normal child, but I pursued a couple of interests from all remember, helped me, as an adult, understand an early age — I went to the conservatory for a couple a lot of my life in a new light. Whatever I did as years, before that conflicted with math Olympiad a child, whatever I pursued, whatever courses I en- training and I decided to do math. I’d return a rolled, I was always, and have always been, foremost couple of years later, as I remember out of curiosity a programmer. In the wide sense: what else is a and a vague remembrance that it (music) had actu- music score? No more and no less than a program — ally been interesting. Math still figured at the top, a series of instructions, written in a code (with its though, but then eventually I left math to devote my- own syntax that you have to learn, etc.), that will self to chess, which was my life pretty much between be executed. And then debugged. A musical work is 11 and 16. And, studying chess, I started listening not exactly analogous to an algorithm, but even so, to music (while studying openings, tactics, etc.), and what a composer does is programming. that’s when I got hooked on music. In the end, at My relationship with composition has always 16 I decided music — composition — was my thing. been tense (as probably anyone’s is — nothing special So my mom, who had been the one pushing there). When I came to the United States, for PhD for my early music training (and hated that I quit in composition at Pitt in 2001, I also “discovered” for math, and later hated much worse that I quit musicology, and I did much more musicology than math for chess!), ended up winning that one. The composition. From that time stems the motivation one who lost, however, was my uncle Rodrigo De for my first LATEX packages. Castro. A mathematician, uncle Luli was in Chicago DW for seven years before returning to Colombia in 1993, : Let’s talk about them later. when I was 15. He’s also a huge music aficionado FGDC: Then eventually between 2005 and 2009 I and connoisseur, and was the one who triggered my was really devoting myself to chess — in 2009 I won, teenage interest in music . . . always trusting that I amazingly, the Pittsburgh Chess Club championship clearly was going to be a mathematician. He’s most and the informal “state” tournament at Carlisle, PA. relevant here, however, because in 1993 he brought That’s where the TEXmate package stemmed from. TEX to Colombia. Soon after my graduation in 2006 I co-founded a Now, a digression for context: some four years contemporary music organization, which has since ago I was visiting Bogota, and went through some grown stronger and stronger. That meant for years notebooks and papers and things my mom had kept I flirted seriously with a career in conducting....
Interview: Federico Garcia-De Castro 260 TUGboat, Volume 37 (2016), No. 3
It’s like I always looked for something to do, something to be, other than a composer . . . . That’s why it was so important to me to understand, as men- tioned above, that I am mainly a programmer, and that my interest in composing is of the same nature. Composing, I’ve since also figured out, is just much harder and much scarier (among other things, you don’t have the luxury of constant feedback through test runs). But it is what I am, period.
DW : How did you first come in contact with TEX? FGDC: So in 1993 I ran into TEX. Then I only had an Atari 130 XE, which I got after months and months of pleading to my parents because I wanted finally to be able to program on a computer, not on slips of paper . . . (also, my parents couldn’t readily afford a computer right away, that was the reason for the wait). I had no PC to run TEX on in 1993, One of the LATEX books written by Federico’s uncle in but I have the vivid memory of being in a class in 2002; Federico prepared the PDF summary included in school and writing out the TEX document that would the CD. produce whatever the textbook we were looking at was. I’d write it on the left side of the notebook; on And then I met him, in Boston in 2012. A couple of the right, I’d calligraph out what would have been weeks ago (as of this writing) I had multiple beers TEX’s output. This was in 1993, just when I got to and chats with him in Toronto. know T X and was hooked enough that I had to do E DW : When you say that your uncle brought T X to it even on paper :) That summer a colleague of my E Colombia, do you mean to you personally or basically uncle hired me to typeset his math book. I remember to all Colombia? too the frustrating moments with ! Extra messages, FGDC and my uncle coming to my rescue (I worked at my : To all Colombia. He basically brought TEX uncle’s place — I did not have a PC!) when the tears with him when returning from his time in the US were starting to come. (PhD in math at Champaign Urbana). At around the same time T X was also brought into the community Back then, AMS-TEX was the thing. (In fact, E A centered on another person (I can’t remember his my uncle had brought with him the L TEX manual, A name), who was associated with the Math Olympiads. but he had never used L TEX and only vaguely told me what it was. I borrowed the book. I was the But my uncle brought it to the National University, A much more central in the math community. And then one who told my uncle (!) that L TEX was onto something . . . . ) The point is that, for me, names he immediately started writing booklets, manuals, like Spivak, Mittelbach, Rahtz, etc., were the same etc., that people needed in order to learn. I remember as names like Mozart, Beethoven, Brahms. he even did one on PiCTEX. And a full booklet for This last one with an h; Braams would also be- tables, which of course were a problematic subject A in T X. And so on. come like that when my uncle kept writing L TEX E manuals for Colombian (and Spanish-speaking) TEX DW : Is your uncle still alive and promoting TEX? users, with which I helped him. In 2002, I think, FGDC: He’s still active at the math department. A El Universo LTEX featured a CD with examples and Demand for TEX manuals declined once most peo- summaries — in PDF, done by me, with color syntax ple know how to use it and with the availability of highlighting and plenty of hyperlinks — a lot of fun everything online these days. But I’m sure copies of with \verb. Years and years later, when working se- that book are still sold every once in a while today. riously on my most complicated program (T Xmuse), E DW I looked back at this code, when I wanted to add : You mentioned TEXmate. What other things have you implemented in T X. (I know you have syntax highlighting to the LATEX docstrip system— E what eventually became the colordoc package. written about some of them.) In 2011, I think, Frank Mittelbach (Beethoven!) FGDC: Here’s a list: got in touch with me to include TEXmate in the • subfiles — an alternative to the \include second volume of the LATEX Graphics Companion. mechanism that allows the subsidiary
David Walden TUGboat, Volume 37 (2016), No. 3 261
documents to be typeset as stand-alone piano, then the masterpiece volume III for two pianos documents. and two percussionists, and finally one for amplified • todo — utilities to add a to-do list at the end piano four hands) is in my view among the highest of a document. creations of the human mind in any area. Crumb’s • texmate — comprehensive chess annotation. music is unmistakable, but in a very open way: it’s • opcit — support for footnote-style prolific in his influence on other composers (in the bibliographies in LATEX. 80s, for example, it swept through Latin America • colordoc — modification of the doc package and everyone was writing like him for a while, in the that provides syntax highlighting. good sense), unlike, for example, Messiaen’s, who sounds like Messiaen to the point that it came to be a And there’s TEXmuse, of course kind of dead end with no more to be explored there. DW : Yes, I have read your papers on TEXmuse: Berio’s Laborintus II is a piece that also fills On musical typesetting: Sonata for TEX and META- me with admiration. This coming spring (I can 1 FONT, Op. 2 , and TEX and music: An update on barely believe it), I am producing and conducting 2 TEXmuse . the Pittsburgh premiere of the piece (which is very I’d like to come back to TEXmuse. How about ambitious: 17 instruments, 8 actors/speakers, 3 solo 3 TEXcel, which you presented at TUG 2016 ? sopranos, narrator, and electronics) as part of a FGDC:TEXcel is a set of macros I developed this residency with Chicago-based vocal ensemble Quince. spring for financial tracking and reporting for my This has been more of a dream than a goal for me; contemporary music company. It was a fun project, until it became a possibility last year, it was simply a nice excuse to program (go back to hacking TEX), too unthinkable. with a clear and manageable goal. It is a complete Lutos lawski’s music is certainly my biggest in- and robust system, but it simply does what it does: fluence. I think the piano concerto is second only, helps in reporting financial information for my orga- maybe, to Beethoven’s Emperor. His cello concerto, nization. It is certainly the backbone of what conceiv- his third symphony, and his string quartet are tow- ably would be a more “public” and general purpose ering exemplars of each genre. His music is rela- package; and, inasmuch as it was a kind of discovery tively conservative in format (most of it for orches- (in the sense that who would have thought that TEX tra, which is a 19th-century instrument), if not in was more appropriate for this than a spreadsheet), its amazing content; and this has meant that he’s a it was an interesting presentation for the TUG meet- little less “sexy” than more fashionable contempora- ing. But I would not count it next to the packages neous names, notably Ligeti. But everyone agrees above that are meant for general use by general users Lutoslawski is a giant. without much further hacking. DW : On your website4, I see full scores5 for some DW : Let’s return to your composing. Is it possible of your compositions. How do you do your compos- to label the kind of music you write, and who are ing—musical instrument, music paper and pencil, your musical influences (in addition to your uncle)? instrument and music notation program, or directly FGDC : The genre is usually called “new music”. into a music notation program (e.g., TEXmuse)? But for someone who doesn’t already know what FGDC that means, it doesn’t mean much. Lately I’ve said : It really depends on the piece, the project, the kind of idea I’m struck by. I just finished a guitar “contemporary chamber music”. That gets it across. piece, that’s inspired by a Cuban trova song (Pedro I think Mahler and Beethoven are the greatest composers in history. At one point I was a devoted Luis Ferrer’s Romanza de la ni˜na mala). You can Bachian (I even published a scholarly article on his think of it almost as a translation into a new language Italian Concerto), but I have since matured, hehe. (in my piece, the guitar is tuned in microtones; and All that said, it is when I listen to Luciano in addition it has no lyrics, it’s just the guitar part). The process was: passage by passage, listen to the Berio, Witold Lutoslawski, and George Crumb that original, then find the right “translation” on my I remember why I am a composer. guitar; I’d then lock the left hand in position, so as DW : Might you give us an example of each of these to not lose the chord, and quickly scribble it down composers that is in any sense representative of their with my right hand on my notebook. But not all the compositions? Perhaps I can listen to them via details — those would be added simply when (next YouTube. step) I’d type the notes into the computer. On the FGDC: Crumb’s Makrokosmos series (the first one other hand, I’ve been composing a piece for six harps is for solo piano, then he wrote one for amplified placed around the audience; in this case I have no
Interview: Federico Garcia-De Castro 262 TUGboat, Volume 37 (2016), No. 3
were pursued in the belief that mechanical tasks are exactly what computers are for. In music, in par- ticular, pitch spelling (including transposition) and line breaking are areas that are largely mechanical but that have been left alone by music typesetting software. Among the two of them they consume the biggest (and unacceptably big) portion of a com- poser’s time these days . . . . It was this frustration that led me to think of TEX for music typesetting. And it was so high on my priority list that I tackled those two algorithms very early on: if they were not going to be possible, then the rest would not be worth it. Federico at the piano strings for his composition In recent times there have been advances. I Livre Pour Deux Pianos, August 2014, New Hazlett follow from a distance, but from what I have seen Theater Community Supported Art Performance MusicXML is very good, there are serious people do- Series, Pittsburgh, PA (photo by Renee Rosensteel) ing serious research on all of this. (I’m still not aware of anyone tackling the spelling problem, though.) It’s part of the reason why I haven’t continued working instrument to find chords on and the piece is really on TEXmuse (in addition to time, my “real” respon- about the surround effect, so exactly what notes I sibilities, etc.): that space is in a sense crowded write is really a minor point. For this there’s mainly a now, and crowded with good efforts. As a system, huge “research” stage that’s really about discovering and thinking of the user’s experience, TEX (sadly) is what the piece is about, and I am a long way away not really the most promising environment; I don’t from even knowing what the best notation will be see the whole musician community installing and for it — so the computer is useless at this point. deciphering TEX. The question, I think, touches on the relation- TEXmuse can still be a contribution at some ship between the notebook and the computer. Do point: as a front end to the other systems that have musicians have it all in their heads? Do they fig- been developing. At this point in TEXmuse,TEX ure it out on paper? Do they use the computer for takes the user’s input (and this is its strength) and it? All understandable questions, but in a way they from it, it makes METAFONT programs that produce are illusory: would you ask a novelist, or a scholar, the music. There’s no reason why TEXmuse’s in- whether they write first on paper and then type it put couldn’t be something other than METAFONT up? The answer in that case is not only obvious (for example, Lilypond, or MusicXML). In fact, this (take notes as needed on paper, but go ahead and is probably much much easier than programming use the computer for the actual text), but also not METAFONT automatically! very interesting. Well, I hate to say it, but writing DW : Please say something about Alia Musica6 and music doesn’t carry any more mystery about it than 7 writing words! the new music festival it sponsors, e.g., how and why were they founded, how does it help you (or DW : Please compare your TEXmuse music tran- the world) for you to spend time as artistic director scription with other programs, for example, Finale, and obviously doing lots of less artistic work to keep Sibelius, MusiXTEX, or Lilypond. them functioning? FGDC: The most important aspect and uniqueness FGDC: In the last 15 years or so (I lived here since in TEXmuse’s approach is that it is all about keeping 2001), Pittsburgh has been going through a major the act of typesetting music as close as writing it by cultural renaissance. Even when I got here the city hand as possible. In several respects: if you’re, say, was far from its infamous past as a dirty steel mid- in c-minor, you don’t write the flat next to each e, west town, and had already shifted to things like the even though you mean it (because that’s part of what health system (the biggest industry in Pittsburgh, being in c minor means). This is the major deficiency through the University of Pittsburgh Medical Cen- of Lilypond — a very complete system, but with a ter), high-tech research (mainly at Carnegie Mellon syntax and an approach so autonomous from the University) and eventually high-tech industry. But musician’s mind that it’s a chore more than a help. culturally it’s been a thing of the last decade or so. TEXmuse also features some algorithms that I founded Alia Musica with another 10 emerging
David Walden TUGboat, Volume 37 (2016), No. 3 263
composers in 2006–7. The main reason was that These are epic, unforgettable events — music there were really no professional outlets for the work at its most relevant, the proof, in fact, that music of young composers in the city, and in fact there was can still be relevant. I mean, who cares that the little visibility, little funding, and little interest. In a counterpoint is well crafted or that the pianist has word, we realized that since no one was playing our good technique? When you’re seeing (as in the third music we would have to do it ourselves. A lot has bullet point above) a symphony orchestra re-creating changed, and it’s continuing to change. Some things and elaborating on the sound of a low throat-singing lag behind (funding, media attention) but they’re note, with muted trombones and string glissandos, catching up. In any case, the contemporary chamber who cares really whether the tempo is correct? Who music scene is much larger, and not only in quan- cares, even, who the composer is? More and more titative terms. More and more young people (and in the mind of the general audience, Alia Musica is that includes, simply statistically, artists, and within the folks who bring these experiences to our lives. them musicians) are either moving in or (perhaps I should mention one more thing, namely, one of 12 more relevantly in a city with a long tradition of the young ensembles just founded, NAT 28 . I have excellent music performance schools) staying after been in touch with them in regards to my 10 years advanced studies. of professional activity as a composer in Pittsburgh. I was reflecting on this during an interview I did As part of the celebration, NAT 28 is going to devote for the new-music blog “I Care If You Listen” on the a full concert to my music this November. A “por- occasion of the 2016 edition of the Pittsburgh Festi- trait concert”, the dream of any composer. They are 8 val of New Music (PFNM), a production of mine and bright young musicians, recent graduates in perfor- of Alia Musica’s in May 2016. As I was saying, when mance, and beyond (or before) plans for this concert we started there wasn’t much devoted to cultivating I have had nothing to do with their formation. I the creation and appreciation of new music in the take this as a sign that the seeds planted by Alia city (and that’s why we started; and, by the way, we Musica (among many seeds planted by others as well) were not the only ones that started more or less at are in fact taking root and producing on their own. that same time). By contrast, at PFNM 2016 one Personally, it is also one more gift I get from Pitts- of the performances was a showcase of current new- burgh — like the right grant that I’ve gotten at the music activity in Pittsburgh, for which I had to select right time for the right new idea, effectively the mech- groups. I had “room” for seven, and I had to make anism by which I’ve stayed, year after year, and based a choice, and it wasn’t easy. New initiatives pop up, my career in what is an increasingly central city. some die, some endure, but the general sense is of vi- DW brant activity. Alia Musica itself has in a way grown : Thank you for taking the time to do this in- out of its original mission of performing Pittsburgh terview. You’ve mentioned a lot of new music I need composers; other younger initiatives have taken that to listen to. role. Alia Musica has been able now to shift its focus, [Interview completed 2016-08-17] from making an impact on the careers of emerging musicians, to making an impact on the actual life Links experience of its audiences. So, for example: • 1 http://tug.org/TUGboat/tb24-2/tb77garcia.pdf In 2014 we produced a piece that was written for 2 9 to 99 percussionists by Pulitzer Prize winner http://tug.org/TUGboat/tb33-2/tb104garcia.pdf 3 http://tug.org/TUGboat/Contents/contents37-2.html John Luther Adams; we gathered 67 percussion- 4 http://garciadecastro.net/composer ists at a park. 5 http://tinyurl.com/garciadecastroscores • We presented one of the most epic works of 6 http://aliamusicapittsburgh.org the 20th century, the variations for piano on 7 http://icareifyoulisten.com/2016/05/5-questions- The People United will Never Be Defeated, per- federico-garcia-de-castro-pittsburgh-new-music- formed by the composer himself, the legendary festival-artistic-director 8 http://pghnewmusic.com Frederic Rzewski, at a fish market! 9 • http://newmusicusa.org/projects/spring-2016-a-ken- In 2015 we were able to bring a residency with ueno-premiere-2 cutting-edge California composer/vocalist Ken 10 http://youtu.be/A_4nfxShyGM 9 Ueno to perform his own concerto for overtone/ 11 http://youtu.be/bz8OVFygnQA 10 throat-singing and orchestra (excerpt ). 12 http://www.nat28.org • As part of the May 2016 festival we produced a flashmob of Stravinsky’s Firebird11 at the cen- ⋄ David Walden tral Market Square in Pittsburgh. http://tug.org/interviews
Interview: Federico Garcia-De Castro 264 TUGboat, Volume 37 (2016), No. 3
A Typographers’ Inn X LE TEX Peter Flynn Back at the ranch, we have been experimenting with X LE ATEX in our workflow, spurred on by two recent Dashing it off requests to use a specific set of OpenType fonts for A I recently put up a new version of Formatting Infor- some GNU/Linux documentation. X LE TEX offers A mation (http://latex.silmaril.ie), and in the two major improvements on pdfLTEX: the use of section on punctuation I described the difference be- OpenType and TrueType fonts, and the handling of tween hyphens, en rules, em rules, and minus signs. UTF-8 multibyte characters. In particular I explained how to type a spaced Font packages. You can’t easily use the font pack- dash — like that, using ‘dash~---Ђlike’ to put a A ages you use with pdfLTEX because the default font tie before the dash and a normal space afterwards, encoding is EU1 in the fontspec package which is key so that if the dash occurred near a line-break, it to using OTF/TTF fonts, rather than the T1 or OT1 would never end up at the start of a line, only at A conventionally used in pdfLTEX. But late last year the end. I somehow managed to imply that a spaced Herbert Voß kindly posted a list of the OTF/TTF dash was preferable to an unspaced one (probably fonts distributed with TEX Live which have packages because it’s my personal preference, but certainly A of their own for use with X LE TEX [6]. not an absolute). comp.text.tex A The ensuing discussion on re- Table 1: List of font packages supporting X LE TEX vealed some curious inconsistencies. Petros Travioli (as of 25 Dec 2015) very kindly directed me at the Oxford Dictionaries some Accanthis with CMR web site at http://www.oxforddictionaries.com/ accanthis some with CMR words/punctuation#dash, which gives examples of Alegreya Alegreya an unspaced em-rule, but in the ‘Read more’ link AlegreyaSans some Alegreya Sans with CMSS on that page, we discovered that the examples are cabin some Cabin with CMSS actually spaced en-rules. This is the practise recom- caladea some Caladea with CMR mended by Wikipedia’s style guide, which says that carlito some Carlito with CMSS the em-rule is not spaced; and the APA style guide cinzel some Cinzel with CMR agrees with them [1, p 97]. Strunk & White use it ClearSans some Clear Sans with CMSS unspaced, but don’t actually mention it; but the As- ebgaramond some EB Garamond with CMR sociated Press style guide disagrees and says to use FiraMono some FiraMono with CMTT TUGboat \thinspace spaces, which is what does ( , FiraSans some Fira Sans with CMSS in fact). gillius some Gillius with CMSS So what authorities say they think is right, and gillius2 some Gillius2 with CMSS what publishers actually do, can be very different. I imfellEnglish some IM FELL English with CMR just picked up five books I read since the start of the libertine some Libertine with CMR year: librebaskerville some Libre Baskerville with CMR • Sansom, Ian (2012) Paper: An Elegy. Fourth librecaslon some Libre Caslon with CMR Estate (Harper Collins), London, 2012 (spaces LobsterTwo some Lobster Two with CMR around en rule). merriweather some with CMR • Wilson, Bee (2013) Consider The Fork. Penguin, Merriweather some with CMSS London (spaces around em rule). mintspirit Mint Spirit some with CMSS • Jones, Terry and Alan Ereira (2005) Mediaeval mintspirit2 Mint Spirit2 some with CMR Lives. BBC Books, London (spaces around PlayfairDisplay Playfair Display em rule). quattrocento some Quattrocento with CMR • Sayers, Dorothy (1942) The Nine Tailors. Victor raleway some Raleway with CMSS Gollancz, London (unspaced em rule). roboto some Roboto with CMSS • Banks, Iain M (2003) The Player of Games. sourcecodepro some SourceCodePro with CMTT Orbit (Macmillan), London (spaces around sourcesanspro some Source Sans Pro with CMSS en rule). sourceserifpro some Source Serif Pro with CMR I suspect that, as with many points of typographic universalis some Universalis with CMSS style, you should follow the conventions of your dis- cipline; but if you have free rein, choose whichever These packages, shown in Table 1, work with style you think best — but be consistent. the \usepackage command in the normal way. The
Peter Flynn TUGboat, Volume 37 (2016), No. 3 265
LATEX Font Catalogue has a separate page at http:// Table 3: Font names for using the Microsoft Windows A www.tug.dk/FontCatalogue/opentypefonts.html Core Fonts in X LE TEX for fonts with OpenType support. Andale Mono AndaleMono So what do you do about all those other font Arial Arial packages not yet adapted to detect that they are Arial Black Arial Black being used in X LE ATEX? Individual font specifi- Comic Sans MS Comic Sans MS A cation in X LE TEX is slightly different to that in Courier New CourierNew pdfLATEX: it requires the fontspec package. This pro- Georgia Georgia vides three commands which let you specify the three Impact Impact basic families expected by LATEX: \setmainfont, Times New Roman Times New Roman \setsansfont, and \setmonofont (there are also Trebuchet MS Trebuchet MS commands for loading individual fonts). The argu- Verdana Verdana ment is either a full fontname like Times New Roman Webdings or a font filename like Lato-Hairline.ttf, and this is where the fun starts, because both methods have For example, \setsansfont{Comic Sans MS}. advantages and disadvantages for ease of use and portability. use your system’s font cache to find a fontname. You Full fontnames. There are OTF/TTF replacements create the cache by running the command A for many of the pdfLTEX-oriented package fonts, sudo fc-cache -f -vv which can be loaded using the full font name, in- You can then use the fc-list command to list the cluding spaces. The TEX Gyre project has created a set of fonts which work with fontspec, equivalent to fonts it found (the second colon-separated field) and the old Adobe ‘35’ which have been a mainstay of use a filter like grep (1) to find the name you want. desktop publishing for many years (see Table 2). Font filenames. You can also load the font by file- name, providing the filetype (extension), location Table 2: Font names for equivalents of the Adobe PostScript ‘35’ fonts (path), and naming pattern for the font variants as options (see Figure 1). TeX Gyre Adventor Avant Garde TeX Gyre Bonum Bookman \setmainfont{Lato-Hairline}[Extension=.ttf, TeX Gyre Chorus Zapf Chancery Path=/usr/share/fonts/truetype/lato/, TeX Gyre Cursor Courier UprightFont=*, BoldItalicFont=*BoldItalic, TeX Gyre Heros Helvetica ItalicFont=*Italic, BoldFont=*Bold] TeX Gyre Pagella Palatino TeX Gyre Schola Century Schoolbook Figure 1: Loading a font by filename TeX Gyre Termes Times
For example, \setsansfont{TeX Gyre Adventor}. The naming pattern uses an asterisk to represent the filename you gave as the main argument to the If you need the Microsoft Windows Core Fonts command; so in the example, the italic variant would which come with most Windows and Mac systems be the file named Lato-HairlineItalic.ttf, but (available as RPM/DEB packages for GNU/Linux), you can add whatever punctuation (hyphens, spaces, the names are shown in Table 3. etc) your filenaming pattern requires. This method However, the downside with all the other OTF is probably better than the fontname if you know the or TTF fonts already installed on a computer is exact places and names of all your font files, because that the user may not know how to find out the you can tailor the command to suit your own setup. full fontname — it’s usually the one shown when you The disadvantage is that filenames can be differ- display the system font folder or pull down the font ent for the same font file across systems, so there is menu in a wordprocessor. The upside is that the less portability; but the advantage is that it’s usually full fontname is usually fairly clear and descriptive, easier to find filenames than to find full fontnames. and stays built into the font even if you change the However, you can also create a .fontspec file which filename. provides the mapping from filename to fontname, so On GNU/Linux systems, where there is no strict frequent users can make life much easier for them- rule about where such fonts get installed, you must selves.
Typographers’ Inn 266 TUGboat, Volume 37 (2016), No. 3
Logos But most likely, the designer wanted the lines to get Logotypes are typographic designs or glyph variants shorter so that they followed the curvature of the of more than one letter, but available as a single label. glyph (originally, cast as a single piece of metal type). SEMI-FIRM CHEESE in ATF Garamond is one example, and TEX is BEECH-SMOKED another. ON THE FARM The TEX and related logos work fine in Com- Three lines was probably too many, but I still think puter Modern, but in other faces the spacing needs they made a mistake putting vanity of the design adjustment, and this is tedious in the extreme when above the usability of the text. dealing with many fonts in several faces. There have been several articles on the problem of adjustments [4, 5], not least from Don Knuth [3]; but Karl Berry and Robin Fairbairns parameterised the macros for \TeX and other commands in the ltugboat document class, which were tuned for CM by Barbara Beeton, the redoubtable editor of TUGboat.
Table 4: Example adjustments to logo settings
Figure 2: Poorly-broken lines in a description
I have borrowed this code and extended it so References that you can specify the kerning either side of the [1] American Psychological Association. Publication letter E in T X and the letter A in LAT X, as well E E Manual of the American Psychological Association. as their vertical displacement and their scale. Three Technical report, APA, Washington, DC, Jan 2010. other arguments let you give the font name, font [2] Peter Flynn. Typographers’ Inn—Formatting series, and font shape, so that each combination can and centering. TUGboat, 33(1):8–9, Jan 2012. have its own set of adjustments. http://tug.org/TUGboat/tb33-1/tb103inn.pdf. I’ll upload a draft of the package (flexlogo) to [3] Donald E. Knuth. The TEX Logo in Various CTAN once I have a few buglets sorted out. Fonts. TUGboat, 7(2):101, Jan 1986. http: //tug.org/TUGboat/tb07-2/tb15knutlogo.pdf. A A Afterthought [4] Grzegorz Murzynowski. LTEX vs. LTEX—a TUGboat In this column in TUGboat 33:1 [2], I described the modification of the logo. , 29(1):180, Jan 2008. 17th European T X Conference problems raised by poorly-broken centered material, E (EuroBachoTEX), Bachotek, Poland. CSTUG, especially headings. Hardly a day goes by without GUST. http://tug.org/TUGboat/tb29-1/ me seeing another example, and Figure 2 shows the tb91murzynowski-logo.pdf. A label from a very fine cheese I brought as a gift to an [5] Jacek Rużyczka. texlogos.sty: LTEX package A elderly relative recently. She wanted to know what for LTEX logos. http://ctan.org/pkg/texlogos, a ‘cheese beech’ was. . . see Figure 2. Jan 2016. SEMI FIRM CHEESE BEECH [6] Herbert Voß. Re: XeLaTeX/biblatex - SMOKED ON THE FARM anything missing? comp.text.tex, Dec 2015. [email protected]. Maybe they prepared the text in Word and sent it to the designer, who followed it without question ⋄ Peter Flynn (which is unprofessional), or that the vendor has no Textual Therapy Division, clue, and the designer neither (which is not unusual, Silmaril Consultants Cork, Ireland alas). Would it have killed them to rearrange it? Phone: +353 86 824 5333 SEMI-FIRM CHEESE peter (at) silmaril dot ie BEECH-SMOKED ON THE FARM http://blogs.silmaril.ie/peter
Peter Flynn TUGboat, Volume 37 (2016), No. 3 267
LuaTEX version 1.0.0 2 The past Hans Hagen Originally we planned to release the first version a few years ago but our ambitions didn’t work out well with 1 The release that schedule so we finally took a decade to get there. For the record it is good to summarize what happened After some ten years of development and testing, on during those years. September 9, 2016, we released LuaT X 1.0.0! It E • Around 2005, after we talked a bit about extend- happened at the tenth meeting of the ConT Xt users E ing TEX in a flexible way and Hartmut added the and developers group in the Netherlands. Lua scripting language to pdfTEX as an experiment. Instead of staying below one and ending up with This add-on was inspired by the Lua extension to versions like 0.99.1234, we decided that the moment the SciTE editor that I (still) use. was there to show the TEX audience that LuaTEX is • At that time one could query counter registers and stable enough to lose its beta status. Although func- box dimensions and print strings to the TEX input tionality has evolved and sometimes been replaced, buffer. • we have been using LuaTEX ourselves in production The Oriental TEX project then made it possible to right from the start. Of course there are bugs and go forward and come up with a complete interface. for sure we will fix them. For this, Taco converted the code base from Pascal to C, a quite impressive effort. • We spent more than a year intensively discussing, testing and implementing the interface between TEX and Lua. Many binaries and lots of test code were flying between Taco and my machine as we pro- gressed and decided what directions to go. These were really interesting times. • In successive years we polished and extended things; in recent years, we cleaned up interfaces, polished more code, filled in gaps and reached the point where we were more or less satisfied. • The core is still traditional TEX, but has been ex- tended with pdfTEX protrusion and expansion (re- worked) and directional features from Aleph (cleaned Our main objective was and still is to provide a up). We did add some extensions (in ε-TEX fashion) variant of TEX that permits user extensions without but removed most of the ones that we inherited from the need to adapt the inner workings. We did add pdfTEX because Lua could do better. a few things here and there but they mostly relate • The backend and extension interfaces are now mostly to opening up the inner parts and/or the wish to separated and although we don’t expect to add more influence some hard-coded behaviour. Via Lua we backends, it makes the code somewhat cleaner be- managed to support modern functionality without cause all kinds of PDF-related issues are no longer mixed with front-end mechanisms. bloating the code or adding more and more depen- • dencies on foreign code. In the process a stable and The font subsystem is no longer limited to 8-bit fonts. It must be noted that for instance Open- flexible MetaPost library became part of the engine. Type support is done in Lua, which provides a lot of The functionality as present now will stay. We flexibility. This also serves as an example of exten- might open up some more parts, we will stepwise sibility. A small TEX core, independent of libraries, clean up the code base while staying as close as possi- was definitely an objective and it works out well. ble to the Knuthian original, we will try to document • The (rewritten but compatible) hyphenation machin- bits and pieces. We might also experiment a bit ery can use runtime loaded (and extended) patterns. with better isolation of the backend, and simplify There are a few extensions and of course one can some internals. For that we can use the experimental revert to Lua for more. version but if we diverge too much we may need to • Already at an early stage, hyphenation, ligaturing give that another name. and kerning were separated, which was one step We want to thank all those who have tested the in adding callbacks to nearly every stage in the betas and helped to make LuaT X better. typesetting process. E • Math supports wide (more than 8-bit) characters Hans Hagen too so that one can implement Unicode math easily. Hartmut Henkel The machinery has OpenType math code paths Taco Hoekwater because there are some fundamental differences with Luigi Scarso traditional TEX math fonts.
LuaTEX version 1.0.0 268 TUGboat, Volume 37 (2016), No. 3
• Although the kpse library is still the default inter- • So far we managed to avoid extensions beyond those face to the file system, all in- and output can be needed as part of the opening up. We stick close to controlled and intercepted, for instance for input Don Knuth’s concepts so that existing documenta- filtering or re-encoding on the fly. tion still conceptually applies. We keep our promise • The token scanner has been opened up so that one of not adding to the core. But, we might open up can write (simple) parsers. Experimental intercep- (make configurable) some of the remaining hard- tion code didn’t prove to be useful so that interface coded properties. has been dropped. We kept it simple and efficient. • Some node lists could use a bit of (non-critical) • During callbacks related to the node lists, individual cleanup, for instance passive nodes, localpar nodes, nodes can be accessed and manipulated at will. Of and other leftovers. Maybe we should add missing course one needs to know a bit about the internals left/right skips. and not mess up the lists to the extent that TEX • We can optimize some callback resolution (more will choke on it: things that ‘can’t happen’ now direct) so that we can gain a little performance. can. Most of the original documentation of the • Inheritance of attributes needs checking and maybe code by Don Knuth still applies (which was another we need to permit some more explicit settings. objective) but of course directional support and such • We will move some more code to the API file and go beyond that. And it’s surprisingly fast. plan to update the global PDF and Lua states con- • Images and reusable boxes are now native nodes; sistently (there are some leftovers from the early they travel through the system as special kinds of days). Some C macros can probably go away. rules instead of whatsits with dimensions. Users • We can possibly minimize some return values of can define their own rule types too. Lua functions and only return nil when we expect There is more to say but much has been reported multiple calls in line. This might be more efficient. already in articles in this and other journals. In the Con- We plan to look into Lua 5.3 but we might well TEXt distribution there are four documents describing conclude that it’s better to stick to 5.2. aspects of the development and choices we have made • We have to figure out a way to deal with literals in (mkiv.pdf, hybrid.pdf, about.pdf and still.pdf) and virtual characters. This relates to font switching in we keep writing (onandon.pdf). One thing will hopefully the result. be clear by now: the choice of Lua was a good one. • Maybe we will reorganize some code so that docu- 3 The future mentation is easier. We hope to continue to stick close to what Don Knuth documents. The project is driven by ConT Xt users and ConT Xt E E • We can clean up and isolate the backend a bit more. development which is why we found it proper to release We also could add a few more options to delegate version one at the tenth meeting. Right from the start actions to Lua and we should get rid of some historic ConT Xt supported LuaT X and this means that most E E PDF artifacts. mechanisms have been tested in production. There is some risk in this as users then are always forced to Of course we have some ideas of what to do next but these don’t need an extension to the engine because update the binary with the macros but the ConTEXt garden provides easy ways to deal with this. In fact, we can use Lua for that. most users switched to the new engine pretty soon after In that perspective it is tempting to think of a (lean and mean) LuaT X variant for ConT Xt: a close to we started rewriting ConTEXt. We greatly appreciate E E their patience. traditional core with many hooks and a minimal number of dependencies on libraries and such. In a ConT Xt setup Raw performance of LuaTEX is of course less than E a only user needs LuaT X because all (workflow) related 8-bit pdfTEX but in practice and on modern machines E scripts are written in Lua and if additional functionality LuaTEX behaves well. In fact, many mechanisms, like native XML handling and MetaPost processing are way (like graphic conversions) is needed, it can easily be provided by external programs. faster in ConTEXt MkIV then in the now frozen MkII version. Given the fact that we’re using Unicode and We will not touch the stable version unless it con- more complex fonts, one can safely assume that in Con- cerns bug fixes and/or simple extensions, but we will keep exposing ConT Xt users to the experimental branch TEXt the overhead due to delegation to Lua has no real E drawbacks. (as we do now). Of course users of other macro packages We will continue development, but functionality can pick up binaries from the compile farm that has been will stay stable within versions. The code will be further set up by Mojca and friends. streamlined and documented. We deliberately postponed So . . . be prepared. some cleanup till after version one. And of course bugs ⋄ will be fixed. We hope to stepwise improve the manual Hans Hagen too. So what will the future bring? Pragma ADE http://pragma-ade.com
Hans Hagen TUGboat, Volume 37 (2016), No. 3 269
LuaTEX 0.82 OpenType math enhancements 2. When positioning limits on an N-ary operator (e.g., integral sign), the horizontal position of Hans Hagen the upper limit is moved to the right by half of Abstract the italic correction, while the position of the lower limit is moved to the left by the same LuaT X 0.82 (and later) have had improvements in E distance. OpenType math typesetting. 3. When positioning superscripts and subscripts, 1 Introduction their default horizontal positions are also differ- ent by the amount of the italic correction of the When TEX typesets mathematics it makes some as- sumptions about the properties of fonts and dimen- preceding glyph. sions of glyphs. Due to practical limitations in the And, with respect to kerning: traditional eight-bit fonts, such as the number of 4. Set the default horizontal position for the su- available characters in a font and a limited number perscript as shifted relative to the position of of heights and depths, some juggling takes place. the subscript by the italic correction of the base For instance, TEX sometimes uses dimensions as a glyph. signal to treat some characters as special. This is not a problem as long as one knows how to make I must admit that when the first implementa- a font and in practice that was done by looking at tion showed up, my natural reaction to unexpected the properties of Computer Modern to implement behaviour was just to compensate for it. One such so- similar shapes. After all, there are not that many lution was simply not to pass the italic correction to math fonts around and basically there is only one the engine and deal with it in Lua. In practice, that engine that can deal with them properly. didn’t work well for all cases; one reason was that the engine saw the combination of old fonts as a new one However, when Microsoft set the standard for 2 OpenType math fonts it also steered the direction and followed a mixed code path. Another approach of their use in rendering mathematics. This means I tried was a mix of manipulated italic values and Lua, but finally, as specifications settled I decided that the LuaTEX engine, which handles OpenType fonts, has to implement some alternative code paths. to leave it to the engine completely, if only because At the start, this involved a bit of gambling because successive versions of LuaTEX behaved much better. there was no real specification; since then we now So, as we were closing in on the first stable re- have a better picture. One of the more complex lease of LuaTEX (1.0.0 was released on September 27, changes that took place is in the way italic correction 2016; this note was mostly written in the early part is applied. A dirty way out of this dilemma would be of 2016), I decided to fix the pending issues and sat to turn the math fonts into virtual ones that match down to look at the math-related code. I must admit that I had never looked in depth into that part of traditional TEX properties, but this would not be a nice solution. the machinery. In the next sections I will discuss It must be noted that in the process of imple- some of the outcomes of this exercise. menting support for the new fonts, Taco (Hoekwater) I will also discuss some extensions that have been turned some noad types (see below) into a generic on the agenda for years. They are rather generic noad with a subtype. This simplified the transition. and handy, but I must also admit that the MkIV At the same time, a lot of detailed control was added code related to math has so many options to control in the way successive characters are spaced. rendering that I’m not sure if they will ever be used in ConT Xt. Nevertheless, these generic extensions In LuaTEX before 0.85, the italic correction was E always added when a character got boxed (a fre- fit well into the set of basic features of LuaTEX. quently used preparation in the math builder). Now 2 Italic correction this is only done for the traditional fonts because, concerning italic correction, the OpenType standard As stated above, the normal code path included states:1 italic correction in all the math boxes made. This 1. When a run of slanted characters is followed by meant that, in some places, the correction had to a straight character (such as an operator or a be removed and/or moved to another place in the delimiter), the italic correction of the last glyph chain. This is a natural side effect of the fact that is added to its advance width. TEX runs over the intermediate list of math nodes
1 2 Recently version 1.8 has been published on the Microsoft ConTEXt employed Unicode math right from the start website. of LuaTEX.
LuaTEX 0.82 OpenType math enhancements 270 TUGboat, Volume 37 (2016), No. 3
H__2 H__2 H__2 H__2 H__2 H__2 H__2 H__2 H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ ∫ ∫2 ∫2 푓 푓H__2 푓2 ∫ ∫ ∫ 푓 H__푓2 푓 H__ H____V H____V H__2 __VH__2 __VH__2 Figure 1: Italic correction examples (1): cambria
superscripts shifted right and subscripts left. H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H____V H____V H__2 H__2 H__2 H__2 H__∫ H__∫ H__∫ H__∫ H__∫ H__∫ 2 2pagella H__2 H____V2 H__2 H____V2 2 2 H__2 H__2 2 2 H__2 2 H__2 Figure 2: Italic correction examples (2): H__∫ H__∫ H__∫ H__푓 H__푓 H__푓 ∫ ∫ ∫ 푓 푓H__2 푓2 plain integral vs. integral with limits H__2 H____V2 H____V latin modern 2 2 (noads) and turns them into regular nodes, mostly H__ H__ H__2 H__2 H__ H__ H__ H__푓 H__푓2 H__푓 glyphs, kerns, glue and boxes. ∫ ∫H__2 ∫H____V2 H__ H____V2 The complication is not so much the italic cor- lucida ot rections themselves, because we could just continue Figure 3: Italic correction examples (3): to do the same, but the fact that these corrections correction amounts are font-dependent. are to be interpreted differently in case of integrals. There, the problem is that we have to (kind of) look \Udelimiter "0 "0 "222B \Uright .}} backward at what is done in order to determine what \def\evenbiggerint{\mathop{ italic corrections are to be applied. \Uleft height 6ex depth 6ex axis The original solution was to keep track of the \Udelimiter "0 "0 "222B \Uright .}} applied correction via variables but that still made The axis keyword will apply a shift up over the some analysis necessary. In the new implementation, size of the current styles math axis. We use this in more information is stored in the processed noads. some examples as: This is a logical choice given that we have already added other information. It also makes it possible to $ \displaystyle\standardint ^a_b\enspace fix cases that will (for sure) show up in the future. \displaystyle\wrappedint ^a_b\enspace In figure 1 we show two examples of inline italic \displaystyle\biggerint ^a_b\enspace correction. The superscripts are shifted to the right \displaystyle\evenbiggerint^a_b\enspace and the subscripts to the left. In the case of an $ integral sign, we need to move half the correction. In figure 4 you can see some subtle differences. This is triggered by the \nolimits primitive. In fig- The wrapped version doesn’t shift the superscript ure 2 we show the difference between just an integral and subscript. The reason is that the operator is character and one tagged as having limits.3 hidden in its own wrapper and the scripts attach The amount of correction, if present at all, de- at an outer level. So, unless we start analyzing the pends on the font, and in this document we use innermost noad and apply that to the outer, we DejaVu math. Figure 3 shows a few variants. As cannot know the shift. Such analyzing is asking you can see, the amount of correction is highly font for problems: where do we stop and what slight dependent. variations do we take into account? It’s better to be 3 Vertical delimiters predictable. Another observation is that Latin Modern does When we go into display math, there is a good chance not provide (at least not yet) large integrals at all. that an integral has to be enlarged. The integral The following four cases are equivalent: sign in Unicode has slot 0x222B, so we can define a bigger one as follows: \Uleft height 3ex depth 3ex axis \Udelimiter "0 "0 "222B \def\standardint{\Umathchar "1 "0 "222B } \Uright . \def\wrappedint{\mathop{\Umathchar "1 "0 "222B}} \def\biggerint{\mathop{ \Uleft . \Uleft height3ex depth3ex axis \Uright height 3ex depth 3ex axis 3 \Udelimiter "0 "0 "222B We show some boxes so that you can get an idea what TEX is doing. Essentially, TEX puts superscripts and sub- scripts on top of each other with some kern in between and \Uleft . then corrects the dimensions. \Umiddle height 3ex depth 3ex axis
Hans Hagen TUGboat, Volume 37 (2016), No. 3 271
H__ 푎 H__ H__ 푎 H__ 푎
H__ H__ 푎 H__ 푎 H__ H__ 푎 푎 푎 H__ H__ H__ H__ H__ H__ 푎 H__ 푎 H__ H__ ⌠ H__ 푎 H__ 푎 H__ H__⎮ H__ H__ H__ ∫ H__ ⎮ H__ H__⎮H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__ H__⌠ H__⎮ H__⎮ H__ H__ H__ __V ⎮ ⎮ __V ⌠ ∫ ∫ ∫ ∫ ∫ __V∫ H__ ∫ ∫ ∫ H__⎮ __V ⎮ ⎮ H____V푏 __VH__ 푏 H__ H__ H____V H__ ⎮ H____V __VH__ H____V푏 __VH__ 푏 ⎮ 푏 H__ 푏 H____V 푏 __VH__ 푏 H____V ⎮ H____V ⎮ __V ⌡푏 H__⎮ H____V H____V⎮ H____V⎮ ⎮ 푏 __VH__ 푏 H____V H____V H____V ∫ ⎮ H____V⌡푏
Figure 4: Comparison of integral⌡ variants (standard, wrapped, bigger, even bigger) among fonts: TEX Gyre Pagella, Cambria, Latin Modern, and Lucida OT.
⌠ ⌠ ⌠ ⌠ ⌠ ⌠ ⌠ ⌠ ⌠ ⎮ ⎮ ⎮ ⎮ ⌠ ⌠ ⌠ ⎮ ⎮ ⎮ ⎮ ⌠ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⌠ ⎮ ⎮ ∫ ∫ ∫ ⎮ ⎮ ∫ ∫ ∫ ∫ ∫ ∫ ⎮ ⎮ ∫ ∫ ∫ ⌠ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ∫ ∫ ⎮ ⎮ ∫ ⎮ ⎮ ⎮ ⌡ ⎮ ⌡ ⎮ ⌡ ⎮ ⌡ ⎮ ⎮ ∫ ∫ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⎮ ⌡ ⌡ ⌡ ⌡ ⌡ ⎮ ⎮ ⎮ ⎮ ⌡ ⎮ ⌡ ⎮ ⎮ Figure 7: Cambriaaxis integrals, exact with dimensions. axis exact ⌡ Figure 5: Cambria⌡ integrals, adaptive; axis left,⌡ ⌡ noaxis right. noaxis
⎛ ⎛ ⎛ ⎛ ⎛ ⎛ ⎛ ⎛ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ( ⎜ ( ( ձ ⎜ ( ⎜ ( ( ձ ⎜ ⎛ ( ձ ⎜ ⎜ ⎜ ( ձ ⎜ ⎜ ⎜ ⎛ ⎛ ⎛ ⎜ ⎜ ⎜ ⎜ ⎛ ⎜ ⎜ ⎝ ⎜ ⎝ ⎜ ⎛ ⎜ ⎜ ⎜ ⎝ ⎜ ⎝ ⎛ ⎜ ⎜ ( ձ ঈ ⎜ ( ⎜ ⎜ ⎜ ⎝ ⎝ ⎜ ⎜ ⎜ ( ( ⎜ ⎜ ⎝ ⎝ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ ⎜ Figure 8: Cambriaaxis left parenthesis, exact with dimensions. axis exact ⎝ ⎜ ⎜ ⎜ ⎝ ⎝ Figure 6: Cambria left⎝ parenthesis, adaptive; ⎝ ⎝ ⎝ axis left, noaxis right. for such symbols. The keyword exact will correct noaxis the dimensions when no exact match is made, and this can be the case as long as we use the stepwise \Udelimiter "0 "0 "222B larger glyphs and before we end up using the com- \Uright . posed shapes. When no dimensions are specified, the normal construction takes place and the only key- \Uleft . \Umiddle height 3ex depth 3ex axis word that can be used then is noaxis which keeps \Udelimiter "0 "0 "222B the axis out of the calculations. After about a week \Uright . of experimenting and exploring options, this combi- nation made most sense, read: no fuzzy heuristics However, because this all looks a bit clumsy, we but predictable behaviour. After all, one might need now provide a new primitive: different solutions for different fonts or circumstances \Uvextensible and the applied logic (and expectations) can (and height dimension h i will, for sure) differ per macro package. Figures 5–8 depth hdimensioni show some examples. [no]axis exact hdelimiteri 4 Horizontal delimiters The symbol to be constructed will have size Horizontal extenders also have some new options. Al- height plus depth. When an axis is specified, the though one can achieve similar results with macros, symbol will be shifted up, which is normally the case the following might look a bit more natural. Also,
LuaTEX 0.82 OpenType math enhancements 272 TUGboat, Volume 37 (2016), No. 3
(default) ∑̸ 800 ∑̸900∑ ̸1000 ∑̸1100 ∑̸1200 ∑̸1300 ∑̸1400 ∑̸1500 xits – has variants left ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ middle ↔ ↔ ↔ ↔ ↔ ↔ ↔ cambria – lacks variants ↔ ↔ ↔ ↔ ↔ ↔ ↔ ∑̸ 800 ∑̸ 900 ∑̸ 1000 ∑̸ 1100 ∑̸ 1200 ∑̸ 1300 ∑̸ 1400 ∑̸ 1500 right ↔ ↔ ↔ ↔ ↔ ↔ ↔ ̸∑800 ̸∑900 ̸∑1000 ̸∑1100 ̸∑1200 ̸∑1300 ̸∑1400 ̸∑1500 ↔ ↔ ↔ ↔ ↔ ↔ ↔ pagella – lacks variants Figure 9↔: Stepwise↔ ↔ ↔ wider↔ ↔\Uhextensible↔ with options (Cambria).↔ ↔ ↔ ↔ ↔ ↔ ↔ Figure 11: Using overlay in \Umathaccent.
(default) ! ! ! ! ! ! ! ! ! ! When no dimension is given the keywords are ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ! ! ! ! ! ! ! ! ! ! ignored as it makes no sense to mess with the exten- ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ! ! ! ! ! ! ! ! ! ! sible in that case. left ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ! ! ! ! ! ! ! ! ! ! 5 Accents ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ! ! ! ! ! ! ! ! ! ! middle ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ Many years ago, I observed that overlaying charac- ! ! ! ! ! ! ! ! ! ! ters (which happens when we negate an operator ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ right ! ! ! ! ! ! ! ! ! ! which has no composed negation glyph) didn’t al- ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ways give nice results and, therefore, a tracker item ! ! ! ! ! ! ! ! ! ! ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ ↔ was created. When going over the todo list, I ran Figure 10: Stepwise wider \Udelimiterunder with across a suggested patch by Khaled Hosny that added options (Cambria). an overlay accent type. As the suggested solution fits in with the other extensions, a variant has been implemented. some properties are lost once the delimiter is con- The results definitely depend on the quality and structed, so macros can become complex when trying completeness of the font, so here we will use XITS. to determine the original dimensions involved. The placement of an overlay also depends on the We start with the new \Uhextensible primitive top accent shift as specified in the font for the used that accepts a dimension. It’s just a variant of the glyph. Instead of a fixed criterion for trying to find over and under delimiters with no content part. the best match, an additional fraction (numerator) \Uvextensible parameter can be specified. A value of 800 means height hdimensioni that the target width is 800/1000. depth hdimensioni The \Umathaccent command now has the fol- left | middle | right lowing syntax: hfamilyi \Umathaccent hsloti [top | bottom | overlay] So for example you can say: [fixed] [fraction hnumberi] $\Uhextensible width 30pt 0 "2194$ hdelimiteri The left, middle and right keywords are only {hcontenti} interpreted when the requested size can’t be met When we have an overlay, the fraction concerns due to stepwise larger glyph selection (i.e., before we the height; otherwise it concerns the width of the start using arbitrary sizes made of snippets). Figure 9 nucleus. In both cases, it is only applied when search- shows what we get when we step from 2–20 points ing for stepwise larger glyphs, as extensibles are not by increments of 2 points in Cambria. influenced. An example of a specification is: The dimensions and options can also be given \Umathaccent to the four primitives: overlay "0 "0 "0338 \Uoverdelimiter \Uunderdelimiter fraction 950 \Udelimiterover \Udelimiterunder {\Umathchar"1"0"2211} Figure 10 shows what happens when the delimiter is Figure 11 shows what we get when we use dif- smaller than requested. The source for the samples ferent fractions (from 800 up to 1500 with a step of looks like this: 100). We see that \overlay is not always useful. $\Udelimiterunder width 1pt 0 "2194 Normally you can forget about the factor be- {\hbox{\strut !}} cause overlays make most sense for inline math, which
Hans Hagen TUGboat, Volume 37 (2016), No. 3 273
푎 1 푎 1 푥 + /푏 + 푥 푥 + /2 + 푥 푥 + ( /푏) + 푥 푥 + ( /2) + 푥 푎 1 푎 1 exact 푥 + /푏 + 푥 푥 + /2 + 푥 푥 + ( /푏) + 푥 푥 + ( /2) + 푥 noaxis 푥 + 푎/푏 + 푥 푥 + 1/2 + 푥 푥 + (푎/푏) + 푥 푥 + (1/2) + 푥 exactnoaxis 푥 + 푎/푏 + 푥 푥 + 1/2 + 푥 푥 + (푎/푏) + 푥 푥 + (1/2) + 푥
Figure 12: Skewed fraction results in Latin Modern.
uses relatively small glyphs, so we can get 푥̸ x̸ xxx̸ This looks quite consistent: with the following code: 푎 푎 푎 푎 푎 $\Umathaccent overlay "0 "0 "0338 {x}$ 푥 + ( ) 푥 + ( ) 푥 + ( ) 푥 + ( ) 푥 + ( ) $\Umathaccent overlay "0 "0 "0338 {\tf x}$ 푏 푏 푏 푏 푏 $\Umathaccent overlay "0 "0 "0338 {\tf xxx}$ 1pt 2pt 3pt 4pt 5pt A normal accent can also be influenced by fraction: ⏞ ⏞ ⏞ ⏞ ⏞⏞⏞ Here we use code like: 푎 × 푏 푎 × 푏 푎 × 푏 푎 × 푏 푎 × 푏 $\displaystyle x + {{a} \abovewithdelims() exact 2pt {b}}$ 6 Fractions Using struts, it is best to zero the gap: A normal fraction has a reasonable thick rule but as 푎 푎 푎 푎 푎 soon as you make it bigger you will notice a peculiar 푥 + ( ) 푥 + ( ) 푥 + ( ) 푥 + ( ) 푥 + ( ) effect: 푏 푏 푏 푏 푏 1pt 2pt 3pt 4pt 5pt 푎 푎 푎 푎 푎 푥 + ( ) 푥 + ( ) 푥 + ( ) 푥 + ( ) 푥 + ( ) Here we use code like: 푏 푏 푏 푏 푏 $\displaystyle x + {{\strut a} \abovewithdelims() 1pt 2pt 3pt 4pt 5pt exact 2pt {\strut b}}$
Such a fraction is specified as: 7 Skewed fractions x + { {a} \abovewithdelims () 5pt {b} } The math parameter table contains values specify- ing horizontal and vertical gaps for skewed fractions. A new keyword exact avoids the excessive spacing: Some guessing is needed in order to implement some- x + { {a} \abovewithdelims () exact 5pt {b} } thing that uses them, so we now provide a primitive Now we get: similar to the other fraction related ones but with a few options that one can use to influence the render- ing. Of course, a user can mess around directly 푎 푎 푎 푎 푎 푥 + ( ) 푥 + ( ) 푥 + ( ) 푥 + ( ) 푥 + ( ) with the parameters \Umathskewedfractionhgap 푏 푏 푏 푏 푏 and \Umathskewedfractionvgap. 1pt 2pt 3pt 4pt 5pt The syntax used here is: { {1} \Uskewed / options {2} } One way to get consistent spacing in such frac- h i { {1} \Uskewedwithdelims / () hoptionsi {2} } tions is to use struts: The options can be noaxis and exact, a com- x + { {\strut a} \abovewithdelims () exact 5pt bination of them or just nothing. By default we add {\strut b} } half the axis to the shifts and also by default we Now we get: zero the width of the middle character. For Latin Modern, the results are shown in figure 12. 푎 푎 푎 푎 푎 푥 + ( ) 푥 + ( ) 푥 + ( ) 푥 + ( ) 푥 + ( ) 8 Side effects 푏 푏 푏 푏 푏 Not all bugs reported as such are really bugs. Here 1pt 2pt 3pt 4pt 5pt is one that came from a misunderstanding: In Eijk- hout’s T X by Topic, the rules for handling styles in Yet another way to increase the distance be- E scripts are described as follows: tween the rule and text a bit is: • In any style superscripts and subscripts are \Umathfractionnumvgap \displaystyle4pt taken from the next smaller style. Exception: \Umathfractiondenomvgap\displaystyle4pt in display style they are taken in script style.
LuaTEX 0.82 OpenType math enhancements 274 TUGboat, Volume 37 (2016), No. 3
• Subscripts are always in the cramped variant of mode down up the style; superscripts are only cramped if the + 2 0 dynamic dynamic CH2 + CH2 + CH2 original style was cramped. + 2 1 푑 푢 CH2 + CH2 + CH2 • In an ..\over.. formula in any style the nu- 2 푠 푢 CH + CH+ + CH2 merator and denominator are taken from the 2 2 2 + 2 next smaller style. 3 푠 푢 + 푠 − 푑 CH2 + CH2 + CH2 • + 2 The denominator is always in cramped style; 4 푑 + (푠 − 푑)/2 푢 + (푠 − 푑)/2 CH2 + CH2 + CH2 the numerator is only in cramped style if the + 2 5 푑 푢 + 푠 − 푑 CH2 + CH2 + CH2 original style was cramped. CH + CH+ + CH2 CH + CH+ + CH2 CH + CH+ + CH2 • Formulas under a \sqrt or \overline are in 2 2 2 2 2 2 2 2 2 cramped style. 0 1 2 CH + CH+ + CH2 CH + CH+ + CH2 CH + CH+ + CH2 In LuaTEX, one can set the styles in more detail, 2 2 2 2 2 2 2 2 2 which means that you sometimes have to set both 3 4 5 normal and cramped styles to get the effect you want. Figure 13: The effect of setting \mathscriptsmode. If we force styles in the script using \scriptstyle and \crampedscriptstyle we get the following (all render the same): 9 Fixed scripts 푏푥=푥푥 default 푥=푥푥 We have three parameters that are used for anchoring 푏푥=푥푥 script 푥=푥푥 superscripts and subscripts, alone or in combinations. 푏푥=푥푥 crampedscript 푥=푥푥 d \Umathsubshiftdown u \Umathsupshiftup This is coded as follows: s \Umathsubsupshiftdown $b_{x=xx}^{x=xx}$ When we set \mathscriptsmode to a value other $b_{\scriptstyle x=xx}^{\scriptstyle x=xx}$ $b_{\crampedscriptstyle x=xx} than zero, these are used for calculating fixed po- ^{\crampedscriptstyle x=xx}$ sitions. This is something that is needed in, for instance, chemical equations. You can manipulate Now we set the following parameters: the mentioned variables to achieve different effects, \Umathordrelspacing\scriptstyle=30mu and the specifications are shown in figure 13, with \Umathordordspacing\scriptstyle=30mu enlarged examples below the table. This gives: 푏푥 =푥 푥 10 Remark default 푥=푥푥 푏푥 =푥 푥 script 푥 =푥 푥 The changes that we have made are hopefully not 푏푥=푥푥 too intrusive. Instead of extending existing com- crampedscript 푥=푥푥 mands, new ones were introduced so that compati- Since the result is not what is expected (vis- bility should not be a significant problem. To some ually), we should say: extent, these extensions violate the principle that \Umathordrelspacing\scriptstyle=30mu extensions should be done in Lua, but TEX being \Umathordordspacing\scriptstyle=30mu a math renderer and OpenType replacing old font \Umathordrelspacing\crampedscriptstyle=30mu technology, we felt that we should make an exception \Umathordordspacing\crampedscriptstyle=30mu here. Hopefully, not too many bugs were introduced. Now we get: 푏푥 =푥 푥 ⋄ Hans Hagen default 푥 =푥 푥 푏푥 =푥 푥 Pragma ADE script 푥 =푥 푥 http://pragma-ade.com 푏푥 =푥 푥 crampedscript 푥 =푥 푥
Hans Hagen TUGboat, Volume 37 (2016), No. 3 275
Introducing LaTeX Base compiled to LLVM bytecode using clang and from LLVM to JavaScript using Emscripten. Gareth Aye Whereas similar services send users’ documents A LaTeX Base (https://latexbase.com) is a web- to servers with installed LTEX compilers and pack- based LATEX editor that provides many useful fea- ages, LaTeX Base sends the compiler and packages tures such as to the browser. In addition to making offline mode possible, compiling in the browser also allows LaTeX • live, compile-as-you-type document preview, • Base to compile documents quickly and often — so one-click document publishing and sharing, much so that we can offer a real-time preview instead • offline mode, of requiring the user to compile manually. • integrations with file storage services like Google Drive and Dropbox, 3 Packages • syntax highlighting, Our design goal when considering the issue of pack- • and familiar keyboard shortcuts for Vim and ages was to make a large number of packages (eventu- Emacs users. ally anything hosted on the CTAN registry) available This article focuses on the technical side of the inter- to users while only ever downloading the packages actions between LaTeX Base and LATEX. However, needed to compile their documents. What we came we’re eager to hear from users about their experi- up with is lazy package loading. Every time you ences using the service; please feel free to reach out include a new package in a document with LaTeX to us at [email protected] with suggestions or if Base, you’ll download it from our servers. When you you’d like to beta test new features. Many features use that package in the future it’ll be cached in your do require a premium membership. browser. For this reason, using packages that a user Figure 1 shows the first page presented after hasn’t previously used while offline will not work. loading, with simple LaTeX source on the left and You can also expect compiling to take slightly longer the preview output on the right. the very first time you use a package. For the time being, we only support a small 1 Offline mode number (around 25) of the most commonly used One unique aspect of LaTeX Base amongst web ap- packages, but our roadmap includes extending sup- plications is that it can be used with or without an port to arbitrary hosted packages. Internet connection! This is possible thanks to “ser- vice workers”: a recent development in the web plat- 4 Images form that allows applications to intercept and cache The only way that our implementation of LAT X network requests. That means that you can write E differs from a standard compiler is in how we han- your papers on a plane, in a park, or anywhere in dle external files (like images). We don’t currently between. While LaTeX Base isn’t the first web-based give users direct access to the virtual Emscripten LAT X editor, it is the only one with this capability. E filesystem that LAT X sees when it’s running on If you’re a programmer as well as a LAT X en- E E https://latexbase.com. Instead, we support call- thusiast, you may suspect that there’s a bit more ing \includegraphics with an image url that we’ll to the story. Service workers allow us to cache the fetch and preload in Emscripten’s virtual filesys- editor, but (LA)T X doesn’t run in the browser (it’s E tem. When you download your documents, we au- ordinarily compiled to machine code). How can La- tomatically convert these url identifiers to simple TeX Base compile documents without an Internet file names and bundle the downloaded images so connection if it’s limited to executing JavaScript? that no changes are necessary to compile documents 2 Enter Emscripten elsewhere. The answer lies in a fascinating tool that came out Our roadmap also includes allowing users to of Mozilla’s research group a few years ago called Em- upload images and other local resources rather than scripten (wikipedia.org/wiki/Emscripten), which supplying urls. compiles LLVM bytecode to JavaScript. Many code- bases such as Unreal Engine, Bullet Physics, and 5 Conclusion the Lua programming language (which appears to Web applications are great. They allow users to be of some interest to the greater LATEX community) use software without permanently installing it. The have been ported from C/C++ to JavaScript using abilities and permissions they’re granted by default Emscripten. In building LaTeX Base, pdflatex was are very limited compared to native applications, so
Introducing LaTeX Base 276 TUGboat, Volume 37 (2016), No. 3
Figure 1: Getting Started page of LaTeX Base.
they are preferable from a practical security perspec- About the author tive. They’re built on open standards, so they run Gareth is a New York native living in Portland, OR, anywhere and don’t need to be sanctioned by any with his wife Alison and toddler Albee. He received organization or app store. Using cutting edge tools, a BA in Computer Science with a Math minor from LaTeX Base is able to offer many advanced capabili- Middlebury College and worked in software develop- ties right in the browser. In this author’s (absolutely ment, most recently as an engineering lead at Mozilla, biased) opinion, it’s on its way to becoming the best before building LaTeX Base. In his free time, he en- A way to write LTEX documents. joys playing jazz piano and chess. In closing, I want to recognize Mozilla, not only for their tremendous standards work that’s made the ⋄ Gareth Aye web the wonderful thing it is today, but also for their https://latexbase.com work on components that made LaTeX Base possible including Ace, Emscripten, PDF.js, and localforage.
Gareth Aye TUGboat, Volume 37 (2016), No. 3 277
Computer Modern Roman fonts for ebooks Martin Ruckert
How it all started Last year on February 19, I looked at the first ver- sion of my first ebook and I was shocked. I had just finished the printed version of “The MMIX Supple- ment for The Art of Computer Programming” [5] and Donald Knuth had provided extensive help to make its appearance match the books in his series. Fig. 1: First version of my ebook Donald Knuth had developed TEX, METAFONT, and the Computer Modern Roman (CMR) type faces es- pecially to be able to typeset “The Art of Computer Programming” [3] in the best possible quality. But when I looked at my newly bought Kindle Paper- white—not the most expensive, but still a decent ebook reader — what I saw (Figure 1) did not re- semble even remotely what you would expect from TEX and friends. I studied the specification of the epub format and found that TrueType or OpenType fonts should work with it. My first attempt with the TrueType versions of the CMR fonts failed because I had over- looked the few instances where the characters in the Fig. 2: Second version of my ebook book were not pure ASCII. So I switched to the that translates TEX input to an intermediate re- Computer Modern Unicode (CMU) version of the presentation that can be used by the new rendering fonts [4], and mailed the publisher the first long list engine. In preparation for this project, I started to of change requests including the request to use these identify those subproblems which I would need to fonts. When I received the next version of my ebook, ignore in order to have a reasonable sized project. Dayna Isley, the digital development editor respon- This brought me back to investigating the font issue. sible for the ebook, wrote: “I’m finding that embed- ded fonts are not well supported across Kindle apps ebook versus Preview and devices. In most cases, the fonts default to the standard Kindle fonts. Kindle for PC and Paper- One of the good programs to view TEX output on- white support embedded fonts, but the body font is screen is YAP, which comes with MiKTEX [6]. YAP difficult to read (very faint) and therefore not effec- is an acronym standing for Yet Another Previewer. tive.” And see for yourself (Figure 2), she was right. The word “previewer” indicates that it is the pur- My schedule was tight, I was teaching 18 credit pose of the program to give the user an advance hours that semester, and aside from the fonts there view, an approximation of what one should expect to were more and bigger problems to be solved before see on paper. The paper version is the “real thing” the ebook could be released. So we settled for a se- and the electronic version is only an intermediate lection of standard ebook fonts and moved on. The step in its production. An indication of this attitude final ebook uses Baskerville fonts for the main text is the selection of fonts. In its default configuration, body. It is no match for the printed version, but YAP uses METAFONT in ljfour mode to generate it was a good compromise given the limitations of bitmap fonts. These bitmaps are optimized for a time and technique. (once) popular 600 dpi laser printer. YAP scales Now, a year later, I decided to get back to the them down to display the TEX output on the low problem of ebook production with more time to my resolution computer screen, and if you reduce down- disposal: I plan to use my sabbatical in 2017 to scaling, you can see precisely, down to the last pixel, build a prototype ebook renderer that uses the al- what you are supposed to get on paper. gorithms of TEX for ebook layout and a front-end The situation has changed significantly with the introduction of ebooks. Now books are produced
Computer Modern Roman fonts for ebooks 278 TUGboat, Volume 37 (2016), No. 3 specifically for reading on some kind of computer screen. The electronic rendering is no longer an ap- proximation of something yet to come, it is the final product. The built-in font rendering software (and hard- ware) of computers usually does not support META- FONT generated bitmapped fonts. It supports True- Type or OpenType outline fonts. These are now the de facto standards. The emerging universal stan- dard in character encoding is, perhaps due to the Fig. 3: From The METAFONTbook World Wide Web, the UTF-8 encoding. Outline fonts can be scaled to any resolution desired, but as we will shortly see, this is not sufficient for opti- mal on-screen reading.
Rendering Computer Modern Roman fonts To investigate the rendering of the available CMR fonts on current electronic devices, a reference ren- dering is needed. I choose (somewhat but not com- pletely arbitrarily) my personal copy of The META- FONTbook and picked the second paragraph of the Fig. 4: CMU font, ebook preface [2, page v]. It reads, typeset below in 10pt Computer Modern Roman as in the printed book: “ Modern printing equipment based on raster lines — in which metal “type” has been replaced by purely combinatorial patterns of zeroes and ones that specify the desired position of ink in a discrete way — makes mathematics and computer science in- creasingly relevant to printing. We now have the ability to give a completely precise definition of let- ter shapes that will produce essentially equivalent results on all raster-based machines. Moreover, the shapes can be defined in terms of variable param- LM eters; computers can “draw” new fonts of charac- Fig. 5: font, ebook ters in seconds, making it possible for designers to will have on the appearance of fonts, I can reason- perform valuable experiments that were previously ably hope that the reproduction of the photographs unthinkable.” shown in this article preserve the relative differences I then took a photograph of this paragraph from which I observed on my output devices. the book (Figure 3) which I will use as my refer- I have tried my best to take all the photographs ence for the Computer Modern Roman 10pt font in this article under identical conditions, for the sake from now on. Apart from the plain text, the pho- of comparison. Using a good camera (Canon EOS tograph contains an insert with the first two let- 60 D, 18Mpixel, 18mm–135mm lens, 1/15s, 5300K, ters magnified six times. In comparing the different ISO320, 56mm focal length, 16 aperture), I took font renderings, one should pay special attention to all photographs under identical light conditions and the thickness of the different strokes of the “M” and post-processed the raw images in the same way, try- the rounding of the “o”. As a first observation you ing to reproduce the differences in appearance as might notice that the font as shown in figure 3 ap- well as possible. pears to be much heavier than the same font in the previous paragraph — depending of course on how TrueType, OpenType, and Unicode fonts you printed or rendered this article in order to read it. While it is impossible for me to avoid the effects As a first example, lets look at the rendering on my that your rendering software and your output device ebook reader (Kindle Paperwhite 2, 1024x758 pix- els, 212dpi) using the OpenType Computer Modern
Martin Ruckert TUGboat, Volume 37 (2016), No. 3 279
Fig. 6: CMU Font, smart-phone Fig. 10: METAFONT with blacker = 0.6, laptop
Fig. 7: CMU Font, laptop Fig. 11: METAFONT with blacker = 1.6, smart-phone
METAFONT Fig. 8: at 142dpi, laptop Fig. 12: METAFONT with blacker = 2.4, ebook of a specific font implementation on a specific output device. Another popular choice are the OpenType Latin Modern (LM) fonts [1]. The native rendering on the Kindle Paperwhite (Figure 5) is compara- ble to that of the CMU fonts. It seems that the eInk technology used on the Kindle Paperwhite just needs heavier fonts. When considering reading text on an electronic device, two other choices come to mind: laptop com- puters and smart phones (or tablets), which typ- Fig. 9: METAFONT at 4 × 142dpi, laptop ically have a smaller screen but higher resolution. Unicode (CMU) fonts that I had tried already for Figures 6 and 7 show the reference text as displayed my ebook (Figure 2). Figure 4 shows how the ebook on my smart-phone (Motorola Moto G, 1280x720 renders this outline font using the built-in rendering pixels, 329dpi) and my laptop (Dell Latitude E6530, engine. Comparing it with the printed book (Fig- 1920x1080 pixels, 142dpi). ure 3), it is obvious that the rendering lacks contrast It is clearly visible that, due to high resolution and looks significantly lighter. It turns out that the and good contrast, the font rendering on the smart- initial observation that the font is “very faint” is not phone already approaches the rendering on tradi- a general property of the CMR fonts but a property tional paper, whereas the laptop screen falls short of
Computer Modern Roman fonts for ebooks 280 TUGboat, Volume 37 (2016), No. 3 our expectations. METAFONT was designed to pro- Conclusion duce good looking fonts at low resolution. Donald Preparation of an ebook from a T X source will al- Knuth writes: “However, it will always be less ex- E ways be more than just flipping a switch in the T X pensive to work with devices of lower resolution, and E file. Just as preparing a book for print is more than we want the output of METAFONT to look as good just adopting the publisher’s style file: it might re- as possible on the machines that we can afford to quire for example stretching a paragraph by rewrit- buy.” [2, page 195] Of course, we can hope that the ing it to get a good page break; repositioning and ever-increasing resolution of our computer screens redesigning illustrations, so that they fall on the will make those techniques dispensable within the right page and fit the available space on the page. next years. But for the time being and for afford- These things are no longer necessary nor possible able, low-cost devices, good font rendering will con- with ebooks, but other problems appear: Now the tinue to be an issue. author has to judge the appearance of tables or pro- gram listings at different sizes and optimize font METAFONT and bitmapped fonts sizes for good readability at various magnification METAFONT is aware of rasterization and takes great levels. Still, I expect that the algorithms of TEX care to round the outlines of the glyphs to the avail- can help us to produce ebooks of much better qual- able raster, but it assumes an output device that ity than the ebooks we have today. places small dots of black ink on white paper. In But even if I can get TEX to produce a beauti- contrast, my ebook is able to produce 16 gray lev- ful page layout for the ebook reader, I still need — els and my smart-phone screen is, at least in the- especially for the traditional look and feel of books ory, capable of 256 shades of gray. (Other font ren- like “The Art of Computer Programming” — a True- dering engines use even more sophisticated subpixel Type or OpenType version of the Computer Modern rendering.) To overcome this limitation of bitmap Roman font family using Unicode encoding that is fonts generated by METAFONT, one can render the specifically designed for ebooks (or other on-screen bitmaps for a higher resolution and then scale down reading). My experiments indicate that such fonts the result to a lower resolution, converting partially- are possible and I sincerely hope that one of the black regions to gray pixels. The effect of this mech- many font specialists takes on this project. If you anism can be seen in figure 8 and figure 9. Clearly do, please let me know! the downscaling gives superior results. So the fol- lowing figures all show fonts that are scaled down References by a factor of 4. [1] Boguslaw Jackowski and Janusz M. Nowacki. The METAFONT system for font design offers The Latin Modern (LM) Family of Fonts. special parameters to adapt the generated bitmap http://www.gust.org.pl/projects/e-foundry/ fonts for any specific output device [2, Chapter 24, latin-modern/, 2009. Discreteness and Discretion]. The main parameter, Computers & Typesetting, of course, is the resolution. Since we are dealing [2] Donald E. Knuth. The METAFONTbook. Addison-Wesley, 1986. with fonts that are too light, we turn our attention to the parameter blacker. The variable blacker is a [3] Donald E. Knuth. The Art of Computer special correction intended to help adapt a font to Programming. Addison Wesley, 1998. the idiosyncrasies of the current output device [2, [4] Andrey V. Panov. Computer Modern Unicode page 93]. Its effect can be seen when comparing Fonts. http://canopus.iacp.dvo.ru/~panov/ figure 9 to figure 10, where the parameter blacker cm-unicode/, 2010. has been chosen so that the visual appearance of [5] Martin Ruckert. The MMIX Supplement: the font on screen would match as closely as possi- Supplement to The Art of Computer ble the appearance in the printed book (Figure 3). Programming Volumes 1, 2, 3 by Donald E. Similar results can be obtained for the smart-phone Knuth. Addison-Wesley, 2015. (Figure 11) and the ebook (Figure 12) with appro- [6] Christian Schenk. MiKT X. blacker E priately chosen values of . The illustrations http://www.miktex.org/, 2016. show that with appropriate parameters, the glyphs as rendered by METAFONT look better than their ⋄ Martin Ruckert counterparts produced by the built-in font render- Hochschule M¨unchen ing engines from standard outline fonts optimized Lothstrasse 64 for high-resolution printers. 80336 M¨unchen Germany ruckert (at) cs dot hm dot edu
Martin Ruckert TUGboat, Volume 37 (2016), No. 3 281
When (image) size matters Peter Willadt Abstract
For space and performance reasons, scaling of images 2500 dpi, 900 kB 500 dpi, 58 kB to be included into a PDF document down to a certain resolution is often desirable. This article describes a halfway automatic method to achieve this goal with pdfTEX.
1 Basics 375 dpi, 42 kB 250 dpi, 24 kB TEX output is by default device independent, and this is fine. In ancient implementations, adoption to different previewers or printing devices resulted from the work of DVI processing software, in recent years TEX has been widely replaced by pdfTEX and other software that produces PDF output which can 200 dpi, 20 kB 100 dpi, 10 kB be processed by a wide range of devices (the P in PDF stands for portable, after all). Figure 1: The same photograph in several resolutions. With scalable fonts and scalable inline graphics See for yourself where quality degradation becomes produced by software packages like TikZ or META- perceptible. POST, still everything is fine. Problems arise when raster graphics are embedded into a PDF file. pdfTEX includes raster graphics at their natural size. Espe- professional printing equipment can achieve on plain cially with the megapixel mania of digital cameras paper. Printing this page on your own device will this leads to bloated files. Download time and pro- probably be even more sobering: On my 1200 dpi cessing effort at the printing device increase; perhaps laser printer, I can’t see any difference among the im- your printer will give up with an out-of-memory error ages. With special paper and techniques like duotone for rendering a stamp-sized photograph. printing, there is room at the top. Rescaling bitmap images to a size that suffices For online viewing, one pixel of an image corre- for usual post-processing help keep file size and pro- sponds to one pixel on screen. If you zoom in even cessing complexity small while retaining expected more pixels may be needed. Considering high-res image quality. The most important question is: what devices and moderate zooming, 300 dpi will probably resolution will suffice? There are two answers: With suffice for the next few years. pure black-and-white pictures (‘line art’), the print- ing devices’ native resolution (e.g. 1200 dpi) is fine. With grayscale or color pictures, a resolution of 1/4 2 Looking outside the box of that will easily do. The reason is that colored 1 In the early times of desktop publishing, when disk ‘pixels’ are formed by combining several dots. For space was costly and memory size and local network 16 distinct gray tones, one ‘pixel’ consists in theory bandwidth were seriously limited, layout designers × of a 4 4 matrix of black or white pixels. In practice, often worked with low-resolution preview pictures the real resolution may be even coarser, as effects like and final images would be inserted on the way to the bleeding of ink or surface roughness of paper have imagesetter. There even existed a standard called also to be considered. With professional printing open prepress interface (OPI)[1] for automatic image equipment, true output resolution is measured in lpi replacement in PostScript files. (lines per inch) and grayscale or color images scaled Adobe software (at least InDesign and Distiller) to their dpi equal to the printing devices’ lpi should will rescale images during PDF production to an ap- be fine. If you read this article in the print version of propriate resolution chosen for the intended target TUGboat , figure 1 gives you the chance to see what you choose (e.g. print or web). OpenOffice and Libre-
1 Office leave images untouched, while Microsoft Word It does not matter if the device does halftoning by ras- treats pictures, without any chance to intervene, in tering or dithering. Special printing devices which are capable of producing ink drops of varying size or using thermal subli- a way that causes considerable grief to people in mation are not covered by these thoughts. printing offices.
When (image) size matters 282 TUGboat, Volume 37 (2016), No. 3
3 Including pictures for different output that this technique is best carried out with interactive devices into a single PDF file software and visual checks for the results. Unfortu- nately, reducing color depth does not yield large gains Probably for purposes similar to OPI, the PDF spec- 2 ification allows the inclusion of different images for in space, but it might be useful to do gray-scale viewing on screen and printing. Unfortunately, there conversion for material to be printed in black and are several restrictions and drawbacks: white to get fine control over the results. Gamma correction and adjustment of black and white levels • both images have to have the same dimensions are often helpful to get better printing results, but • both images should have the same resolution for file size there is no benefit. • both images will be included within the PDF file, so file size gets bloated. 5 Proposal for a perfect solution • Software support is rare. A presumably perfect solution would scale pictures Alternative print images are enabled as an exper- on the fly while producing PDF, ideally triggered imental feature in pdftex.def and can be used with by a command like \pdfFinalResolution=300 or the graphicx package out of the box. You just say \destination=web in the document preamble. This \includegraphics command would probably be supported by some [print=imgPrint.jpg,...]{imgView} bookkeeping to avoid unnecessary computations on already downscaled images. If black-and-white out- instead of put was intended, all images might be converted to \includegraphics[...]{myimgView} grayscale, also keyword-driven. Of course, when im- and you’re done. ages were to be clipped, only the visible part of these It only works with bitmap graphics and you images would be included. have to specify the full filename. Another drawback I guess that this could be done with LuaTEX is that image reuse does not work with this option almost out of the box, and as it has now (Sept. 2016) for screen images, so your file gets bloated even more. reached a stable state, there should be no obstacles With Adobe Acrobat, I have been able to use it, to implementing it. but most other PDF processing software fails. On my GNU/Linux system, I ended up with a file I 6 Implementation (less than perfect) could view but not print. Considering all this, I can and usage unfortunately see no good use for this technology I have resorted to external software that reads a apart from playing pranks. TEX log file to scan for filenames of images and re- 4 Ways of attack quired target resolutions and then builds up scaled images. As you can specify paths for graphic inclu- There are three possible hooks to scale images: before sion with the graphicx LATEX package, you get a the pdfTEX run; while pdfTEX is processing pictures; comparatively easy solution if you adopt to some and as a postprocessor on the finished PDF. conventions. You should avoid giving path names Googling for the problems aforementioned, you on individual \includegraphics commands and in- will find a postprocessing solution using Ghostscript stead use the \graphicspath directive. In a first on the final PDF file [2] and another one using a run you will comment the path to the final images Python tool [3]. A out, having generated the downscaled pictures you There also exists a LTEX package and corre- will comment the original file path out. sponding ConTEXt module, both called degrade [4], which shrink image files on the fly using ImageMagick \graphicspath{{my/hires/images/}} in the background. Both of these packages require a %\graphicspath{{printimg/}} Unix-ish operating system and \write18 has to be % move comment up for final pdfLaTeX run enabled. You will have to repeat this procedure as you Beyond downscaling, there are other ways of change image sizes or as you add new images, so it getting smaller image files. For one, increasing JPEG is probably best to start generating scaled pictures compression allows drastic reductions in space. This when your document is almost done. Really fast can be done when there will be no further image previewing can — as you probably know — be done by processing involved, but it requires careful visual specifying the draft option to the graphics package, checking for compression artifacts. Also, color depth can be decreased (by “posteri- 2 With the example picture, only ten percent reduction of zation” or grayscale conversion). The author believes disk space was achieved by grayscale conversion.
Peter Willadt TUGboat, Volume 37 (2016), No. 3 283 where you get only frames instead of pictures in your to recompile all of your documents just because you PDF file. bought a new printer. So, your workflow will look like this: pdflatexpicscale changes image size and tar- A get resolution. This has serious consequences if you • Run LTEX on your file, with \graphicspath pointing to the original files. intend to use clipping, or to display pictures in a size dependent on their resolution. Also, anisotropic • Run pdflatexpicscale on your LAT X project. E scaling is not supported. • A Run LTEX on your file, with \graphicspath When a file gets used several times at different pointing to your optimized files. sizes, only the largest will be included. The software • Repeat if you change picture sizes, add new reads the log file from beginning to the end and starts pictures, or choose a different target resolution. rendering immediately, so when an image is included If you cannot produce PDF files directly, the at first in thumbnail size and then larger, it will be only change to the workflow will be that you have rendered several times. to additionally call your PDF producing software. The Perl script uses ImageMagick’s convert pdflatexpicscale3 is a Perl script. It depends software for scaling pictures, so quality of resam- on some standard Perl packages and the presence of pling and file compression (most important for lossy ImageMagick software. As these prerequisites are compression formats like JPEG) depend upon Im- quite common, it should run with your system. You ageMagick’s algorithms. call the script with the name of your LATEX project Security concerns: ImageMagick has had several and optionally with the desired resolution and desired security flaws fixed in 2016. So it is probably not a picture directory. If you omit arguments, reasonable good idea to provide scaling services to anonymous defaults will be assumed. So a typical call would be: users that might upload a malicious image file. The solution presented only deals with pure pdflatexpicscale --printdpi=200 \ raster graphics (JPEG and PNG). If you include --destdir=medrespics myarticle graphics in a mixed format like PDF, rasterization A If your LTEX file is called myarticle.tex, you might be beneficial or disadvantageous, depending on A have done a LTEX run, so that the log file exists, you the content. Rastering vector graphics is definitely want 200 dpi output and the directory for the scaled not what you want. Treating your PDF with one of pictures is an existing subdirectory of the current the postprocessing solutions mentioned might help. directory called medrespics, then you may copy the A last remark: Having two projects share the above command verbatim. same images is a recipe for dissatisfaction. It is quite The software can be downloaded from CTAN common to keep, for instance, a presentation and [5], and is included in TEX Live. Documentation is the corresponding handout in the same folder, but included. You may probably want to read it, as it is graphic requirements are totally different. The best not identical with this article. solution is to keep downscaled pictures in separate directories; pdflatexpicscale can easily cope with 7 Caveats, limitations and drawbacks this. My PostScript printer prints some black-and-white images inverted. I could have inverted them with an References image processor, but then they would look wrong [1] http://wwwimages.adobe.com/www. on screen. As a workaround I converted them to adobe.com/content/dam/Adobe/en/ grayscale. Some provision needs to be made to devnet/postscript/pdfs/5660.OPI_2.0.pdf keep pdflatexpicscale from scaling them down like other halftone images. The easiest way is keep [2] http://tex.stackexchange.com/questions/ them in a separate directory and to include this di- 14429/pdftex-reduce-pdf-size-reduce- rectory at the beginning of the \graphicspath list. image-quality The target resolution you choose may not truly [3] http://tex.stackexchange.com/questions/ meet the printing devices’ needs, especially if you do 2198/how-to-create-small-pdf-files-for- not know who will print your document. Perhaps the-internet the printing device has got fantastic image scaling [4] http://ctan.org/pkg/degrade software that you replace by some inferior software [5] http://ctan.org/pkg/pdflatexpicscale on your computer. Also you probably will not want
3 This name was chosen because Google found no hits in ⋄ Peter Willadt July, 2016. willadt (at) t-online dot de
When (image) size matters 284 TUGboat, Volume 37 (2016), No. 3
A survey of the history of musical notation Werner Lemberg
Abstract Music has been and still is an essential part of life. Simi- lar to writing text there have been various ideas on how to notate music. This article tries to show, with many images, the solutions found in the course of more than 3000 years of history. https://www.youtube.com/watch?v=27opcKxcg1c, with permission 1 Introduction Figure 1: A kinnor-like lyre. Over the millennia, humanity has developed many different ways to notate music. The solutions canbe roughly categorized visually as follows. ence proceedings.1 Most images shown here are high- 1. action description resolution scans; it is thus recommended that you have a look at the online PDF version so that you can zoom 2. words into the document for details! 3. letters The music examples were typeset with GNU Lily- 4. digits Pond version 2.19.43.2 5. graphics 6. stylized graphics 2 Mesopotamia — Hurrian songs 7. abstract symbols The oldest notation for music we currently know ofwas 8. combination of 1–7 found in the Royal Palace at Ugarit, an ancient port city in northern Syria, today called Ras Shamra ( ). رأس شمر -This ordering also roughly corresponds to historical de These clay tablet shards date to approximately 1400 BCE velopment across cultures: The oldest Chinese sources (figs. 2 and 3); the notation uses words and digits (in we know of are action descriptions, Mesopotamia seems Akkadian cuneiform) for a nine-string lyre (fig. 1). to have started with letters and digits, while modern There are several problems making it hard to inter- Western notation essentially uses all possible combina- pret the data in a meaningful way. tions. Interestingly, preserving music itself has been • The text is written in a poorly understood Hurrian much less important than preserving words — this is dialect. true for all ancient cultures throughout the world. We • Words in the notation represent intervals, not know many texts of hymns and songs, but their music pitches (fig. 4) — is this polyphonic? If not, whatis did not survive. Another observation is that most cul- the order of the pitches? Ascending? Descending? tures only developed tablatures. A tablature basically • Should the intervals be filled with scales or some- notates the fingering to play the music on an instru- thing different? In other words, is this a one-to- ment, not the music itself. An exception to that was a one representation of what should be played, or is notation system for songs in ancient Greek; however, it it just a mnemonic aid? was lost with the fall of the Roman empire. Perhaps due • What do the numbers mean? Repetition? Beats? to the century-long ban of instruments in the church Something completely different? music of early Christianity, musicians in western Eu- rope developed new ways to notate sung music, which eventually led to the modern notation which is used all 3 Greece — The Seikilos Column over the world today. The example shown in this section is the famous Seiki- The emphasis in this survey is on the graphical rep- los column, found in one of the largest Aegean cities resentation of music, showing both the inventiveness in antiquity, Tralleis ( α ῖ , today Aydın, Anatolia, and the beauty of the solutions discovered, via many im- Turkey), with an approximate age of 2000 years (figs. 7, ages. Using some technical terms related to music for 5, 6). It is a tombstone depicting an epigram or a skolion the descriptions is unavoidable; readers without a mu- (drinking song). sical background, however, can simply skip them and enjoy the pictures for themselves. 1. MOTYF. International Students’ Moving Type Festival 2014: Type in Music, the Rhythm of Letters. Polsko-Japońska Akademia Technik This article is a greatly revised and extended ver- Komputerowych, Warsaw 2015. ISBN 978-83-63103-76-7. sion of a paper submitted to the MOTYF 2014 confer- 2. http://www.lilypond.org
Werner Lemberg TUGboat, Volume 37 (2016), No. 3 285
http://www.ramivitale.com/wp-content/uploads/2013/09/H6TabletsFront_lg.jpg
http://www.ramivitale.com/wp-content/uploads/2013/09/H6TabletsBack_lg.jpg Figure 2: Hymn tablet h. 6 (front and back), consisting of shards RS 15.30, 15.49, 17.387 (Natl. Museum of Damascus).
http://digital.library.stonybrook.edu/cdm/ref/collection/amar/id/6904, with permission
Rº 5 qáb-li-te 3 ir-bu-te 1 qáb-li-te 3 ša-aḫ-ri 1 i-šar-te 10 uš-ta-ma-a-ri 6 ti-ti-mi-šar-te 2 zi-ir-te 1 ša-aḫ-ri 2 ša-aš-ša-te 2 ir-bu-te 2 7 um-bu-be 1 ša-aš-ša-te 2 ir-bu-te 1[+X] na-ad-qáb-li 1 ti-tar-qáb-li 1 ti-ti-mi-šar-te 4 8 zi-ir-te 1 ša-aḫ-ri 2 ša-aš-ša-te 4 ir-bu-te 1 na-ad-qáb-li 1 ša-aḫ-ri 1 9 ša-aš-ša-te 4 ša-aḫ-ri 1 ša-aš-ša-te 2 ša-aḫ-ri 1 ša-aš-ša-te 2 ir-bu-te 2 10 ki-it-me 2 qáb-li-te 3 ki-it-me 1 qáb-li-te 4 ki-it-me 1 qáb-li-te 2 Figure 3: A transcription of the cuneiform text below the double line that represents musical notation, following Manfred Dietrich and Oswald Loretz (Kollationen zum Musiktext aus Ugarit, Ugarit-Forschungen 7, 1975).
qáb-li-te 3 ir-bu-te 1 qáb-li-te 3 ša-aḫ-ri 1 i-šar-te 10 uš-ta-ma-a-ri \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Figure 4: The intervals and counters as used in the Hymn tablet. Depending on the order of strings (either ascending or descending), which is unknown, either the first or the second line is the correct one.
A survey of the history of musical notation 286 TUGboat, Volume 37 (2016), No. 3