; TeX output 1996.03.07:1114$U B$': cmti10Midnight?Macr}'os:Eborder.tex 4D"V cmbx10173ڍC4pi( cmssdc10b7order.texEK`y cmr10MacrosU>totypGesetborders. EV*ersion:1.0U>(21OctobGer1991)(doc:23Oct1991)ECopyright[cU> !", cmsy10 }1991U>MarcelR.vqanderGoGot|;"91*= manfntds2 ਍                                            mm la  G ?P G   G  G  G ?F G 2cs2 ਍                                            mm lb TheׯmacrosdescribGedinthismanualsectionareusedtotypGesetborders,suchastheborderaroundthis paragraph.[TheseBbGordersarebuiltfromdi erent\characters":Ointhisexamplefromquartercirclesfor the{cornersandstraightlinesegmentsfortheedges,,but,given{anappropriatefont,,otherbGorderscan also"bGetypeset.`(Below"weexplainhowabGorderfontmustbGedesignedinordertobeusefulwiththese macros.)qBeforeUUanyofthemacrosdescribGedbelowcanbeused,youmust'ExX.Thewidthofthelinesiswidth|2hsp}'ace.ThetextisthanputinthebGorderwithvsp}'acespaceqatthetopandatthebGottom,wandhsp}'ace"{spaceattheleftandattherighthandsides.F*orinstance,theUU rstparagraphofthismanualsectionwassetwith6h$\setborder[\hsize,1em,\smallskipamount]\border${\noindent?Themacrosdescribed...)?....$}TheUUwidth andUUhsp}'ace"D6mustUUbGedimensions;vsp}'ace!]canbeadimensionoraglueamount(without\vskip).z$o cmr9With:ߤN cmtt9\setborder,rthetextbAet9ween:braces,{...},isreadinthesamew9ay:aswheny9ouwrite\vboxl7{...}. $(Y:oucanuse\bgroupand\egroupinsteadofthebraces.)uThetextis%j cmti9notanargumen9tof\setborder,whic9hisimpAortantifitcontainscatcoAdechanges.ϼY:oucanchangetheparagraphshapAe,5^orhavemorethanoneparagraphToftext.:<⍍\dbO h੍                          P POa \ x$+ \       򍍟  2cs2 C                          P PObqx F:or4instance,:thetextinthisparagraphissetwithsomeextra\leftskipand\rightskipglue, whic9htakes|careJofcen9teringeveryline.Thiswasdoneasfollows:ffG VӍ\setborder[10cm,?1cm,4mm]\border{ Ӎ\parindent=0pt?\parfillskip=0pt\leftskip=0pt?plus1cmminus5mm\rightskip=0ptplus1cmminus5mm$XelMidnightMacr}'os:border.tex 4D193ڍ&For?instance,thetextinthisparagraph... r...}fffG$IfZ\setborderdoAesnotsuity9ourpurpose,y9oucanwriteyourownequiv|ralent.zGenerally:,toputtextin $aCbAorder,=y9ou rstgenerateabo9xcontainingthebAorderoftheappropriatesize.>ThenyoumakeabAoxcon9tainingf*thisbAorderbo9xplusthetextsuperimposedonit.Superimposingisdoneb9yeither\backspacing"usingnegativ9e4kerns, cmmi10;:::;7;ھitshouldreturntheappropriateborderelement,UUwheretheelementsarenumbGeredasfollows:;<8䍒`0੍8䍑1 8䍑18䍑18䍑18䍑18䍑18䍑18䍑18䍑18䍑2ट 8䍑38䍑{48䍑38䍑{4 8䍑5 8䍑6 8䍑68䍑68䍑68䍑68䍑68䍑68䍑68䍑68䍑7\borderelmqիiscalledwithinanhbGox;itqshouldtypesetacharacter,xabox,xoranvrule.G(Sincethemacroisexpanded5withinanhbGox,<you5shouldbecarefulnottoputextraspacesinit;@RdoingthatmaycausestrangegapsUUinthebGorder.) r$Aconvenientwayofwriting\borderelmiswithan\ifcaseconstruction.6F*orinstance,6assumethatin>rfont\qcthecharactersa,Cb,c,etc.j&correspGond>rto`ds2',C` ',`a',etc.j&Then>ryoucouldwrite\borderelmasfollows:KffG Cr\def\borderelm#1%{{\qc?\ifcase#1>a\or?b\orc\ord\ore\orf\org\orh%noextraspace/?\fi}}fffG<In(fact,\amacrolikethisisalreadyde nedinbGorder.tex.L?Itiscalled\roundcorners,sothatyoucansay\let\borderelm=\roundcornersEǫtogetthebGorderswithroundedcorners.lThecornerelementscomefromfontL\manfnt,NwhichcorrespGondstotheexternalfont`manfnt.'n(ThecornerelementsaredescribGedonpage389UUofTheTU>'ExXbGook.)q\roundcornersUUscales,whichmeansthatyoucansay*,forinstance,JW$\font\manfnt=manfnt?scaled2074to/getlargercorners|providedyouhavetheappropriatelyscaledfont le(2074correspGondsto\magstep4). Ifyoudonotwanttoloadthemanfntfont(e.g.,>bGecauseyourinstallationdoGesnothaveit),>youshouldde neUU\let\manfnt=\relaxbGeforeyou\inputborder.tex.$HopGefullyavqarietyofborderfontswillcomeavqailableinthefuture.^ButevenwithjustthequartercirclesFyoucanalreadyvqaryyourbGordersquiteabit.lW*ealreadysawabGorderwithhalfcirclesbefore,I|itisanUUeasyexercisetode neacompletebGorderthatway*.qTheUUfollowingde nitionde nesafanciercorner: ffG Cr\setbox0=\hbox{\roundcorners2}\vbox{\offinterlineskip\hbox{\copy0\roundcorners0\copy0}\hbox?to3\wd0{\hfil\roundcorners7}\hbox?to3\wd0{\hfil\copy0}?}%fffG=ItUUde nesthe\numbGerUU2"(ornumberUU5)corner: ύ caVdIa 1IbIay;theothercornerscanbede nedsimilarly*.5C$20MidnightMacr}'os:border.tex3ڍ&$If1Qy9ouwant,8Pyoucanomitthecornersfrom\borderelm(i.e.,8Pwrite\borderelmtoreturnnothingforargu- $men9ts0,2,5,and7).Butify9oudonotwantanyedgeelements,youshouldstillputsomethingwithwidth(orheigh9t)forthetop/bAottom(orleft/right)edges;Rforinstance,\hboxDto10pt{}isav|ralidtopelement.Border.texusessev9eralbAoxanddimenregisters._?Ratherthanreservingpriv|rateregisters,whichwouldmakethemunav|railableforDotherpurpAoses,border.texDuses\box0,\box2,\box4,\dimen0,\dimen2,and\count2.rANormally:,thisdoAesnotcauseproblems,sincetheyarealw9aysrestoredtotheiroldv|ralue.Theonlytimey9oushouldtakethisintoaccount,isin \borderelm:thismacroshouldnotdepAendonan9yglobalv|raluesoftheseregisters, norshoulditmakeanylastingc9hangesTtothem.$Ifny9ouareafontdesigner,iandwanttode neafontthatcanbAeusedwithborder.tex,iy9oushouldunderstand$somethingkgofho9w\borderetc.buildthebAorders.AkThecen9terstripYisbuiltfromanedge,jwhitespace(glue),andanotheredge.Theamoun9tofwhitespaceischosensothatthewidthofthecen9terstripisthewidthofthetopstrip.)%ThewholebAorderisbuiltbyverticallyaligningthetopstrip,an9umbAerofcenterstrips,andthebAottomstrip. Thisisdonebyaligningthelefthandedgesofthehorizontalstrips.The8v9erticalsizeofthebAorderisagaindeterminedbytheverticalsizeofthebAoundingbo9xes.Y:oumaynoticethattheќquartercircleelemen9tsdescribAedonp.QI389ofTheTuAEXbook(usedin\roundcorners),donot tproperlyintheirbAoundingbo9xesforthepurposeofsettingborders.]Infact,7\roundcornersm9ustgotoconsiderablee orttorepAositionTtheboundingbo9xes.pIfyoucan,avoidsuchproblemswithanynewfontsyoudesign.$There aretwo morevqariantsofbGorders.ZFirst,CtosetonlyonehorizontalstripofabGordergenerated by(\border,P]youcanuse\hborder.AIttakesfourargument:nthewidth,P]andthenumbGersoftheleftele-ment,Mmiddlewelement,andwrightelement.E.g.,M\border{4cm}012generatesthetopofthebGorder,whereas\border{4cm}567generatesthebGottom.dTherearealso\hxborder,4\hminusborder,and\hplusborder.However,UUtherearenoverticalequivqalents.$Finally*,fKtherebaremacros\minusgrayand\plusgray.|TheybGehavebliketheirbGordercounterparts,exceptMthatthecenterofthebGorderis lledwithanextracharacter(\borderelm8)ratherthanwithwhitespace.qF*orUUusewiththesemacros,\borderelmmustreturncharactersasfollows:8Ǎ8䍒`0੍8䍑1 8䍑18䍑18䍑18䍑18䍑18䍑18䍑18䍑18䍑2ट 8䍑3 8䍑8 8䍑88䍑88䍑88䍑88䍑88䍑88䍑88䍑88䍑48䍑3 8䍑8 8䍑88䍑88䍑88䍑88䍑88䍑88䍑88䍑88䍑4 8䍑5 8䍑6 8䍑68䍑68䍑68䍑68䍑68䍑68䍑68䍑68䍑7Thisxisusefulifyouhavecharactersthatcontaina\gray"pattern(a\stipple"or\BenDay"pattern).AlthoughafontwithagraypatternshouldnotbGehardtode ne,F5totheauthor'sknowledgethereiscurrentlyUUnosuchfontinthepublicdomain.qThesegraymacroscanalsobGeusedwith\setborder.FH;g G 4pi( cmssdc101*= manfnt%j cmti9$': cmti10ߤN cmtt9 cmmi10Aacmr6|{Ycmr8o cmr9K`y cmr10Y