; TeX output 1997.03.05:1629so. DtGGcmr17The7tGGcmss17dcolumnpacqkage!", cmsy10XQ cmr12DarvidCarlisle37 1996/09/23.!Kt : cmbx9Abstractэoo cmr9Thispac9k|ragede nesasystemforde ningcolumnsofentriesinanߤN cmtt9array borTtabularwhic9haretobAealignedona`decimalpoin9t'.XK`y cmr10ThisUUpackqagede nestakesasingleargumentspGecifyingthenumbGerofdecimalplaces,xKandtheI.texUU leshoulduse.,withbGeingusedintheoutput.I\newcolumntype{.}{D{.}{.}{-1}}X.qDzspGeci esUUacolumnofentriestobecentredonthe b> cmmi10:.I\newcolumntype{,}{D{,}{,}{2}}X,=spGeci es7takesacolumnofentrieswithatmosttwodecimalplacesaftera;.XTheUUfollowingtablebGegins\begin{tabular}{|d{-1}|d{2}|.|,|}3䍍d8؟ fffd1fd!fd24 ff1Ͳ2ϟ ff37138:2,3; ff<1A;D`2T`ß ff8؟ fffd1fd!fd234 ff1Ͳ23ϟ ff 361238:5,3; ff2300A;D`2T`ß ff8؟ fffd1121fd!fd24 ff1121Ͳ2ϟ ff3586138:20,3; ff2674A;D`29T`ß ff8؟ ff fd1844 ff184ϟ ff 3610,3; ff769T`ß ff8؟ fffd!fd44 ffͲ4ϟ ff,3; ffA;D`4T`ß ff8؟ ff4 ffϟ ff38:4,3; ffT`ß ffI'fffr @ -:q% cmsy6L|{Ycmr8ThisX lehasvÎersionnumbwhichhadanegativehde}'cimal*plac}'es!iLGargumentis Iwider]thanthesecondcolumn, sothatthedecimalpGointappearsinthemiddleofItheUUcolumn.XAlsoknotethatthispackqagedealscorrectlywithentrieswithnodecimalpart,InoUUintegerpart,andblankentries.XIfjyouhavetableheadings(insertedwith\multicolumn{1}{c}{..}toover-IrideqtheDKcolumntypGe)thenitmaybGethatneitheroftheaboveq`centred'or`rightIaligned'UUformsisquitewhatyouwant.ILτffŸ1headffahead Lτffkhead LτffILτ ff111 5" cmmi9:2:? ff1,:2^rLτ ffD1:2Lτ ff ILτ ff1112121:2:? ff 11212,:2^rLτ ff11212:2Lτ ffILτ ff1:4:? ff,:4^rLτ ff:4Lτ ff疰Lτff1wideTheadingff/SdwideTheadingLτffpwideTheadingLτff疰Lτ ff11 w1:2@ ffXq1]:2jCLLτ ff81:2Lτ ff 疰Lτ ff w1:4@ ff]:4jCLLτ ff:4Lτ ff7>XIn\bGothofthesetablesthe rstcolumnissetwithD{.}{.}{-1}toproduceIa2columncenteredonthe.,jKandthesecondcolumnissetwithD{.}{.}{1}toIproGduceUUarightalignedcolumn.XTheIcenteredcolumnproGducescolumnsthatarewiderthannecessaryto tinIthednumbGersunderaheadingasithastoensurethatthedecimalpointiscentred.ITherightalignedcolumntwodoGesnothavethisdrawback,#butunderawideIheadingUUacolumnofsmallrightaligned guresloGoksabitodd.XInversionv1.03athirdalternativeisintroGduced.]Thethirdhde}'cimal+plac}'es!iIargument\mayspGecifyb}'othۿthenumbGerofdigitstotheleftandtotherightoftheIdecimalplace.,Thethirdcolumninthe rsttablesabGoveissetwithD{.}{.}{5.1}IandXGinthesecondtable,YD{.}{.}{1.1},toXGspGecify` veplacestotheleftandoneItotheright'and`oneplacetotheleftandonetotheright'respGectively*.(YouImayJuse`,'Gorothertokens,Gnotnecessarily`.'%inthisargument.)%ThecolumnofI gures CisthenpGositionedsuchthatanumbGerwiththespeci ednumbers CofdigitsIisUUcentredinthecolumn.!čI#Nff cmbx121aLTheffMacrosLsٓRcmr71S! cmsy9h$ow cmss9pack9age#g iXFirstUUweloadarray.styifitnotalreadyloaded. Ls2S\RequirePackage{array}XThebasicideasbGehindthesemacrosareexplainedinthedocumentationforIarray.sty.dHowever-theyusethreetrickswhichmaybGeusefulinothercontexts.XbTheseparatorissurroundedinextra{?},5gsothatitissetwith\mathordbspacing,UUotherwise,forinstancea`,'wouldhaveextraspaceafterit.XbThenseparatorisnotgivenitsspGecialde nitionbymakingitactive,t-asthisbwouldSnotworkforanentrysuchas&?.5&,MasSthe rsttokenofanalignmentbentryisreadb}'eforeURthepreamblepart,incaseitisan\omit,inwhichcasebtheJpreambleistobGeomitted.QInsteadweswitchthemathcoGdeto(hex)b8000,UUwhichmakesthetokenactasifitwereactive.XbAlthoughm\mathcode`.="8000makes.Z$actasifitwereactive,itisstillnotballowedrinconstructionssuchas\def.{},yeveninmath-moGde,ysowehavebtoconstructanactiveversionoftheseparator, thisisdonebymakingitthebuppGercaseUUof~,andthenusingtheconstruct2Tsob\uppercase{\def~}{hde nitionci1k}. bNotethatthehde nitionci9۲isnotuppGercased, Qsothede nitioncanrefertobtheUUstandard,non-activeuseoftheseparator.,`\DC@ISet.upuppGercasetablesasrequired,6handthengrabthe rstpartofthenumericalIargumentUUinto\count@.Ls3S\def\DC@#1#2#3{% Ls4]\uccode`\~=`#1\relaxLs5]\m@thLs6]\afterassignment\DC@x\count@#3\relax{#1}{#2}}'|\DC@xIIfY\count@isnegative,[centreYonthedecimalpGoint.aIfitispositiveeither#1will IbGe5emptyinwhichcasebadoutdecimalparttothenumbGerofdigitsspeci edIbyz\count@or(newfeatureinv1.03)itisnoneemptyinwhichcase\count@Icontains thenumbGerofdigitstotheleftofthepoint,and#1containsajunktokenI(probablyt.)followedtbythenumbGerofdigitstotherightofthepGoint.IneitherIofUUtheselattercases,\DC@rightisused.Ls7S\def\DC@x#1\relax#2#3{% Ls8]\ifnum\z@>\count@Ls9f\expandafter\DC@centreI10]\elseI11f\expandafter\DC@rightI12]\fiI13]{#2}{#3}{#1}}\DC@centreIIfUUcenteringonthedecimalpGoint,justneedtobGoxupthetwohalves.I14S\def\DC@centre#1#2#3{%I15]\let\DC@end\DC@endcentreI16]\uppercase{\def~}{$\egroup\setbox\tw@=\hbox\bgroup${#2}}%I17]\setbox\tw@=\hbox{${\phantom{{#2}}}$}%I18]\setbox\z@=\hbox\bgroup$\mathcode`#1="8000}\DC@endcentreIand)thenpadoutthesmallerofthetwo)bGoxessothereisthesameamountofstu IeitherUUsideofthepGoint.I19S\def\DC@endcentre{$\egroupI20f\ifdim\wd\z@>\wd\tw@I21p2\setbox\tw@=\hboxto\wd\z@{\unhbox\tw@\hfill}%I22f\elseI23p2\setbox\z@=\hboxto\wd\tw@{\hfill\unhbox\z@}\fiI24f\box\z@\box\tw@}$\DC@rightIThisdealswithbGoththecaseswhereaspeci ednumberofdecimalplacesisgiven.I25S\def\DC@right#1#2#3{%I26]\ifx\relax#3\relaxIIf#3isempty*,ݹadd\hfilltorightalignthecolumn,ݹandJustset\DC@rltobGegin IaUUgroup,sonothingfancyisdonewiththewholenumbGerUUpart.I27f\hfillI28f\let\DC@rl\bgroupI29]\elseIOtherwisemset\DC@rlsothatthewholenumbGermpartisputinabox\count@ Itimes)aswideasadigit.c5InordertosharecoGdewiththeotherbranch,2]thenmove3!YsoI#3|(thenumbGer|ofdecimalplaces)into\count@throwingawaythe`.'=fromthe IuserUUsyntax.I30f\edef\DC@rl{to\the\count@\dimen@ii\bgroup\hss\hfill}% I31f\count@\@gobble#3\relaxI32]\fiI33]\let\DC@end\DC@endrightIBox2containsthedecimalpart,setto\dimen@whichiscalculatedbGelowtobGeI\count@UUtimesthewidthofadigit,plusthewithofthe`decimalpGoint'.I34]\uppercase{\def~}{$\egroup\setbox\tw@\hboxto\dimen@\bgroup${#2}}%I35ap\setbox\z@\hbox{$1$}\dimen@ii\wd\z@I36ap\dimen@\count@\dimen@iiI37ap\setbox\z@\hbox{${#2}$}\advance\dimen@\wd\z@I38ap\setbox\tw@\hboxto\dimen@{}%IBoxwA0containsthewholenumbGerpart,eitherjustatitsnaturalsizeforrightIaligned5columns,orsetto(theoldvqalueof)\count@timesthewidthofadigit.I\DC@rlUUde nedabGoveUUdeterminesthetwoUUcases.I39ap\setbox\z@\hbox\DC@rl$\mathcode`#1="8000}b\DC@endrightIJustUU nisho thesecondbGox,andthenputoutbothboxes.I40S\def\DC@endright{$\hfil\egroup\box\z@\box\tw@}:DITheUUuserinterface,de netheDcolumntotakethreearguments.I41S\newcolumntype{D}[3]{>{\DC@{#1}{#2}{#3}}c<{\DC@end}}I42Sh=pack9age#g i4-; $ow cmss9#Nff cmbx12! cmsy9 5" cmmi9': cmti10 cmmi10K`y cmr10ٓRcmr73S