÷ƒ’À;è TeX output 1996.03.06:1128‹ÿÿÿÿ ª� ýs o� ýÞ�‘U‡¸óDÓítG®G®cmr17¹An–7tEnhanced“Implemen�Œqtation“of“the“Allo�sŽcationŽŸ�‘WÐBMacros–7tin�“L�Ÿüdú�‘úKGóX«Q cmr12ºAŽŽ‘¹”¹T�‘ý[™Ÿ¸-EŽ‘;gX‘`œ2�Ÿ—Œó·ág£G® cmmi12»"ŽŽ‘@\é¹,“L�Ÿüdú�‘úKGºAŽŽ‘¹”¹T�‘ý[™Ÿ¸-EŽ›;gX“2.09,“and“plain-T�‘ý[™Ÿ¸-EŽ˜XŽŸ�����’Ö/ºBernd‘ê¨Raic�¬rhleŽŽ¤��’ϾVStettener–ê¨Str.“73ŽŽ¡��’»>5D-73732–ê¨Esslingen,“FR�¬rGŽŽ¡��‘{£Email:‘8àó߆µT cmtt12Åraichle@Informatik.Uni-Stuttgart.DEŽŽŽŽŽŸB37�’ȹéº1995/09/24‘ê¨(v1.1b)ŽŸ".ø�’æ!Kót ‰: cmbx9ÇAbstractŽŸ ÛÈ�‘oßüóo´‹Ç cmr9ÆThis–‘ stš¾9yle“option“reimplemen˜ts“the“allo�AÇcation“command“macros“pro˜videdޤ �‘bbš¾9y–ÍEplain-T�‘þuAŸïÿEŽ‘˜ŸX“and“adds“macros“to“allo˜w“allošAÇcation“of“lo˜cal“registers“insideŽ¡�‘bgroups.ŽŸ Á®��‘IóÂÖN ff cmbx12É1Ž‘aLËIn�ŒÌtro�s3ductionŽŸç��‘IóÂÖN  cmbx12Ê1.1Ž‘gÀRestrictions–€of“Åplain.texÊ's“Register“Allo�`cation“MacrosŽŸuT�‘IóKñ`y cmr10²In–Ã}ó ßêŸ'EŽ‘ãxX's“grouping“mec˜h-Ž¡�‘banism–²ßwill“restore“the“register“when“y�¸ãou're“done“with“the“group,‘ÊAandŽ¡�‘bif–gkyš¸ãou“are“certain“that“other“macros“will“not“mak˜e“global“assignmen˜tsŽ¡�‘bto–9Sthat“register“when“y�¸ãou“need“it.‘ W(5)“But“when“a“register“is“usedŽ¡�‘bb•¸ãy›ì¥sev“eral˜macros,‘yor˜o“v“er˜long˜spans˜of˜time,‘yit˜should˜b•Ge˜allo“catedŽ¡�‘bb�¸ãy›ÈVË\newcount²,–åË\newdimen²,“Ë\newbox²,“etc.‘ “!(6)˜Similar˜remarks˜applyŽ¡�‘b[.–ªª.“.“]‘³to–1¤insertions“(whic�¸ãh“require“Ë\box²,–h·Ë\count²,“Ë\dimen²,“and‘1¤Ë\skipŽ¡�‘b²registers–UUall“haš¸ãving“the“same“n˜um˜b�Ger).ŽŽŸ�’ø1ŽŽŒ‹* ª� ýs o� ý´�‘X²This–Hmeans,‘Jºthat“within“plain-T�‘þU>Ÿ'EŽ›ãxX“and“all“formats“based“on“plain-T�‘þU>Ÿ'EŽ˜X“a“userޤ �‘Ican–D`not“allošGcate“a“register“for“temp˜orary“use“using“the“givš¸ãen“mec˜hanisms.‘ËNonethe-Ž¡�‘Iless–Oýthere“is“often“the“need“for“a“allo�Gcated“register“whic�¸ãh“is“only“used“within“a“ratherŽ¡�‘Ismall– Åpiece“of“došGcumen�¸ãt“text“and“should“b˜e“set“free“for“reuse“in“the“rest“of“theŽ¡�‘Iformatting‘UUrun:Ž¡�‘XIf–`Ña“macro“Ë\macroa“²needs“a“register“whicš¸ãh“should“nev˜er“b�Ge“destro˜y˜ed“b˜y“anotherŽ¡�‘Imacro–‹Ë\macrob“²whicš¸ãh“is“called“b˜y“Ë\macroa²,‘FØy˜ou“either“ha˜v˜e“to“kno˜w“ab�Gout“theŽ¡�‘Irealisation–UUof“Ë\macrob“²or“yš¸ãou“ha˜v˜e“to“allo�Gcate“a“new“register.Ž¡�‘XThe–/”name“of“this“newly“allo�Gcated“register“is“only“knoš¸ãwn“to“the“macro“pac˜k‘ÿqÇageŽ¡�‘Iin–ÿÿwhicš¸ãh“macro“Ë\macroa“²resides.‘UUIf“y˜ou“ha˜v˜e“a“lot“of“macros“whic˜h“needs“registersŽ¡�‘Ibš¸ãy–½{their“o˜wn“it“is“p�Gossible“that“all“of“the“256“registers“of“one“t˜ypšGe“will“b˜e“allo˜cated.Ž¡�‘IIn–‘most“cases“it“w�¸ãould“bšGe“p˜ossible“to“share“some“of“these“registers“b�¸ãy“more“thanŽ¡�‘Ione–¼Ámacro“b�Gecause“the“register“is“only“needed“within“(an“en•¸ãvironmen“t‘¼ÁdelimitedŽ¡�‘Ib�¸ãy)–ã(a“group.‘K¸T‘ÿ*ªo“share“registers|if“they“are“used“only“lošGcally|it“will“b˜e“necessaryŽ¡�‘Ito–j©proš¸ãvide“a“mec˜hanism“to“allošGcate“registers“lo˜cally‘ÿ*ª.‘±ÄUnfortunately“Ëplain.texŽ¡�‘I²and–-all“derivš¸ãed“formats,‘5lik˜e“L�Ÿýó5�‘üffóÙ“ Rcmr7±AŽŽ‘͉²T�‘þU>Ÿ'EŽ‘ãxX,‘5misses“this“mec˜hanism“leading“to“the“problemŽ¡�‘Ithat–UUsome“macro“pacš¸ãk‘ÿqÇages“cannot“b�Ge“com˜bined.Ž¡�‘XIn–’the“folloš¸ãwing“example“it“is“necessary“to“call“t˜w˜o“macros“Ë\macroa“²and“ËmacrobŽ¡�‘I²in–ÃÓthe“same“group“(e.g.“bšGecause“Ë\macroa“²p˜erforms“sp˜ecial“actions“at“the“b˜egin“andŽ¡�‘IË\macrob–zDzat“the“end“of“an“en•¸ãvironmen“t).‘âF‘ÿ*ªurther›zÇy“ou˜do˜not˜ha“v“e˜an“y˜kno“wledgeŽ¡�‘Iab�Gout–ÿHthe“use“of“scratcš¸ãh“register“in“Ë\macroa²,‘~Ë\macrob“²or“the“text“in“the“argumen˜tŽ¡�‘IspšGeci ed–¹Åb�¸ãy“the“user.‘ŸTherefore“it“is“imp˜ossible“to“use“a“scratcš¸ãh“register“to“sa˜v˜eŽ¡�‘Ithe–UUcurrenš¸ãt“v‘ÿqÇalue“of“Ë\hsize²;“w˜e“ha˜v˜e“to“allo�Gcate“a“new“register“to“sa˜v˜e“it.Ž©�‘[æXó"ߤN cmtt9Í\newdimen\savedhsizeŽŸ�‘[æX\def\callAandB#1{\begingroupޤ �‘n̰\savedhsize=\hsizeŽ¡�‘n̰\hsize=0.8\hsize‘æX\macroaŽ¡�‘n̰#1\relaxŽ¡�‘n̰\hsize=\savedhsize‘ s,\macrobŽ¡�‘eY„\endgroup}ŽŸ�‘I²If–Qâthere“will“b�Ge“a“mec•¸ãhanism,›‘e.g.‘gob“y–Qâa“macro“Ë\lnewdimen²,˜to“allošGcate“a“lo˜calޤ �‘Iregister– Cit“is“pšGossible“to“use“this“lo˜cal“register“inside“the“group“without“w�¸ãorryingŽ¡�‘Iab•Gout›DÍp“ossible˜dep“endencies˜b“et•¸ãw“een˜the˜macros˜and˜the˜user˜sp�Geci ed˜text.‘lDAd-Ž¡�‘Iditionally–safter“lea�¸ãving“the“group,‘Búthe“dimen“register“will“bšGe“free“to“b˜e“used“b�¸ãyŽ¡�‘Iother‘UUmacros.ަ�‘[æXÍ\def\callAandB#1{\begingroupޤ �‘n̰\lnewdimen\savedhsize‘ s,\savedhsize=\hsizeŽ¡�‘n̰\hsize=0.8\hsize‘æX\macroaŽ¡�‘n̰#1\relaxŽ¡�‘n̰\hsize=\savedhsize‘ s,\macrobŽ¡�‘eY„\endgroup}ŽŸþ6��‘IÊ1.2Ž‘gÀLoš`cal–€Register“Allo˜cation“MacrosŽŸuT�‘I²When–dkusing“this“reimplemen�¸ãtation“of“the“allo�Gcation“macros,‘”›the“Ëplain.tex“²macrosŽ����‘yºÍ\newcountŽŽŽŽ��Ÿ ��‘yº\newdimenŽŽŽŽ��Ÿ��‘3P\newskipŽŽŽŽ��Ÿ$��‘ìæ\newboxŽŽŽŽ��Ÿ0��‘À$\newinsertŽŽŽŽ¤ �‘IË\newcount²,–ÿË\newdimen²,“Ë\newskip²,“and–ªË\newbox“²will“ha•¸ãv“e–ªa“cš¸ãhanged“b�Geha˜viour“inŽ¡�‘It•¸ãw“o‘UUasp�Gects:ŽŽŸ�’ø2ŽŽŒ‹ / ª� ýs o� ý´����‘Xó !",š cmsy10¸ŽŽŽ‘b²Do–]Únot“assume“that“registers“whicš¸ãh“are“allo�Gcated“consecutiv˜ely“ha˜v˜e“con-ޤ �‘bsecutivš¸ãe–‡register“n˜um˜b�Gers.‘In“general“y˜ou“should“not“mak˜e“an˜y“assumptionŽ¡�‘babšGout–UUthe“order“of“register“n•¸ãum“b˜ers.Ž©����‘X¸ŽŽŽ‘b²It–ÌAis“pšGossible“that“a“register“w�¸ãas“lo˜cally“allo˜cated“and“used“in“the“past.‘DAfterŽ¡�‘blea�¸ãving–¬nthe“group“the“register“is“set“to“free“and“the“old“v‘ÿqÇalue|normallyŽ¡�‘bzero|is–·šrestored.‘=4Nonetheless“y�¸ãou“should“not“assume“that“a“newly“allo�GcatedŽ¡�‘bregister–UUis“initialised“with“the“v‘ÿqÇalue“zero.ަ�‘\Û)The–Û)b�Gehaš¸ãviour“of“the“macros“Ë\newmuskip“²and“Ë\newtoks“²are“not“c˜hangedŽ����‘À$Í\newmuskipŽŽŽŽ��¡��‘3P\newtoksŽŽŽŽ¡�‘I²bšGecause–'Vthey“are“not“used“for“insertions.‘çËNonetheless“this“can“b˜e“c�¸ãhanged“in“aŽ¡�‘Ifuture‘UUv�¸ãersion.Ž¡�‘XË\lnewcount²,–qÇË\lnewdimen²,“Ë\lnewskip²,“Ë\lnewmuskip²,“Ë\lnewbox²,“and‘8ãË\lnewtoksŽ����‘À$Í\lnewcountŽŽŽŽ��¡��‘À$\lnewdimenŽŽŽŽ��Ÿ��‘yº\lnewskipŽŽŽŽ��Ÿ$��‘ Ž\lnewmuskipŽŽŽŽ��Ÿ0��‘3P\lnewboxŽŽŽŽ��Ÿ<��‘yº\lnewtoksŽŽŽŽ¡�‘I²are–H†the“set“of“new“macros“to“allošGcate“registers“within“the“scop˜e“of“the“curren�¸ãt“group.Ž¡�‘IAš¸ãt–UUthe“end“of“the“curren˜t“group“the“allo�Gcated“register“is“freed.Ž¡�‘XAs–[with“their“global“counš¸ãterparts“y˜ou“should“not“assume“that“the“registers“areŽ¡�‘Iallo�Gcated–ðøin“a“consecutiv�¸ãe“order|neither“increasing“nor“decreasing|or“that“theŽ¡�‘Iallo�Gcated–UUregister“is“initialised“with“zero.ŽŸþ6��‘IÊ1.3Ž‘gÀUsage‘€ExamplesޤuT��‘Ió#ò"V cmbx10Î1.3.1Ž‘l#‚L�Ÿýñ�‘ûÜ*ó$f$Øcmbx7ÏAŽŽ‘èüÎT�‘þ<Ÿ8ãEŽ‘3sX's–ÕTPicture“En•®9vironmen“tŽ¡�‘I²L�Ÿýó5�‘üff±AŽŽ‘͉²T�‘þU>Ÿ'EŽ‘ãxX's–qØpicture“en•¸ãvironmen“t–qØuses“the“b�Go�¸ãx“register“Ë\@picbox“²and“the“dimen“registerޤ �‘IË\@picht–e²to“sa•¸ãv“e–ethe“con•¸ãten“ts–eof“a“picture“and“the“user“sp�Geci ed“heigh�¸ãt“of“thisŽ¡�‘Ipicture–þ‘at“the“b�Geginning“of“the“en•¸ãvironmen“t.‘m|These›þ‘t“w“o˜registers˜are˜set˜at˜theŽ¡�‘Ib�Geginning–“Îand“used“at“the“end“of“the“Ëpicture“²en•¸ãvironmen“t.‘-2Because–“Îthe“t•¸ãw“oŽ¡�‘Iregisters–v™are“used“noš¸ãwhere“else,‘¾éit“is“p�Gossible“to“share“them“b˜y“only“allo�GcatingŽ¡�‘Ithem–UUwithin“the“en•¸ãvironmen“t.Ž¡�‘XThis–Öis“the“simpli ed“co�Gde“for“the“Ë\begin{picture}“²and“Ë\end{picture}“²com-Ž¡�‘Imands;–UUthe“macros“Ë\begin“²and“Ë\end“²start“and“end“a“new“group:ŽŸ�‘IÍ\newbox\@picboxޤ �‘I\newdimen\@pichtŽ©�‘I\def\picture(#1,#2){%Ž¡�‘Rs,\@picht–¹–=“#2\unitlength‘ s,%“save“picture“heightŽ¡�‘Rs,\setbox\@picbox–¹–=“\hbox“to“#1\unitlength\bgroupŽ¡�‘[æX\ignorespaces}ަ�‘I\def\endpicture{%Ž¡�‘[æX\hssŽ¡�‘Rs,\egroup‘U Œ%–¹–close“picture“boxŽ¡�‘Rs,\ht\@picbox–¹–=“\@picht‘æX%“set“box“height“to“save“picture“heightŽ¡�‘Rs,\dp\@picbox–¹–=“0pt‘%̰%“set“box“depth“to“0ptŽ¡�‘Rs,\mbox{\box\@picbox}}‘Ÿî%–¹–output“this“boxŽŸ�‘X²Using–íðthe“new“lošGcal“allo˜cation“macros“the“co˜de“cš¸ãhanges“is“simple:‘¢ýMo˜v˜e“theޤ �‘IË\newbox–VƲand“Ë\newdimen“²command“within“the“Ë\picture“²macro“de nition“and“re-Ž¡�‘Iname–UUthem“to“Ë\lnewbox“²and“Ë\lnewdimen²:ŽŸ�‘M¹–Í%\newbox\@picboxŽŸ �‘M¹–%\newdimen\@pichtŽŽŸ�’ø²3ŽŽŒ‹s ª� ýs o� ý´�‘IÍ\def\picture(#1,#2){%ޤ �‘Rs,\lnewbox\@picboxŽ¡�‘Rs,\lnewdimen\@pichtŽ¡�‘Rs,\@picht–¹–=“#2\unitlength‘ s,%“save“picture“heightŽ¡�‘Rs,\setbox\@picbox–¹–=“\hbox“to“#1\unitlength\bgroupŽ¡�‘[æX\ignorespaces}ŽŸçÀ�‘X²Additionally– zwš¸ãe“can“use“a“prop�Gert˜y“of“the“usage“pattern“of“these“t˜w˜o“registers:ޤ �‘IWithin–÷—a“nested“use“of“the“Ëpicture“²en•¸ãvironmen“t|y“ou–÷—can“use“subpictures“withinŽ¡�‘Ia–ä�picture|these“registers“are“allo�Gcated“for“eacš¸ãh“nesting“lev˜el.‘wThis“is“not“reallyŽ¡�‘Inecessary–»íbšGecause“the“b˜oš¸ãx“and“the“dimen“register“is“alw˜a˜ys“used“in“a“group“andŽ¡�‘Iis– Únevš¸ãer“c˜hanged“globally‘ÿ*ª.‘YôIt“is“p�Gossible“to“add“tests“to“a˜v˜oid“a“(lošGcal)“reallo˜cationŽ¡�‘Iof–UUthese“registers:ŽŸìš�‘IÍ\let\@picbox=\relax‘æX%–¹–mark“register“as“not“yet“allocatedޤ �‘I\let\@picht–¹–=\relax‘æX%“mark“register“as“not“yet“allocatedŽŸçÀ�‘I\def\picture(#1,#2){%Ž¡�‘Rs,\ifx\@picbox\relax‘¹–\lnewbox\@picbox‘ s,\fiŽ¡�‘Rs,\ifx\@picht\relax‘ s,\lnewdimen\@picht‘¹–\fiŽ¡�‘Rs,\@picht–¹–=“#2\unitlength‘ s,%“save“picture“heightŽ¡�‘Rs,\setbox\@picbox–¹–=“\hbox“to“#1\unitlength\bgroupŽ¡�‘[æX\ignorespaces}Ž©ú ��‘IÎ1.3.2Ž‘l#‚L�Ÿýñ�‘ûÜ*ÏAŽŽ‘èüÎT�‘þ<Ÿ8ãEŽ‘3sX's–ÕTË\multiput“ÎMacroŽŸuT�‘I²Another–í¾example“of“registers“whic�¸ãh“are“used“only“in“one“rarely“used“macro,‘Øareޤ �‘Ithe–µðcounš¸ãt“register“Ë\@multicnt“²and“the“t˜w˜o“dimen“registers“Ë\@xdim“²and“Ë\@ydim“²forŽ¡�‘Ithe–¤’Ë\multiput“²command.‘_}T‘ÿ*ªo“cš¸ãhange“it“according“to“the“sc˜heme“ab�Go˜v˜e“y˜ou“ha˜v˜eŽ¡�‘Ito–UUinsert“an“additional“grouping.Ž¡�‘XIn�‘ŽWL�Ÿýó5�‘üff±AŽŽ‘͉²T�‘þU>Ÿ'EŽ‘ãxX‘ü2�Ÿÿó  b> cmmi10µ"ŽŽ‘*pX²these–ŽWthree“rarely“used“registers“and“some“more“are“shared“with“theŽ¡�‘IË\bezier–Ò·²command,‘òwhose“de nition“has“to“b�Ge“cš¸ãhanged“accordingly‘ÿ*ª.‘éíThis“sho˜wsŽ¡�‘Ithe–UUneed|and“adv‘ÿqÇan�¸ãtage|of“a“bšGetter“allo˜cation“sc�¸ãheme.ަ��‘IÎ1.3.3Ž‘l#‚P�‘þž½Ÿ8ãIŽ‘cC‘þ¼)T�‘þ<Ÿ8ãEŽ‘3sXŽ©uT�‘I²The–Pùmacro“pac�¸ãk‘ÿqÇage“P�‘þÌП'IŽ‘©DC‘þæfT�‘þU>Ÿ'EŽ‘ãxX“uses“a“lot“of“dimen“registers.‘þA‘P·subset“of“these“registersŽ¡�‘Iare–Î6only“used“within“a“picture“or“within“a“set“of“dra�¸ãwing“and“parameter“settingŽ¡�‘Icommands.Ž¡�‘XAs–íôan“example“the“dimen“registers“Ë\totalarclength“²is“only“used“in“a“v�¸ãery“re-Ž¡�‘Istrictic–NOset“of“commands,–‚êi.e.,“it–NOcan“bšGe“allo˜cated“within“the“scop˜e“of“the“higher“lev�¸ãelŽ¡�‘Icommands–UUor“within“P�‘þÌП'IŽ‘©DC‘þæfT�‘þU>Ÿ'EŽ‘ãxX's“Ë\beginpicture“².–ªª.“.‘ÿÿË\endpicture‘UU²en•¸ãvironmen“t.ŽŸ! —��‘IÉ2Ž‘aLËImplemen�ŒÌtationŽŸç��‘IÊ2.1Ž‘gÀProlog,�‘€L�ŸýAl�‘û#×ó%2Ç@Écmbx8ÐAŽŽ�~/ÊT�‘ý¿áŸªªEŽ‘ìSX‘a2�ŸÌÌó'DF‰” cmmib10Ò"ŽŽ‘9»0ÊP• ac“k‘ÿ@age–€Declarations,“etc.ަ�‘I²The–ˆ‡vš¸ãery“ rst“thing“w˜e“do“is“to“ensure“that“this“ le“is“not“read“in“t˜wice.‘ \T‘ÿ*ªo“thisŽ¡�‘Iend–§‡wš¸ãe“c˜hec˜k“whether“the“macro“Ë\lnewcount“²is“de ned.‘7ØIf“so,‘ÊJw˜e“just“stop“readingŽ¡�‘Ithis‘UU le.ŽŸ û&��‘Lüs±1Ž‘Sª®ó.©±�Ê cmsy9Ùh�Æ+ó/ÒoÇw cmss9Úpack�¾9ageŽ‘%øÑÙiÍ\expandafter\ifx\csname‘¹–lnewcount\endcsname\relaxŽŸ ��‘Lüs±2Ž‘Sª®Ùh�Æ+Úpack�¾9ageŽ‘%øÑÙiÍ\else–¹–\expandafter\endinput“\fiŽŽŸ�’ø²4ŽŽŒ‹'‹ ª� ýs o� ý´�‘X²F‘ÿ*ªor–]’the“sakš¸ãe“of�“L�Ÿýó5�‘üff±AŽŽ‘͉²T�‘þU>Ÿ'EŽ‘ãxX‘ü2�Ÿÿµ"ŽŽ‘,βusers“declarations“for“this“pac˜k‘ÿqÇage“are“included.‘Š~Theޤ �‘Iadditional–çpgroup“hacš¸ãk“is“needed“to“prev˜en˜t“the“de nition“of“Ë\ProvidesPackage“²asŽ¡�‘IË\relax–UU²if“it“is“unde ned.Ž©��‘Lüs±3Ž‘Sª®Ùh�Æ+Úpack�¾9age–8Ùj“ÚtestŽ‘:ýhÙiÍ\begingroup\expandafter\expandafter\expandafter\endgroupޤ ��‘Lüs±4Ž‘Sª®Ùh�Æ+Úpack�¾9age–8Ùj“ÚtestŽ‘:ýhÙiÍ\expandafter\ifx\csname‘¹–ProvidesPackage\endcsname\relaxŽ¡��‘Lüs±5Ž‘Sª®Ùh�Æ+Úpack�¾9age–8Ùj“ÚtestŽ‘:ýhÙiÍ\elseŽ¡��‘Lüs±6Ž‘]ÚÍ\NeedsTeXFormat{LaTeX2e}Ž¡��‘Lüs±7Ž‘Sª®Ùh�Æ+Úpack�¾9ageŽ‘%øÑÙi‘ s,Í\ProvidesPackage{localloc}%Ž¡��‘Lüs±8Ž‘Sª®Ùh�Æ+ÚtestŽ‘ˆ%Ùi‘ s,Í\ProvidesFile{localtst.tex}%Ž¡��‘Lüs±9Ž‘Sª®Ùh�Æ!Úpack�¾9ageÆ&!ÚtestŽ‘>¼ÙiŽ¡��‘I±10Ž‘]ÚÍ\ProvidesFile{localloc.dtx}%Ž¡��‘I±11Ž‘Sª®Ùh�ó-5ùž" cmmi9Ø=Æ!Úpack�¾9ageÆ&!ÚtestŽ‘>¼ÙiŽ¡��‘I±12Ž‘f‘Í[1995/09/24–¹–v1.1b“%Ž¡��‘I±13Ž‘kJœÍAdditional–¹–LaTeX“Kernel“Macros“(local“allocation)]Ž¡��‘I±14Ž‘Sª®Ùh�Æ+Úpack�¾9age–8Ùj“ÚtestŽ‘:ýhÙiÍ\fiŽŸ��‘I±15Ž‘Sª®Ùh�Úpack�¾9ageŽ‘#g ÙiŽŸ�‘X²T‘ÿ*ªo–OEalloš¸ãw“the“use“of“this“ le“within“a“plain-T�‘þU>Ÿ'EŽ‘ãxX“job,‘�Àw˜e“ha˜v˜e“to“c˜hange“theŽŸ �‘Icategory–UUco�Gde“of“the“`at'“c�¸ãharacter“Ë@².ަ��‘I±16Ž‘Sª®Í\expandafter\chardef\csname‘¹–lcllc@at\endcsname=\catcode`\@Ž¡��‘I±17Ž‘Sª®Í\catcode`\@=11–¹–%“\makeatletterŽŸþ6��‘IÊ2.2Ž‘gÀAccessing–€the“Åmuskip“ÊregistersŽŸuT�‘I²Beside–o­the“w•¸ãell-kno“wn–o­T�‘þU>Ÿ'EŽ‘ãxX“registers,›vDlik�¸ãe“Ë\count“²or“Ë\box²,˜there“is“another“set“ofޤ �‘Iregisters–|qwhic�¸ãh“are“used“only“in“few“macros.‘çThe“Ë\muskip“²registers“are“normallyŽ¡�‘Iused–ÿin“math“mošGde“only“and“the“co˜ercion“of“the“v‘ÿqÇalue“in“a“Ë\muskip“²register“to“anŽ¡�‘Iin�¸ãteger–UU(Ë\count²),“dimension“(Ë\dimen²),“or“glue“(Ë\glue²)“pro�Gduces“an“error.Ž¡�‘XThe–ÔÒunit“of“a“Ë\muskip“²v‘ÿqÇalue“is“1›ª®m�¸ãu|there“are“18˜m�¸ãu“in“1˜em“of“the“curren�¸ãtŽ¡�‘Ifonš¸ãt–ðÄin“Ìmath–"çfamily“2².‘DIf–ðÄy˜ou“assign“a“v›ÿqÇalue“to“a“Ë\muskip“²register,‘ this“v˜alue“isŽ¡�‘Irepresenš¸ãted–_Õin“the“unit“m˜u,‘¢unot“in“pt.‘‘GThe“dimension“of“the“Ë\muskip“²v‘ÿqÇalue“isŽ¡�‘Icomputed,–UUif“this“v‘ÿqÇalue“is“used“b�¸ãy“Ë\mskip“²or“Ë\mkern².Ž¡�‘XT‘ÿ*ªo–’Žuse“a“Ë\muskip“²register“as“a“replacemen�¸ãt“for“a“Ë\count“²register,‘¹ƒit“is“necessaryŽ¡�‘Ito––do“assignmenš¸ãts,–>&additions,“and––other“op�Gerations“in“units“of“m˜u.‘ ŠIf“y˜ou“w˜an˜tŽ¡�‘Ito–è8co�Gerce“an“inš¸ãteger“to“a“Ë\muskip“²register,‘ ñy˜ou“ha˜v˜e“to“get“the“v‘ÿqÇalue“with“Ë\theŽ¡�‘I²and–Cadd“the“k•¸ãeyw“ord–CËmu“²while“scanning“the“n•¸ãum“b�Ger.‘_T‘ÿ*ªo–Cget“the“in�¸ãteger“v‘ÿqÇalue“of“aŽ¡�‘IË\muskip–UU²register,“yš¸ãou“can“use“the“follo˜wing“macro“Ë\lcllc@cnvmutocnt².ŽŸ����‘îótÍ\lcllc@cnvmutocntŽŽŽ‘I²The–ábmacro“Ë\lcllc@cnvmutocnt“²ist“called“with“a“Ë\muskip“²register“or“a“v‘ÿqÇalue“in“ËmuŽ¡�‘I²units–¶ as“its“argumenš¸ãt.‘“ãIt“will“expand“to“the“in˜teger“v›ÿqÇalue.‘“ãT‘ÿ*ªo“get“the“v˜alue“of“aŽ¡�‘Iregister,‘nwš¸ãe–ë rst“expand“the“v‘ÿqÇalue“of“this“register“to“a“list“of“tok˜ens“with“T�‘þU>Ÿ'EŽ‘ãxX'sŽ¡�‘IË\the–øˆ²primitivš¸ãe.‘[_Example:‘¸,if“the“register“has“the“v‘ÿqÇalue“3µ:²4‘ª®m˜u,‘!Tthe“expansion“ofŽ¡�‘IË\the–UU²pro�Gduces“the“tok�¸ãens�“Ë3Ž�‘•RŸÿ±12Ž�‘8Ë.Ž�‘N5Ÿÿ±12Ž�‘ÇË4Ž�‘$Ÿÿ±12Ž�‘,þËmŽ�‘1¿ûŸÿ±12Ž�‘:8áËuŽ�‘?xÞŸÿ±12Ž‘GñIJ.ަ��‘I±18Ž‘Sª®Í\def\lcllc@cnvmutocnt#1{\expandafter\lcllc@delmukey\the#1}ŽŸ�‘X²After–§wš¸ãe“ha˜v˜e“expanded“the“v‘ÿqÇalue“of“the“register,‘—it“is“necessary“to“strip“of“theŽ¡�‘Iunit›yôk•¸ãeyw“ord˜Ëmu˜²and˜the˜fraction˜of˜the˜v‘ÿqÇalue.‘ߤT‘ÿ*ªo˜do˜this,‘ƒw“e˜ha“v“e˜to˜use˜tok“ensŽ¡�‘Iwith›UUÌc–ÿ}'ate“gory‘“çc“o“de˜²12˜to˜matc•¸ãh˜the˜expansion˜string˜pro�Gduced˜b“y˜Ë\the².ަ��‘I±19Ž‘Sª®Í\begingroup–¹–\catcode`\M=12“\catcode`\U=12“\catcode`\.=12ޤ ��‘I±20Ž‘]ÚÍ\lowercase{\endgroupŽ¡��‘I±21Ž‘Sª®Í\def\lcllc@delmukey#1.#2MU{#1}}ŽŽŸ�’ø²5ŽŽŒ‹4 ª� ýs o� ý´��‘IÊ2.3Ž‘gÀAllo�`cation‘€registersޤuT��‘IÎ2.3.1Ž‘l#‚Registers–ÕTde ned“in“Ëplain.texŽ¡�‘I²Plain-T�‘þU>Ÿ'EŽ‘ãxX's–Ù)allo�Gcation“macros“use“a“ xed“set“of“Ëcount“²registers“con�¸ãtaining“a“set“ofޤ �‘In•¸ãum“bšGers–Ñàwith“the“highest“allo˜cated“register“n•¸ãum“b˜er.‘EöT‘ÿ*ªo›Ñàmak“e˜the˜follo“wing˜macroŽ¡�‘Ico�Gde–UUmore“readable,“alias“names“for“these“Ëcount“²registers“are“de ned.Ž©��‘I±22Ž‘Sª®Í\countdef\count@ptr‘æX=‘¹–10ޤ ��‘I±23Ž‘Sª®Í\countdef\dimen@ptr‘æX=‘¹–11Ž¡��‘I±24Ž‘Sª®Í\countdef\skip@ptr‘Ÿî=‘¹–12Ž¡��‘I±25Ž‘Sª®Í\countdef\muskip@ptr‘,Â=‘¹–13Ž¡��‘I±26Ž‘Sª®Í\countdef\box@ptr‘Y„=‘¹–14Ž¡��‘I±27Ž‘Sª®Í\countdef\toks@ptr‘Ÿî=‘¹–15Ž¡��‘I±28Ž‘Sª®Í\countdef\read@ptr‘Ÿî=‘¹–16Ž¡��‘I±29Ž‘Sª®Í\countdef\write@ptr‘æX=‘¹–17Ž¡��‘I±30Ž‘Sª®Í\countdef\mathfam@ptr‘ s,=‘¹–18ŽŸ�‘IËplain.tex–ñ"²for“T�‘þU>Ÿ'EŽ‘ãxX“3“in�¸ãtrošGduces“a“new“allo˜cation“command“needing“an“additionalޤ �‘IallošGcation–9¶coun�¸ãt“register.‘h’T‘ÿ*ªo“simplify“the“co˜de“of“this“pacš¸ãk‘ÿqÇage“with“older“v˜ersionsŽ¡�‘Iof–UUËplain.tex²,“a“dummš¸ãy“coun˜t“register“is“allo�Gcated“and“used.ަ��‘I±31Ž‘Sª®Í\begingroup\expandafter\expandafter\expandafter\endgroupޤ ��‘I±32Ž‘Sª®Í\expandafter\ifx\csname‘¹–newlanguage\endcsname\relaxŽ¡��‘I±33Ž‘]ÚÍ\csname‘¹–newcount\endcsname\language@ptrŽ¡��‘I±34Ž‘Sª®Í\elseŽ¡��‘I±35Ž‘]ÚÍ\countdef\language@ptr–¹–=“19Ž¡��‘I±36Ž‘Sª®Í\fiŽŸ�‘X²The–Çallo�Gcation“command“for“insertion“uses“another“register,‘ã‰whic�¸ãh“is“alreadyޤ �‘Ialiased–UUas“Ë\insc@unt².ŽŸ�‘IÍ\countdef\insc@unt–¹–=“20“%“=“19“in“older“versions“of“`plain.tex'ŽŸþ6��‘IÎ2.3.2Ž‘l#‚Additional‘ÕTRegistersŽŸuT�‘I²F‘ÿ*ªor–´›the“new“lošGcal“allo˜cation“macros“additional“registers“are“needed“con�¸ãtainingŽ¡�‘Ithe–Y&bšGoundaries“for“all“t�¸ãyp˜es“of“lo˜cally“allo˜cated“registers.‘}:Whereas“all“globallyŽ¡�‘IallošGcated–¨wregisters“are“lo˜cated“in“the“lo•¸ãw“er–¨wregion“of“the“register“n•¸ãum“b˜ers–¨w(with“theŽ¡�‘Iexception–×øof“the“set“of“registers“needed“for“an“insertion),‘ñ lošGcally“allo˜cated“registersŽ¡�‘Iare–ÎÍtakš¸ãen“from“the“higher“region“of“the“register“n˜um˜b�Gers|from“top“to˜w˜ards“theŽ¡�‘Ib�Gottom.Ž¡�‘XT‘ÿ*ªo›kBa•¸ãv“oid˜using˜six˜additional˜coun“t˜registers˜w“e˜use˜Ë\muskip˜²registers˜to˜sa“v“eŽ¡�‘Ithe–çcurrenš¸ãt“lo˜w˜er“bšGoundary“of“the“allo˜catable“register“region.‘'These“b˜oundariesŽ¡�‘Iare–Þ5initialised“either“with“256“or“the“actual“bšGoundary“of“the“insertion“allo˜cationŽ¡�‘Iregister.ަ��‘I±37Ž‘Sª®Í\newmuskip\count@limit– s,\count@limit“=–¹–\the\insc@unt“muޤ ��‘I±38Ž‘Sª®Í\newmuskip\dimen@limit– s,\dimen@limit“=–¹–\the\insc@unt“muŽ¡��‘I±39Ž‘Sª®Í\newmuskip\skip@limit–,Â\skip@limit“=–¹–\the\insc@unt“muŽ¡��‘I±40Ž‘Sª®Í\newmuskip\box@limit–æX\box@limit“=–¹–\the\insc@unt“muŽ¡��‘I±41Ž‘Sª®Í\newmuskip\muskip@limit–¹–\muskip@limit“=“256muŽ¡��‘I±42Ž‘Sª®Í\newmuskip\toks@limit–,Â\toks@limit“=‘¹–256muŽŸ�‘X²T‘ÿ*ªo–Y²simplify“the“cošGde“of“the“follo�¸ãwing“allo˜cation“macros“and“to“sa•¸ãv“e–Y²macro“space,ޤ �‘It•¸ãw“o–»ºadditional“Ë\muskip“²registers“are“allo�Gcated“and“initialised“with“the“constan�¸ãtsŽ¡�‘I16–UUand“256.ŽŽŸ�’ø6ŽŽŒ‹Df ª� ýs o� ý´��‘I±43Ž‘Sª®Í\newmuskip\cclvi@mu–Ÿî\cclvi@mu“=‘¹–256muŽ© ��‘I±44Ž‘Sª®Í\newmuskip\xvi@mu–!\xvi@mu“=‘¹–16muŽŸþ6��‘IÊ2.4Ž‘gÀAllo�`cation–€Macros“for“the“\End“User"ޤuT��‘IÎ2.4.1Ž‘l#‚Global–ÕTAllo�QÇcation“MacrosŽ¡����‘À$Í\newcountŽŽ���Ÿ �‘À$\newdimenŽŽŽŽ���¤ ¡�‘yº\newskipŽŽŽŽ���¤ ¡¡�‘Ž\newmuskipŽŽŽŽ���¤ ¡¡¡�‘3P\newboxŽŽŽŽ���¤ ¡¡¡¡�‘yº\newtoksŽŽŽŽ���¤ ¡¡¡¡¡�‘yº\newreadŽŽŽŽ���¤ ¡¡¡¡¡¡�‘À$\newwriteŽŽŽŽ���¤ ¡¡¡¡¡¡¡�‘3P\newfamŽŽŽŽ���¤ ¡¡¡¡¡¡¡¡�‘“b\newlanguageŽŽŽŽŽ‘I²W‘ÿ*ªe› (ha•¸ãv“e˜to˜replace˜the˜original˜macros˜in˜Ëplain.tex˜²b“y˜new˜ones˜to˜allo“w˜lo�Gcallyޤ �‘IallošGcated–Ó”registers.‘ìƒOtherwise“it“will“b˜e“p˜ossible“that“the“t•¸ãw“o–Ó”regions,‘ó#the“lo•¸ãw“erŽ¡�‘Ione–´Ywith“globally“allošGcated“registers“and“the“higher“one“with“lo˜cally“allo˜catedŽ¡�‘Iregisters,–UUwill“o•¸ãv“erlap–UUresulting“in“a“double“use“of“the“same“register.Ž¡�‘XWith–Šthe“new“macros“it“will“b�Ge“unnecessary“to“un-outer“the“Ëplain.tex“²macros,Ž¡�‘IbšGecause–™the“lo˜cal“allo˜cation“macros“ha•¸ãv“e–™to“b˜e“non“outer.‘VÞNonetheless“wš¸ãe“w˜an˜t“toŽ¡�‘Iuse–o£this“pacš¸ãk‘ÿqÇage“in“conjunction“with“L�Ÿýó5�‘üff±AŽŽ‘͉²T�‘þU>Ÿ'EŽ‘ãxX“and“therefore“w˜e“ha˜v˜e“to“de ne“someŽ¡�‘Iof–UUthem“as“non“outer.Ž¡�‘XThe–�top“levš¸ãel“macros“use“the“lo˜w“lev˜el“macro“Ë\alloc@“²whic˜h“has“the“follo˜wingŽ¡�‘Iparameters:‘“1The–æ bšGoundaries“of“the“lo•¸ãw“er–æ and“the“higher“region,‘ 7the“t�¸ãyp˜e“of“theŽ¡�‘Iallo�Gcated–�§register,‘·þa“ ag“if“wš¸ãe“ha˜v˜e“to“c˜hec˜k“on“o˜v˜erlapping“with“insertion“registers,Ž¡�‘Ithe–qT�‘þU>Ÿ'EŽ‘ãxX“primitivš¸ãe“to“b�Ge“used“to“de ne“this“register,‘Løand“the“user“giv˜en“con˜trolŽ¡�‘Isequence.ŽŸ��‘I±45Ž‘Sª®Í%\outerަ��‘I±46Ž‘Sª®Í\def\newcount– s,{\alloc@\count@ptr“\count@limit›¹–\count“1\countdef˜}ަ��‘I±47Ž‘Sª®Í%\outerަ��‘I±48Ž‘Sª®Í\def\newdimen– s,{\alloc@\dimen@ptr“\dimen@limit›¹–\dimen“1\dimendef˜}ަ��‘I±49Ž‘Sª®Í%\outerަ��‘I±50Ž‘Sª®Í\def\newskip–,Â{\alloc@\skip@ptr“\skip@limit› s,\skip“1\skipdef˜}ަ��‘I±51Ž‘Sª®Í%‘¹–\outerަ��‘I±52Ž‘Sª®Í\def\newmuskip–¹–{\alloc@\muskip@ptr“\muskip@limit\muskip“0\muskipdef}ަ��‘I±53Ž‘Sª®Í%\outerަ��‘I±54Ž‘Sª®Í\def\newbox–æX{\alloc@\box@ptr“\box@limit‘,Â\box“1\chardef‘ s,}ަ��‘I±55Ž‘Sª®Í%‘¹–\outerަ��‘I±56Ž‘Sª®Í\def\newtoks–,Â{\alloc@\toks@ptr“\toks@limit› s,\toks“0\toksdef˜}ަ��‘I±57Ž‘Sª®Í%‘¹–\outerަ��‘I±58Ž‘Sª®Í\def\newread–,Â{\alloc@\read@ptr“\xvi@mu‘Y„\read“0\chardef‘ s,}ަ��‘I±59Ž‘Sª®Í%\outerަ��‘I±60Ž‘Sª®Í\def\newwrite– s,{\alloc@\write@ptr“\xvi@mu‘Y„\write“0\chardef“}ަ��‘I±61Ž‘Sª®Í%\outerަ��‘I±62Ž‘Sª®Í\def\newfam–æX{\alloc@\mathfam@ptr\xvi@mu‘Y„\fam“0\chardef‘ s,}ަ��‘I±63Ž‘Sª®Í%‘¹–\outerަ��‘I±64Ž‘Sª®Í\def\newlanguage{\alloc@\lang@ptr– s,\cclvi@mu‘,Â\language0\chardef“}ŽŸ�‘XË\newinsert–lq²needs“additional“cošGde“b˜ecause“this“macro“has“to“allo˜cate“a“set“ofŽ¡�‘IË\box²,–Ê›Ë\count²,“Ë\dimen²,“and–³'Ë\skip“²registers“with“the“restriction“that“all“registersŽ¡�‘Iha•¸ãv“e–UUto“ha•¸ãv“e–UUthe“same“n•¸ãum“b�Ger.‘qÇË\newinsert–UU²is“rede ned“at“the“end“of“this“ le.ŽŸþ6��‘IÎ2.4.2Ž‘l#‚Lo•QÇcal›ÕTAllo“cation˜MacrosŽŸuT����‘ŽÍ\lnewcountŽŽ���¡�‘Ž\lnewdimenŽŽŽŽ���¡¡�‘À$\lnewskipŽŽŽŽ���¡¡¡�‘ Lø\lnewmuskipŽŽŽŽ���¡¡¡¡�‘yº\lnewboxŽŽŽŽ���¡¡¡¡¡�‘À$\lnewtoksŽŽŽŽŽ‘I²There–_Àis“an“equiv‘ÿqÇalen�¸ãt“set“of“macros“to“allošGcate“registers“lo˜cally‘ÿ*ª.‘‘ Instead“of“usingŽ¡�‘Ithe–Zíloš¸ãw“lev˜el“macro“Ë\alloc@“²it“uses“the“macro“Ë\lalloc@“²with“the“same“set“ofŽ¡�‘Iparameters.ŽŸ��‘I±65Ž‘Sª®Í\def\lnewcount–¹–{\lalloc@\count@ptr“\count@limit“\count‘ s,1\countdef“}ަ��‘I±66Ž‘Sª®Í\def\lnewdimen–¹–{\lalloc@\dimen@ptr“\dimen@limit“\dimen‘ s,1\dimendef“}ŽŽŸ�’ø²7ŽŽŒ‹QU ª� ýs o� ý´��‘I±67Ž‘Sª®Í\def\lnewskip– s,{\lalloc@\skip@ptr“\skip@limit“\skip‘,Â1\skipdef“}ޤ ��‘I±68Ž‘Sª®Í\def\lnewmuskip{\lalloc@\muskip@ptr\muskip@limit\muskip‘¹–0\muskipdef}Ž¡��‘I±69Ž‘Sª®Í\def\lnewbox–,Â{\lalloc@\box@ptr“\box@limit“\box‘æX1\chardef‘ s,}Ž¡��‘I±70Ž‘Sª®Í\def\lnewtoks– s,{\lalloc@\toks@ptr“\toks@limit“\toks‘,Â0\toksdef“}ŽŸò�‘X²Lo•Gcal›ôYallo“cation˜macros˜for˜Ë\read²,–\Ë\write˜²streams,“math˜Ë\fam²,“Ëlanguageޤ �‘I²n•¸ãum“bšGers,‘µSor–�Rinsertions“are“p˜ossible“but“not“v�¸ãery“useful“b˜ecause“of“the“global“natureŽ¡�‘Iof–UUthese“resources.ŽŸú6��‘IÊ2.5Ž‘gÀLo• w›€Lev“el˜Allo�`cation˜MacrosŽŸuT�‘I²The–UUallo�Gcation“scš¸ãheme“used“b˜y“the“macros“in“Ëplain.tex“²is“simple:ŽŸíi����‘X¸ŽŽŽ‘b²all–UUallo�Gcations“are“global,Ž©ö´����‘X¸ŽŽŽ‘b²register,–&kmath›°family‘ÿ*ª,“language,“input/output˜stream˜n•¸ãum“b•Gers˜are˜allo“catedŽ¡�‘busing–£‹the“lo•¸ãw“est–£‹pšGossible“n•¸ãum“b˜er,–Çi.e.,“it–£‹is“done“from“lo•¸ãw“er‘£‹n“um“b˜er–£‹to“higherŽ¡�‘bn•¸ãum“b�Gers,ަ����‘X¸ŽŽŽ‘b²the–šCset“of“insertion“registers“(Ëbox²,–«Ëcount²,“Ëskip²,“and›šCËdimen²),“whic•¸ãh˜ha“v“e˜toŽ¡�‘bha•¸ãv“e–Nthe“same“register“n•¸ãum“b•Ger,‘2�are›Nallo“cated˜b“eginning˜from˜255˜to˜lo•¸ãw“erŽ¡�‘bn•¸ãum“b�Gers.ŽŸíi�‘XConš¸ãtrary–ï-to“this“simple“sc˜heme“this“pac˜k‘ÿqÇage“uses“n˜um˜bšGers“for“lo˜cally“allo˜catedŽ¡�‘Iregisters–7from“top“to“bšGottom“in�¸ãterfering“with“the“original“insertion“register“allo˜ca-Ž¡�‘Ition–UUscš¸ãheme“Ìand‘]Þ²the“simple“test“for“a“register“n˜um˜b�Ger“o˜v˜er o˜w.Ž©ò����‘ý 6Í\lcllc@insnumsŽŽŽ‘I²Insertion–vïregisters“are“noš¸ãw“allo�Gcated“in“a“non-monotonous“order“using“the“lo˜w˜estŽ¡�‘IpšGossible‘.6n•¸ãum“b˜er–.6(b˜ecause“the“allo˜cation“of“the“needed“set“of“registers“is“done“in“aŽ¡�‘Iglobal›‚w•¸ãa“y).‘÷ÕT‘ÿ*ªo˜allo“w˜the˜c“hec“king˜of˜o“v“erlapping˜of˜globally˜or˜lo•Gcally˜allo“catedŽ¡�‘Iregisters–€ðwith“the“registers“used“for“insertions,‘‹Öthe“insertion“register“n•¸ãum“b�Gers‘€ðareŽ¡�‘Isa•¸ãv“ed–þóas“a“list“in“Ë\lcllc@insnums².‘TüEacš¸ãh“en˜try“in“this“list“is“sa˜v˜ed“as�“Ë\do¸hµn¸iË.Ž‘%ÆŸ²;‘¾theŽ¡�‘Ilist–UUis“initialised“as“empt�¸ãy‘ÿ*ª.ŽŸ ûZ��‘I±71Ž‘Sª®Í\def\lcllc@insnums{}ަ����‘øf \lcllc@checkinsŽŽŽ‘I²Whenev�¸ãer–ƒŸa“new“Ëbox²,–Ï2Ëcount²,“Ëskip²,“or–ƒŸËdimen“²register“is“allošGcated“it“has“to“b˜eŽ¡�‘Ic•¸ãhec“k“ed–‹ rst,‘if“the“next“pšGossible“free“register“is“already“allo˜cated“for“an“insertion.Ž¡�‘XT‘ÿ*ªo–8ádetect“a“collision“bšGet•¸ãw“een–8áa“p˜ossibly“free“register“n•¸ãum“b˜er–8áand“the“set“ofŽ¡�‘Iinsertion–ÑGregisters,‘ë°the“macro“Ë\lcllc@checkins“²is“called“with“the“register“n•¸ãum“b�GerŽ¡�‘Ito–tFbšGe“tested“in“Ë\allocationnumber².‘&ÂThe“argumen�¸ãt“of“this“macro“has“to“b˜e“either“1Ž¡�‘Ior– o¸²1“and“is“used“to“get“the“next“register“n•¸ãum“bšGer– oto“b˜e“tested“against“the“insertionŽ¡�‘In•¸ãum“bšGer–list“if“an“additional“iteration“is“needed.‘[`The“result“is“a“register“n•¸ãum“b˜er‘inŽ¡�‘IË\allocationnumber– i²whic�¸ãh“is“not“used“for“an“insertion.‘Xx(Note:‘KÑNonetheless“it“canŽ¡�‘IbšGe–UUan“out-of-region“register“n•¸ãum“b˜er–UUof“an“already“used“register!)ŽŸ ûZ��‘I±72Ž‘Sª®Í\def\lcllc@checkins#1{%ŽŸ ��‘I±73Ž‘]ÚÍ\begingroupŽŸûZ�‘I²After–íop�Gening“a“new“group,‘ôthe“macro“Ë\do“²is“de ned“to“read“the“next“insertionŽ¡�‘In•¸ãum“b�Ger–‘delimited“bš¸ãy“a“simple“dot.‘$òIt“then“tests“this“n˜um˜b�Ger“against“the“curren˜tŽ¡�‘IË\allocationnumber–þQ²and“if“the“register“n•¸ãum“b�Gers–þQare“equal,‘(�Ë\allocationnumberŽ¡�‘I²is–UUadv‘ÿqÇanced“bš¸ãy“the“giv˜en“argumen˜t“(whic˜h“is“1“or“¸²1).Ž¡�‘XT‘ÿ*ªo›è a•¸ãv“oid˜a˜global˜c“hange˜of˜Ë\allocationnumber²,‘ýæa˜group˜hac“k˜with˜expansionŽ¡�‘Iis–óˆused:‘®,If“the“list“Ë\lcllc@insnums“²is“expanded“with“this“de nition“of“Ë\do²,‘theŽŽŸ�’ø8ŽŽŒ‹ `D ª� ýs o� ý´�‘I²result–çŒis“emptš¸ãy“if“the“register“n˜um˜b�Ger“is“not“used“for“an“insertion.‘(kOtherwise“itޤ �‘Iexpands–R0to“the“Ë\advance“²command“follo•¸ãw“ed›R0b“y˜an˜additional˜Ëlcllc@checkinsŽ¡�‘I²(whicš¸ãh–§³has“to“b�Ge“protected“b˜y“Ë\noexpand²)“to“start“another“iteration“with“theŽ¡�‘Ic�¸ãhanged‘UUË\allocationnumber².Ž©��‘I±74Ž‘f‘Í\def\do##1.{%ޤ ��‘I±75Ž‘p2Í\ifnum##1=\allocationnumberŽ¡��‘I±76Ž‘yw^Í\advance\allocationnumber#1\relaxŽ¡��‘I±77Ž‘yw^Í\noexpand\lcllc@checkins{#1}%Ž¡��‘I±78Ž‘p2Í\fi}%ŽŸ�‘I²The–±,folloš¸ãwing“expanded“de nition“text“of“Ë\x“²con˜tains“co�Gde“to“close“the“groupޤ �‘Iand–í¬the“expansion“of“Ë\lcllc@insnums²,‘SÁwhicš¸ãh“is“either“empt˜y“or“con˜tains“theŽ¡�‘Icš¸ãhange–ðƒof“Ë\allocationnumber“²and“an“iterativ˜e“call“of“Ë\lcllc@checkins².‘CPAfterŽ¡�‘Ithe–UUde nition“is“completed,“the“co�Gde“is“executed“whic�¸ãh“closes“the“group.ަ��‘I±79Ž‘f‘Í\edef\x{\endgroup‘¹–\lcllc@insnums}%ŽŸ ��‘I±80Ž‘]ÚÍ\x}ŽŸ����‘3P\alloc@ŽŽŽ‘IË\alloc@–Ú²is“the“loš¸ãw“lev˜el“macro“for“global“allo�Gcation,‘Œwhic˜h“is“called“with“six“argu-Ž¡�‘Imenš¸ãts.‘ËYThe–Ȇmacro“itself“only“uses“the“ rst“four“argumen˜t:‘X(The“t˜w˜o“b�Goundaries,Ž¡�‘Ithe– ñitem“t�¸ãypšGe“to“b˜e“allo˜cated,‘kand“a“ ag“if“this“item“is“propably“used“for“an“inser-Ž¡�‘Ition.‘äThe–†´remaining“t•¸ãw“o›†´argumen“ts,‘“ the˜T�‘þU>Ÿ'EŽ‘ãxX˜primitiv“e˜and˜the˜con“trol˜sequenceŽ¡�‘Ito–UUassign“the“allošGcated“n•¸ãum“b˜er–UUis“used“b�¸ãy“Ë\lcllc@def².ަ��‘I±81Ž‘Sª®Í\def\alloc@#1#2#3#4{%ŽŸ�‘I²In–ˆothe“ rst“step“wš¸ãe“assign“the“b�Goundary“of“the“lo˜w˜er“region“for“this“item“t˜yp�Ge“toŽ¡�‘IË\allocationnumber–UU²and“incremenš¸ãt“it“b˜y“one.ަ��‘I±82Ž‘]ÚÍ\allocationnumber#1%ŽŸ ��‘I±83Ž‘]ÚÍ\advance\allocationnumber\@neŽŸ�‘I²If–Éothis“item“tš¸ãyp�Ge“is“used“b˜y“insertion,‘&uw˜e“ha˜v˜e“to“c˜hec˜k“for“collision“with“theŽ¡�‘IË\lcllc@checkins– š²macro.‘Y‰After“the“execution“of“this“macro,‘&Ë\allocationnumberŽ¡�‘I²conš¸ãtains–j.the“next“free“n˜um˜bšGer“to“b˜e“used“for“allo˜cation.‘°SThis“n•¸ãum“b˜er–j.is“assignedŽ¡�‘Iglobally–UUto“the“register“con�¸ãtaining“the“b�Goundary‘ÿ*ª.ަ��‘I±84Ž‘]ÚÍ\ifnum#4=\@ne–¹–\lcllc@checkins\@ne“\fiŽŸ ��‘I±85Ž‘]ÚÍ\global#1\allocationnumberŽŸ�‘I²W‘ÿ*ªe–í‰noš¸ãw“ha˜v˜e“found“an“un˜used“register.‘O.Nonetheless“it“is“p�Gossible“that“the“registerŽ¡�‘In•¸ãum“bšGer–ú¨is“either“not“in“the“range“of“existing“register“n•¸ãum“b˜er–ú¨or“it“is“used“for“aŽ¡�‘Ilo•Gcally›UUallo“cated˜register.‘qÇË\ch@ck˜²is˜used˜to˜test˜these˜things.ަ��‘I±86Ž‘]ÚÍ\ch@ck#1#2#3%ŽŸ�‘I²A�¸ãt–Áthe“end“the�“¸hÌc–ÿ}'ontr“olŽ�‘'�Fse–ÿ}'quenc“e‘À[¸iŽ‘Tj²is“de ned“using“the“found“Ë\allocationnumber².ަ��‘I±87Ž‘]ÚÍ\lcllc@def\global{}#3}ŽŸ����‘yº\lalloc@ŽŽŽ‘IË\lalloc@–Z‹²is“the“loš¸ãw“lev˜el“macro“for“lošGcal“allo˜cation.‘�iThe“de nition“of“this“macroŽ¡�‘Ia–UUcopš¸ãy“of“Ë\alloc@“²with“some“small“c˜hanges.ަ��‘I±88Ž‘Sª®Í\def\lalloc@#1#2#3#4{%ŽŸ�‘I²In–E¤the“ rst“step“wš¸ãe“assign“the“b�Goundary“of“the“Ìhigher‘Y1²region“and“Ìde–ÿ}'cr“ement‘8|²it‘E¤b˜yŽ¡�‘Ione.‘Ø,Because–wwthe“higher“b�Goundary“is“sa•¸ãv“ed–wwin“a“Ë\muskip“²register,‘ÿwš¸ãe“ha˜v˜e“to“useŽ¡�‘IË\lcllc@cnvmutocnt–UU²to“get“the“b�Goundary“v‘ÿqÇalue.ަ��‘I±89Ž‘]ÚÍ\allocationnumber\lcllc@cnvmutocnt#2%ŽŸ ��‘I±90Ž‘]ÚÍ\advance\allocationnumber\m@neŽŽŸ�’ø²9ŽŽŒ‹ o« ª� ýs o� ý´�‘I²The›ß·c•¸ãhec“k˜for˜insertion˜n“um“b�Ger˜collisions˜is˜called˜with˜¸²1˜to˜decremen“t˜the˜regis-ޤ �‘Iter›*n•¸ãum“b�Ger˜to˜get˜the˜next˜free˜register˜n“um“b�Ger.‘XThe˜Ë\allocationnumber˜²is˜thenŽ¡�‘Iassigned›UUÌlo–ÿ}'c“al‘‚Øly‘7Ò²to˜the˜Ë\muskip˜²register˜con�¸ãtaining˜the˜b�Goundary‘ÿ*ª.Ž©��‘I±91Ž‘]ÚÍ\ifnum#4=\@ne–¹–\lcllc@checkins\m@ne“\fiŽŸ ��‘I±92Ž‘]ÚÍ#2\the\allocationnumber–¹–mu“%ŽŸ�‘I²The›¥»c•¸ãhec“k˜for˜an˜already˜used˜globally˜allo�Gcated˜register˜or˜a˜range˜under o“w˜isŽ¡�‘Ineeded,‘UUto�Go.ަ��‘I±93Ž‘]ÚÍ\ch@ck#1#2#3%ŽŸ�‘I²A�¸ãt–Áthe“end“the�“¸hÌc–ÿ}'ontr“olŽ�‘'�Fse–ÿ}'quenc“e‘À[¸iŽ‘Tj²is“de ned“using“the“found“Ë\allocationnumber².ަ��‘I±94Ž‘]ÚÍ\lcllc@def\relax{(local)}#3}ŽŸ����‘"ìæ\ch@ckŽŽŽ‘I²The–¸âtest“macro“Ë\ch@ck“²for“a“collision“of“the“globally“and“lošGcally“allo˜cated“registersŽ¡�‘Ifrom–�Ëplain.tex“²has“to“bšGe“c�¸ãhanged“b˜ecause“the“higher“b˜oundary“is“giv�¸ãen“as“aŽ¡�‘IË\muskip–UU²v‘ÿqÇalue“instead“of“a“normal“in�¸ãteger.ަ��‘I±95Ž‘Sª®Í\def\ch@ck#1#2#3{%ޤ ��‘I±96Ž‘]ÚÍ\ifnum#1<\lcllc@cnvmutocnt#2\relax‘¹–\elseŽ¡��‘I±97Ž‘f‘Í\errmessage{No–¹–room“for“a“new“#3}%Ž¡��‘I±98Ž‘f‘Í%‘¹–\allocationnumber\m@neŽ¡��‘I±99Ž‘]ÚÍ\fi}ŽŸ����‘Ž\lcllc@defŽŽŽ‘IË\lcllc@def–¶\²is“used“to“assign“the“found“Ë\allocationnumber“²to“the�“¸hÌc–ÿ}'ontr“olŽŽ¤ ��‘Ise–ÿ}'quenc“e‘À[¸iŽ‘v»°²using– ¡the“T�‘þU>Ÿ'EŽ‘ãxX“primitivš¸ãe.‘Ž«Additionally“an“en˜try“is“written“to“the“ËlogŽ¡�‘I² le.ަ��‘E�±100Ž‘Sª®Í\def\lcllc@def#1#2#3#4#5{%ޤ ��‘E�±101Ž‘]ÚÍ#1#4#5=\allocationnumberŽ¡��‘E�±102Ž‘]ÚÍ\wlog{\string#5#2=\string#3\the\allocationnumber}}ŽŸþ6��‘IÎ2.5.1Ž‘l#‚Lo•®9w›ÕTLev“el˜Insertion˜Allo�QÇcation˜MacrosŽŸuT�‘I²Insertions–ìpneed“a“set“of“registers“with“the“same“register“n•¸ãum“b�Ger.‘7T‘ÿ*ªo–ìp nd“a“newޤ �‘Iregister›a n•¸ãum“b•Ger˜when˜allo“cating˜an˜insertion,‘dw•¸ãe˜ha“v“e˜to˜get˜the˜maxim“um˜of˜allŽ¡�‘Ib�Goundaries–UUused“for“an“insertion.ŽŸ����‘ÙÌÍ\lcllc@getmaxŽŽŽ‘IË\lcllc@getmax–ã–²is“used“to“assign“Ë\allocationnumber“²to“the“maxim�¸ãum“ofŽ¡�‘IË\allocationnumber–UU²and“its“argumen�¸ãt.ަ��‘E�±103Ž‘Sª®Í\def\lcllc@getmax#1{%ޤ ��‘E�±104Ž‘]ÚÍ\ifnum#1<\allocationnumber‘¹–\elseŽ¡��‘E�±105Ž‘f‘Í\allocationnumber#1\advance\allocationnumber\@neŽ¡��‘E�±106Ž‘]ÚÍ\fi}ŽŸ����‘Ž\newinsertŽŽŽ‘IË\newinsert–UU²globally“allo�Gcates“a“set“of“registers“used“for“an“insertion.ަ��‘E�±107Ž‘Sª®Í\outer\def\newinsert{%ޤ�‘I²First–R•wš¸ãe“ha˜v˜e“to“ nd“the“maxim˜um“of“all“globally“allo�Gcated“register“n˜um˜b�Ger“usedŽŸ �‘Ifor–UUan“insertion.‘qÇW‘ÿ*ªe“start“b�¸ãy“setting“Ë\allocationnumber“²to“¸²1‘ª®.–ªª.“.ަ��‘E�±108Ž‘]ÚÍ\allocationnumber\m@neŽ¡�‘I².–ªª.“.‘UXand–8get“the“maxmim�¸ãum“of“the“b�Goundaries“for“Ëcount²,–KpËdimen²,“Ëskip²,“and‘8ËboxŽŸ �‘I²registers.ަ��‘E�±109Ž‘]ÚÍ\lcllc@getmax\count@ptr‘¹–\lcllc@getmax\dimen@ptrŽŸ ��‘E�±110Ž‘]ÚÍ\lcllc@getmax\skip@ptr‘ s,\lcllc@getmax\box@ptrŽŽŸ�’õÿ²10ŽŽŒ‹ }P ª� ýs o� ý´�‘I²Then–|twš¸ãe“ha˜v˜e“to“c˜hec˜k“if“this“Ë\allocationnumber“²is“already“used“for“anotherޤ �‘Iinsertion.Ž©��‘E�±111Ž‘]ÚÍ\lcllc@checkins\@neŽŸ�‘I²Aš¸ãt–Tdlast“w˜e“ha˜v˜e“to“c˜hec˜k“if“this“Ë\allocationnumber“²is“used“for“one“of“the“lo�GcallyŽ¡�‘Iallo�Gcated‘UUregisters.ަ��‘E�±112Ž‘]ÚÍ\ch@ck\allocationnumber\count@limit\countޤ ��‘E�±113Ž‘]ÚÍ\ch@ck\allocationnumber\dimen@limit\dimenŽ¡��‘E�±114Ž‘]ÚÍ\ch@ck\allocationnumber\skip@limit\skipŽ¡��‘E�±115Ž‘]ÚÍ\ch@ck\allocationnumber\box@limit\boxŽŸ�‘I²The–þäfound“register“n•¸ãum“b�Ger–þäfor“insertions“is“then“(globally)“inserted“in�¸ãto“the“list“ofŽŸ �‘Iinsertion‘UUn•¸ãum“b�Gers.ަ��‘E�±116Ž‘]ÚÍ\begingroupŽ¡��‘E�±117Ž‘f‘Í\let\do\relaxŽ¡��‘E�±118Ž‘f‘Í\xdef\lcllc@insnums{\do\the\allocationnumber.\lcllc@insnums}%Ž¡��‘E�±119Ž‘]ÚÍ\endgroupŽŸ�‘I²A�¸ãt–Áthe“end“the�“¸hÌc–ÿ}'ontr“olŽ�‘'�Fse–ÿ}'quenc“e‘À[¸iŽ‘Tj²is“de ned“using“the“found“Ë\allocationnumber².ަ��‘E�±120Ž‘]ÚÍ\lcllc@def\global{}\insert\chardef}ŽŸ�‘X²The–�Îregister“Ë\insc@unt“²whicš¸ãh“is“used“to“con˜tain“the“b�Goundary“n˜um˜b�Ger“forޤ �‘Iinsertion–UUregisters“in“the“original“Ëplain.tex“²macro“is“not“used“an�¸ãymore.Ž¡�‘XFinally‘ÿ*ª,–UUthe“category“co�Gde“of“the“`at'“c�¸ãharacter“Ë@“²is“reset“to“its“original“v‘ÿqÇalue.ަ��‘E�±121Ž‘Sª®Í\catcode`\@=\lcllc@atŽŸ��‘E�±122Ž‘Sª®Ùh�Ø=Úpack�¾9ageŽ‘#g ÙiŽŸ!Ä�‘IÉReferencesŽŸç���‘I²[1]ŽŽ‘XŽ;Donald–R:E.“Kn�¸ãuth,›RÙÌThe‘‘ T�‘þKß'EŽ‘Í-Xb–ÿ}'o“ok²,˜Addison-W‘ÿ*ªesley‘R:Publ.,˜Reading,˜Mass.,˜JuniŽ¡�‘XŽ;1991.ŽŸ���‘I[2]ŽŽ‘XŽ;File–UUËplain.tex²,“vš¸ãersion“3.14159,“Marc˜h“1995.ŽŽŸ�’õÿ11ŽŽŒø‰cƒ’À;説 ó/ÒoÇw cmss9ó.©±�Ê cmsy9ó-5ùž" cmmi9ó'DF‰” cmmib10ó%2Ç@Écmbx8ó$f$Øcmbx7ó#ò"V cmbx10ó"ߤN cmtt9ó!ý': cmti10ó ßê cmmi10óKñ`y cmr10óÙ“ Rcmr7ù� ßßßßßß