÷ƒ’À;è TeX output 1998.01.17:2005‹ÿÿÿÿ y ý£ ? þ’ºy™óDÓítG®G®cmr17¹The–7tóÖÆG®G®cmss17ºtabulašŒqrx“¹pac˜k‘ÿäageŸùº¯ó!",š cmsy10¿ŽŽŽŸ’Þþ­óX«Q cmr12»Da¬rvid‘ê¨CarlisleŽŽŽŽŽŸ37’æ 1997/09/18ŽŸ-e’ï!Kót ‰: cmbx9ÇAbstractŽŸ_‘‘xßüóo´‹Ç cmr9ÆA‘å‡new›å½en•¾9vironmen“t,–×óߤN cmtt9ÈtabularxÆ,“is˜de ned,“whic•¾9h˜tak“es˜the˜same˜argu-ޤ ‘kmen¾9ts–áFas“Ètabular*Æ,›ë¯but“moAÇdi es“the“widths“of“certain“columns,˜rather“thanŽ¡‘kthe–cin¾9ter“column“space,‘wto“set“a“table“with“the“requested“total“width.‘#TheŽ¡‘kcolumns–á¹that“maš¾9y“stretc˜h“are“mark˜ed“with“the“new“tok˜en“ÈX‘á¬Æin“the“pream˜bleŽ¡‘kargumen¾9t.Ž¡‘xßüThis–Tpacš¾9k‘ÿ|rage“requires“the“Èarray“Æpac˜k‘ÿ|rage.Ž©!v‘RóÂÖN ff cmbx12Ê1Ž‘jLËInŒÌtros3ductionŽŸç‘RóKñ`y cmr10²This–=pacš¸ãk‘ÿqÇage“implemen˜ts“a“v˜ersion“of“the“ó ßê‘ "5Ÿý-:ó¹Aa¨cmr6Á1ŽŽŽ‘LÜÀY‘ÿJªou–ÕXcan“noÃŽw“use“ó"ßCÊscmtt8Í\footnote“Àinside“ÍtabularxÀ!ŽŽŸ’²1ŽŽŒ‹* y ý£ ? ýä‘R²If–UUwš¸ãe“c˜hange“the“ rst“line“to“Ë\begin{tabularx}{300pt}{|c|X|c|X|}“²w˜e“get:ŽŸ+õt‘m€ŸßL͉ff,¤fd¤™œ„ ff–&»ŸüfdMulticolumn‘UUen¸ãtry!“¡„ ffŽ’‘ÚOTHREE‘Ÿ™œ„ ffŽ’Áò€F¸ãOURŽŽ’+™›Ÿ™œ„ ffŽŽŸ‰ff,¡¤'™œ„0ff–ŸØfdone“¡„0ffŽ‘!ÌÎThe–UUwidth“of“thisޤ ‘!ÌÎcolumn–UUdepGends“onŽ¡‘!ÌÎthe–UUwidth“of“the“table.ŽŽ’‹séŸ'™œ„0ffŽ’˜“4three‘ ¸åŸ'™œ„0ffŽ’Áò€Column–UUfour“will“actޤ ’Áò€in–UUthe“same“w•¸ãa“y‘UUasŽ¡’Áò€column›UUt•¸ãw“o,˜with˜theŽ¡’Áò€same‘UUwidth.ŽŽ’+™›Ÿ'™œ„0ffŽŽŸ(‰ff,ŽŽŽŸ6U‘RÊ3Ž‘jLËDi erences›ffbs3et•ŒÌw“een˜ó#߆µTff cmtt12Îtabularx˜Êand˜Îtabular*ŽŸç‘R²These›‹§t•¸ãw“o˜en“vironmen“ts˜tak“e˜the˜same˜argumen“ts,‘³þto˜pro•Gduce˜a˜table˜of˜a˜sp“eci edޤ ‘Rwidth.‘qÇThe–UUmain“di erences“bGet•¸ãw“een–UUthem“are:ŽŸ¢÷‘a¸ŽŽŽ‘kËtabularx–²mošGdi es“the“widths“of“the“Ìc‘ÿ}'olumns²,‘Kïwhereas“Ëtabular*“²mo˜di esŽ¡‘kthe–UUwidths“of“the“in¸ãter-column“Ìsp–ÿ}'ac“es².Ž©Ñ|‘a¸ŽŽŽ‘kËtabular–Íp²and“Ëtabular*“²en•¸ãvironmen“ts›Ípma“y˜bGe˜nested˜with˜no˜restriction,Ž¡‘kho•¸ãw“ev“er–[“if“one“Ëtabularx“²en•¸ãvironmen“t–[“oGccurs“inside“another,‘]"then“the“innerŽ¡‘kone–UUÌmust‘H-²bGe“enclosed“b¸ãy“Ë{‘?ý}².ަ‘a¸ŽŽŽ‘k²The›ë6b•Go“dy˜of˜the˜Ëtabularx˜²en•¸ãvironmen“t˜is˜in˜fact˜the˜argumen“t˜to˜a˜com-Ž¡‘kmand,‘ã‰and–Çso“certain“constructions“whicš¸ãh“are“not“allo˜w˜ed“in“command“ar-Ž¡‘kgumen•¸ãts›UU(lik“e˜Ë\verb²)˜ma“y˜not˜bGe˜used.Ÿü^ÿ±2ŽŽŽ¦‘a¸ŽŽŽ‘kËtabular*–P˜²uses“a“primitivš¸ãe“capabilit˜y“of“T‘þU>Ÿ'EŽ‘ãxX“to“moGdify“the“in˜ter“column“spaceŽ¡‘kof–˜¦an“alignmenš¸ãt.‘;»Ëtabularx“²has“to“set“the“table“sev˜eral“times“as“it“searc˜hesŽ¡‘kfor–íthe“bGest“column“widths,‘Îand“is“therefore“m•¸ãuc“h›íslo“w“er.‘U¤Also˜the˜fact˜thatŽ¡‘kthe›UUb•Go“dy˜is˜expanded˜sev•¸ãeral˜times˜ma“y˜break˜certain˜T‘þU>Ÿ'EŽ‘ãxX˜constructs.ŽŸ ý½‘RÊ4Ž‘jLËCustomising–ffthe“bs3ehaŒÌviour“of“ÎtabularxŽŸç‘Ró$ÂÖN  cmbx12Ï4.1Ž‘pÀT‘þàerminal‘€outputŽ©uT‘R²If–ûothis“declaration“is“made,‘dösaš¸ãy“in“the“doGcumen˜t“pream˜ble,‘döthen“all“follo˜wingŽ‘ûf È\tracingtabularxŽŽŽŽ¡‘RËtabularx›" ²en•¸ãvironmen“ts˜will˜prin“t˜information˜abGout˜column˜widths˜as˜they˜re-Ž¡‘RpGeatedly–UUre-set“the“tables“to“ nd“the“correct“widths.Ž¡‘aAs–°an“alternativ¸ãe“to“using“the“Ë\tracingtabularx“²declaration,‘Ñ either“of“the“op-Ž¡‘Rtions–ºËinfoshow“²or“Ëdebugshow“²maš¸ãy“bGe“giv˜en,‘( either“in“the“Ë\usepackage“²commandŽ¡‘Rthat–UUloads“Ëtabularx²,“or“as“a“global“option“in“the“Ë\documentclass“²command.ŽŸê/‘RÏ4.2Ž‘pÀThe›€en• vironmen“t˜used˜to˜t“yp`eset˜the˜ó%߆µT cmtt12ÐX˜Ïcolumnsަ‘R²By–dUdefault“the“ËX‘cβspGeci cation“is“turned“inš¸ãto“Ëp{¸hÌsomeŽ‘B+value‘À[¸iŽ‘:!ÇË}².‘ žÈSuc˜h“narro˜wŽ¡‘Rcolumns–†)often“require“a“spšGecial“format,‘Ò^this“ma¸ãy“b˜e“ac•¸ãhiev“ed–†)using“the“Ë>“²syn-Ž¡‘Rtax–>of“Ëarray.sty².‘ŸƒSo“for“example“yš¸ãou“ma˜y“giv˜e“a“spGeci cation“of“Ë>{\small}X².Ž‘RŸpƉffÿrŸ J=‘ "5Ÿý-:Á2ŽŽŽ‘LÜÀSince–3V‘ÿJªersion“1.02,›(éÍ\verb–@and“\verb*–3ÀmaÃŽy“bŸ'EŽ‘ãxX'sޤ ‘RË\raggedright–ž{²macro“rede nes“Ë\\“²in“a“w•¸ãa“y›ž{whic“h˜con icts˜with˜its˜use˜in˜a˜tab-Ž¡‘Rular–Â-or“arraš¸ãy“en˜vironmen˜ts.‘¸OF‘ÿ*ªor“this“reason“this“pac˜k‘ÿqÇage“in˜troGduces“the“com-Ž 6È\arraybackslashŽŽŽŽ¡‘R²mand–ôÐË\arraybackslash²,›®this“ma¸ãy“bGe“used“after“a“Ë\raggedright²,˜Ë\raggedleftŽ¡‘R²or–UUË\centering“²declaration.‘qÇThš¸ãus“a“Ëtabularx“²pream˜ble“ma˜y“spGecifyŽ¡‘RË>{\raggedright\arraybackslash}X².Ž¡‘aThese–Ä@preamš¸ãble“spGeci cations“ma˜y“of“course“bGe“sa˜v˜ed“using“the“command,Ž‘ÙÌÈ\newcolumntypeŽŽŽŽ¡‘RË\newcolumntype²,–UUde ned“in“Ëarray.sty².‘qÇThš¸ãus“w˜e“ma˜y“sa˜yŽ¡‘RË\newcolumntype{Y}{>{\small\raggedright\arraybackslash}X}Ž¡‘R²and–UUthen“use“ËY“²in“the“Ëtabularx“²preamš¸ãble“argumen˜t.Ž¡‘aThe–xMËX‘xD²columns“are“set“using“the“Ëp“²column“whic¸ãh“correspGonds“to“Ë\parbox[t]².Ž 6È\tabularxcolumnŽŽŽŽ¡‘R²Y‘ÿ*ªou–µAmaš¸ãy“w˜an˜t“them“set“using,–;sa˜y‘ÿ*ª,“the–µAËm“²column,‘;whic˜h“correspGonds“toŽ¡‘RË\parbox[c]².‘¥It–_Jis“not“pGossible“to“cš¸ãhange“the“column“t˜ypGe“using“the“Ë>“²syn˜tax,Ž¡‘Rso–å¦another“system“is“pro¸ãvided.‘LË\tabularxcolumn“²should“bšGe“de ned“to“b˜e“a“macroŽ¡‘Rwith–Ÿone“argumen•¸ãt,‘Â]whic“h–Ÿexpands“to“the“Ëtabular“²preamš¸ãble“spGeci cation“that“y˜ouŽ¡‘Rw•¸ãan“t–”:to“correspšGond“to“ËX².“The“argumen¸ãt“will“b˜e“replaced“b¸ãy“the“calculated“widthŽ¡‘Rof–UUa“column.Ž¡‘aThe–ðdefault“is“Ë\newcommand{\tabularxcolumn}[1]{p{#1}}².‘ ¼˜So“wš¸ãe“ma˜yŽ¡‘Rcš¸ãhange–UUthis“with“a“command“suc˜h“as:Ž¡‘RË\renewcommand{\tabularxcolumn}[1]{>{\small}m{#1}}ŽŸþ6‘RÏ4.3Ž‘pÀColumn‘€widthsŽŸuT‘R²Normally–‘¸all“ËX‘‘¨²columns“in“a“single“table“are“set“to“the“same“width,‘ Ðho•¸ãw“ev“er–‘¸it“isŽ¡‘RpGossible–'‡to“makš¸ãe“Ëtabularx“²set“them“to“di eren˜t“widths.‘bƒA‘'|pream˜ble“argumen˜t“ofŽ¡‘RË{>{\hsize=.5\hsize}X>{\hsize=1.5\hsize}X}– ‘²spGeci es“t•¸ãw“o– ‘columns,‘6Ÿthe“sec-Ž¡‘Rond–ÂÂwill“bGe“three“times“as“wide“as“the“ rst.‘º Ho•¸ãw“ev“er–ÂÂif“yš¸ãou“w˜an˜t“to“pla˜y“gamesŽ¡‘Rlikš¸ãe–UUthis“y˜ou“should“follo˜w“the“follo˜wing“t˜w˜o“rules.Ž©‘a¸ŽŽŽ‘k²Makš¸ãe–í%sure“that“the“sum“of“the“widths“of“all“the“ËX‘í ²columns“is“unc˜hanged.‘O (InŽ¡‘kthe›ƒzabGo•¸ãv“e˜example,‘the˜new˜widths˜still˜add˜up˜to˜t“wice˜the˜default˜width,Ž¡‘kthe–UUsame“as“t•¸ãw“o–UUstandard“ËX“²columns.)ަ‘a¸ŽŽŽ‘k²Do–UUnot“use“Ë\multicolumn“²enš¸ãtries“whic˜h“cross“an˜y“ËX“²column.ަ‘RAs–UUwith“most“rules,“these“maš¸ãy“bGe“brok˜en“if“y˜ou“kno˜w“what“y˜ou“are“doing.ŽŸþ6‘RÏ4.4Ž‘pÀIf–€the“algorithm“fails.–@.“.ŽŸuT‘R²It–_ma¸ãy“bGe“that“the“widths“of“the“`normal'“columns“of“the“table“already“total“moreŽ¡‘Rthan–íÝthe“requested“total“width.‘OJó&m#½R cmss10Ñtabulaš¸ãrx“²refuses“to“set“the“ËX‘íòcolumns“to“a“negativ˜eŽ¡‘Rwidth,‘ÒBso–±}in“this“case“yš¸ãou“get“a“w˜arning“\X‘±SColumns“toGo“narro˜w“(table“toGo“wide)".Ž¡‘aThe–z’ËX‘zG²columns“will“in“this“case“bGe“set“to“a“width“of“1em“and“so“the“tableŽ¡‘Ritself–ßýwill“bGe“wider“than“the“requested“total“width“givš¸ãen“in“the“argumen˜t“to“theŽ¡‘Ren•¸ãvironmen“t.‘CÊThis››VbGeha“viour˜of˜the˜pac“k‘ÿqÇage˜can˜bGe˜customised˜sligh“tly˜as˜notedŽ¡‘Rin–UUthe“došGcumen¸ãtation“of“the“co˜de“section.ŽŽŸ’3ŽŽŒ‹, y ý£ ? ýä‘RÊ5Ž‘jLËThe‘ffMacrosŽŸç‘Uüs±1Ž‘\ª®ó(©±Ê cmsy9Óhó)ÒoÇw cmss9Ôpack¾9ageŽ‘#g ÓiŽŸ‘Uüs±2Ž‘\ª®È\DeclareOption{infoshow}{\AtEndOfPackage\tracingtabularx}ޤ ‘Uüs±3Ž‘\ª®È\DeclareOption{debugshow}{\AtEndOfPackage\tracingtabularx}Ž¡‘Uüs±4Ž‘\ª®È\ProcessOptionsŽŸ‘a²This–UUrequires“Ëarray.sty².Ž¡‘Uüs±5Ž‘\ª®È\RequirePackage{array}[1994/02/03]Ž©‘a²First–UUsome“registers“etc.“that“w¸ãe“need.Ž¡‘Uüs±6Ž‘\ª®È\newdimen\TX@col@widthŽ¡‘Uüs±7Ž‘\ª®È\newdimen\TX@old@tableŽ¡‘Uüs±8Ž‘\ª®È\newdimen\TX@old@colŽ¡‘Uüs±9Ž‘\ª®È\newdimen\TX@targetŽ¡‘R±10Ž‘\ª®È\newdimen\TX@deltaŽ¡‘R±11Ž‘\ª®È\newcount\TX@colsŽ¡‘R±12Ž‘\ª®È\newif\ifTX@ަ‘a²Noš¸ãw–Ž6a“tric˜k“to“get“the“b•Go“dy–Ž6of“an“en˜vironmen˜t“in˜to“a“tok˜en“register,‘œnwithoutޤ ‘Rdoing–Gƒanš¸ãy“expansion.‘m,This“doGes“not“do“an˜y“real“c˜hec˜king“of“nested“en˜vironmen˜ts,Ž¡‘Rso–;bif“yš¸ãou“should“need“to“nest“one“Ëtabularx“²inside“another,‘@“the“inner“one“m˜ust“bGeŽ¡‘Rsurrounded–UUb¸ãy“Ë{‘?ý}².Ž¡‘À$È\tabularxŽŽŽ‘R²Prior–°†to“v1.06,›Ñ|this“macro“toGok“t•¸ãw“o‘°†argumen“ts,˜whic“h›°†w“ere˜sa“v“ed˜in˜separate˜regis-Ž¡‘Rters–»ßbšGefore“the“table“b˜o˜dy“wš¸ãas“sa˜v˜ed“b˜y“Ë\TX@get@body².‘> Unfortunatly“this“disablesŽ¡‘Rthe–ç%Ë[t]“²optional“argumen•¸ãt.‘M No“w–ç%just“sa•¸ãv“e–ç%the“width“spGeci cation“separately‘ÿ*ª,‘ý/thenŽ¡‘Rclear–the“tokš¸ãen“register“Ë\toks@².‘ºFinally“call“Ë\TX@get@body“²to“bGegin“sa˜ving“theŽ¡‘Rb•Go“dy–ª-of“the“table.‘pPThe“Ë{\ifnum0=`}\fi“²wš¸ãas“added“at“v1.03,‘¿cto“allo˜w“ËtabularxŽ¡‘R²to–UUappGear“inside“a“Ë\halign².Ÿü^ÿ±3ŽŽŽ¡‘a²This–mecš¸ãhanism“of“grabbing“an“en˜vironmen˜t“b•Go“dy›do“es˜ha•¸ãv“e˜the˜disadv‘ÿqÇan“tageŽ¡‘R(shared–/Ówith“the“AMS‘/Êalignmenš¸ãt“en˜vironmen˜ts)“that“y˜ou“can“not“mak˜e“extensionŽ¡‘Ren•¸ãvironmen“ts›UUb“y˜coGde˜suc“h˜asŽ©‘RÈ\newenvironment{foo}{\begin{tabularx}{XX}}{\end{tabularx}}ŽŸ‘R²as–'Éthe“cošGde“is“lo˜oking“for“a“literal“string“Ë\end{tabularx}“²to“stop“scanning.‘b˜SinceŽ¡‘Rvš¸ãersion–C‘2.02,‘Gone“ma˜y“a˜v˜oid“this“problem“b˜y“using“Ë\tabularx“²and“Ë\endtabularxŽ¡‘R²directly–UUin“the“de nition:ަ‘RÈ\newenvironment{foo}{\tabularx{XX}}{\endtabularx}ŽŸ‘R²The–5Õscanner“noš¸ãw“loGoks“for“the“end“of“the“curren˜t“en˜vironmen˜t“(Ëfoo“²in“this“ex-Ž¡‘Rample.)‘gDThere–üare“some“restrictions“on“this“usage,‘&Ithe“principal“one“bGeing“thatŽ¡‘RË\endtabularx–UU²is“the“Ì rst‘H-²tokš¸ãen“of“the“`end“coGde'“of“the“en˜vironmen˜t.ŽŸ‘R±13Ž‘\ª®È\def\tabularx#1{%Ž‘RŸ&e‰ffÿrŸ J=‘ "5Ÿý-:Á3ŽŽŽ‘LÜÀThis–4šadds“an“extra“levšÃŽel“of“grouping,‘Œkwhic˜h“is“not“really“needed.‘äçInstead,‘ŒkI‘4@could“useޤ €Í\iffalse{\fi\ifnum0=`}\fiŽ‘ni Àhere,–~5and‘)<Í\ifnum0=`{}\fiŽ‘CÒ°Àb€table“with“eac¸ãh“ËX‘>{²column“the“width“of“the“ nal“table.‘j+Assuming“that“there“isŽ¡‘Rat–Ý‚least“one“ËX‘Ýc²column,‘õythis“will“prošGduce“a“table“that“is“to˜o“wide.‘IÖDivide“the“excessŽ¡‘Rwidth–êbš¸ãy“the“n˜um˜bGer“of“ËX‘Ù²columns,‘!Ìand“reduce“the“column“width“b˜y“this“amoun˜t.Ž¡‘RReset–k7the“table.‘³mIf“the“table“is“not“noš¸ãw“the“correct“width,‘p¯a“Ë\multicolumn“²en˜tryŽ¡‘Rm¸ãust–>`bGe“`hiding'“one“of“the“ËX›>Z²columns,‘B÷and“so“there“is“one“less“ËX˜²column“a ectingŽ¡‘Rthe–Áùwidth“of“the“table.‘·³So“wš¸ãe“reduce“b˜y“1“the“n˜um˜bšGer“of“X‘ÁÝcolumns“and“rep˜eatŽ¡‘Rthe‘UUproGcess.ŽŸÛn‘f È\TX@endtabularxŽŽŽ‘R²Although›*I‘ha•¸ãv“e˜tried˜to˜mak“e˜Ëtabularx˜²loGok˜lik“e˜an˜en“vironmen“t,‘Œit˜is˜in˜fact˜aŽ¡‘Rcommand,–UUall“the“wš¸ãork“is“done“b˜y“this“macro.ަ‘R±28Ž‘\ª®È\def\TX@endtabularx{%ŽŸI%‘R²De ne–‹´the“ËX‘‹¦²column,‘™Kwith“an“inš¸ãternal“v˜ersion“of“the“Ë\newcolumntype“²command.Ž¡‘RThe–UUË\expandafter“²commands“enable“Ë\NC@newcol“²to“get“the“Ìexp‘ÿ}'ansion“²ofŽ¡‘RË\tabularxcolumn{\TX@col@width}–å·²as“its“argumen¸ãt.‘"íThis“will“bGe“the“de nitionŽ¡‘Rof–UUan“ËX“²column,“as“discussed“in“section“4.ަ‘R±29Ž‘fÚÈ\expandafter\TX@newcol\expandafter{\tabularxcolumn{\TX@col@width}}%ŽŽŸ’²5ŽŽŒ‹3Û y ý£ ? ýä‘R²Initialise–º‰the“column“width,‘Öand“the“n•¸ãum“bšGer–º‰of“ËX‘º-²columns.‘¡cThe“n•¸ãum“b˜er–º‰of“ËXޤ ‘R²columns–ö‚is“set“to“one,‘ ywhicš¸ãh“means“that“the“initial“coun˜t“will“bšGe“one“to˜o“high,‘ ybutŽ¡‘Rthis–UUv‘ÿqÇalue“is“decremen¸ãted“bšGefore“it“is“used“in“the“main“lo˜op.Ž¡‘aSince–UUv1.02,“switc¸ãh“the“de nition“of“Ë\verb².Ž©‘R±30Ž‘fÚÈ\let\verb\TX@verbŽŸ‘R²Since›tv1.05,‘»Ïsa•¸ãv“e˜the˜v‘ÿqÇalues˜of˜all˜LŸýó5‘üff±AŽŽ‘͉²T‘þU>Ÿ'EŽ‘ãxX˜coun“ters,‘»Ïthe˜list˜Ë\cl@@ckpt˜²con“tainsŽ¡‘Rthe–%_names“of“all“the“LŸýó5‘üff±AŽŽ‘͉²T‘þU>Ÿ'EŽ‘ãxX“counš¸ãters“that“ha˜v˜e“bGeen“de ned“so“far.‘áåW‘ÿ*ªe“expandŽ¡‘RË\setcounter–æ²at“this“pGoinš¸ãt,‘!Éas“it“results“in“few˜er“tok˜ens“bGeing“stored“in“Ë\TX@ckpt²,Ž¡‘Rbut–ˆKthe“actual“resetting“of“the“coun¸ãters“oGccurs“when“Ë\TX@ckpt“²is“expanded“afterŽ¡‘Reacš¸ãh–mtrial“run.‘…Actually“since“v1.07,‘2³use“something“equiv‘ÿqÇalen˜t“to“the“expansionŽ¡‘Rof–]the“original“de nition“of“Ë\setcounter²,‘_so“that“Ëtabularx“²w¸ãorks“in“conjunctionŽ¡‘Rwith‘UUËcalc.sty².ަ‘R±31Ž‘fÚÈ\def\@elt##1{\global\value{##1}\the\value{##1}\relax}%ޤ ‘R±32Ž‘fÚÈ\edef\TX@ckpt{\cl@@ckpt}%Ž¡‘R±33Ž‘fÚÈ\let\@elt\relaxŽ¡‘R±34Ž‘fÚÈ\TX@old@table\maxdimenŽ¡‘R±35Ž‘fÚÈ\TX@col@width\TX@targetŽ¡‘R±36Ž‘fÚÈ\global\TX@cols\@neŽŸ‘R²T¸ãypGeout–UUsome“headings“(unless“this“is“disabled).ަ‘R±37Ž‘fÚÈ\TX@typeout@Ž¡‘R±38Ž‘o‘È{\@spaces–¹–Table“Width\@spaces“Column“Width\@spaces“X“Columns}%ŽŸ‘R²First–UUattempt.‘qÇMoGdify“the“ËX“²de nition“to“coun¸ãt“ËX“²columns.ަ‘R±39Ž‘fÚÈ\TX@trial{\def\NC@rewrite@X{%Ž¡‘R±40Ž’‹êŠÈ\global\advance\TX@cols\@ne\NC@find‘¹–p{\TX@col@width}}}%ŽŸ‘R²RepGeatedly–”zdecrease“column“width“un¸ãtil“table“is“the“correct“width,‘» or“stops“shrink-ޤ ‘Ring,‘Ošor–N+the“columns“bGecome“t•¸ãw“o›N+narro“w.‘odIf˜there˜are˜no˜m“ulticolumn˜en“tries,‘OšthisŽ¡‘Rwill–UUonly“tak¸ãe“one“attempt.ަ‘R±41Ž‘fÚÈ\loopޤ ‘R±42Ž‘o‘È\TX@arithŽ¡‘R±43Ž‘o‘È\ifTX@Ž¡‘R±44Ž‘o‘È\TX@trial{}%Ž¡‘R±45Ž‘fÚÈ\repeatŽŸ‘R²One–,last“time,‘4Fwith“wš¸ãarnings“bac˜k“on“(see“appGendix“D)‘+øuse“Ëtabular*“²to“put“it“inޤ ‘Ra–UUbGoš¸ãx“of“the“righ˜t“size,“in“case“the“algorithm“failed“to“ nd“the“correct“size.Ž¡‘aSince–¬Æv1.04,‘Î}loGcally“makš¸ãe“Ë\footnotetext“²sa˜v˜e“its“argumen˜t“in“a“tok˜en“register.Ž¡‘RSince–²äv1.06,‘ GË\toks@“²conš¸ãtains“the“pream˜ble“spšGeci cation,‘ Gand“p˜ossible“optionalŽ¡‘Rargumenš¸ãt,–UUas“w˜ell“as“the“table“b•Go“dy‘ÿ*ª.ަ‘R±46Ž‘fÚÈ{\let\@footnotetext\TX@ftntext\let\@xfootnotenext\TX@xftntextޤ ‘R±47Ž‘o‘È\csname‘¹–tabular*\expandafter\endcsname\expandafter\TX@targetŽ¡‘R±48Ž‘y2È\the\toks@Ž¡‘R±49Ž‘o‘È\csname‘¹–endtabular*\endcsname}%ŽŸ‘R²Noš¸ãw–Œšthe“alignmen˜t“is“ nished,‘Úkand“the“Ë}“²has“restored“the“original“meaning“ofޤ ‘RË\@footnotetext–UU²expand“the“register“Ë\TX@ftn“²whic¸ãh“will“execute“a“series“ofŽ¡‘RË\footnotetext[¸hÌnum‘Äc¸iŽ‘¶%Ë]{¸hÌnote‘À[¸iŽ‘/CË}ŽŽŸ’²6ŽŽŒ‹@ y ý£ ? ýä‘R²commands.‘\W‘ÿ*ªe–Aneed“to“bšGe“careful“ab˜out“clearing“the“register“as“wš¸ãe“ma˜y“bGe“insideޤ ‘Ra–UUnested“Ëtabularx².Ž©‘R±50Ž‘fÚÈ\global\TX@ftn\expandafter{\expandafter}\the\TX@ftnŽŸ‘R²Noš¸ãw–* nish“o “the“Ëtabularx“²en˜vironmen˜t.‘ð Note“that“w˜e“need“Ë\end{tabularx}Ž¡‘R²here–×¶as“the“Ë\end{tabularx}“²in“the“user's“ le“is“nevš¸ãer“expanded.‘øêNo˜w“use“Ë\TX@Ž¡‘R²rather–UUthan“Ëtabularx².Ž¡‘aW‘ÿ*ªe–]‹also“need“to“ nish“o “the“group“started“b¸ãy“Ë{\ifnum0=`}\fi“²in“the“macroŽ¡‘RË\tabularx².ަ‘R±51Ž‘fÚÈ\ifnum0=`{\fi}%ŽŸ ‘R±52Ž‘fÚÈ\expandafter\end\expandafter{\TX@}}ŽŸ‘À$\TX@arithŽŽŽ‘R²Calculate–þ×the“column“width“for“the“next“try‘ÿ*ª,‘$setting“the“ ag“Ë\ifTX@“²to“false“if“theŽ¡‘RlošGop–UUshould“b˜e“ab˜orted.ަ‘R±53Ž‘\ª®È\def\TX@arith{%ޤ ‘R±54Ž‘fÚÈ\TX@falseŽ¡‘R±55Ž‘fÚÈ\ifdim\TX@old@table=\wd\@tempboxaŽŸ‘R²If–ú˜wš¸ãe“ha˜v˜e“reduced“the“column“width,‘#ébut“the“table“width“has“not“c˜hanged,‘#éw˜eޤ ‘Rstop– Rthe“loGop,‘Rand“output“the“table“(whicš¸ãh“will“cause“an“o˜v˜er-full“alignmen˜t)“withŽ¡‘Rthe–UUprevious“v‘ÿqÇalue“of“Ë\TX@col@width².ަ‘R±56Ž‘o‘È\TX@col@width\TX@old@colޤ ‘R±57Ž‘o‘È\TX@typeout@{Reached–¹–minimum“width,“backing“up.}%Ž¡‘R±58Ž‘fÚÈ\elseŽŸ‘R²Otherwise–UUcalculate“the“amounš¸ãt“b˜y“whic˜h“the“curren˜t“table“is“toGo“wide.ަ‘R±59Ž‘o‘È\dimen@\wd\@tempboxaŽ¡‘R±60Ž‘o‘È\advance\dimen@‘¹–-\TX@targetŽ¡‘R±61Ž‘o‘È\ifdim\dimen@<\TX@deltaŽŸ‘R²If–ïèthis“amoun¸ãt“is“less“than“Ë\TX@delta²,‘VŒstop.‘ A€(Ë\TX@delta“²should“bGe“non-zeroŽŸ ‘Rotherwise–UUwš¸ãe“ma˜y“miss“the“target“due“to“rounding“error.)ަ‘R±62Ž‘y2È\TX@typeout@{Reached‘¹–target.}%Ž¡‘R±63Ž‘o‘È\elseŽŸ‘R²Reduce–”âthe“n•¸ãum“bGer–”âof“e ectivš¸ãe“ËX‘”Ò²columns“b˜y“one.‘0o(Chec˜king“that“w˜e“do“not“getޤ ‘R0,‘(Fas–this“wš¸ãould“proGduce“an“error“later.)‘_Then“divide“excess“width“b˜y“the“n˜um˜bGerŽ¡‘Rof–Güe ectiv¸ãe“columns,‘J§and“calculate“the“new“column“width.‘mTT‘ÿ*ªempGorarily“store“thisŽ¡‘Rv‘ÿqÇalue–UU(times“¸²1)“in“Ë\dimen@².ަ‘R±64Ž‘y2È\ifnum\TX@cols>\@neޤ ‘R±65Ž’‚w^È\advance\TX@cols\m@neŽ¡‘R±66Ž‘y2È\fiŽ¡‘R±67Ž‘y2È\divide\dimen@\TX@colsŽ¡‘R±68Ž‘y2È\advance\dimen@‘¹–-\TX@col@widthŽ¡‘R±69Ž‘y2È\ifdim–¹–\dimen@“>\z@ŽŸ‘R²If–¶Ôthe“new“width“w¸ãould“bšGe“to˜o“narro¸ãw,‘Öˆab˜ort“the“lo˜op.‘<òAš¸ãt“the“momen˜t“toGo“narro˜w,ޤ ‘Rmeans–UUless“than“0‘ª®pt!Ž¡‘aPrior–Nto“v2.03,‘Oßif“the“lošGop“w¸ãas“ab˜orted“here,‘Oßthe“X‘Ncolumns“w¸ãere“left“with“theŽ¡‘Rwidth–VAof“the“previous“run,‘–|but“this“maš¸ãy“mak˜e“the“table“far“toGo“wide“as“initialŽŽŸ’7ŽŽŒ‹L y ý£ ? ýä‘R²guesses–˜åare“alw•¸ãa“ys–˜åtoGo“big.‘Ÿ'EŽ‘ãxXBoGok.Ÿü^ÿ±4ŽŽŽ¦‘R93Ž‘j×pÈ\def\write{\begingroupޤ ‘R±94Ž‘tJœÈ\def\write{\afterassignment\endgroup\toks@}%Ž¡‘R±95Ž’‚w^È\afterassignment\write\count@}%ŽŸ‘R²T‘ÿ*ªurn–~Xo “wš¸ãarnings“(see“appGendix“D).“Also“prev˜en˜t“them“bGeing“turned“bac˜k“on“b˜yŽŸ ‘Rsetting–UUthe“parameter“names“to“bGe“registers.ަ‘R±96Ž‘o‘È\hbadness\@MŽ¡‘R±97Ž‘o‘È\hfuzz\maxdimenŽ¡‘R±98Ž‘o‘È\let\hbadness\@tempcntaŽ¡‘R±99Ž‘o‘È\let\hfuzz\@tempdimaŽŸ‘R²Makš¸ãe–®the“table,‘ÄHand“ nish“the“h˜bGo˜x.‘|Since“v1.06,‘ÄHË\toks@“²con˜tains“the“pream˜bleŽŸ ‘RspšGeci cation,–UUand“p˜ossible“optional“argumenš¸ãt,“as“w˜ell“as“the“table“b•Go“dy‘ÿ*ª.ަ‘N±100Ž‘o‘È\expandafter\tabular\the\toks@Ž¡‘N±101Ž‘o‘È\endtabular}%ޤ‘R²Since–UUv1.05“reset“all“LŸýó5‘üff±AŽŽ‘͉²T‘þU>Ÿ'EŽ‘ãxX“counš¸ãters,“b˜y“executing“Ë\TX@ckpt².ަ‘N±102Ž‘fÚÈ\TX@ckptŽ¡‘R²Prin¸ãt–UUsome“statistics.‘qÇAdded“Ë\TX@align“²in“v1.05,“to“line“up“the“columns.ަ‘N±103Ž‘fÚÈ\TX@typeout@{\@spacesޤ ‘N±104Ž‘tJœÈ\expandafter\TX@alignŽ¡‘N±105Ž’‚w^È\the\wd\@tempboxa\space\space\space\space\space\@@Ž¡‘N±106Ž‘tJœÈ\expandafter\TX@alignŽ¡‘N±107Ž’‚w^È\the\TX@col@width\space\space\space\space\space\@@Ž¡‘N±108Ž‘tJœÈ\@spaces\the\TX@cols}}ŽŸ‘À$\TX@alignŽŽŽ‘R²Macro–UUadded“at“v1.05,“to“impro•¸ãv“e–UUthe“prin¸ãting“of“the“tracing“info.ަ‘N±109Ž‘\ª®È\def\TX@align#1.#2#3#4#5#6#7#8#9\@@{%Ž¡‘N±110Ž‘fÚÈ\ifnum#1<10‘¹–\space\fiŽ¡‘N±111Ž‘fÚÈ\ifnum#1<100‘¹–\space\fiŽ¡‘N±112Ž‘fÚÈ\ifnum#1<\@m\space\fiŽ¡‘N±113Ž‘fÚÈ\ifnum#1<\@M\space\fiŽ¡‘N±114Ž‘fÚÈ#1.#2#3#4#5#6#7#8\space\space}ޤ‘f \arraybackslashŽŽŽ‘RË\\‘UU²hac¸ãk.ަ‘N±115Ž‘\ª®È\def\arraybackslash{\let\\\@arraycr}Ž¡‘ü­ \tracingtabularxŽŽŽ‘R²Prin¸ãt–UUstatistics“on“column“and“table“widths.ަ‘N±116Ž‘\ª®È\def\tracingtabularx{%ޤ ‘N±117Ž‘fÚÈ\def\TX@typeout{\PackageWarningNoLine{tabularx}}%Ž¡‘N±118Ž‘fÚÈ\def\TX@typeout@##1{\typeout{(tabularx)‘¹–##1}}}Ž‘RŸff‰ffÿrŸ J=‘ "5Ÿý-:Á4ŽŽŽ‘LÜÀActually–ÕXthe“T‘þ•AŸ¸ãEŽ‘MXBošŸ'EŽ‘ãxX“inš¸ãto“an“irreco˜v˜erable“error“pGosition,‘æwith“errorŽ¡‘Rmessages–éthat“did“not“men¸ãtion“the“cause“of“the“error.‘È„The“`p•Go“or–éman's“Ë\verb²'Ž¡‘R(and–åË\verb*²)“de ned“here“is“based“on“page“382“of“the“T‘þU>Ÿ'EŽ‘ãxXBoGok.‘wxAs“explainedŽ¡‘Rthere,‘îëdoing–Ð3vš¸ãerbatim“this“w˜a˜y“means“that“spaces“are“not“treated“correctly‘ÿ*ª,‘îëandŽ¡‘Rso–6Ë\verb*“²maš¸ãy“w˜ell“bGe“useless,‘Öho˜w˜ev˜er“I‘!consider“this“section“of“cošGde“to“b˜e“error-Ž¡‘Rreco•¸ãv“ery‘ÿ*ª,–UUrather“than“a“real“implemenš¸ãtation“of“v˜erbatim.Ž¡‘aThe––Cmecš¸ãhanism“is“quite“general,‘¦~and“an˜y“macro“whic˜h“w˜an˜ts“to“allo˜w“a“formŽ¡‘Rof–ÈFË\verb“²to“bGe“used“within“its“argumenš¸ãt“ma˜y“Ë\let\verb=\TX@verb².‘BÂ(Making“sureŽ¡‘Rto–UUrestore“the“real“de nition“later!)Ž¡‘aË\verb–UU²and“Ë\verb*“²are“sub‘Ž8ject“to“the“follo¸ãwing“restictions:Ž©‘^8ä1.ŽŽŽ‘kSpaces–‚ÿin“the“argumenš¸ãt“are“not“read“v˜erbatim,‘­but“ma˜y“bšGe“skipp˜ed“accordingŽ¡‘kto–UUT‘þU>Ÿ'EŽ‘ãxX's“usual“rules.ަ‘^8ä2.ŽŽŽ‘kSpaces–Ð`will“bGe“added“to“the“output“after“conš¸ãtrol“w˜ords,‘ê÷ev˜en“if“they“w˜ere“notŽ¡‘kpresen¸ãt–UUin“the“input.ަ‘^8ä3.ŽŽŽ‘kUnless–iŸ'EŽ‘ãxX“wš¸ãould“strip“the“outer“braces“from“suc˜h“a“group.‘øäThe“`Ë!²'Ž¡‘Rwill–UUbGe“remo•¸ãv“ed‘UUlater.Ž¡‘aOriginally›ÊI‘Éõfollo•¸ãw“ed˜Kn“uth,–åñand˜had˜Ë\def\@tempa{##1}²,“ho•¸ãw“ev“er˜this˜did˜notŽ¡‘Ralloš¸ãw–ŠäË#“²to“appGear“in“the“argumen˜t.‘uSo“in“v1.04,‘˜HI‘ŠÖc˜hanged“this“to“to“use“a“tok˜enŽ¡‘Rregister,›¥xand–•qË\edef².‘2This“allo¸ãws“Ë#“²appGear,˜but“makš¸ães“eac˜h“one“appGear“t˜wice!,‘¥xsoŽ¡‘Rlater–UUwš¸ãe“loGop“through,“replacing“Ë##“²b˜y“Ë#².ޤ‘N±134Ž‘\ª®È\def\TX@vb#1{\def\@tempa##1#1{\toks@{##1}\edef\@tempa{\the\toks@}%ŽŸ ‘N±135Ž‘o‘È\expandafter\TX@v\meaning\@tempa\\‘¹–\\\ifnum0=`{\fi}}\@tempa!}ަ‘0¦|\TX@vŽŽŽ‘R²Strip–UUthe“initial“segmen¸ãt“of“the“Ë\meaning²,“including“the“`Ë!²'“added“earlier.Ž¡‘N±136Ž‘\ª®È\def\TX@v#1!{\afterassignment\TX@vfirst\let\@tempa=‘¹–}ަ‘a²As–ZÜexplained“abGo•¸ãv“e›ZÜw“e˜are˜going˜to˜replace˜Ë##˜²pairs˜b“y˜Ë#².‘‚[T‘ÿ*ªo˜do˜this˜w“e˜needޤ ‘Rnon-spGecial–Û1Ë#“²tok•¸ãens.‘IMak“e–Û1Ë*“²inš¸ãto“a“parameter“tok˜en“so“that“w˜e“can“de ne“macrosŽ¡‘Rwith–UUargumenš¸ãts.‘qÇThe“normal“meanings“will“bGe“restored“b˜y“the“Ë\endgroup“²later.ŽŸ‘N±137Ž‘\ª®È\begingroupޤ ‘N±138Ž‘\ª®È\catcode`\*=\catcode`\#Ž¡‘N±139Ž‘\ª®È\catcode`\#=12ަ‘Ž\TX@vfirstŽŽŽ‘R²As–^Îa“spšGecial“case,‘¡,prev•¸ãen“t–^Îthe“ rst“c¸ãharacter“from“b˜eing“dropp˜ed.‘Ž2This“mak¸ãesޤ ‘RË\verb*|‘?ý|–˜ò²proGduce“Ë ².›