; TeX output 1990.11.07:1946/?-iӍ.vb9DtGGcmr17CommqutativeDiagramsinT[-E;gX>0N cmbx12PaulTaylorZ+XQ cmr12DepartmenrtofComputing,TImpSerialCollegeofScience,TVecrhnologyandMedicine,180Queen'sGate,LondonSW72BZ+44715895111.@ cmti12ext.N85057"p1߆T cmtt12_b4July1990#B[@t : cmbx9Abstract+'9o cmr9TuAEX>andLfN- cmcsc10NavTuAdEXha9ve>bAecomestandardasaw9ay>ofwritingpapersinComputerScience, '9andarebAeingadoptedinCategoryTheory:. Ev9eninsourceformtheyareeasierto'9compAosem=andreadthanattemptstowritemathematicsinASCII.InCategoryTheory'9\comm9utativeĈdiagrams"areessen9tialforaclearvisualunderstandingofthepapAer,mbut'9theUgraphicscapabilitiesofTuAEXaresolimitedthatitisv9erydiculttodrawthem'9nicely:,]ifJatall. Thisman9ualdescribAessomemethodswhic9hhavebAeenusedfordoing'9so,qcriticising themforeithertheirsourcesyn9taxorfortheprintedresult(\semantics"),'9andsetsoutdesigncriteria.Thentheauthor'spac9k|rageisdescribAed,withexamples."+97"Vff cmbx101'In=trouduction-9K`y cmr10InepapGersinmathematicsandcomputersciencewhichemployCategoryTheory*,thereis 9muchbGene tinclarityif\commutativediagrams"areusedasmuchaspGossibletoillustrate9de nitions,@equationsyanduniversalpropGerties.Hereisatypicalsuchdiagram: itisoneof9theMacLane-Kellyequations.Y3Ml feM>DO line10D?yl fey>Հ6>2fd2->2fd2->2fd-' b> cmmi10A8!", cmsy10(BQ(CDG))(A8Bq)(CDG)S((A8Bq)C)D'A8((BQC)DG)S(A8(BQC))D㍍U\id`t8assl㍍O\assla8idx㍍asslx㍍&asslx㍍asslU߻=m9The#ma8jorityofsuchdiagramsarerectangular,c,althoughtrianglesareoftenrequired,and9sometimesweneedtodepicta\cubGe."91.1,L"s3O- cmcsc10Oa^T E!XpicturesOf9F*orpLffUP- cmcsc10PaTU>ExX^ٓRcmr71 users,anobviousapproachtothisproblemistousetheExXpictures,Wbuttheneedtoquote9co-ordinatesniseliminatedbyuseofastandardgrid:YMob8jectsandarrowsareplacedatthe9\current"pGosition,$[withcommandstoadvqancebycolumnsandrows.sAvqarietyofarrowsis9provided,withsystematicnames.9 X-ffğ "5-:2LܸPrenÎtice-Hall,1990,ISBN0-13-120486-6ٛ "5-:3LܸAvailable fromMikÎeBarratMcGillUniversityJ, Montreal,Q, QgorQ. (oRBITNETg1isnotrecommendedb=2/?-iӍ{-9ALffUPaTU>ExXusermayconsiderthatthepictureenvironmentprovidesthebasisforageneral 9packqage,butLffUPaTU>ExXwasneverdesignedtobGeusedinthisway*. bItprovidesexcellentfacilities9forglobalmanagementofdoGcumentswhichTU>'ExXdoGesnotsupply*,1'butthepopularityof9theapictureenvironmentaiswayaoutofpropGortiontothefacilitiesactuallyprovidedorthe9amountofcoGde(200linesor10kbwithoutcomments)involved.Asaprogramminglanguage9it alsoe ectivelydeprivestheuserofthosefewbutusefulprogrammingprimitiveswhich9TU>'ExXhas."zLffUPaTU>EXdoGcuments,andevenmoresoLffUPaTU>ExXprograms,arethereforecharacterised9byverbGosityandawkwardsyntax:rcompareour...X&\rTo^f&Y...9withBorceux's...{X}\n{\Ear{f}}\n{Y}...9Let( mesay*,r however,to( bGefair,thatifI'hadhadLffUPaTU>ExXandF*rancisBorceux'spackqage 9avqailablewhenIg rststartedusingTU>'ExX,Iwouldneverhavegonetothetroubleof9programmingthepackqagedescribGedinthispaper.691.2,TESXercise18.46uT9Consideringthefactthatmostdiagramsareessentiallyrectangulararrays,ntheycarrywith9them0an\intrinsic"co-ordinatesystemgivenbythecellstructure. Borceuxhasalready9exploitedthisfact,Nbuthiscellsaretranslateddirectlyintoco-ordinatesandsoareforced9tobGethesamesize./Howeveringeneralthecellsmaybeofdi erentwidthsandheights9depGendingonthesizesoftheob8jectandmorphismlabels. _Thisadjustmentissomething9whichshouldbGetheresponsibilityofthediagrampackqage,notoftheuser.9A8simple{solution^5 totheseproblemswasprovidedbyDonaldKnuthinTheTKß'E-Xb}'ook.9Notice thatthe\co-ordinatesystem"adoptedplaceseachob8jectandeachmorphismina9separatecell,)ratherthanusingthe\categorical2-cells"whichMikeBarrseemstohavehad9inmind.t*9\newcommand\rTo[1]{\smash{\mathop{\longrightarrow}\limits^{#1}}}9\newcommand\lTo[1]{\smash{\mathop{\longleftarrow}\limits^{#1}}}9\newcommand\dTo[1]{\Big\downarrow\rlap{$\vcenter{\hbox{$\scriptstyle#1$}}$}}9\newcommand\uTo[1]{\Big\uparrow\rlap{$\vcenter{\hbox{$\scriptstyle#1$}}$}}9\newenvironment{diagram}%9{\renewcommand{\arraystretch}{2}\begin{array}{*{20}{c}}}%9{\end{array}}Lqɍ9$$\beginfdiagramg"qǍ-/A*(B*(C*D))t&\rTo{\Assl}OW&(A*B)*(C*D)/&\rTo{\Assl}@& ((A*B)*C)*D\\"\dTo{\Id*\Assl}t&OW&=/&@&\uTo{\Assl*\Id}\\-/A*((B*C)*D)t&OW&\rTo{\Assl}/&@& (A*(B*C))*D\\9\endfdiagramg$$9whichproGducesthefollowingresult:9 X-ffğ "5-:5LܸIChaÎvepartlytranslateditintoLwRaWTAi=EMXbutitisstillnecessarytodescendtotheTAEXlevÎeltode ne thecommands.=31/?-iӍ{-'LȍH!A8(BQ(CDG))T΍Snassl2:!(A8Bq)(CDG)T΍Tassl2@!(A((A8Bq)C)DkHXCu cmex10C?kHX?kHXy8qidx? O!cmsy7asslڻ=KKxCxKKx?KKx?8Q$assl^4idH!A8((BQC)DG)T΍T6assl2֑ܭx!(A(A8(BQC))D(9Alreadywecanseeaverygreatimprovement,inparticular9'9theLffUPaTU>ExXsourceissetoutinthesamewayastheintendeddiagram,and9'9therearenoco-ordinates.691.3,-!", cmsy10AMSb-TESXuT9InAUXMS-TU>'ExXthisisdevelopGedandusingthecode;.78䍑9$$\CD :A*(B*(C*D))s@>\Assl>>Q(A*B)*(C*D))@>\Assl>>C((A*B)*C)*D~\\ 5?@V\Id*\AsslVVB=.&3 &;@AA\Assl*\IdA~\\:A*((B*C)*D)|x&N@>\Assl>>.&C(A*(B*C))*D~\\ 9\endCD$$N89wecanget5뵍׍IǘA8(BQ(CDG))*aasslT>UM!(A8Bq)(CDG)*F³asslT>UM!1((A8Bq)C)D8Uid[۵asslldC?ld?ldy߻=T/CxT/?T/?8Z٭asslgoid2IǘA8((BQC)DG)*T6asslTԟ>>UM!1(A8(BQC))D7봍9ThisisbGetterthanKnuth'sversioninthat9'9the arrowswillstretchto ttheirlabGels(thisisdonesimplybyreplacing '9\longrightarrowwith\rightarrowfill),9'9thereisaninterestingsyntactic^6 |sideausing@>f>g>toproGducethetwolabGels,and9'9thecolumndelimiters(&)areimplicitinthearrows.9However,9'9if pthelabGelononearrowinacolumnislargerthananother, thearrows '9will (]bGeofdi erentlengths.Althoughahackisprovidedtoovercomethis:'9\pretend{f\haswidth{longlabel},bthearrowscanonlystretchasfarastheedgeof'9theenclosingcell,sointhecaseofobje}'ctsofdi erentlengthswestillgetgaps.9'9theimplicitcolumndelimitersdon'twork,asyousee,9'9thelabGelonthelowerarrowcausestheverticalarrowstofallshortoftheirendpGoints, '9and9'9thereisnoprovisionfordi erentarrowheadsorfordiagonals.9 X-ffğ "5-:6LܸAMRsimpli edMeextractfromK cmsy8ATMS-TAEMXMeisincludedinthesourceofthisdo'ExXSRandLffUPaTU>EXuserswillalreadybGeawareSRofthewysiwyg}^7 Bfallacy*. gNeverthelessthe 9suggestionisfrequentlymadethatthebGestwaytosolvethisproblemwouldbGeto\drawit9on2thescreen." Giventhat,6>byhypGothesis,6>weareusingTU>'ExXorLffUPaTU>EXandnotaPMac^89to!|compGosethetextTofthedocument,)letusconsidertheimplicationsofusingthelatterto9drawjustthediagrams.9'9ThepGositioningoftheob8jectandmorphismlabelsispartofthesameproblemasthe'9calculationMYofthelengthsofthearrows,`sotheselabGelsmustbGeinsertedonthePMac'9toGo,usingitsfontsandnotenjoyingtheadvqantagesofuniformTU>'ExXde nitions.9'9Bringingthediagramsandthetexttogethereitherinvolvesphysicalscissors-and-paste'9orwrequiresadvidriverwhichtranslatesintoPPostscript. Thereareplentyof'9high-resolution.printersaroundwhicharecapableofprintingdvidoGcumentswithout'9usingPPostscript|andthey'refaster,toGo! EventhosedriverswhichcanincorpGorate'9PPostscriptaremutuallyincompatible.9'9F*orgeachdiagraminthedoGcumentyouneedaseparatePPostscript le(arecent'930-pagenpapGerofminecontained68diagrams).Drawingeachofthediagramsseparately'9anddown-loadingthemfromaPMactoPUnixwouldbGeverytime-consuming,eand'9keeping`'ExXsourcevia'9ax\specialcommand.Thoughmoremanageable,$thisisstillnotpGortable.Nowthat'9you'reL6nolongerusingaPMactodrawthepictures,_Cit'sjustasdiculttodothisas'9programmingtheprobleminTU>'ExXinthe rstplace.9'9The'omissingfeaturesofTU>'ExX,notablydiagonallines,1JcouldbGeaddedby(low-level)use'9ofeembGeddedPPostsScriptin\specials. TheresultswouldbGesuperior,butportability'9wouldbGelost.691.5,DesignCriteriauT9Having3studiedseveralpartialsolutionstotheproblem,wenowsetoutourbasicdesign9criteria.r1.'9TheremustbGenopreprocessing(cf.eqninPUnix)orinclusionof les(suchas'9PPostscriptpicturesinsertedusing\specialcommands): wtheentirediagrammust'9formpartofthesourceofthedoGcumentitself.r2.'9SimplediagramsmustbGeabletobedrawn\onthe y"andnotneedtobedrawnon'9papGerҤ rst(althoughobviouslycomplexdiagramswillalreadyhavebGeenworkedouton'9papGeranyway).r3.'9The$layoutofthesourcecoGdemustresembletheintendeddiagramasfarassyntactically'9pGossible.r4.'9TheremustbGenomeasuringoflabelstocalculateco-ordinatesorlengthsofarrows.r5.'9TheremustbGeavqarietyofarrowstyles,Ewithfacilitiesforde ningnewones.Diagonal'9arrowsshouldbGeprovidedatvqariousslopGes,albeitwithlimitedchoiceandfeatures.9 X-ffğ "5-:7Lܸ\WhatyÎouseeiswhatyouget."ٛ "5-:8LܸThewÎordsinRSmallCapitwwalsaretrademarks.=59w/?-iӍ{-r6.'9ThebpackqagemustbGecompatiblebothwithplainTU>'ExXandwithLffUPaTU>EX,andnotrely '9onnon-standardfonts^9 |sorlanguagefeatures.hr7.'9F*uture(versionswhichimprovetheappGearanceofthediagramsshouldbecompatible'9withpastpapGerswrittenusingthepackqage(butyouhackatyourownrisk).99Inadditiontherearestheticcriteria,someofwhichmaybGeamatterofopinion:89'9Arrowsshouldstretchtomeettheob8jectswhichareintendedtobGetheirendpoints.9'9ArrowsshouldbGealigned(bothhorizontallyandvertically)withthecentresofthe'9ob8jects.9'9LabGelsqonarrowsshouldnota ectthespacingofthediagramexcepttoavoid'9overlapping.9'9Stretchingofarrowsshouldnota ectthecenteringoftheirlabGels.!k92'UserMan=ual1O9MyversionofthediagramisproGducedasfollows:Xu9\inputdiagramsN㋍qɍ9$$\beginfdiagramg"qǍ/ϧA*(B*(C*D))yO|&\rTo^\AsslOW&(A*B)*(C*D)/&\rTo^\Assl; &((A*B)*C)*D\\"\dTo^{\Id*\Assl}yO|&OW&=/&; &\uTo_{\Assl*\Id}\\/ϧA*((B*C)*D)yO|&OW&?\rTo^\Assl/&; &(A*(B*C))*D\\9\endfdiagramg$$ J49whichyields*^荍TA8(BQ(CDG))塟1fb ㊍UVassl.ן1fb *|L>(A8Bq)(CDG) Ɵ1fb ㊍UVassl.1fb *|L>'X((A8Bq)C)Dyfb:J)<^M0fbVCid`z8asslyfb _߻=M0fbOrassla8idG"TA8((BQC)DG)塟1fb>HUVassl.1fb@|L>'X(A8(BQC))D1y9AsMyousee,qGitisbasedonKnuth'sversionbutdoGesnotadoptAUXMS-TU>'ExX'sMconfusingattempts 9toeliminate&s.rItalsostretchesthearrowstomeettheob8jects.ߍ92.1,Typingthediagram9Thebasicruleistodividethediagramintocells:Gҍ}OʍȍOȍȍȍȍȍȍȍȍȍȍȍȍȍȍȍùOʍȍOȍȍȍȍȍȍȍȍȍȍȍȍȍȍȍOʍȍOȍȍȍȍȍȍȍȍȍȍȍȍȍȍȍ<OʍȍOȍȍȍȍȍȍȍȍȍȍȍȍȍȍȍMA8(BQ(CDG))l1fbUVassl.\1fb|L>l(A8Bq)(CDG)Qǟ1fbUVassl.'y1fb|L>?Q((A8Bq)C)DQ@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@;G@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@1sFLщLfb1:b"5^e)LщLfbOLidZ*8asslsFLщLfb _}JȍJȍȍȍȍȍȍȍȍȍȍȍȍȍȍȍȍAùJȍJȍȍȍȍȍȍȍȍȍȍȍȍȍȍȍȍA{=ԟJȍJȍȍȍȍȍȍȍȍȍȍȍȍȍȍȍȍA;Ԥ<JȍJȍȍȍȍȍȍȍȍȍȍȍȍȍȍȍȍAe-LщLfbgoassly8idG!Q@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@;G@P@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@MA8((BQC)DG)l1fbN@UVassl.1fbO9|L>?Q(A8(BQC))D9><ffğ "5-:9LܸDiagonallinescan#fcmti8onlyb'ExX,in9thesamewayasitdoGesformatrices,tables,etc.)9Each cellshouldcontaineither )anob8ject(anordinarymathematicalexpression,Osetin9mathsKXmoGde)or^amorphism(anarrowsuchas\rTo^f). zHorizontalandverticalarrows9cannot8AbGemixedinonecell,FRandonlyonehorizontalarrowpGercellisallowed(butseethe9sectiononparallelmapsbGelow).9Likewise,jre-alignmentUofob8jectsusing\hfilislikelytofailsinceobjectsendupbGeing9setinan\hboxtotheirnaturalwidth(andheight).9DonotenclosethearrowcommandsinbGoxesorbraces,QbGecausethisalsopreventsthe9automaticstretchingfromworking.9EveryDmorphismmusthaveanob8jectateachendtoterminateit:itmustnotmeet9another1morphismorextendo theedgeofthediagram. SIfyouwanttousethearrow9commandsforotherlineswithoutob8jectstoterminatethem(thisishowtheabGovediagram9withTdottedcellswasdrawn),vthentheob8jectpGositionmustbGeoccupiedbyaspacecommand9such~as\;orbysomethingelsethatproGducesanob8jectbutdoesnotprint,D^such~as{}9or3R\null.iEven\relaxor\emptywoulddo,@'solongasthere'ssomethingotherthanwhite9space(orcomments)bGetweensuccessive&s.{Ifyouforgettoterminateanarrow,'gpartorall9ofitwillbGelost.9AnyZLffUPaTU>ExXenvironment,say\begin{env}...\end{env},isjustapackqagedwayofinvoking9the& commands\envand\endenv^10x,/soforplainTU>'ExXyoujustuse\diagram...\enddiagram9instead.rtThererisalsoacommand\commdiagwithanargument, Nbutthisisonly9included!forreversecompatibility*. OfcourseLffUPaTU>ExXuserscanalsosubstitute\[...\]or9begin{displaymath}...\end{displaymath}for$$...$$.>U)$$)\diagram$)...)\enddiagram)$$)ne}'ededforTU>'ExX`0or㍑}$$}\commdiag{...}}}$$}obsoleteorw֔\begin{displaymath}֔\begin{diagram}唒...֔\end{diagram}֔\end{displaymath}֔LffUPaTU>ExXonlyDorwaK\[aK\begin{diagram}pK...aK\end{diagram}aK\]aKLffUPaTU>ExXonlyG9TheE horizontalMarrowcommandsmayalsobGeusedintext,VKA1fb U]0 0ercmmi7ffb G|L>BLBq.Sincethereisno9enclosingmatrix,thisiswrittenas$A\rTo^fB$without&.9ArrowsҷmaybGemadetocomerightuptotheob8jectsbyusingthe\MapsAbutcommand;9thisisinfactanabbreviationfor\MapShortFall=0ptwhichsetstheactualamountofspace9at$"theendsofthearrows(default0.4em).IndividualarrowsmaybGealteredinthiswayby9usingthiscommandinsideacell.9EachcellinthediagramisforcedtobGeatleast\DiagramCellWidthwideand9\DiagramCellHeightchigh^11x.GThedefaultvqaluesare3em,|qwhichallowsforob8jectsofwidth9\MMM";Zifևthey'rewiderornarrower,theևbGestwayևtoadjustthesizeofthediagramisby9usingthecommand\CellSize=5emwhichchangesbGothparameterstogether.9 X-ffğw-:10LܸThereśisalsoanextralevÎelofgrouping,IandLwRaWTAi=EMXchecksthatthethesameenvironmenttypExXsense:'theycannot,forinstance,bGeusedin9foGotnotes.9TheruleforpGositioningthelabelsis9'9for"V cmbx10horizon9talarrows,\rTo^f_gand\rTo{f}{g}give1fb U]0f㋍(gfb G|L>";9'9forv9erticalarrows,\dTo^f_gand\dTo{f}{g}givefC?y;g[;9'9fordiagonalarrows,\SW^f_gand\SW{f}{g}putfabGoveandg[bGelow.9'9Usingtilde,thelabGelmayinsteadbreakthearrow\rTo~fgivesYA٪1fb Lύ8fO1fb1R|L>B9Althoughthearrowsextendintoadjacentcells,thelabGelsremaincentredinthec}'ellinwhich 9thearr}'owwasdeclared.9Anyordinary(mathematical)textyouputinthecellwithanarrowwillappGearinthe9usualrvway*.sForhorizontalarrowsitwillthereforebGeattachedtothearrowhead/tail,whilst9forverticalanddiagonalarrowsitwilllietothesideof(orbGetween)thearrows.dHoweverif9you:wanttoputasupGerscriptonthearrow-headyoushouldde neanewarrowcommand:9section2.4explainshowtodothis.9BydefaultthelabGelsonthearrowsaresetin\textstyle(thesamesizeasintext)9whenXtheyarepartofamatrix,andin\scriptstyle(likesubscripts)intext.:Howeverthis9maybGechangedbyre-de ningthecommand\labelstyle,forinstance9\begin{displaymath}9\renewcommand\labelstyle{\displaystyle}9\begin{diagram}9A&\rTo^{\sum^n_1f_i}_{\rmdisplay}&B9\end{diagram}9\qquad9...9\end{displaymath}9givesǟ'|ɍ ]#A/H1fbj ȴn CX :M1fi@ čʪdisplayD1fb;|L>_}B|lKAT1fbj8CPލn%1 fi 1 jtextȟ1fb;|L>щB xAA_>1fbj8n?CPƩO \cmmi5n$ƩZcmr51 fi S2SVscript(1fb;|L>C,B yjAjg1fbjy󇋟CP8Ƭn$ƫ17Ef1i 2F/scriptscript1fb;|L>UB َ)n9Similarly*,ob8jectsaresetin\displaystyleunlessthe\objectstylecommandisrede ned.9 Jffğw-:12LܸHoÎweverutheyarenotrecognisedsynÎtacticallyinthesamewayJ,]andsoforinstancenQnolimitswillnot wÎork.=8 {/?-iӍ{-92.3,Arrowstylescurrentlyav@ailableuT9The followingarrowstylesareavqailable,Oannotatedwiththeirnamesastheleading( rst, 9uppGer,superscriptorleft-hand)argument,e.g.X\rTo^{\ttrTo}.Thearrowsaremadeupof9juxtapGosedupieces,+asexplainedinthenextsection.Pleasenotethatgoodalignmentdepends9totalargeextentonhavinganaccuratedvidriver,whichmostarenot._WhereverpGossible,9thearrowshavebGeendesignedtobetolerantofinaccuracies,butthisisdiculttoachieve,9althoughitmayimprovewithfutureversions.dSomeofthearrowshavesynonymssuchas9\lFromforreversecompatibility*..QōٕNAZ }1fbɍ9ʰnrTo .qF1fb|L>$Bލg:O'[^ROfbgfbg%;wnuToRO**fb|ndTo**fb _8"N[CYbudBލg: ^sHȍHȍȍȍȍȍgy<HȍHȍȍȍȍȍg%nuDotsto7wshȍgȍȍȍȍwMDndDotstoxry<hȍgȍȍȍȍw _8" F>CM<Y@x'@@@@@@@@@@@.<`nlDotsto čbGU@|C@@@@@@@@@@@u(D[>ٕTD)A_&1fbō9*nrArr .|1fb 'ύ*D-_8Bލg X7ZD6Wfbg7"fbg%;#nuArrW**fbNndArr7#**fbfbD?8"TC_7D^G1fb9*nlArr .|1fbA## DٕOCA*@1fb"]Í9nrOnto .M-1fbg*LHa msxm10HtNBލ s" s""$^fbgx8fbg%c@nuOnto"**fbWIgndOntox9  fbǍa#a'#8" C*(QH3R1fb9nlOnto .M-1fb#!tD0ry7{U,@A7=>f=؍========Ѝ싇nrImplies 0j=========)7BލX卍-8*0q ȍakQȍakk! )ȍakȍakg%8FnuImplies0qȍakaktYndImplies"ЍȍakX)+8",C7N(AH='>=======ЍnlImplies 0jˍ=========(=Dٕ,o ;Bލg:- ^/ fb͠Hf%fbg%?nuMapsto/ 11fbffdfnZndMapsto&**fb _8",@C7HJ<81fb,!9JnlMapsto .d1fb-fb D4z7rzٕ@6AK>ߟg^0ncmsy5O:1fb#ݸ9nrIntoA .s1fb(o|L>9Bލg:A2^D!fb.;;\#88fbg%h6nuIntoAD!ccfb[}UndIntoA$**fb _8"@eCKmDDBލg:&}^)lfb.;U\.88fbg%AnuIntoB)lccfb[c`ndIntoB/**fb _8"%C0O<21fb&9nlIntoB .X1fb%*eD4ryٕ3t=A>>E1fb!I9nrEmbed .f1fb(o|L>@Bލg:4^7 fbXx6_g*q͉qfbg%H=nuEmbed7 y yfb: ^p\ndEmbedg+**fb _8"3EC>MKBލg:H`^KT~<31Vfb~<31Vfb~<31VfbgƤ~<31Vfb~<31Vfb~<31Vfbg%nuDashtoK춄VfbKT C~<31Vfb@~<31VfbndDashto()Vfbǟ C~<31Vfb@~<31Vfb _8"GCRғ892.4,De ningadditionalarrowsuT9TheTarrowcommandssuchas\rToarede nedinasystematicwayfrom veparts.nF*rom 9lefttorightortoptobGottom,theseare:[+leadingtip,  rst ller,middle,second ller,trailingtip9The'ExX'sexpandablebrackets.9F*orexample,9\newcommand\rCrossedInto{\HorizontalMap\rthooka-+-\rhvee}9$$\begin{diagram}9A& \rCrossedInto^f&B\cr9\end{diagram}$$9proGduces>6٭AلVg^1fbqōf *+1fbXj|L> BU9and7similarlyfor\VerticalMap.{UnliketheoptionallabGels,_Ithe veargumentsaremandatory;9nullargumentsmustbGegivenas{}or\empty.9SomesymbGolsmaybGeuseddirectlyasbitsofarrows,whilstothersneedtobGemoved9intothecorrectpGositions.LF*orinstance\>"(greaterthan)makesagoGodarrow-tailRbutis9not; suitableasahe}'adCbGecausetheshaftofthearrowwouldnotjoinupwithitspGoint.͕In9thesecasesitisbGettertode neanewsymbol(e.g.\rhvee)foruseaspartofanarrow.ޟ=10 Ѡ/?-iӍ{-9TheobvioussymbGols;q=; nequiv();j and$wnj(k)9areksuitableashorizontalandvertical llers.@Thesinglelines(-and|)aretreatedasspGecial 9cases:raruleisproGducedinsteadofarepeatingsymbol.rTheextrasymbols_[nhfdot; nvfdot;nhfdash and$wnvfdash9canbGeusedforhorizontalandverticaldottedanddashedlines. 6RepGeatingsymbGolsare9overlappGedeslightlytoensureagoGodjoin; thisalsomakesthemstickoutattheend, >sothe9samesymbGolshouldalsobeusedasatailifotherwisetherewouldbenone.a5Itisalsoa9goGodideatorepGeatdotsanddashesasmiddlestoensureregularity*. l9Thearrows#Md 0nleftarrowt?j(?knLeftarrow˿N(߿Onleftharpoonup=#)Q$nleftharpoondown!0nrightarrowt?j)?knRightarrow˿N*߿Onrightharpoonup=#+Q$nrightharpoondown?"0nuparrowv12*?knUparrow?OH߿Onupharpoonleft?$HQ$nupharpoonright?#0ndownarrowv12+?knDownarrow?OH߿Ondownharpoonleft?$HQ$ndownharpoonright%>㍑9maybGeusedasheads,althoughtheyarerathersmallandalsounsuitablefordottedlines9(someofthesesymbGolscomefromtheAMSmsxm10andmsym10fonts).rInstead%dOR<\nlhvee>snrhveefd_ndhvee:C^T;nuhveeOR\nlhcveesnrhcveefeHgndhcvee8CHfT;nuhcveeN\nlhvveersnrhvveefd_䍒fd_ndhvvee:C^䍒C^T;nuhvveePD\nlhlaD-snrhlaD?ndhla FWD6T;nuhla9proGducebetterresults.rThefollowingarealsouseful:%ƍM, H@ ntwoheadleftarrow/jntriangleleft%HJ7nblacktriangleleft, H@ ntwoheadrightarrow.jntriangleright%HI7nblacktriangleright .".Ÿ"@ ntwoheaduparrowM4jntriangleup%HN7nblacktriangle.#.Ÿ'#@ ntwoheaddownarrowwJOjnlittletriangledown%HH7nblacktriangledown%ō9someofwhichhavebGeen\madeup." l9Thefollowingareusefulastails:>㍍d61B>G`ngtq8R<pnlthHNnblacktriangleRHJ-nnblacktriangleleft6{^G`nwedgeqƋ_pnveehHHnblacktriangledownRHI-nnblacktriangleright9togetherwiththefollowingmadeupsymbGols:>㍍daeB!fbofnltbarȓB!fb6nrtbar_@ffZnutbar0 քf?bndtbar^g^ofnrthookaFm@6nrthookbg^fZnlthooka/T}@?bnlthookb`~[ofnuthooka_R[6nuthookbr\fZndthooka.&F\?bndthookb9whicharedesignedfor\rMapsto,\rIntoA,etc. l9SubscriptsandsupGerscriptscanbeaddedtoarrowheads:9\newcommand\rToStar{\HorizontalMap\empty-\empty-{\mathop{\rhvee}\limits^*}}9$$\begin{diagram}9A&\rToStar^f&B\\9\end{diagram}$$9proGducesA1fb U]0ffbg蹍*dw>n8LBq.9When֖designingnewarrowstylesyouneedtoknowtheexactrulesgoverningtheway9thebitsareputtogether.\9'9Allbitsareindividuallysetin\hboxesinmathsmoGde.ޟ=11 6/?-iӍ{-9'9Theshaftofthehorizontalarrowsiscentredonthe\mathaxis",=sothatsymbGols(such '9as\scriptstylearrowheads)whicharenotalignedonthisaxismustbGe\raised.9'9The]middleandtipsofhorizontalarrowsarenarrowedby ;1&fe12emoneachside(this'9bGeing)themarginformostofthecmmi10andcmsy10characters)sothattheyjoinup'9withthe ller.9'9The|middleandtipsofthevertic}'alarrowsarehorizontallycentred,fsotoshiftthemleft'9orBrightrelativetotheshaftitisnecessarytokernbytwic}'etherequiredshift.Since'9thereisnotoporbGottommarginonthestandardcharacters,noshorteningisdone.9'9The llersegmentsareshortenedateachendbyupto0.15em(horizontal)or0.35ex'9(vertical)sothatwhentherepGetitionsarespacedouttheywilljoinup.92.5,ExtendingverticalarrowsL.9ThecubGeo ersagoodexampleofhowhorizontalandverticalarrowsstretch.Noticehow9theљcellshaveљbGeensub-dividedfurthertogivethe\3D"ce ect.,andthatthepositionsof9thelabGelsonthemapsbetraythecellsinwhichtheyweredeclared.~nqɍ9$$\beginfdiagramgRqǍ7A'YϏ&v&\rArr^{f'}Q&,&?B'F&j&\\YϏ&?\SE_av&Q&,&\vLine^{h'}F&\SE_bj&\\"\dArr^{g'}YϏ&v&?AQ& \rArr^f,&_\HonVF&j&_B\\YϏ&v& \dArr^gQ&,&_\dArrF&j&\\7C'YϏ&\hLinev&\VonHQ&\rArr^{k'},&?D'F&j&\dArr_h\\YϏ&?\SE_cv&Q&,&F&\SE_dj&\\YϏ&v&?CQ&,& \rArr^kF&j&_D\\9\endfdiagramg$$ ڍ9The5brokenlines(h^0MnandkP^0)aresimplytwoarrows.Thecommands\HonV(\horizontal9on$vertical")and\VonHɮ(\verticalonhorizontal")allowarrowsinonedirectiontopass9through,$[whilstobstructingarrowsintheotherdirectionasifanob8jectwerepresent.sThey9eachhaveanoptionalargument:\HonV[=]and\VonH[\|]shouldbGeusedtoallowextra9spacecfordoublelines.Thereisalsoacommand\HmeetV`whichcausessinglehorizontaland9verticallinestomeet,formingacorner.9Hereistheresult:oa*RA01fb2ڍf^0#!1fb5 ͍ύ*D-BBq0>8 8 fb Jfb6ҟD@b@rV@bLoarWD@YB (@@R:h^0 JL։Lfb6ߟD@b@!V@"b+WD@2YO (@8@8RG"Bg[ٟ^0>/z/zfbfbD?8vAٸs1fbjڍ.9f#&1fbTt퍍ύ*D-EgBUTDfb JL։LfbUTIP8 8 fbU[kgDO*O*fbfbD? Kwwfbfb?C0M1fb1Lώ#1fb*+1fbkP^0.#%1fbѝύ*D-JDG0IR1*1*fbfbD?LdhG"6ҟD@b@rV@뷟LocrWD@YB (@@R6ޟ@b@!~V@" ,d+~WD@2YN (@8@8R Cן1fb3UޟdWџ1fb? " Ba7Œʇfbō:^ۋfb ̍ΰhʇ**fb _a**fbzkG"C9"f9'9Horizon9talG{arrowsmaybGe\piledontopofeachother. E ectively*,Yaone-column'9diagram.iscreated,zwhichmayhaveeitherBahorizontalarroworBanob8jectineach'9row.This*worksbGothindiagramsandintext.Thespacing(\baselineskip)between'9therowsis.5\PileSpacing,ontheassumptionthatyouwillputsomethingbGetween'9parallelA(arrows;aablankline(\\\\)willsuce,Qrthenthespacingisthesameasthat'9forverticalarrows.9'9V erticalsarrowsmaysimplybGeputtogetherinthesamecell,withanytextbGetween'9them.rThespacingisalways\PileSpacing.(\pilemustnotbGeused.)9'9TheexpGerimental\ParallelMapcommand(whichappGearedinthesourceofprevious'9versionsbutneverworked)hasnotbGeenandwillnotbeimplemented.9'9Diagonalbylinesarecurrentlyimplementedas xed(non-stretching)bGoxesandcan'9thereforeepbGejuxtaposed,separatedwithexplicitspaceandmovedepwith\raiseor'9\raiseboxcommands.rHoweverthiswillbGeincompatiblewithfutureversions.692.7,DiagonallinesuT9Aswehavealreadysaid,TU>'ExXmakesdrawingdiagonallinesvery}dicult:9'9thereisnodiagonalruleprimitive:rjuxtapGosedcharactershavetobGeused,9'9there>isnosquareroGotfunctiontoenableonetocomputethediagonallengthofa'9character(usingPythagoras),9'9thereisnodiagonalleaderfunctionforrepGetition,9'9pGositioning5oflinesegmentsinvolvessomanyhorizontalandverticalshiftsthatdvi'9driversinevitably\losetheirplace"withroundingerrors,rsothatthesegmentsdon't'9joinup.ޟ=13ڵ/?-iӍ{-9Consequently*,thehprovisionofdiagonalarrowsinthispackqageisratherprimitive,andonly 9singlenunbrokenLffUPaTU>ExX-stylearrows(like\rArr)areprovidedattheslopGesindicatedbythe9diagram. Notice4thatallofthediagonallinesliebGetween4ob8jectstwo4cellsapartinone9directionandtwo,Rthree,fourorsixcellsaparttheotherway*.LongerlinesmaybGeobtained9withs4\NE(4,4)^for\sSE(4,6)_g,forinstance,butthenumbGerss4mustbGeconsistentand9\DiagramCellHeightand\DiagramCellWidthmustbGeequal.9Thosearrowswhichextendthroughseveralrowsaredeclaredinthetopcellinwhich9theyprint,6i.e.intherowandcolumnadjacenttotheuppGerterminatingob8ject(irrespective9ofthesenseofthearrow).9F*orexample,hereisthediagramde ningapullback:fnqɍ9$$\beginfdiagramg:qǍRUY&/Y&"&@ &j\\Y&\SE\ESE^x\SSE_y/Y&"&@ &j\\Y&/Y&X\times_Z\SEpbkY"&\rTo_p@ &Xj\\Y&/Y&_\dTo^q"&@ &\dTo_fj\\Y&/Y&,Y"&\rTo^g@ &Zj\\9\endfdiagramg$$9whichgivesEĸFU+D@.b@Ə˟V@Џ˟W@ (@Qk@QkRޟHڟqQH֟H۩ҟSHΟVHEVxΟWDHuʟ6H[Ɵ H AŸ\H'H'j3 Ax˟AAK AJ 7yAˏ˟YAƓ" ryЏ˟$YDAՋ-S9AK5Aa >nA˟FA싟OA싟OUܮXZ ? ~C ;Yp؟1fb ULύ.5ppٟ1fb2|L>(MX ݍ\fb'-fb'&Qq\**fb _-**fb _/BfU[@YY1fb݁ڍ:gpڟ1fb|L>)ZdM9The\rightangle"symbGol\SEpbkisjustlikeacharacterwhichprintswayoutsideits9(zero-size)_bGoundingbox.;Therearealsothreeothersfortherarecaseswherethepullback9isnotupwardsandleftwards!rNoticethatthestretchingalgorithmalignstheg[withthep.692.8,Posets(HasseDiagrams)uT9Posetsymaretrivialcategories,Xbutinpracticethey'rethemostdicultdiagramstodraw!Here9islanexamplewhichillustratesmanyoftheforegoingtechniques.$[Makeitmorecomplicated!]O*qɍ9$$\CellSize=1em\MapsAbut\beginfdiagramg"qǍ o'&a&oqo&f& ooP&o7& o/!&Co&oS.&&o\\'&\WNW\WWNWa&qo&\NW\WNWf&\uArroP&\NW\NEo7&\uArr/!&\ENE\NECo&S.&\EENE\ENE&\\'&a&qo&f& ooP&o7& o/!&Co&S.&&\\9\endfdiagramg$$|o|o|o|o|o2|o 5D6ڵӟfb 86֟fbdYdH&bHVHWHë(HmHQUTiQUVP%VPxqVPVPPYP!P:P#I#@V@V@ͮ!@dYdH&bHVHWH(Hm Hڵџ ɉ fb#I#@V@V@$@#VV$$ԟ ɉ fbd'(WV bmm*#VV ' 'WxwVYV'%V!:UV!:UT1e'( WV b$m$m*|o|oޟ=143/?-iӍ{-93'Implemen=tationandcompatibility9Thediagrampackqageiscurrentlyavqailableasasingle30kb^13 printableTU>'ExXsource lewhich 9iscompatiblewithbGothLffUPaTU>ExXandplainTU>'EX.ItloadstheLffUPaTU>EXline10fontas\tenln9(itsLffUPaTU>ExXname)andalsode nessome(exotic)arrowcommandsintermstheAMSsymbGols,9butifthesearetobGeusedthenthe lemssymb.texmustbeloadedseparately*. ׂ9Compatibilitywithpastandfutureversions(thenumbGersofwhichhavebGeenassigned9p}'ostfacto)isasfollows:59V ersion0:FwOriginalimplementationofTU>'ExXercise18.46;April1986.39=9\matrix{..}mustbGechangedto\diagram..\enddiagram(or\commdiag{..}).39=9\mapright,Oetc.,must bGechangedto(orde nedas)\rTo.SPositionalarguments=9arestillrecognised,solongastheyar}'eenclosedinbraces.39=9\crshouldbGechangedto\\.9V ersion1:FwHorizontalarrowsmadetostretchtoedgeofcell;1987{9.39=9\rTo{f}{g}works,but\rTofgdoGesn't:ritmustbGechangedto\rTo^f_g.39=9\mkern-20mu\rTo{f}{g}\mkern-20muidiomformanualstretchingofhorizontal =9arrowstomeetob8jectsmustbGeremoved.39=9\VerticalMapHeightand\VerticalMapDepthcommandsshouldbGeremoved.39=9Therearenow veargumentsto\HorizontalMap,#\VerticalMapand\DiagonalMap.39=9Nested\commdiagcommandsforparallelmapsshouldbGechangedto\pile.39=9ParallelmapscontructedbyputtingthemintherowsorcolumnsbGeforeandafter=9mustbGemovedtothecorrectcellandputina\pile.9V ersion2:FwHorizontalcarrowsmadetostretchtomeetob8jectsand\supGerscript"labels'9introGduced;~widely>OcirculatedversionswithabannerdatedSeptembGertoDecembGer1989.39=9&\rTo\across3&shouldbGechangedto&&\rTo&&;X\acrossdoesn'tworkatallwith=9ob8jects,andisonlysuppGortedforarrowsforbackwardscompatibility*.39=9The-parameters\HorizontalMapLength,W\VerticalMapHeight,\VerticalMapDepth,=9\VerticalMapExtraHeight,ԃ\VerticalMapExtraDepthɣand\DiagonalLineSegments=9areobsoleteandshouldbGeremoved.39=9The+labGelsonsoutheastandnorthwest+diagonallineshave+beeninterchanged+(^and=9_:previouslymeantleftandrightrespGectivelyfordiagonals;Jtheynowmean|=9morelogically|abGoveandbelow).39=9Diagonallinesareconstructeddi erently;t+user-de neddiagonalarrowsshouldbGe=9replaced]Hwith\NNW\etc.,andexplicitmovement]Hofthemremoved. 4KWhere]Hitis=9still3necessarytode neadditionaldiagonalarrowcommands,@thecoGordinates,e.g.=9(2,4)mustbGegiven,andshouldbGeaddedtothede nition.39=9Bentlines,with\dlBentand\ruBentto,currentlydonotwork.a4Instead\HmeetV=9mustbGeplacedatthecorner.9V ersion3:FwV*erticalmapsalsomadetostretchtomeetob8jects;current.9F uture:7DiagonalalineswillbGemadetostretchinsofarasthisispossible, soexplicit'9movement1ofdiagonalswillbGecomeincompatible.Itisintendedthatasinglecommand,'9such as\nwTo, `willserveforallslopGes, `theslopebeinggivenbycoGordinates; sincethe'9partsGofthearrowcommandwillthentheslopGe-dependent,theGwayofde ningthem'9willchange.97ffğw-:13LܸWithoutcommenÎts;thedevelopmentversionistwicethissize.ޟ=15Ӡ/?-iӍ{-9The*jgeneralrulewiththisversionistoremovethehackswhichwereneededtopGosition 9verticalsIetc.bGefore.Y*oumustalsobGecarefultoensurethateveryarrowisterminatedby9anob8jectorpseudo-objectateachend,uandthatthereisthecorrectnumbGerof&s. cBecause9of2"theway2"terminatingob8jectscontrolthebGehaviousofarrows,~thisversionismuchless9tolerantthanearlierones.9Suggestions1forimprovements1andfurtherapplications(e.g.proGofnetsandPetrinets)are9welcome.9InlImpGerialCollege,thepackqageisavqailableon/home/leonardoandwillbGepickedup9automaticallybythetexandlatexcommands.9I[wouldliketothankSimonAmbler,߬R}'ogerCrew,߬V;aleriadePaiva,EugenioMo}'ggi,,9LukeOng,qV;aughnPr}'attandJaneSpurr,whohaveusedpre-releaseversions,fortheir9comments5andsuggestionsandr}'equest5thosewhousethisp}'ackageintheirpublishedpapersto9acknowle}'dgeme.ޟ=16 /?-iӍ5@ԍNqɍ9$$\beginfdiagramgqǍp/&<&Go&f&oo&ʯL&o6&/ &3 &S.&]&n&.\\ /&<&Go&f&oo&_\NNNWʯL&o6&\NNNE/ &3 &S.&]&n&.\\/&<&Go&f&oo&ʯL&o6&/ &3 &S.&]&n&.\\/&<&Go&f&oo&\NNWʯL&o6&?\NNE/ &3 &S.&]&n&.\\/&<&Go&f&oo&\nNWʯL&o6&?\nNE/ &3 &S.&]&n&.\\/&\WWNW<&Go&\WNWf&\wNWoo&\NWʯL&\uArro6&\NE/ &\eNE3 &\ENES.&]&\EENEn&.\\/&<&Go&f&oo&_\lArrʯL& *o6&\rArr/ &3 &S.&]&n&.\\&&&&&\WWSW\WSW\wSW\SW\sSW\SSW\SSSWʯL&\dArr8&\SE\eSE\sSE\ESE\SSE\SSSE\EESE&&&&&.\\/&<&Go&f&oo&ʯL&o6&/ &3 &S.&]&n&.\\/&<&Go&f&oo&ʯL&o6&/ &3 &S.&]&n&.\\/&<&Go&f&oo&ʯL&o6&/ &3 &S.&]&n&.\\/&<&Go&f&oo&ʯL&o6&/ &3 &S.&]&n&.\\/&<&Go&f&oo&ʯL&o6&/ &3 &S.&]&n&.\\ 9\endfdiagramg$$9proGduces(thearrowsbutnotthelabelsof):K@nNNNWMnNNNEȟDMȟB BP1TB JB؟bB{XBĻ`&B¤/B8\B=B_B&K B-şTB5 ^cBnNNWJnNNE>nnNW}DK}A=AMA A}7yA=YA=$YAd-S9A֪5A}>nA6=FA{OAFnuArr„ODDFN>nğ5ل-S9D$Y DYe7yğ 6D||KnnNE RsD65 5 fb+4nWWNWi9nWNWnNWןD]ןJAJIJt WJ?WJJ)!Ju(HJ1Jݟ1 ǟ(H I! tW  E W J/ uA   _KnNE;PneNEYSnENE[nEENEM'UNDiM'URPW쒨Pa9ןPj/ TPtJP~eߟP7VP7P؏XP[PK? ұP P½M]PwGPJYJHmFqQHSBH9>SH:VH:WH66H2 H.\Hӷ*H쪣k쪥QQ{gQ1fbLώ I1fb- ύ*D-9QnrArrfbM'D)M'WM]a9ן j/ ұt[~eߟX77V؏JK? T½쒨wGURJJmF\SB 9>6:W:V6S2.qQӷ*+,xz=;p;V+g8E~쪥] ]m (=W=VԀ bݟ՟1՟1 (H I! tW = W J' uA }O }O=FM>n5}-S9=$Y=Yd7y֪ }6={Ƞ Ƞ rPyYgp@؟g(^cĻ`T¤K B_=8\&/-ş&5 {XnA6DFA|OA|OUϟBBW1TB JBߟbB#{XBg&B«/B8\B DB_B &K B-̟TB5^cBnSW _KnSE;PneSEYSnESE[nEESE>nsSWFndArrKnsSE>nSSWJnSSE@nSSSWMnSSSEޟ=17;/R- cmcsc10QCscmtt8P- cmcsc10O- cmcsc10N- cmcsc10JTmsxm5Ha msxm10DO line10Cu cmex109DtGGcmr177"Vff cmbx101߆T cmtt120N cmbx12.@ cmti12-!", cmsy10+XQ cmr12 cmmi10K`y cmr10t : cmbx9o cmr9#fcmti8K cmsy8 |{Ycmr8 O!cmsy7 0ercmmi7ٓRcmr7Aacmr60ncmsy5O \cmmi5Zcmr51: