Lecture Notes in Computer Science 3130 CommencedPublicationin1973 FoundingandFormerSeriesEditors: GerhardGoos,JurisHartmanis,andJanvanLeeuwen EditorialBoard DavidHutchison LancasterUniversity,UK TakeoKanade CarnegieMellonUniversity,Pittsburgh,PA,USA JosefKittler UniversityofSurrey,Guildford,UK JonM.Kleinberg CornellUniversity,Ithaca,NY,USA FriedemannMattern ETHZurich,Switzerland JohnC.Mitchell StanfordUniversity,CA,USA MoniNaor WeizmannInstituteofScience,Rehovot,Israel OscarNierstrasz UniversityofBern,Switzerland C.PanduRangan IndianInstituteofTechnology,Madras,India BernhardSteffen UniversityofDortmund,Germany MadhuSudan MassachusettsInstituteofTechnology,MA,USA DemetriTerzopoulos NewYorkUniversity,NY,USA DougTygar UniversityofCalifornia,Berkeley,CA,USA MosheY.Vardi RiceUniversity,Houston,TX,USA GerhardWeikum Max-PlanckInstituteofComputerScience,Saarbruecken,Germany Apostolos Syropoulos Karl Berry Yannis Haralambous Baden Hughes Steven Peter John Plaice (Eds.) TeX, XML, and Digital Typography InternationalConferenceonTeX,XML,andDigitalTypography Held Jointly with the 25thAnnual Meeting of theTeX Users Group,TUG 2004 Xanthi, Greece,August 30 - September 3, 2004 Proceedings 1 3 VolumeEditors ApostolosSyropoulos GreekTeXFriendsGroup,366,28thOctoberStr,67100Xanthi,Greece E-mail:[email protected] KarlBerry TeXUsersGroup,P.O.Box2311,Portland,OR97208-2311,USA E-mail:[email protected] YannisHaralambous ENSTBretagne,DépartementInformatique,CS83818,29238Brest,France E-mail:[email protected] BadenHughes UniversityofMelbourne DepartmentofComputerScienceandSoftwareEngineering 111BarryStreet,CarltonVIC3053,Australia E-mail:[email protected] StevenPeter BeechStavePressandTeXUsersGroup,310HanaRoad,Edison,NJ08817,USA E-mail:[email protected] JohnPlaice UniversityofNewSouthWales,SchoolofComputerScienceandEngineering UNSWSYDNEYNSW2052,Australia E-mail:[email protected] LibraryofCongressControlNumber:2004095630 CRSubjectClassification(1998):I.7,H.5.4,G.4 ISSN0302-9743 ISBN3-540-22801-2SpringerBerlinHeidelbergNewYork Thisworkissubjecttocopyright.Allrightsarereserved,whetherthewholeorpartofthematerialis concerned,specificallytherightsoftranslation,reprinting,re-useofillustrations,recitation,broadcasting, reproductiononmicrofilmsorinanyotherway,andstorageindatabanks.Duplicationofthispublication orpartsthereofispermittedonlyundertheprovisionsoftheGermanCopyrightLawofSeptember9,1965, initscurrentversion,andpermissionforusemustalwaysbeobtainedfromSpringer.Violationsareliable toprosecutionundertheGermanCopyrightLaw. SpringerisapartofSpringerScience+BusinessMedia springeronline.com ©Springer-VerlagBerlinHeidelberg2004 PrintedinGermany Typesetting:Camera-readybyauthor,dataconversionbyOlgunComputergrafik Printedonacid-freepaper SPIN:11306221 06/3142 543210 Preface This volume contains the papers that were accepted for presentation at the In- ternationalConferenceonTEX,XML,andDigitalTypography,jointlyheldwith the 25thAnnualMeetingoftheTEXUsersGroupinXanthi,Greeceinthesum- merof2004.Theterm“DigitalTypography”referstothepreparationofprinted matter using only electronic computers and electronic printing devices, such as laser-jetprinters.Thedocumentpreparationprocessinvolvesmainlytheuseofa digital typesetting system as well as data representation technologies. TEX and its offspring are beyond doubt the most successful current digital typesetters, while XML is the standard for text-based data representationfor both business and scientific activities. Allpapersappearinginthisvolumewerefullyrefereedbythemembersofthe program committee. The papers were carefully selected to reflect the research work that is being done in the field of digital typography using TEX and/or its offspring. Theproblemsforwhichcomprehensivesolutionshavebeenproposedinclude proper multilingual document preparation and XML document processing and generation. The proposedsolutions deal not simply with typesetting issues, but also related issues in document preparation, such as the manipulation of com- plex bibliographic databases,and automatic conversionof text expressedin one grammaticalsystemtoamorerecentone(asfortheGreeklanguage,converting between monotonic Greek and polytonic Greek). The conference is being graciously hosted by the Democritus University of Thrace in Xanthi and by the Greek TEX Friends. We wish to thank Basil K. PapadopoulosandGeorgiaPapadopoulouoftheDemocritusUniversityfortheir generous help and support in the preparation of the conference. Also special thanks go to Stratos Doumanis, GeorgiosMaridakis,andDimitrios Filippou for theirinvaluablehelp.LastbutnotleastwethanktheManipulicityofXanthifor their help and support. Xanthi, Greece Apostolos Syropoulos July 2004 Karl Berry Yannis Haralambous Baden Hughes Steven Peter John Plaice VI Preface Official Sponsors: http://www.intersys.gr Chikrii SoftLab GmbH has created these fine tools: Table of Contents Digital Typography in the New Millennium: Flexible Documents by a Flexible Engine ............................. 1 Christos K.K. Loverdos and Apostolos Syropoulos Moving Ω to an Object-Oriented Platform ............................ 17 John Plaice, Yannis Haralambous, Paul Swoboda, and G´abor Bella Basque: A Case Study in Generalizing LATEX Language Support ......... 27 Jagoba Arias P´erez, Jesu´s La´zaro, and Juan M. Aguirregabiria µoνo2πoλυ: Java-BasedConversionof Monotonic to Polytonic Greek ..... 34 Johannis Likos Using LATEX to Typeset a Mar¯at.h¯ı-English Dictionary .................. 55 Manasi Athale and Rahul Athale Hyphenation Patterns for Ancient and Modern Greek .................. 59 Dimitrios Filippou Typesetting the Deseret Alphabet with LATEX and METAFONT .......... 68 Kenneth R. Beesley FEATPOST and a Review of 3D METAPOST Packages.................. 112 Luis Nobre Gon¸calves Interactive Editing of MathML Markup Using TEX Syntax .............. 125 Luca Padovani Typesetting CJK Languages with Ω .................................. 139 Jin-Hwan Cho and Haruhiko Okumura Dynamic Arabic Mathematical Fonts ................................. 149 Mustapha Eddahibi, Azzeddine Lazrek, and Khalid Sami Arabic Mathematical e-Documents ................................... 158 Mustapha Eddahibi, Azzeddine Lazrek, and Khalid Sami Migrating to XML: The Case of the GUST Bulletin Archive............. 169 Wl(cid:1)odzimierz Bzyl and Tomasz Przechlewski Animations in pdfTEX-Generated PDF ............................... 179 Jan Holeˇcek and Petr Sojka iTEXMac: An Integrated TEX Environment for Mac OS X............... 192 J´eroˆme Laurens VIII Table of Contents MlBibTEX: Beyond LATEX........................................... 203 Jean-Michel Hufflen Managing TEX Resources with XML Topic Maps....................... 216 Tomasz Przechlewski S¸¨aferTEX: Source Code Esthetics for Automated Typesetting ............ 229 Frank-Rene Schaefer Creating Type 1 Fonts from METAFONT Sources....................... 240 Karel P´ıˇska Beyond Glyphs, Advanced Typographic Features of Fonts............... 257 George Williams Author Index.................................................... 265 Digital Typography in the New Millennium: Flexible Documents by a Flexible Engine Christos K.K. Loverdos1 and Apostolos Syropoulos2 1 Department of Informatics and Telecommunications, Universityof Athens TYPA Buildings, Panepistimiopolis GR-157 84 Athens,Greece [email protected] http://www.di.uoa.gr/∼loverdos 2 Greek TEX FriendsGroup 366, 28th October Str. GR-671 00 Xanthi,Greece [email protected] http://obelix.ee.duth.gr/∼apostolo Abstract. The TEX family of electronic typesetters contains the pri- marytypesettingtoolsforthepreparationofdemandingdocuments,and havebeeninuseformanyyears.However,oureraischaracterized,among others,byUnicode,XMLandtheintroductionofinteractivedocuments. In addition, the Open Source movement, which is breaking new ground in theareas of project support and development,enables masses of pro- grammers towork simultaneously.Asadirect consequence,it isreason- abletodemandtheincorporationofcertainfacilitiestoahighlymodular implementationofaTEX-likesystem.Facilitiessuchastheabilitytoex- tend the engine using common scripting languages (e.g., Perl, Python, Ruby, etc.) will help in reaching a greater level of overall architectural modularity.Obviously,inordertoachievesuchagoal,itismandatoryto attract a greater programming audience and leverage the Open Source programming community. We argue that the successful TEX-successor should be built around a microkernel/exokernel architecture. Thus, ser- vicessuchasclient-sidescripting,fontselectionanduse,outputroutines andthedesignandimplementationofformatscanbeprogrammedasex- tension modules. In orderto leverage thehugeamount of existing code, and keep document source compatibility, the existing programming in- terface is demonstrated to be just another service/module. 1 Introduction The firststeps towardscomputertypesetting tookplace inthe 1950s,butitwas not until Donald E. Knuth introduced TEX in 1978 [16] that true quality was brought to software-based typesetting. The history of TEX is well-known and the interested reader is referred to [16] for more details. Today, the original TEX is a closed project in the sense that its creator has decided to freeze its development. As a direct consequence no other programs A.Syropoulosetal.(Eds.):TUG2004,LNCS3130,pp.1–16,2004. (cid:1)c Springer-VerlagBerlinHeidelberg2004 2 Christos K.K.Loverdos and Apostolos Syropoulos are allowed to be called TEX. In addition, the freely available source code of the system was a major step on the road towards the formation of the Open Source movement, which, in turn, borrowed ideas and practices from the Unix world. Furthemore, the development of TEX and its companion system, META- FONT, had made obvious the need for properly documented programs. This, in turn, initiated Knuth’s creation of the literate programming program develop- ment methodology. This methodology advances the idea that the programcode and documentation should be intermixed and developed simultaneously. Thesourcecode ofTEXandMETAFONT beingfreelyavailablehashadenor- mous consequences. Anyone can not only inspect the source code, but also ex- periment freely with it. Combined with TEX’s (primitive, we should note, but quite effective for the time) ability to extend itself, this led to such success sto- ries as LATEX and its enormous supporting codebase, in the form of packages. As a direct consequence of the fact that the source code is frozen, stability was brought forth. Note that this was exactly the intention Knuth had when devel- opinghis systems.Acommonreferred-tocore,unchangedinthe passingoftime and almost free of bugs, offered a “secure” environment to produce with and even experiment with. However,in aneverchangingworld,especially in the fast-pacedfield of com- puterscience,almostanythingmusteventuallybesurpassed.Anditistheemerg- ingneedsofeacherathatdictatepossiblefuturedirections.TEXhasundoubtedly served its purpose well. Its Turing-completeness has been a most powerful as- set/weaponinthebattlesforandofevolution.Yet,thedesiredabstractionlevel, neededtocopewithincreasingcomplexity,hasnotbeenreached.Unfortunately, with TEX being bound to a fixed core, it cannot be reached. Furthermore, the now widely accepted user-unfriendliness of TEX as a lan- guage poses another obstacle to TEX’s evolution. It has created the myth of thosefew,veryspecialandquiteextraordinary“creatures”1abletodecryptand produce code fragments such as the following2: \def\s@vig{{\EO@m=\EO@n \divide\EO@n by20 \relax \ifnum\EO@n>0\s@vig\fi \EO@k=\EO@n\relax \multiply\EO@k by-20\relax \advance\EO@m by \EO@k\relax \global\advance\EO@l by \@ne \expandafter\xdef\csname EO@d\@roman{\EO@l}\endcsname{% \ifnum\EO@m=0\noexpand\noexpand\EOzero \else\expandafter\noexpand \expandafter\csname EO\@roman{\EO@m}\endcsname\fi} \expandafter\@rightappend \csname EO@d\@roman{\EO@l}\endcsname \t@\epi@lmecDigits}} Of course, to be fair, programmers in several languages (C and Perl among others) are often accused of producing ununderstandable code and the well- known obfuscated code contests just prove it. On the other hand, with the ad- 1 ThesecondauthormayberegardedasoneofGandalf’sfamuli,whilethefirstauthor is just a Hobbit, wishing to havebeen an Elf. 2 Taken from thedocumentation of the epiolmec package by thesecond author. Digital Typography in theNew Millennium 3 ventof quite sophisticatedassemblers,today one caneven write well-structured assemblylanguage,adheringevento “advanced”techniques/paradigms,suchas object-oriented programming. Naturally, this should not lead to the conclusion that we should start writing in assembly (again)! In our opinion, software com- plexity should be tackled with an emphasis on abstraction that will eventually lead to increased productivity, as is shown in the following figure: (cid:1) (cid:3) (cid:1) (cid:3) (cid:1) (cid:3) require(cid:1)s increase(cid:1)s Complexity Abstraction Productivity (cid:2) (cid:4) (cid:2) (cid:4) (cid:2) (cid:4) TEX’s programming language is more or less an “assembly language” for electronic typesetting. It is true that higher level constructs can be made – macros and macro packages built on top of that. But the essence remains the same.AlthoughitistruethatTEXisessentiallybugfreeanditsmacroexpansion facility behaves the way it is specified (i.e., as defined in [9]), it still remains a factthatittakesanon-specialistquitesometime tofully understandthemacro expansion rules in spite of Knuth’s initial intentions [12, page 6]. The fact that one should program in the language of his/her choice is just another reason for moving away from a low-level language. And it is true that we envision an environment where as many programmers as possible can – and the most important, wish to – contribute. In the era of the Open Source revo- lution, we would like to attract the Open Source community and not just a few dedicated low-level developers. Open Source should also mean, in our opinion, “open possibilities” to evolve the source. This is one of our major motivations for reengineering the most successful typesetting engine. RichardPalais,thefoundingchairmanofTUG,pointedoutbackin1992[12, page 7] that when developing TEX, Knuth ...hadNSFgrant support that not onlyprovided himwith the timeand equip- ment he needed, but also supported a team of devoted and brilliant graduate students who did an enormous amount of work helping design and write the large quantity of ancillary software needed to make the TEX system work ... and immediately after this, he poses the fundamental question: Where willtheresources come fromforwhat willhave tobe atleast anequally massive effort? And will the provider of those resources be willing, at the end of the project, to put the fruits of all his effort in the Public Domain? The answer seems obvious now. The way has been paved by the GNU/Linux/- BSD revolutionarydevelopmentmodel, as has been explained crystalclearly in The Cathedral and the Bazaar [15]. This paper is an attempt to define a service-oriented architecture for a fu- ture typesetting engine, which will be capable of modular evolution. We take a layeredapproachofdesigningsomecorefunctionalityandthendefineextensible services on top of the core. The engine is not restricted to a specific program- ming language either for its basic/bootstrapping implementation or, even more