; TeX output 2001.10.31:1001y? UUsGGecrm1728UnehnouvyellecrituredesenvironnementsBCGGecss1728tabularYethayrraydeL]b' ecrm1200AǺTK*EOX!", cmsy10\FeranklMittelbacwhDawvidlCarlisle2K cmsy8yߍxTeraductionlfranaiseparJean-PierreDrucbSert2zvVImprimlle31oSctobre2001#π!!u ecbx0900Rsum鎟 S{\bfseries}l.V*ousn'tesjplusU obligsdecommencerchaqueentrepar\bfseries.Rffffr @ -:q% cmsy6K"ecrm0800Ce(cÒhieralenumrodeversionv2.3m,rvisle1998/05/13. Z-:yKDaÒvid*Iaacceptgrcieusementl'inclusiondeco{decl.}fffd<,Peut,treutiliseavqantuneoptionl,r,c,p,moub.Ceci <,insre_jdecl.directemententtedel'entredanslacolonne.BR ff ffffCC ff<{decl.}fffd<,Peuttreutiliseaprsuneoptionl,r,c,p,moub.Ceci <,insreU decl.justeaprsl'entredanslacolonne.BR ffffCC%ff^ڟ|%fffd<,Insreuneligneverticale.Ladistanceentredeuxcolonnes <,seraaaugmentedel'paisseurdelaligne,contrairement<,laU dnitionoriginaledeLfAzTUY&E9X.BR%ffffffCC!=ff!{decl.}=fffd<,Peut/treutilisen'impGorteoetcorrespondl'option|. <,Laddirenceestquedecl.serainsrelaplaced'une<,ligneaverticale,donccetteoptionnesupprimepasl'es-<,paceNnormalementinsrentrelescolonnes,contrairement<,U @{...}.BR=ffffffCC n=+V eccc1000T ab.U 1Lesoptionsduprambule.ajDansOlescolonnesquionttengendresparp,moub,lavqaleurpardfaut jdeU \parindentest0pt.CecipGeuttremodipar:j>{\setlength{\parindent}{1cm}}p.ajles&optionsavqaient&tdveloppGesl'originepourl'applicationsui-jvqante7:>{$}c<{$}engendreunecolonneenmoGdemathmatiquedansunjenvironnementVR,6 ecss1000tabular.SivousutilisezcetypGedeprambuledansunen-jvironnementarray,vousobtenezunecolonneenmoGdeLR]carlesdollarsjsupplmentairesU annulentceuxdjprsents.ajV*ousDpGouvezaussipenserdesapplicationspluscomplexes.UnproblmejclassiqueDpGeutfacilementtrersoluaveclasquence>{\centerdots}cj<{\endcenterdots}.CPourcentrerdesnombressurleurspGointsdcimaux,jilU sut^1 {(juste?)dednirlesmacrossuivqantes: j{\catcode`\.\active\gdef.{\egroup\setbox2\hbox\bgroup}}j\def\centerdots{\catcode`\.\active\setbox0\hbox\bgroup}j\def\endcenterdots{\egroup\ifvoid2N\setbox2\hbox{0}\fiRffffr E !i-:1KC'est(FJrankMittelbacÒhquileditj!(2 y?y+\ifdimN\wd0>\wd2\setbox2\hboxto\wd0{\unhbox2\hfill}\else 6\setbox0\hboxNto\wd2{\hfill\unhbox0}\fiy+\catcode`\.12N\box0.\box2} jAttention\#:cesmacrosnemarchent\#passiunecellulecompGorteplusieursjpGointsdcimauxousiletableauestutilisenargumentd'uneautrecom-jmande.4UneapproGchebienmeilleureestd'utiliserlepackqagedcolumn.styjcritU parDavidCarlisle.ajEnutilisantc!{\hspace{1cm}}cvouslargissezd'uncentimtrel'espacejentredeuxcolonnes,tandisquec@{\hspace{1cm}}cvousdonneexactementjunU centimtred'espaceentredeuxcolonnes.YR-!N ecbx12001.1pDnirdenouveauxtyp_esdecolonnestaAlorsU qu'ilestpratiquedetapGerݼ\newcolumntypeqk>{ !", cmsy10h.HЃ ecti1000quelques*d}/clarationsic.}{c}<{hquelques*autr}/esHd}/clarationsi}Rsi!vousavezunecolonneparticuliredansuneseuletable,celadevientpGeupra- Rtiqueisivousutilisezsouventdescolonnesdecetteforme.LanouvelleversionvousRpGermet;dednirunnouveauspcicateurdecolonne,parexemplex,quirem-RplaceraͮplusieurscommandesdespGcicateursdecolonnes^2|2.NouspouvonsdoncRdnirU :qk\newcolumntype{x}{>{h8d}/clarationsi?i}{c}<{hautr}/es!hd}/clarationsiY}}ROnM pGeutalorsutiliserlespcicateurdecolonnexdanslesargumentsdeprambule RdeRtouslesenvironnementsRarrayoutabulardanslesquelsvousdsirezceformat.aIlQesthabitueld'avoirQbGesoindecolonnesenmodemathmatiqueetenmodeLRRdansU lemmetableau.Sinousdnissons:qk\newcolumntype{C}{>{$}c<{$}}k\newcolumntype{L}{>{$}l<{$}}k\newcolumntype{R}{>{$}r<{$}}Ralors nouspGouvonsutiliserCpouravoir unmodeLRcentrdansunarray,ouunRmoGdeU mathmatiquecentrdansuntabular.aL'exemple.donnplushautpGourlespointsdcimauxcentrspGourraittreRaectU unspGcicateurdparlacommandesuivqante:k\newcolumntype{d}{>{\centerdots}c<{\endcenterdots}}aCette>&solutioncentretoujourslepGointdanslacolonne.Cecin'estpastrsjoliRsizlacolonneestformedegrandsnombres,maisavecpGeudedcimales.UneautreRsolutionU d'unecolonnedest:k\newcolumntype{d}[1]{>{\rightdots{#1}}r<{\endrightdots}}RoU lesmacrosadquatesseraient^3R:q`+\def\coldot{.}%NOusivouspr\'ef\'erez,\def\coldot{\cdot}Rffffr E !i-:2KCettecommandetaitappengendraientuneerreurdansjlesversionsantrieures,maissontmaintenantautorises.Parexemple,j>{hde}/cl1Zi+}>{hde}/cl2Zi}U estquivqalent>{hde}/cl2Zi+hde}/cl1Zi=0V}.ajLacommande\extracolsepnefonctionnepasaveclesanciennesversionsjdearray.sty(lirelescommentairesdansarray.bug).Aveclaversion2.1,j\extracolsepg0pGeutdenouveautreutilisedansdesexpressions@{...}jcommeH/avecleLfAzTUY&E9Xstandard;ellepGeutaussisetrouverdansunecommandej!{...},U maisilconvientU delirelanoteci-dessous.nmessagesd'erreurengendrsendcoGdantlesspcicationsdescolonnesjfontZ{rfrencel'argumentduprambule0]f ecbx1000aprsqu'ilatrcritparlajcommandeu\newcolumntype,etnonpasauprambuletelqu'ilat铀critjparpl'utilisateur.CelasembleinvitablepGourtoutsystmeutilisantunpr-(6C+y?jtraitement,U etestdoncconsidrcommeunefonctionnalit. ajLeetraitementdeladclarationdeplusieurspGeutsemblertrangejdegprimeabGord.Lesanciennesversionsconsidraient>{hde}/cl1Zi+}>{hde}/cl2Zi}jcomme]πquivqalant>{hde}/cl1Zi+hde}/cl2Zi=0V}.CepGendant,celaempGchel'utilisa-jteurMderemplacerlesparamtresd'unecommande\newcolumntyped-jnieenutilisantcesdclarations.Parexemple,suppGosonsquenousuti-jlisonsL{unspGcicateurdecolonneCK(dniau-dessus)dansunenviron-jnement3array.LeC3Yindiquedutextecentrdanslacolonne,alorsquej>{\bfseries}C,quiestrcriten>{\bfseries}>{$}c<{$}nepGeutpassp-jcierunecolonnedetexteengras,parcequeleprambuleressembleraenjfaitr\hfil$\bfseries$#$?$\hfiletdoncletextedanslacolonnen'estjpas.aectparlacommande\bfseriesU&!Laversionactuelleinversel'ordrejdezcesdclarations,etainsil'exempleprcdentfournitunprambuledejla5forme\hfil$$\bfseries#$$\hfil,lesdollarss'annulant5mutuellementjpGourU donnerl'eetescompt.ajL'utilisation0de\extracolsepestsujetteauxdeuxrestrictionssuivqantes.Iljdoitcyavoirauplusunecommande\extracolsepparspGcicateur@ouj!,9etcettecommandedoittreentretellequelle,ellenedoitpastrelejrsultatU dudveloppGementU d'unecommande.jAinsi,HP\newcommand{\ef}{\extracolsep{\fill}}...@{\ef}HPnemarchepasjaveccepackqage.CepGendant,ilestpGossibled'utiliserlaplaceuneconstruc-jtionU comme\newcolumntype{e}{@{\extracolsep{\fill}}.ajComme8indiqudansleLfAzTUY&E9XbGook,8andednirlacommande\multicolumn,jchaqueacolonnel'exceptiondelapremireestcompGosedutextecomprisjdansܯlacelluleetdecequisetrouvedansl'espaceentrelescolonnessitu鎡japr}/scetteңcolonne.Celasigniequedansuntableauavecңcommepram-jbule@|l|l|l|l|,uneentretelleque\multicolumn{2}{|c|}estincorrectejsiU ellen'intervientU pasdanslapremirecolonne.jDanshleLfAzTUY&E9Xstandard,cetteerreurn'estpastellementvisibleparcequejcetteSversiona0joutedesespacesngatifs,sibienquechaque|n'oGccupeSpasdejplacehorizontalement.Maisdanscepackqage,leslignesverticalesconserventjleurU paisseur,onvoitalorsdeuxlignessideuxbarresonttspGcies.!֍R3iTheG\dopcumenctationdriverle~RTherstbitofcoGdecontainsthedocumentationdriverleforTUY&E9X,Ɨi.e.,theleRthatXfwillproGducethedocumentationyouarecurrentlyreading.CItwillbGeextractedRfromU thislebythedocstripprogram.U1\% cmsy9h1ow cmss9driveroi U2\\NeedsTeXFormat{LaTeX2e}[1995/12/01]U3\\documentclass{ltxdoc}U4U5\\AtBeginDocument{\DeleteShortVerb{\|}} r%NundothedefaultisnotusedU6U7ac\usepackage{array}(7Ry?U8\h$5" cmmi9=driveroiU9\hdriveroi R10R11ac%NAllowlargetableatbottomR12ac\renewcommand{\bottomfraction}{0.7}R13R14\\EnableCrossrefsR15ac%\DisableCrossrefs+%NSay\DisableCrossrefsifindexisreadyR16R17\\RecordChangesU|%NGatherupdateinformationR18R19\\CodelineIndexU|%NIndexcodebylinenumberR20R21ac%\OnlyDescription8%NcommentoutforimplementationdetailsR22ac%\OldMakeindex!"%NuseifyourMakeIndexispre-v2.9R23\\begin{document}R24j֘\DocInput{f-array.dtx}R25\\end{document}R26\h=driveroi!֍R4iTheG\constructionofthepreamcble~RItisobviousthatthoseenvironmentswillconsistmainlyofan\halign,bGecause RTUY&E9XrttypGesetstablesusingthisprimitive.}ThatiswhywewillnowtakealoGokatRthealgorithmwhichdeterminesapreamblefora\halignstartingwithagivenRuserU preambleusingtheoptionsmentionedabGove.aTheGcurrentversionisdenedatthetopoftheleloGokingsomethinglikethisR27\hpack9age#g i R28\%\NeedsTeXFormat{LaTeX2e}[1994/05/13]R29\%\ProvidesPackage{array}[\filedate\spaceNversion\fileversion]aThemostinterestingmacrosofthisimplementationarewithoutdoubtthose Rwhich arerespGonsiblefortheconstructionofthepreambleforthe\halign.RTheaunderlyingalgorithmwasdevelopGedbyLampor t(resp.Knuth,cseetexhaxRV87#??),U andithasbGeenextendedandimproved.aTheOuserpreamblewillbGereadtokenbytoken.,;AtokenisasinglecharacterlikeRc@orabloGckenclosedin{...}.F*orexamplethepreambleof\begin{tabular}R{lc||c@{\hspace{1cm}}}U consistsofthetokenl,c,|,|,@and\hspace{1cm}.aThecurrentlyusedtokenandtheone,usedbGefore,areneededtodecideonhowRther"constructionofthepreamblehastobGecontinued.ȅIntheexamplementionedRabGovethelcausesthepreambletobeginwith\hskip\tabcolsep.F*urthermoreR#?\hfill-wouldbGeappendedtodeneaushleftcolumn.Thenexttokenisac.RBecauseitwasprecededbyanlitgeneratesanewcolumn.|ThisisdonewithR\hskip?\tabcolsep&\hskip\tabcolsep.KThecolumnwhichistobGecenteredRwillbGeappendedwith\hfil?#\hfil.K(Thetoken|wouldthenaddaspaceofR\hskip?\tabcolsepĹandaverticallinebGecausethelasttokenswasac.kTheRfollowingtoken|wouldonlyaddaspace\hskip?\doublerulesepbGecauseitwas(8 `y?Rpreceded?bythetoken|.jjW*ewillnotdiscussourexamplefurtherbutrathertake RaU loGokatthegeneralcaseofconstructingpreambles.aThef=exampleshowsthatthedesiredpreambleforthe\haligncanbGecon-RstructedassoGonastheactionofallcombinationsofthepreambletokensareRspGecied.vThere9are18suchtokenssowehaveK`y cmr101918 =3429combinationsifRwe{ countthebGeginningofthepreambleasaspGecialtoken.>F*ortunately,ąthereRareTmanycombinationswhichgeneratethesamespaces,willidentifyatokenwithinaclasswithanumbGer,sowecaninsertRthe>formatting(forexampleofacolumn).jT*able2listsalltokenclassesandtheirRcorrespGondingU numbers.㍠`n0tokenR\@chclass[^\@chnumǍw_Nc=0:`0w_Nl=0:`1w_Nr=0:`2lp-arg=0:`3lt-arg=0:`4lb-arg=0:`5w_N|=1:`0l!-arg=1:`1l<-arg=2ۺl>-arg=3ۺ]Jcff~>etoken4LJ\@chclassp\@chnumǍ+StartI54}c+@-argI55}c!I56}c@I57}cI59}cpGf]103tGf]104bGf]105ӍjT*ableU 2:qClassesofpreambletokens\@chclass'5\@chnum ݼ\@lastchclassRThe@NclassandthenumbGer@NofthecurrenttokenaresavedinthecountregistersR\@chclassyand\@chnum,¼whiletheclassoftheprevioustokenisstoredintheRcountlչregister\@lastchclass.Allofthementionedregistersarealreadyallo-RcatedLninlatex.tex,N+whichisthereasonwhythefollowingthreelinesofcoGdeareRcommentedRout.pLaterthroughoutthetextIRwillnotmentionitagainexplicitelyRwheneverU Iusea%sign.qThesepartsarealreadydenedinlatex.tex. fR30\%N\newcount\@chclass R31\%N\newcount\@chnumR32\%N\newcount\@lastchclass4 k \@addtopreambleRW*eUwillsaveUthealreadyconstructedpreambleforthe\halignintheglobalmacro R\@preamble.qThisU willthenbGeenlargedwiththecommand\@addtopreamble.R33\\def\@addtopreamble#1{\xdef\@preamble{\@preambleN#1}}y[R4.1pThecharacterclassofa6} ecsx1200tokent \@testpachRWith͑thehelpof\@lastchclasswecannowdeneamacrowhichdeterminestheRclassGzandthenumbGerGzofagivenpreambletokenandassignsthemtotheregistersR\@chclassU and\@chnum.R34\\def\@testpach{\@chclass(9 m/y?RFirstUwedealwiththecasesinwhichthetoken(#1)istheargumentof!,V%@,<Uor R>.qW*eU canseethisfromthevqalueof\@lastchclass:R35ac\ifnumN\@lastchclass=6\@ne\@chnum\@ne\else R36fJ\ifnumN\@lastchclass=75\elseR37j֘\ifnumN\@lastchclass=8\tw@\elseR38o\ifnumN\@lastchclass=9\thr@@ROtherwise_BwewillassumethatthetokenbGelongstotheclass0andassigntheRcorrespGondingU numberU to\@chnumifourassumptioniscorrect.R39j֘\elseN\z@RIfcthelasttokenwasap,morab,\@chnumalreadyhastherightvqalue.HThisisRtheU reasonforthesomewhatcuriouschoiceofthetokennumbGersinclass10.R40j֘\ifnumN\@lastchclass=10\elseROtherwise0wwewillcheckif\@nextchariseitherac,7loranr.eHSomeapplicationsRchange_thecatcoGdesofcertaincharacterslikeH@4inamstex.sty.AsaresulttheRtestsbGelowwouldfailsincetheyassumenon-activecharactertokens.ThereforeRwe gevqaluate\@nextcharoncetherebyturningthersttokenofitsreplacementRtextintoachar.Z~AtthispGointherethisshouldhavebGeentheonlycharpresentinR\@nextcharU whichputintoviaa\def.R41j֘\edef\@nextchar{\expandafter\string\@nextchar}% R42j֘\@chnumR43j֘\ifN\@nextcharc\z@\elseR44o\ifN\@nextcharl\@ne\elseR45tI4\ifN\@nextcharr\tw@\elseRIfbzitisadierenttoken,eweknowthattheclasswasnot0.W*eassignthevqalue0Rtof\@chnumbGecausethisvqalueisneededforthe|token.NowfwemustchecktheRremainingclasses.3Notethatthevqalueof\@chnumisinsignicanthereformostRclasses.R46j֘\z@N\@chclassR47j֘\if\@nextcharN|\@ne\elseR48o\ifN\@nextchar!6\elseR49tI4\ifN\@nextchar@7\elseR50y\ifN\@nextchar<8\elseR51}\ifN\@nextchar>9\elseRTheU remainingpGermittedtokensarep,mandb(class10).R52fJ10R53fJ\@chnumR54fJ\ifN\@nextcharm\thr@@\elseR55j֘\ifN\@nextcharp4\elseR56o\ifN\@nextcharb5\elseRNowWtheonlyremainingpGossibilityisaforbiddentoken,XJsowechoGoseclass0and RnumbGerm0andgiveanerrormessage.fThenwenishthemacrobyclosingallR\if's.R57j֘\z@N\@chclass\z@\@preamerr\z@\fi\fi\fi\fi R58j֘\fiN\fi r\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}P10 z y?R4.2pMultiplecolumns(form)t\@xexpast \the@toks  \the@tokszRNowH2wediscussthemacrothatdeletesallformsoftypGe*{Nt}{Stringn}froma RuserpreambleandreplacesthemwithNt5copiesofString.NestedexpressionsRarei{dealtwithcorrectly*,nthatmeansexpressionsarenotsubstitutediftheyareRinU explicitbraces,asin@{*}.aThismacroiscalledvia\@xexpasthpr}/eambleOi.x<*0x\@@.Theexpression*0xRisbGeingusedtoterminatetherecursion,asweshallseelater,and\@@servesasRanargumentdelimiter.\@xexpasthasfourarguments.TherstoneisthepartRoftheuserpreamblebGeforetherstexpressionwhilethesecondandthirdonesRaremtheargumentsoftherstexpression(thatisN&andStringP&inthenotationRmentionedU abGove).qThefourthargumentistherestofthepreamble.R59\\def\@xexpast#1*#2#3#4\@@{%RThenumbGerofcopiesofStringp(#2)thataretobeproducedwillbesavedinaRcountU register.R60j֘\@tempcntaN#2RW*e)savethepartofthepreamblewhichdoGesnotcontainaform(#1)inaRPlainTUY&E9XU tokenregister.qW*ealsosaveString7(#3)usingaLfAzTUY&E9Xtokenregister.R61j֘\toks@={#1}\@temptokena={#3}%RNow-OwehavetousealittletricktoproGduceNЌcopiesofString.W*ecouldtryR\def\@tempa{#1}&andthenN,times\edef\@tempa{\@tempa#3}. rThiswouldRhaveEtheundesiredeectthatallmacroswithin#1and#3wouldbGeexpanded,Ralthough,-for*example,constructionslike@{..}arenotsuppGosedtobechanged.RThatU iswhywe\lettwocontrolsequencestobGeequivqalentto\relax.R62j֘\let\the@toksz\relaxN\let\the@toks\relaxRThenweensurethat\@tempacontains{\the@toksz\the@toks...\the@toks}R(theU macro\the@toksexactlyNtimes)assubstitutiontext.R63j֘\def\@tempa{\the@toksz}% R64j֘\ifnum\@tempcntaN>0\@whilenum\@tempcnta>0\doR65tI4{\edef\@tempa{\@tempa\the@toks}\advanceN\@tempcnta\m@ne}%RIf'N,<,!,@)~RThepreamblewillbGeenlargedwiththehelpof\xdef, buttheargumentsof>,R<,BV!and@arenotsuppGosedtobeexpandedduringtheconstruction(wewantRanCimplementationthatdoGesn'tneeda\protect).SowehavetondawaytoRinhibitU theexpansionofthosearguments.aW*e2willsolvethisproblemwithtokenregisters.SW*eneedoneregisterforeveryR!Uand@,#whileweneedtwoforeveryc,#l,r,m,pUorb. ThislimitsthenumbGerRofcolumnsofatablebGecausethereareonly256tokenregisters.IButthen, whoRneedsU tableswithmorethan100columns?aOneEcouldalsondasolutionwhichonlyneedstwoorthreetokenregistersbyRproGceedingu.similarlyasinthemacro\@xexpast(seepage11).ѩTheadvqantageofRourapproachisthefactthatweavoidsomeoftheproblemsthatarisewiththeRotherU methoGd^4|2.aSo{howdoweproGceed?Letusassumethatwehad!{foo}intheRuserǬpreambleandsaywesavedfoointokenregister5.$ThenwecallR\@addtopreamble{\the@toks5}where\the@toksisdenedinawaythatitdoGesRnotexpand(forexampleitcouldbGeequivqalentto\relax).kEveryfollowingcallRofH7\@addtopreambleleavesH7\the@toks5unchangedin\@preamble.JIfthecon-Rstructionofthepreambleiscompletedwechangethedenitionof\the@tokstoR\the\toksandexpand\@preambleforthelasttime.#DuringthisproGcessallRparts_oftheform\the@tokshNumb}/er}i.RwillbGesubstitutedbythecontentsoftheRrespGectiveU tokenregisters.aAs-wecanseefromthisinformaldiscussiontheconstructionofthepreambleRhastotakeplacewithinagroup, sothatthetokenregistersweusewillbGefreedRlateron.]F*orthatreasonwekeepallassignmentsto\@preambleglobal;,?thereforeRthe)replacementtextofthismacrowillremainthesameafterweleavethegroup.'5\count@RW*e2furtherneedacountregistertoremembGerwhichtokenregisteristobGeusedRnext.nThiswillbGeinitializedwith1ifwewanttobGeginwiththetokenregis-Rter0.W*eusethePlainTUY&E9Xscratchregister\count@bGecauseeverythingtakesRplaceloGcally*.HAllwehavetodoisinsert\the@toks\the\count@intothepream-Rble.Y\the@tokshwillremainunchangedand\the\count@expandsintothesavedRnumbGer.Rffffr E !i-:4KMaÒyb{..}and<{..}havingtoRbGeinsertedatthismomentbecauseformatinginstructionslike\hfilhavetobGeRset"aaroundthem.`Ontheotherhanditisnotknownyet,,ifany<{..}instructionRwillU appGearintheuserpreambleatall.aW*e\solvethisproblembyaddingtwotokenregistersatatime.weremovepGossible-formsintheuserpreamblewiththecommandR\@xexpast.uAswealreadyknow,thiscommandsavesitsresultinthemacroR\@tempa.R87j֘\@xexpastN#1*0x\@@P14y?RAfterwards3Pweinitializeallregistersandmacros,:thatweneedforthebuild-upof Rtheipreamble.:ZSincewewanttostartwiththetokenregister0,{\count@hastoRcontainU thevqalue1.R88j֘\count@\m@ne R89j֘\let\the@toks\relaxRThenU wecallup\prepnext@tokinordertopreparethetokenregister0foruse.R90j֘\prepnext@tokRT*oLevqaluatetheuserpreamble(withoutstars)savedin\@tempaweusetheLfAzTUY&E9X Rmacro\@tfor.XwThestrangeappGearingconstructionwith\expandafterisbasedRonthefactthatwehavetoputthereplacementtextof\@tempaandnotthemacroR\@tempaU tothisLfAzTUY&E9Xmacro.R91j֘\expandafterN\@tfor\expandafter\@nextchar R92o\expandafterN:\expandafter=\@tempa\doRThebGodyofthisloop(thegroupafterthe\do)isexecutedforonetokenatatime,Rwhereas[thecurrenttokenissavedin\@nextchar.@AtrstweevqaluatethecurrentRtokenwiththealreadydenedmacro\@testpach,oi.e.weassignto\@chclasstheRcharacterU classandto\@chnumthecharacternumbGerofthistoken.R93j֘{\@testpachRThenwebranchoutdepGendingonthevqalueof\@chclassintodierentmacrosRthatU extendthepreamblerespGectively*.R94j֘\ifcaseN\@chclass\@classz\or\@classi\or\@classii R95tI4\orN\save@decl\or\or\@classv\or\@classviR96tI4\orN\@classvii\or\@classviii r\or\@classixR97tI4\orN\@classx\fiRT*woecasesdeserveourspGecialattention: Sincethecurrenttokencannothave RtheZcharacterclass4(start)wehaveskippGedthispossibility*.e.IfthecharacterRclassPis3,onlythecontentPof\@nextcharhastobGesavedPintothecurrenttokenRregister;therefore}dwecallup\save@decldirectlyandsaveamacroname.KAfterRtheLqpreamblehasbGeenextendedweassignthevqalueof\@chclasstothecounterR\@lastchclass6toassurethatthisinformationwillbGeavqailableduringthenextRrunU oftheloGop.R98j֘\@lastchclass\@chclass}%RAftertheloGophasbeennishedspacemuststillbeaddedtothecreatedpreamble,RdepGending>onthelasttoken.{Dependingonthevqalueof\@lastchclassweperformRtheU necessaryopGerations.R99j֘\ifcase\@lastchclassRIfU thelastclassequals0weadda\hskip?\col@sep.N|100j֘\@acolN\orRIfitequals1wedonotaddanyadditionalspacesothatthehorizontallinesdo RnotU exceedtheverticalones.N|101j֘\orP15Dy?RClass2istreatedlikeclass0bGecausea<{...}canonlydirectlyfollowafterclass R0. ɍN|102j֘\@acolN\orɍRMostoftheotherpGossibilitiescanonlyappeariftheuserpreamblewasdefective.RClassֲ3isnotallowedsinceaftera>{..}theremustalwaysfollowac,l,r,p,mRorU b.qW*erepGortanerrorandignorethedeclarationgivenby{..}.N|103j֘\@preamerrN\thr@@\orɍRIfsv\@lastchclassis4theuserpreamblehasbGeenempty*.̃Tosvcontinue,{ weinsertRaU #inthepreamble.N|104j֘\@preamerrN\tw@\@addtopreamble\@sharp\orɍRClassP5isallowedPagain.AInthiscase(theuserpreambleendswith@{..})weneedRnotU doanything.N|105j֘\orɍRAnyǤothercasemeansthattheargumentsto@,$D!,<,>,p,mǤorbhavebGeenRforgotten.qSoU werepGortanerrorandignorethelasttoken.N|106j֘\else r\@preamerrN\@ne\fiɍRNow;:thatthebuild-upofthepreambleisalmostnishedwecaninserttheto-Rkenregistersandthereforeredene\the@toks.rTheactualinsertion,though,isRpGerformedU later.N|107j֘\def\the@toks{\the\toks}} >R6iTheG\macros\@classzto\@classx~RTheb;preambleisextendedbythemacros\@classzto\@classxwhicharecalledRby5\@mkpreamdepGendingon\@lastchclass(i.e.'thecharacterclassofthelastRtoken)."|B\@classxRFirstRwedene\@classxbGecauseofitsimportantrle.pWhenitiscalledwendRthatU thecurrenttokenisp,morb.qThatmeansthatanewcolumnhastostart.N|108\\def\@classx{%ɍRDepGendingU onthevqalueof\@lastchclassdierentactionsmusttakeplace:N|109fJ\ifcaseN\@lastchclassRIfthelastcharacterclasswas0weseparatethecolumnsby\hskip\col@sep RfollowedU by&andanother\hskip\col@sep.N|110fJ\@acolampacolN\orRIfthelastclasswasclass1thatmeansthataverticallinewasdrawn, RbGefore@qthislinea\hskip\col@sepwasinserted.jThereforetherehastobeonlyaR&Rfollowedby\hskip\col@sep.pButthis&maybGeinsertedonlyifthisisnottheRrstU column.qThisproGcessiscontrolledby\if@firstampinthemacro\addamp.N|111fJ\@addampN\@acol\orɍRClassU 2istreatedlikeclass0bGecause<{...}canonlyfollowafterclass0.N|112fJ\@acolampacolN\orP16̠y?RClass73requiresnoactionsbGecauseallthingsnecessaryhave7beendonebythe RpreambleU token>. N|113fJ\orRClass4meansthatweareatthebGeginningofthepreamble.nThereforewestartRthe9preamblewith\hskip\col@sepandthencall\@firstampfalse.h&ThismakesRsureU thatalater\@addampinsertsthecharacter&intothepreamble.N|114fJ\@acolN\@firstampfalse\orRF*orXclass5tokensonlythecharacter&isinsertedasacolumnseparator.4ThereforeRweU call\@addamp.N|115fJ\@addampROther}casesareimpGossible.;F*oranexample\@lastchclassMn=6asitmightRappGearinapreambleoftheform...!p...pwouldhavebGeentakenasanRargumentU of0!by\@testpach.N|116fJ\fi}"|B\@classzRIfSthecharacterclassofthelasttokenis0wehavec,Sl,rSoranargumentofm,SbRor#p.KIntherstthreecasesthepreamblemustbGeextendedthesamewayasifweRhadrclass10.=TheremainingtworcasesdonotrequireanyactionbGecausethespaceRneededTwasgeneratedbythelasttoken(i.e.m,Tborp).qWSince\@lastchclasshasRtheNvqalue10atthispGointnothinghappenswhen\@classxiscalled.GSothemacroR\@chlasszU maystartlikethis:N|117\\def\@classz{\@classxRAccordingqtothedenitionof\insert@columnwemuststorethenumbGeroftheRtokenbùregisterinwhichapreceding>{..}mighthavestoreditsargumentintoR\@tempcnta.N|118j֘\@tempcntaN\count@RT*oU have\count@*=\@tmpcnta4=+81wepreparethenexttokenregister.N|119j֘\prepnext@tokRNowathepreamblemustbGeextendedwiththecolumnwhoseformatcanbedeter- RminatedU by\@chnum.N|120j֘\@addtopreamble{\ifcaseN\@chnumRIfÐ\@chnumhasthevqalue0acenteredcolumnhastobGegenerated.SowebGegin RwithU stretchablespace.N|121y\hfilRTheXcommand\d@llarbeginfollowsexpandinginto\begingroup(inthetab- Rular#environment)orinto$.~Doingthis(providedanappropriatesettingRof\d@llarbegin)weachievethatthecontentsofthecolumnsofanarray#Renvironment -aresetinmathmoGdewhilethoseofatabular#environment -aresetinRLRU moGde.N|122y\d@llarbeginRNow6weinsertthecontentsofthetwotokenregistersandthesymbGolfortheRcolumnU entry(i.e.#ormoreprecise\@sharp)using\insert@column.N|123y\insert@columnP17ny?RW*eendthiscasewith\d@llarendand\hfilwhere\d@llarendagainiseither R$U or\endgroup. 瞍N|124y\d@llarendN\hfil\or瞍RThetemplatesforlandr(i.e.\@chnum1or2)aregeneratedthesameway*.MSinceRoneE\hfilismissingthetextismovedEtotherelevqantside.The\kern\z@isneededRinJ1caseofanemptycolumnentry*.POtherwisethe\unskipin\insert@columnRremovesvthe\hfil. Changedto\hskip1spsothatitinteractsbGetterwithR\@bsphack.N|125y\hskip1sp\d@llarbeginN\insert@column\d@llarend\hfil\or N|126y\hfil\hskip1sp\d@llarbeginN\insert@column\d@llarend\or瞍RThedtemplatesforp,hmandbmainlyconsistofabGox.Incaseof,mitisgeneratedRby\vcenter.@ThiscommandisallowedonlyinmathmoGde.@ThereforewestartRwithU a$.N|127j֘$\vcenter瞍RThepartofthetemplateswhichisthesameinallthreecases(p,Jmandb)isbuiltRbythemacros\@startpboxand\@endpbox. Z(\@startpboxhasanargument:Rthewidthofthecolumnwhichisstoredinthecurrenttoken(i.e.\@nextchar).RBetweenU thesetwoU macroswendthewellknown\insert@column.N|128j֘\@startpbox{\@nextchar}\insert@columnN\@endpbox$\or瞍RTheXtemplatesforpandbaregeneratedinthesamewayXthoughwedonotneedRtheU $charactersbGecauseweuse\vtopor\vbox.N|129j֘\vtopN\@startpbox{\@nextchar}\insert@column\@endpbox\or N|130j֘\vboxN\@startpbox{\@nextchar}\insert@column\@endpbox瞍ROtheryvqaluesfor\@chnumareimpGossible.ThereforeweendtheargumentstoR\@addtopreamble3and\ifcase.fqBeforewecometotheendof\@classzwehaveRtoU preparethenexttokenregister.N|131fJ\fi}\prepnext@tok}ۍ\@classixRIncaseofclass9(>token)werstcheckifthecharacterclassofthelasttokenRwast3.RInthiscasewehaveauserpreambleoftheform..>{...}>{...}..whichRisnotallowed.;W*eonlygiveanerrormessageandcontinue.;SothedeclarationsRdenedU bytherst>{...}areignored.N|132\\def\@classix{\ifnumN\@lastchclass=\thr@@ N|133}\@preamerrN\thr@@\fi瞍RF*urthermore,-we[callup\@class10bGecauseafterwardsalwaysanewcolumnisRstartedU byxc,l,r,p,morb.N|134}\@classx}ۍPX\@classviiiRIf$ thecurrenttokenisa\z@ N|136y\@preamerrN4\@chclass6\@classvi\fi}P18ⶠy?PX\@arrayruleRThereYHisonlyoneincompatibilitywiththeoriginaldenition:ythedenitionof R\@arrayrule.InDtheoriginalalinewithoutwidth^5 viscreatedbymultiplein-Rsertions#^of\hskip?.5\arrayrulewidth.;W*eonlyinsertaverticallineintotheRpreamble.ThisdisdonetopreventproblemswithTUY&E9X'smainmemorywhengen-ReratingU tableswithmanyverticallinesinthem(espGeciallyinthecaseof0oats).N|137\\def\@arrayrule{\@addtopreambleN\vline} \@classviiRAs%;aconsequenceitfollowsthatincaseofclass7(@token)thepreambleneedRnotQtobGeextended.=Intheoriginaldenition\@lastchclassK=x1istreatedbyRinsertingR\hskip?.5\arrayrulewidth.2{...},bGecausetheseareoverwrittenU bytheargumentof0@.N|139j֘\@preamerrN\thr@@\fi}\@classviRIfPthecurrenttokenisaregular!andthelastclasswas0or2weextendtheRpreamblewith\hskip\col@sep.TIfthelasttokenwasofclass1(forinstance|)Rwe(2extendwith\hskip?\doublerulesepbGecausetheconstruction!{...}hastoRbGeU treatedlike|.N|140\\def\@classvi{\ifcaseN\@lastchclass N|141y\@acolN\orN|142y\@addtopreamble{\hskipN\doublerulesep}\orN|143y\@acolN\orRNow\@preamerr...shouldfollowbGecauseauserpreambleoftheform..>{..}!. Ris-notallowed.ZT*o-savememorywecall\@classviiinsteadwhichalsodoGeswhatRweU want.N|144y\@classviiRIf@\@lastchclassis4or5nothinghastobGedone.V6Class6to10arenotpossible.RSoU wenishthemacro.N|145y\fi}\@classii \@classiiiRIn/thecaseofcharacterclasses2and3(i.e.theargumentof)weonlyhaveRtostorethecurrenttoken(\@nextchar)intothecorrespGonding6tokenregistersinceRtheXpreparationandinsertionoftheseregistersaredonebythemacro\@classz.RThisK isequivqalenttocalling\save@declinthecaseofclass3.n#T*osavecommandRidentiersU wedothiscallupinthemacro\@mkpream.aClass^2exhibitsamorecomplicatedsituation:9thetokenregistershavealreadyRbGeeninsertedby\@classz.JlSothevqalueof\count@istoohighbyone.JlThereforeRweU decrease\count@by1.N|146\\def\@classii{\advanceN\count@\m@neRffffr E !i-:5KSo(thespaceb{...}.P20y?N|156j֘\everypar{% N|157y\vruleN\@height\ht\@arstrutbox\@width\z@N|158y\everypar{}}%N|159j֘}\@endpboxRIfthereareanydeclarationsdenedby>{...}and<{...}theynowfollowin Rthetmacro\@classzthecontentstofthecolumninbGetween.SotthemacroR\@endpboxmustinsertthespGecialstrutmentionedearlierandthenclosethegroupRopGenedU by\@startpbox.N|160\\def\@endpbox{\@finalstrut\@arstrutboxN\egroup\hfil}!֍R7iBuildingG\andcalling\halign~'5\@arrayRAfterawehavediscussedthemacrosneededfortheevqaluationoftheuserpreambleRwe۹candenethemacro\@arraywhichusesthesemacrostocreatea\halign.RIthastwoarguments.9|TherstoneisapGositionargumentwhichcanbGet,tborRc;U thesecondonedescribGesthewantedU preamble,e.g.ithastheform|c|c|c|.N|161\\def\@array[#1]#2{%RFirst9wedeneastrutwhosesizebasicallycorrespGondstoanormalstrutmulti-Rplied6bythefactor\arraystretch.\2ThisstrutistheninsertedintoeveryrowandRenforcesd9aminimaldistancebGetweend9tworows.Nevertheless,whenusinghori-Rzontallines,largeletters(likeaccentedcapitalletters)stillcollidewithsuchlines.RThereforeatrstweaddtotheheightofanormalstrutthevqalueoftheparameterR\extrarowheight.N|162fJ\@tempdimaN\ht\strutbox N|163fJ\advanceN\@tempdimaby\extrarowheightN|164fJ\setboxN\@arstrutbox\hbox{\vruleN|165\@heightN\arraystretch\@tempdimaN|166\@depthN\arraystretch\dp\strutboxN|167\@widthN\z@}%RTheny weopGenagroup,inwhichtheuserpreambleisevqaluatedbythemacro R\@mkpream.TlAsweknowthismusthappGenlocally*.TlThismacrocreatesapreambleRforU a\halignandsavesU itsresultgloballyinthecontrolsequence\@preamble.N|168fJ\begingroup N|169fJ\@mkpream{#2}%RW*eXagainredene\@preamblesothatacallupof\@preamblenowstartstheR\halign.Thusalsotheargumentsof>,<,@and!,savedinthetokenregistersRareinsertedintothepreamble.The\tabskipatthebGeginningandendoftheRpreambleNissetto0pt(inthebGeginningbytheuseof\ialign)..AlsothecommandR\@arstrut0isbuildin,whichinsertsthe\@arstrutbox,denedabGove.UOf0course,RthemkopGeningbraceafter\ialignhastobeimplicitasitwillbeclosedin\endarrayRorU anothermacro.aTheh\noexpandinfrontof\ialigndoGesnoharminstandardLfAzTUY&E9XandwasRadded;sincesomeexpGerimentalsupportforusingtextglyphsinmathredenesR\halignwiththeresultthatisbGecomesexpandablewithdisastrousresultsinP21 ݠy?Rcaseslikethis.DaInthekerneldenitionforthismacrotheproblemdoGesnotsurface RbGecauseNJthere\protectisset(whichisnotnecessaryinthisimplementationasRthereqisnoarbitraryuserinputthatcangetexpanded)andtheexpGerimentalRcoGdeqmadetheredenitionrobust.WhetherthisistherightapproachisopGentoRquestion;considerthe\noexpandacurtesytoallowanunsuppGortedredenitionRofU aTUY&E9Xprimitiveforthemoment(aspGeoplerelyonthatexperimentalcode). <\z@RIfthisisthecasewecreateaninvisibleverticalrulewithdepth\dp\@arstutboxͲ+Rhwante}/dspaceOi{\.AtThusweachievethatallverticallinesspGeciedintheuserpream-RbleU bya|arenowgenerallydrawn.qThentherowendswitha\cr.aIfnthespaceisnegativeweendtherowatoncewitha\crandmovebackupRwithU a\vskip.aWhileBtestingthesemacrosI,foundoutthatthe\endtemplatecreatedby\crRandT&issomethinglikean\outerprimitiveandthereforeitshouldnotappGearinRincompleteޥ\ifstatements.ThusޥthefollowingsolutionwaschosenwhichhidesRtheU \crinothermacroswhenTUY&E9Xisskippingconditionaltext.N|190fJ\expandafter\@xargarraycr\else N|191fJ\expandafter\@yargarraycr\fi{#1}}P23&y? ݼ\@xargarraycr ݼ\@yargarraycrRTheU followingmacroswerealreadyexplainedabGove.N|192\\def\@xargarraycr#1{\unskip N|193fJ\@tempdimaN#1\advance\@tempdima\dp\@arstrutboxN|194fJ\vruleN\@depth\@tempdima\@width\z@\cr}N|195\\def\@yargarraycr#1{\cr\noalign{\vskipN#1}}!֍R9iSpanningG\sevceralcolumns~ \multicolumnRIfC\severalcolumnsshouldbGeheldtogetherwithaspecialformatthecommand R\multicolumn|mustbGeused.;Ithasthreearguments:8thenumbGerofcolumnstoRbGeU covered;theformatfortheresultcolumnandtheactualcolumnentry*.N|196\\long\def\multicolumn#1#2#3{%RFirstwecombinethegivennumbGerofcolumnsintoasingleone;thenwestartaRnewU bloGcksothatthefollowingdenitioniskeptloGcal.N|197j֘\multispan{#1}\begingroupRSincea\multicolumnshouldonlydescribGetheformatofaresultcolumn,weRredenes\@addampinsuchawaythatonegetsanerrormessageifoneusesmoreRthanFonec,Itl,r,p,mForbinthesecondargument.lOneshouldconsiderthatthisRdenitionowisloGcaltothebuild-upofthepreamble;anarray#ortabular#environmentRinE thethirdargumentofthe\multicolumnisthereforeworkedthroughcorrectlyRasU well.N|198j֘\def\@addamp{\if@firstampN\@firstampfalse\else N|199?\@preamerrN5\fi}%RThenMweevqaluatethesecondargumentwiththehelpof\@mkpream.oNowwestillRhave2(toinsertthecontents2(ofthetokenregisterintothe\@preamble,9&i.e.wehaveRtoU say\xdef\@preamble{\@preamble}.qThisisachievedshorterbywriting:N|200j֘\@mkpream{#2}\@addtopreamble\@emptyRAfterEthe\@preambleiscreatedweforgetallloGcaldenitionsandoccupationsofRtheU tokenregisters.N|201j֘\endgroupRInthespGecialsituationof\multicolumn\@preambleisnotneededaspreambleRfor%a\halignbutitisdirectlyinsertedintoourtable.!Thusinsteadof\sharpRthereU hastobGethecolumnentry(#3)wantedbytheuser.N|202j֘\def\@sharp{#3}%RNowwecanpassthe\@preambletoTUY&E9X.<F*orsafetywestartwithan\@arstrut.RThismshouldusuallybGeinthetemplatefortherstcolumnhowevermwedonotknowRifpthistemplatewasoverwrittenbyour\multicolumn./W*ealsoadda\nullattheRright>endtopreventanyfollowing\unskip(forexamplefrom\\[..])toremoveRtheU \tabcolsep.N|203j֘\@arstrutN\@preamble N|204j֘\nullN|205j֘\ignorespaces}P244y?R10q%TheG\EncvironmentDenitions~RAfterandarray>environ-Rments (via\multicolumn)areimpGossible.XWhenthenewfontselectionschemeisRinforcewehavetowesurroundall\halignentrieswithbraces.MSeeremarksinRTUGbGoat10#2.6Actuallywearegoingtouse\begingroupand\endgroup.6How-Rever,thisisonlynecessarywhenweareintextmoGde.InmaththesurroundingRdollar+,signswillalreadyserveasthenecessaryextragroupinglevel.cThereforeweRswitchlthesettingsof\d@llarbeginand\d@llarendbGetweengroupsanddollarRsigns.N|206\\let\d@llarbegin\begingroup N|207\\let\d@llarend\endgroup+\arrayROurU newdenitionof\arraythenreads:N|208\\def\array{\col@sep\arraycolsep N|209fJ\def\d@llarbegin{$}\let\d@llarend\d@llarbegin\gdef\@halignto{}%RSincetheremightbGeanoptionalargumentwecallanothermacrowhichisalso RusedU bytheotherenvironments.N|210fJ\@tabarray} \@tabarrayRThisimacrotestsforaoptionalbracketiandthencallsup\@arrayor\@array[c] R(asU default).N|211\\def\@tabarray{\@ifnextchar[{\@array}{\@array[c]}}"|B\tabular \tabular*RTheH#environmentstabularkandtabulardieronlyintheinitialisationofthecom- RmandU \@halignto.qThereforewedeneN|212\\def\tabular{\gdef\@halignto{}\@tabular}Rand`analogueslyforthestarform.W*eevqalutetheargumentrstusing\setlengthRsoU thatusersofthecalcpackqagecanwritecoGdelikeR\begin{tabular*}{(\columnwidth-1cm)/2}...N|213\\expandafter\def\csnameNtabular*\endcsname#1{% N|214}\setlength\dimen@{#1}%N|215}\xdef\@halignto{to\the\dimen@}\@tabular}\@tabularRTheU restofthejobiscarriedoutbythe\@tabularmacro:N|216\\def\@tabular{%RFirstofallwehavetomakesurethatwestartoutinhmoGde.ZOtherwisewemightRndU ourtabledanglingbyitselfonaline.N|217fJ\leavevmodeP25@y?RItΙshouldbGetakenintoconsiderationthatthemacro\@arraymustbGecalledin RmathmoGde.;Thereforeweopenabox,inserta$andthenassignthecorrectvqaluesRtoU \col@sepand\d@llar....N|218fJ\hboxN\bgroup$\col@sep\tabcolsep\let\d@llarbegin\begingroup N|219\let\d@llarend\endgroupRNow!everything2tabularspGecic!isdoneandweareabletocallthe\@tabarrayRmacro.N|220fJ\@tabarray}\endarrayRWhenptheproGcessingof7arrayispnishedwehavetoclosethe\halignandaf-Rterwardsthesurrounding͊bGoxselectedby\@array.pT*osavetokenspacewethenRredeneU \@preamblebGecauseitsreplacementtextisn'tlongerneeded.N|221\\def\endarray{\crcrN\egroup\egroup\gdef\@preamble{}}PX\endtabular \endtabular*RT*oendatabularortabularenvironmentwecallup\endarray,$lclosethemathRmoGdeU andthenthesurrounding\hbox.N|222\\def\endtabular{\endarrayN$\egroup} N|223\\expandafter\let\csnameNendtabular*\endcsname=\endtabular!֍R11q%LastG\mincutedenitions~RIfthisleisusedasapackqageleweshould\letallmacrosto\relaxthatwereRusedU intheoriginalbutarenolongernecessary*.N|224\\let\@ampacol=\relax%p\let\@expast=\relax N|225\\let\@arrayclassiv=\relax+\let\@arrayclassz=\relaxN|226\\let\@tabclassiv=\relax\let\@tabclassz=\relaxN|227\\let\@arrayacol=\relaxW\let\@tabacol=\relaxN|228\\let\@tabularcr=\relaxW\let\@@endpbox=\relaxN|229\\let\@argtabularcr=\relax+\let\@xtabularcr=\relax \@preamerrRW*e alsohave toredenetheerrorroutine\@preamerrsincenewkindoferrors RareEpGossible.0Thecodeforthismacroisnotperfectyet;4itstillneedstoomuchRmemory*.N|230\\def\@preamerr#1{\def\@tempd{{..}Natwrongposition:}% N|231j֘\PackageError{array}{%N|232j֘\ifcaseN#1Illegalpream-token(\@nextchar):`c'used\or%0N|233oMissingNarg:tokenignored\or:%1N|234oEmptyNpreamble:`l'used\or%2N|235o>\@tempdNtokenignored\orpr%3N|236o<\@tempdNchangedto!{..}\orD%4N|237oOnlyNonecolumn-spec.allowed.\fi}\@ehc}K%5P26L@y?R12q%DeningG\ycourowncolumnsppeciers=6~ \newcolumnRInonewarray.stythemacroforspGecifyingnewcolumnswasnamed\newcolumn. RWhenDthefunctionalitywasaddedtoarray.stythecommandwasrenamedR\newcolumntype.cInitially-bGothnamesweresupported,$butnow(InversionsofRthisU packqagedistributedforLfAzTUY&E9X2 b> cmmi10"()theoldnameisnotdened.N|238\hncolsi$n\newcolumntypeRAsdescribGedabove,the\newcolumntypemacrogivesusersthechancetodeneRletters,U tobGeusedinthesamewayU astheprimitivecolumnspeciers,`c'`p'etc.N|239\>qL ecst0900\def\newcolumntype#1{%R\NC@charJ%wasaddedinV2.01sothatactivecharacters,LWlike@inAMSLfAzTUY&E9XmayRbGeBused.3Thistrickwasstolenfromarray.sty2.0h.3NotethatweneedtouseRthe|pGossiblyactivetoken,#1,in|severalplaces,asthatisthetokenthatactuallyRappGearsU inthepreambleargument.N|240fJ\edef\NC@char{\string#1}%RFirst!wecheckwhetherthereisalreadyadenitionforthiscolumn. qUnlikeR\newcommandSwegiveawarningratherthananerrorifitisdened.lIfitisaRnewU column,add\NC@dohc}/olumnUi.عtothelist\NC@list.N|241fJ\@ifundefined{NC@find@\NC@char}% N|242o{\@tfor\next:=<>clrmbp@!|\do{\if\noexpand\next\NC@charN|243u\PackageWarning{array}%N|244P{RedefiningNprimitivecolumn\NC@char}\fi}%N|245tI4\NC@list\expandafter{\the\NC@list\NC@do#1}}%N|246o{\PackageWarning{array}{ColumnN\NC@char\spaceisalreadydefined}}%RNowYwedeneamacrowithanargumentdelimitedbythenewcolumnspGecier, RthisU isusedtondoGccurencesofthisspecierintheuserpreamble.N|247fJ\@namedef{NC@find@\NC@char}##1#1{\NC@{##1}}%RIfU anoptionalargumentwasnotgiven,giveadefaultargumentof0.N|248fJ\@ifnextchar[{\newcol@{\NC@char}}{\newcol@{\NC@char}[0]}}"|B\newcol@RW*ehcannowdenethemacrowhichdoGestherewriting,\@reargdeftakesthesame RargumentsVas\newcommand,butdoGesnotcheckthatthecommandisnew.!F*oraRcolumn,say`D'withoneargument,deneacommand\NC@rewrite@DwithoneRargument,whichrecursivelycalls\NC@findontheuserpreambleafterreplacingRtheSrsttokenorgroupwiththereplacementtextspGeciedinthe\newcolumntypeRcommand.ɥ\NC@findrwillndthenextoGccurrenceof`D'rzasitwillbe\letequalRtoU \NC@find@Dby\NC@do.N|249\\def\newcol@#1[#2]#3{\expandafter\@reargdef N|250tI4\csnameNNC@rewrite@#1\endcsname[#2]{\NC@find#3}}R&Zffr E !i-:6KTheco\NC@find>{$}c<{$}.W*e'wanttostripthelong?macro:->P28ey?Rand=the\NC@find.ASorstweuse\meaningandthenapplythemacro\NC@strip RtoU thetokenssoproGducedandthen\typeouttherequiredstring.N|264\\def\NC@show#1{% N|265fJ\typeout{ColumnN#1\expandafter\expandafter\expandafter\NC@stripN|266fJ\expandafter\meaning\csnameNNC@rewrite@#1\endcsname\@@}}\NC@stripRDelimittheargumentsto\NC@stripwith`:',~`->',aspace,and\@@topulloutRtheU requiredpartsoftheoutputfrom\meaning.N|267\\def\NC@strip#1:#2->#3N#4\@@{#2->#4}"|B\NC@listRAlloGcateU thetokenregisterusedfortherewritelist.N|268\\newtoks\NC@listYR12.1w}TheformtRW*eXviewthe-formasaslightgeneralisationofthesystemdescribGedinthepre- RviousU subsection.qTheideaistodeneacolumnbyacommandoftheform:VN\newcolumntype{*}[2]{% d8\count@=#1\ifnum\count@>0s"\advance\count@Nby-1#2*{\count@}{#2}\fi} ݼ\NC@rewrite@*RThisdoGesnotworkhoweveras\newcolumntypetakesgreatcarenottoexpandRanything8inthepreamble,qandsothe\ifisneverexpanded.2\newcolumntypeRsetsU upvqariousotherpartsoftherewritecorrectlythoughsowecandene:N|269\\newcolumntype{*}[2]{}RNowFwemustcorrectthedenitionof\NC@rewrite@*.lThefollowingisprobablyRmoreeecientthanadirecttranslationoftheideasketchedabGove, WwedonotneedRto)putainthepreambleandcalltherewriterecursively*,^wecanjustput#1Rcopiesyof#2into\@temptokena.5(NestedformswillbGeexpandedwhenthewholeRrewriteU listisexpandedagain,see\@mkpream)N|270\\long\@namedef{NC@rewrite@*}#1#2{%RStoreU thenumbGer.N|271fJ\count@#1RPutU #1copiesof#2inthetokenregister.N|272fJ\loop N|273fJ\ifnum\count@>\z@N|274fJ\advance\count@\m@neN|275fJ\@temptokena\expandafter{\the\@temptokena#2}%N|276fJ\repeatR\NC@doU willensurethat\NC@findis\letequalto\NC@find@*.N|277fJ\NC@find}P29ry?R12.2w}Mo_dicationstointernalmacrosofOarray.styt\@xexpast \@xexnoopRThese'macrosareusedtoexpand-formsinarray.sty.bV\letthemto\relaxto RsaveU space.N|278\\let\@xexpast\relax N|279\\let\@xexnoop\relax \save@declRW*eTAdonotassumethatthetokenregisterisfree,weaddthenewdeclarationstotheRfrontoftheregister.9Thisistoallowuserpreamblesoftheform,Ͷ>{foo}>{bar}...RUsersarenotencouragedtoentersuchexpressionsdirectly*,buttheymayresultRfromU therewritingof\newcolumntype's.N|280\\def\save@decl{\toksN\count@=\expandafter\expandafter\expandafter N|281*{\expandafter\@nextchar\the\toks\count@}}\@mkpreamRTheʀmainmoGdicationto\@mkpreamistoreplacethecallto\@xexpast(whichRexpandedU -forms)byaloGopwhichexpandsall\newcolumntypespGeciers.N|282\\def\@mkpream#1{\gdef\@preamble{}\@lastchclassN4\@firstamptrue N|283j֘\let\@sharp\relaxN\let\@startpbox\relax\let\@endpbox\relaxRNowFweremovepGossible-formsanduser-denedcolumnspeciersintheuserRpreamblebyrepGeatedlyexecutingthelist\NC@listuntilthere-writeshaveRno2moreeect. TheexpandedpreamblewillthenbGeinthetokenregisterR\@temptokena.qActuallyU weneedtoknowatthispGointthatthisisnot\toks0.N|284j֘\@temptokena{#1}\@tempswatrue N|285j֘\@whilesw\if@tempswa\fi{\@tempswafalse\the\NC@list}%RAfterwards3Pweinitializeallregistersandmacros,:thatweneedforthebuild-upofRtheU preamble.N|286j֘\count@\m@ne N|287j֘\let\the@toks\relaxN|288j֘\prepnext@tokRHavingexpandedalltokensdenedusing\newcolumntype(including*),Dweevqal- Ruate0theremainingtokens,8 which0aresaved0in\@temptokena.ekW*eusetheLfAzTUY&E9XRmacroU \@tfortoinspGecteachtokeninturn.N|289j֘\expandafterN\@tfor\expandafter\@nextchar N|290o\expandafterN:\expandafter=\the\@temptokena\doR\@testpatchU doGesnottakeanargumentsincearray.sty2.0h.N|291j֘{\@testpachN|292j֘\ifcaseN\@chclass\@classz\or\@classi\or\@classiiN|293tI4\orN\save@decl\or\or\@classv\or\@classviN|294tI4\orN\@classvii\or\@classviiiRInU newarray.styclass9isequivqalenttoclass10.N|295tI4\orN\@classxN|296tI4\orN\@classx\fiN|297j֘\@lastchclass\@chclass}%N|298j֘\ifcase\@lastchclassN|299j֘\@acolN\orP30|y?N|300j֘\or N|301j֘\@acolN\orN|302j֘\@preamerrN\thr@@\orN|303j֘\@preamerrN\tw@\@addtopreamble\@sharp\orN|304j֘\orN|305j֘\else r\@preamerrN\@ne\fiN|306j֘\def\the@toks{\the\toks}}\@classixRarray.sty8doGesnotallowrepeated>declarationsforthesamecolumn.Thisis Rallowedginnewarray.styasdoGcumentedintheintroGduction.,VRemovingthetestRforFthiscasemakesclass9equivqalenttoclass10,Iandsothismacroisredundant.RItU is\letto\relaxtosaveU space.N|307\\let\@classix\relaxPX\@classviiiRInnewarray.styexplicitlyallowclass2,̀asrepGeated\z@\ifnum\@lastchclass=\tw@\else N|309y\@preamerrN4\@chclass6\@classvi\fi\fi}"|B\@classvRClass5is@-expressions(andisalsocalledbyclass1)ThismacrowasincorrectinRV*ersionP1.p Nowwedonotexpandthe@-expression,QbutinsteadexplicitlyreplaceRan\extracolsepcommandbyanassignmentto\tabskipbyamethoGdsimilarRtoDthe\newcolumntypesystemdescribGedabove.Q\d@llarbeginD\d@llarendwereRintroGducedU inV2.01tomatcharray.sty2.0h.N|310\\def\@classv{\save@decl N|311j֘\expandafter\NC@ecs\@nextchar\extracolsep{}\extracolsep\@@@N|312j֘\@addtopreamble{\d@llarbegin\the@toks\the\count@\relax\d@llarend}%N|313j֘\prepnext@tok}'5\NC@ecsRRewriteZtherstoGccurrenceof\extracolsep{1in}to\tabskip1in\relax.:.As Ra7Osideeectdiscardanytokensafterasecond\extracolsep,=EthereisnopGointinRtheuserenteringtwoofthesecommandsanyway*,Nsothisisnotreallyarestriction.N|314\\def\NC@ecs#1\extracolsep#2#3\extracolsep#4\@@@{\def\@tempa{#2}% N|315fJ\ifx\@tempa\@empty\else\toks\count@={#1\tabskip#2\relax#3}\fi}N|316\h=ncolsiYR12.3w}Supp_ortforthedelarray.stytRThendelarray.stypackqageextendsthearraysyntaxbysuppGortingthenotation Rofdelimiters.HT*othisendweextendthearrayparsingmechanismtoincludeaRhoGokgwhichcanbeusedbythis(oranother)packqagetodosomeadditionalparsing. \@tabarrayRThis macrotestsforanoptionalbracket andthencallsup\@@arrayorR\@@array[c]U (asdefault).N|317\hpack9age#g i N|318\\def\@tabarray{\@ifnextchar[{\@@array}{\@@array[c]}}P31 y?"|B\@@arrayRThis2¯otestscouldthentestanoptionaldelimiterbGeforetheleftbraceofthe Rmainpreambleargument.240 骬242,5244,246248˪\NC@do}m.w}m.}m.}m.ϑ245,$256$fe "F,$263˪\NC@ecs}m.w}m.}m.}m.}m.}m. 311,$314$fe "˪\NC@findH}m.w}m.}m.}m.}m.}m.}m.}m.}m.骬}m. 9250,$259,262,277˪\NC@ifendlq}m.w}m.}m.}m. 252,$253$fe "˪\NC@listH}m.w}m.}m.}m.}m.}m.}m.}m.}m.骬}m. 9245,$263,268fe "F,285˪\NC@rewriteL}m.w}m.}m. 255,$257˪\NC@rewrite@*,}m.w}m.}m.}m.}m. 269 fe "˪\NC@showH}m.w}m.}m.}m.}m. 263,$264$fe "˪\NC@striplq}m.w}m.}m.}m. 265,$267$fe "˪\NeedsTeXFormat}m.w}m.2,$28˪\newcol@H}m.w}m.}m.}m.}m. 248,$249$fe "˪\newcolumn?}m.w}m.}m.}m.}m.}m.}m. 238 fe "˪\newcolumntypeǍ}m.w}m.}m.}m.骬}m.w}m.}m.}m.}m.}m. '3,$239$fe "F,$269˪\newcommandL}m.w}m.}m. 326,$334˪\newif}m.w}m.}m.}m.}m.}m.}m.}m.}m.}m.}m. 79EUX\newlength?}m.w}m.}m. 323,$325 !dEUX\newtoksH}m.w}m.}m.}m.}m.}m.}m.}m.}m. 268EUX\next͍}m.w}m.}m.}m.}m.ϑ242,$252,254EUX\noexpandlq}m.w}m.}m.}m. 170,$242EUX\null͍}m.w}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m. 204d,y*OEUX\OldMakeindex,}m.w}m.}m.}m.}m. 22EUX\OnlyDescription}m.w}m. 21yPEUX\PackageError,}m.w}m.}m.}m.}m. 231EUX\PackageWarningj243,$246EUX\parL}m.w}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m. 181EUX\prepnext@tok,}m.w}m.}m.}m.}m. eƅ72eƅfe ?lo,90,119,131,cUX147,(m150,288,313 !dEUX\protectH}m.w}m.}m.}m.}m.}m.}m.}m.}m. 177EUX\ProvidesPackage}m.w}m. 29y-kREUX\raise}m.w}m.}m.}m.}m.}m.}m.}m.}m.}m.}m. 331EUX\RecordChangesǍ}m.w}m.}m.}m. 17EUX\renewcommand,}m.w}m. O12,$348EUX\repeat}m.w}m.}m.}m.}m.}m.}m.}m.}m.}m. 276EUX\reserved@aL}m.w}m.}m. 343,$348z5SEUX\save@decl74fe ?l ~,k95,147, cUX148,(m280(mfe ",(m293,310EUX\setlength 155,$214,324EUX\showcolslq}m.w}m.}m.}m.}m.}m. 4,$263$fe "EUX\string p41,$240,258,260yvTEUX\tabcolsep?}m.w}m.}m.}m.}m.}m.}m. 218EUX\tabularH}m.w}m.}m.}m.}m.}m.}m.}m.}m. 212 fe "EUX\tabular*lq}m.w}m.}m.}m.}m.}m.}m.}m. 212 fe "EUX\tabularnewline}m.w}m.}m. 181EUX\the@tokslq}m.w}m.}m.}m.}m.}m.}m.}m. cUX}m. '59 'fe ?lf,$76,78,85fe ?l T,cUX149,(m287,306,312 !dEUX\the@toksz?}m.w}m.}m.}m.}m.}m.}m. 59 Οfe ?ly-UEUX\usepackageL}m.w}m.}m.}m.}m.}m.}m.}m. 7P35$Fy?RChangeG\HistoryR1994/12/08 xa\@array:$add\tabularnewlineAō}m. p22iRv1.0baGeneral:`@classi(plusrapide), p`@classvi(nouvdbutoulandupram-pbule.Sinon`hlineesttropplongue.}m.w}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m. A1kEnlarged1 `@arstrutbAo66->77->&5CorrespAondingc}m.w}m.}m. A1v1.9aGeneral:2)`protectisnolonger&necessary:.tWBut2stillthemacro&`@expast*needstopbAemodi-&ed.`m,<.&These;?optionsnoand`@yargarraycr,psince<`endtemplateseemstobAep`outer.ፑ}m.w}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m.}m. A1 Rv1.9faGeneral:Smallc`d@llarbAegindened&on$toplevqL ecst09009Nffffectt14406} ecsx12001ow cmss90]f ecbx1000/D7` ectt1200.HЃ ecti1000-!N ecbx1200,6 ecss1000+V eccc1000*T2ecrm0700)qL ectt1000(&Lt$ffffecbx1440&7Lecrm0600% cmsy9$5" cmmi9"qL ectt0900!u ecbx0900 . ecrm0900&ectt0800"ecrm0800q% cmsy6K cmsy8 ecrm1200!", cmsy10BCGGecss1728UsGGecrm1728 1 ecrm1000 !", cmsy10 b> cmmi10K`y cmr102