WRITINGPAPERSWITHNROFFUSING−ME EricP.Allman ElectronicsResearchLaboratory UniversityofCalifornia,Berkeley Berkeley,California94720 ThisdocumentdescribesthetextprocessingfacilitiesavailableontheUNIX†operatingsystemviaNROFF†andthe−memacropackage.Itisassumedthatthereaderalreadyisgenerally familiarwiththeUNIXoperatingsystemandatexteditorsuchasex.Thisisintendedtobea casualintroduction,andassuchnotallmaterialiscovered.Inparticular,manyvariationsand additionalfeaturesofthe−memacropackagearenotexplained.Foracompletediscussionofthis andotherissues,seeThe−meReferenceManualandTheNROFF/TROFFReferenceManual. NROFF,acomputerprogramthatrunsontheUNIXoperatingsystem,readsaninputfile preparedbytheuserandoutputsaformattedpapersuitableforpublicationorframing.The inputconsistsoftext,orwordstobeprinted,andrequests,whichgiveinstructionstotheNROFF programtellinghowtoformattheprintedcopy. Section1describesthebasicsoftextprocessing.Section2describesthebasicrequests. Section3introducesdisplays.Annotations,suchasfootnotes,arehandledinsection4.Themore complexrequestswhicharenotdiscussedinsection2arecoveredinsection5.Finally,section6 discussesthingsyouwillneedtoknowifyouwanttotypesetdocuments.Ifyouareanovice,you probablywon’twanttoreadbeyondsection4untilyouhavetriedsomeofthebasicfeaturesout. Whenyouhaveyourrawtextready,calltheNROFFformatterbytypingasarequesttothe UNIXshell: nroff−me−Ttypefiles wheretypedescribesthetypeofterminalyouareoutputtingto.Commonvaluesaredtcfora DTC300s(daisy-wheeltype)printerandlprforthelineprinter.Ifthe−Tflagisomitted,a “lowestcommondenominator”terminalisassumed;thisisgoodforpreviewingoutputonmost terminals.AcompletedescriptionofoptionstotheNROFFcommandcanbefoundinThe NROFF/TROFFReferenceManual. Thewordargumentisusedinthismanualtomeanawordornumberwhichappearsonthe samelineasarequestwhichmodifiesthemeaningofthatrequest.Forexample,therequest .sp spacesoneline,but .sp4 spacesfourlines.Thenumber4isanargumenttothe.sprequestwhichsaystospacefourlines †UNIX,NROFF,andTROFFareTrademarksofBellLaboratories USINGNROFFAND−ME 1 USINGNROFFAND−ME 2 insteadofone.Argumentsareseparatedfromtherequestandfromeachotherbyspaces. 1.BasicsofTextProcessing TheprimaryfunctionofNROFFistocollectwordsfrominputlines,filloutputlineswith thosewords,justifytherighthandmarginbyinsertingextraspacesintheline,andoutputthe result.Forexample,theinput: Nowisthetime forallgoodmen tocometotheaid oftheirparty. Fourscoreandseven yearsago,... willberead,packedontooutputlines,andjustifiedtoproduce: Nowisthetimeforallgoodmentocometotheaidoftheirparty.Four scoreandsevenyearsago,... Sometimesyoumaywanttostartanewoutputlineeventhoughthelineyouareonisnotyet full;forexample,attheendofaparagraph.Todothisyoucancauseabreak,whichstartsa newoutputline.Somerequestscauseabreakautomatically,asdoblankinputlinesandinput linesbeginningwithaspace. Notallinputlinesaretexttobeformatted.Someoftheinputlinesarerequestswhich describehowtoformatthetext.Requestsalwayshaveaperiodoranapostrophe(“´ ”)asthe firstcharacteroftheinputline. Thetextformatteralsodoesmorecomplexthings,suchasautomaticallynumbering pages,skippingoverpagefolds,puttingfootnotesinthecorrectplace,andsoforth. IcanofferyouafewhintsforpreparingtextforinputtoNROFF.First,keeptheinput linesshort.Shortinputlinesareeasiertoedit,andNROFFwillpackwordsontolongerlines foryouanyhow.Inkeepingwiththis,itishelpfultobeginanewlineaftereveryperiod, comma,orphrase,sincecommoncorrectionsaretoaddordeletesentencesorphrases.Second,donotputspacesattheendoflines,sincethiscansometimesconfusetheNROFFprocessor.Third,donothyphenatewordsattheendoflines(exceptwordsthatshouldhave hyphensinthem,suchas“mother-in-law”);NROFFissmartenoughtohyphenatewordsfor youasneeded,butisnotsmartenoughtotakehyphensoutandjoinawordbacktogether. Also,wordssuchas“mother-in-law”shouldnotbebrokenoveraline,sincethenyouwillgeta spacewherenotwanted,suchas“mother-in-law”. 2.BasicRequests 2.1.Paragraphs Paragraphsarebegunbyusingthe.pprequest.Forexample,theinput: .pp Nowisthetimeforallgoodmen tocometotheaidoftheirparty. Fourscoreandsevenyearsago,... producesablanklinefollowedbyanindentedfirstline.Theresultis: Nowisthetimeforallgoodmentocometotheaidoftheirparty. Fourscoreandsevenyearsago,... Noticethatthesentencesoftheparagraphsmustnotbeginwithaspace,sinceblank linesandlinesbeginingwithspacescauseabreak.Forexample,ifIhadtyped:

USINGNROFFAND−ME 3 .pp Nowisthetimeforallgoodmen tocometotheaidoftheirparty. Fourscoreandsevenyearsago,... Theoutputwouldbe: Nowisthetimeforallgoodmen tocometotheaidoftheirparty.Fourscoreandsevenyearsago,... Anewlinebeginsaftertheword“men”becausethesecondlinebeganwithaspacecharacter. Therearemanyfanciertypesofparagraphs,whichwillbedescribedlater. 2.2.HeadersandFooters Arbitraryheadersandfooterscanbeputatthetopandbottomofeverypage.Two requestsoftheform.hetitleand.fotitledefinethetitlestoputattheheadandthefoot ofeverypage,respectively.Thetitlesarecalledthree-parttitles,thatis,thereisaleft-justifiedpart,acenteredpart,andaright-justifiedpart.Toseparatethesethreepartsthe firstcharacteroftitle(whateveritmaybe)isusedasadelimiter.Anycharactermaybe used,butbackslashanddoublequotemarksshouldbeavoided.Thepercentsignis replacedbythecurrentpagenumberwheneverfoundinthetitle.Forexample,theinput: .he´ ´ %´ ´ .fo´ JaneJones´ ´ MyBook´ resultsinthepagenumbercenteredatthetopofeachpage,“JaneJones”inthelowerleft corner,and“MyBook”inthelowerrightcorner. 2.3.DoubleSpacing NROFFwilldoublespaceoutputtextautomaticallyifyouusetherequest.ls2,asis doneinthissection.Youcanreverttosinglespacedmodebytyping.ls1. 2.4.PageLayout Anumberofrequestsallowyoutochangethewaytheprintedcopylooks,sometimes calledthelayoutoftheoutputpage.Mostoftheserequestsadjusttheplacingof“white space”(blanklinesorspaces).Intheseexplanations,charactersinitalicsshouldbe replacedwithvaluesyouwishtouse;boldcharactersrepresentcharacterswhichshould actuallybetyped. The.bprequeststartsanewpage. Therequest.spNleavesNlinesofblankspace.Ncanbeomitted(meaningskipa singleline)orcanbeoftheformNi(forNinches)orNc(forNcentimeters).Forexample,theinput: .sp1.5i Mythoughtsonthesubject .sp leavesoneandahalfinchesofspace,followedbytheline“Mythoughtsonthesubject”, followedbyasingleblankline. The.in+Nrequestchangestheamountofwhitespaceontheleftofthepage(the indent).TheargumentNcanbeoftheform+N(meaningleaveNspacesmorethanyou arealreadyleaving),−N(meaningleavelessthanyoudonow),orjustN(meaningleave exactlyNspaces).NcanbeoftheformNiorNcalso.Forexample,theinput:

USINGNROFFAND−ME 4 initialtext .in5 sometext .in+1i moretext .in−2c finaltext produces“sometext”indentedexactlyfivespacesfromtheleftmargin,“moretext” indentedfivespacesplusoneinchfromtheleftmargin(fifteenspacesonapicatypewriter), and“finaltext”indentedfivespacesplusoneinchminustwocentimetersfromthemargin. Thatis,theoutputis: initialtext sometext moretext finaltext The.ti+N(temporaryindent)requestisusedlike.in+Nwhentheindentshould applytoonelineonly,afterwhichitshouldreverttothepreviousindent.Forexample, theinput: .in1i .ti0 Ware,JamesR.TheBestofConfucius, HalcyonHouse,1950. Anexcellentbookcontainingtranslationsof mostofConfucius´ mostdelightfulsayings. Adefinitemustforanyoneinterestedintheearlyfoundations ofChinesephilosophy. produces: Ware,JamesR.TheBestofConfucius,HalcyonHouse,1950.AnexcellentbookcontainingtranslationsofmostofConfucius’mostdelightfulsayings.Adefinite mustforanyoneinterestedintheearlyfoundationsofChinesephilosophy. Textlinescanbecenteredbyusingthe.cerequest.Thelineafterthe.ceiscentered (horizontally)onthepage.Tocentermorethanoneline,use.ceN(whereNisthe numberoflinestocenter),followedbytheNlines.Ifyouwanttocentermanylinesbut don’twanttocountthem,type: .ce1000 linestocenter .ce0 The.ce0requesttellsNROFFtocenterzeromorelines,inotherwords,stopcentering. Alloftheserequestscauseabreak;thatis,theyalwaysstartanewline.Ifyouwant tostartanewlinewithoutperforminganyotheraction,use.br. 2.5.Underlining Textcanbeunderlinedusingthe.ulrequest.The.ulrequestcausesthenextinput linetobeunderlinedwhenoutput.Youcanunderlinemultiplelinesbystatingacountof inputlinestounderline,followedbythoselines(aswiththe.cerequest).Forexample,the input:

USINGNROFFAND−ME 5 .ul2 Noticethatthesetwoinputlines areunderlined. willunderlinethoseeightwordsinNROFF.(InTROFFtheywillbesetinitalics.) 3.Displays Displaysaresectionsoftexttobesetofffromthebodyofthepaper.Majorquotes, tables,andfiguresaretypesofdisplays,asarealltheexamplesusedinthisdocument.All displaysexceptcenteredblocksareoutputsinglespaced. 3.1.MajorQuotes Majorquotesarequoteswhichareseverallineslong,andhencearesetinfromthe restofthetextwithoutquotemarksaroundthem.Thesecanbegeneratedusingthecommmands.(qand.)qtosurroundthequote.Forexample,theinput: AsWeizenbaumpointsout: .(q Itissaidthattoexplainistoexplainaway. Thismaximisnowheresowellfulfilled asintheareasofcomputerprogramming,... .)q generatesasoutput: AsWeizenbaumpointsout: Itissaidthattoexplainistoexplainaway.Thismaximisnowheresowellfulfilledasin theareasofcomputerprogramming,... 3.2.Lists Alistisanindented,singlespaced,unfilleddisplay.Listsshouldbeusedwhenthe materialtobeprintedshouldnotbefilledandjustifiedlikenormaltext,suchascolumnsof figuresortheexamplesusedinthispaper.Listsaresurroundedbytherequests.(land.)l. Forexample,type: Alternativestoavoiddeadlockare: .(l Lockinaspecifiedorder Detectdeadlockandbackoutoneprocess Lockallresourcesneededbeforeproceeding .)l willproduce: Alternativestoavoiddeadlockare: Lockinaspecifiedorder Detectdeadlockandbackoutoneprocess Lockallresourcesneededbeforeproceeding 3.3.Keeps Akeepisadisplayoflineswhicharekeptonasinglepageifpossible.Anexampleof whereyouwoulduseakeepmightbeadiagram.Keepsdifferfromlistsinthatlistsmay bebrokenoverapageboundarywhereaskeepswillnot. Blocksarethebasickindofkeep.Theybeginwiththerequest.(bandendwiththe request.)b.Ifthereisnotroomonthecurrentpageforeverythingintheblock,anew USINGNROFFAND−ME 6 pageisbegun.Thishastheunpleasanteffectofleavingblankspaceatthebottomofthe page.Whenthisisnotappropriate,youcanusethealternative,calledfloatingkeeps. Floatingkeepsmoverelativetothetext.Hence,theyaregoodforthingswhichwill bereferredtobyname,suchas“Seefigure3”.Afloatingkeepwillappearatthebottom ofthecurrentpageifitwillfit;otherwise,itwillappearatthetopofthenextpage. Floatingkeepsbeginwiththeline.(zandendwiththeline.)z.Foranexampleofafloatingkeep,seefigure1.The.hlrequestisusedtodrawahorizontallinesothatthefigure standsoutfromthetext. 3.4.FancierDisplays Keepsandlistsarenormallycollectedinnofillmode,sothattheyaregoodfortables andsuch.Ifyouwantadisplayinfillmode(fortext),type.(lF(Throughoutthissection, commentsappliedto.(lalsoapplyto.(band.(z).Thiskindofdisplaywillbeindented frombothmargins.Forexample,theinput: .(lF Andnowboysandgirls, anewer,bigger,bettertoythaneverbefore! Bethefirstonyourblocktohaveyourowncomputer! Yeskids,youtoocanhaveoneofthesemodern dataprocessingdevices. Youtoocanproducebeautifullyformattedpapers withoutevenbattinganeye! .)l willbeoutputas: Andnowboysandgirls,anewer,bigger,bettertoythaneverbefore!Be thefirstonyourblocktohaveyourowncomputer!Yeskids,youtoo canhaveoneofthesemoderndataprocessingdevices.Youtoocanproducebeautifullyformattedpaperswithoutevenbattinganeye! Listsandblocksarealsonormallyindented(floatingkeepsarenormallyleftjustified). Togetaleft-justifiedlist,type.(lL.Togetalistcenteredline-for-line,type.(lC.For example,togetafilled,leftjustifiedlist,enter: .(z .hl Textofkeeptobefloated. .sp .ce Figure1.ExampleofaFloatingKeep. .hl .)z Figure1.ExampleofaFloatingKeep.

USINGNROFFAND−ME 7 .(lLF textofblock .)l Theinput: .(l firstlineofunfilleddisplay morelines .)l producestheindentedtext: firstlineofunfilleddisplay morelines TypingthecharacterLafterthe.(lrequestproducestheleftjustifiedresult: firstlineofunfilleddisplay morelines UsingCinsteadofLproducestheline-at-a-timecenteredoutput: firstlineofunfilleddisplay morelines Sometimesitmaybethatyouwanttocenterseverallinesasagroup,ratherthan centeringthemonelineatatime.Todothisusecenteredblocks,whicharesurroundedby therequests.(cand.)c.Allthelinesarecenteredasaunit,suchthatthelongestlineis centeredandtherestarelineduparoundthatline.Noticethatlinesdonotmoverelative toeachotherusingcenteredblocks,whereastheydousingtheCargumenttokeeps. Centeredblocksarenotkeeps,andmaybeusedinconjunctionwithkeeps.For example,tocenteragroupoflinesasaunitandkeepthemononepage,use: .(bL .(c firstlineofunfilleddisplay morelines .)c .)b toproduce: firstlineofunfilleddisplay morelines Iftheblockrequests(.(band.)b)hadbeenomittedtheresultwouldhavebeenthesame, butwithnoguaranteethatthelinesofthecenteredblockwouldhaveallbeenononepage. NotetheuseoftheLargumentto.(b;thiscausesthecenteredblocktocenterwithinthe entirelineratherthanwithinthelineminustheindent.Also,thecenterrequestsmustbe nestedinsidethekeeprequests. 4.Annotations Thereareanumberofrequeststosavetextforlaterprinting.Footnotesareprintedat thebottomofthecurrentpage.Delayedtextisintendedtobeavariantformoffootnote;the textisprintedonlywhenexplicitlycalledfor,suchasattheendofeachchapter.Indexesare atypeofdelayedtexthavingatag(usuallythepagenumber)attachedtoeachentryaftera rowofdots.Indexesarealsosaveduntilcalledforexplicitly.

USINGNROFFAND−ME 8 4.1.Footnotes Footnotesbeginwiththerequest.(fandendwiththerequest.)f.Thecurrentfootnotenumberismaintainedautomatically,andcanbeusedbytyping\**,toproducea footnotenumber1.Thenumberisautomaticallyincrementedaftereveryfootnote.For example,theinput: .(q Amanwhoisnotupright andatthesametimeispresumptuous; onewhoisnotdiligentandatthesametimeisignorant; onewhoisuntruthfulandatthesametimeisincompetent; suchmenIdonotcountamongacquaintances.\** .(f \**JamesR.Ware, .ul TheBestofConfucius, HalcyonHouse,1950. Page77. .)f .)q generatestheresult: Amanwhoisnotuprightandatthesametimeispresumptuous;onewhoisnotdiligent andatthesametimeisignorant;onewhoisuntruthfulandatthesametimeisincompetent;suchmenIdonotcountamongacquaintances.2 Itisimportantthatthefootnoteappearsinsidethequote,sothatyoucanbesurethatthe footnotewillappearonthesamepageasthequote. 4.2.DelayedText Delayedtextisverysimilartoafootnoteexceptthatitisprintedwhencalledfor explicitly.Thisallowsalistofreferencestoappear(forexample)attheendofeachchapter,asistheconventioninsomedisciplines.Use\*#ondelayedtextinsteadof\**ason footnotes. Ifyouareusingdelayedtextasyourstandardreferencemechanism,youcanstilluse footnotes,exceptthatyoumaywanttoreferencethemwithspecialcharacters*ratherthan numbers. 4.3.Indexes An“index”(actuallymorelikeatableofcontents,sincetheentriesarenotsorted alphabetically)resemblesdelayedtext,inthatitissaveduntilcalledfor.However,each entryhasthepagenumber(orsomeothertag)appendedtothelastlineoftheindexentry afterarowofdots. Indexentriesbeginwiththerequest.(xandendwith.)x.The.)xrequestmayhave aargument,whichisthevaluetoprintasthe“pagenumber”.Itdefaultstothecurrent pagenumber.Ifthepagenumbergivenisanunderscore(“”)nopagenumberorlineof dotsisprintedatall.Togetthelineofdotswithoutapagenumber,type.)x"",which 1Likethis. 2JamesR.Ware,TheBestofConfucius,HalcyonHouse,1950.Page77. *Suchasanasterisk.

USINGNROFFAND−ME 9 specifiesanexplicitlynullpagenumber. The.xprequestprintstheindex. Forexample,theinput: .(x Sealingwax .)x .(x Cabbagesandkings .)x .(x Whytheseaisboilinghot .)x2.5a .(x Whetherpigshavewings .)x"" .(x Thisisaterriblylongindexentry,suchasmightbeused foralistofillustrations,tables,orfigures;Iexpectitto takeatleasttwolines. .)x .xp generates: Sealingwax................................................................................................................9 Cabbagesandkings Whytheseaisboilinghot.........................................................................................2.5a Whetherpigshavewings........................................................................................... Thisisaterriblylongindexentry,suchasmightbeusedforalistofillustrations,tables,orfigures;Iexpectittotakeatleasttwolines..........................9 The.(xrequestmayhaveasinglecharacterargument,specifyingthe“name”ofthe index;thenormalindexisx.Thus,several“indicies”maybemaintainedsimultaneously (suchasalistoftables,tableofcontents,etc.). Noticethattheindexmustbeprintedattheendofthepaper,ratherthanatthe beginningwhereitwillprobablyappear(asatableofcontents);thepagesmayhavetobe physicallyrearrangedafterprinting. 5.FancierFeatures Alargenumberoffancierrequestsexist,notablyrequeststoprovideothersortsofparagraphs,numberedsectionsoftheform1.2.3(suchasusedinthisdocument),andmulticolumn output. 5.1.MoreParagraphs Paragraphsgenerallystartwithablanklineandwiththefirstlineindented.Itis possibletogetleft-justifiedblock-styleparagraphsbyusing.lpinsteadof.pp,asdemon-stratedbythenextparagraph. Sometimesyouwanttouseparagraphsthathavethebodyindented,andthefirstline exdented(oppositeofindented)withalabel.Thiscanbedonewiththe.iprequest.A wordspecifiedonthesamelineas.ipisprintedinthemargin,andthebodyislinedupat aprespecifiedposition(normallyfivespaces).Forexample,theinput:

USINGNROFFAND−ME 10 .ipone Thisisthefirstparagraph. Noticehowthefirstline oftheresultingparagraphlinesup withtheotherlinesintheparagraph. .iptwo Andhereweareatthesecondparagraphalready. Youmaynoticethattheargumentto.ip appears inthemargin. .lp Wecancontinuetext... producesasoutput: oneThisisthefirstparagraph.Noticehowthefirstlineoftheresultingparagraphlines upwiththeotherlinesintheparagraph. twoAndhereweareatthesecondparagraphalready.Youmaynoticethattheargument to.ipappearsinthemargin. Wecancontinuetextwithoutstartinganewindentedparagraphbyusingthe.lprequest. Ifyouhavespacesinthelabelofa.iprequest,youmustusean“unpaddablespace” insteadofaregularspace.Thisistypedasabackslashcharacter(“\”)followedbya space.Forexample,toprintthelabel“Part1”,enter: .ip"Part\1" Ifalabelofanindentedparagraph(thatis,theargumentto.ip)islongerthanthe spaceallocatedforthelabel,.ipwillbeginanewlineafterthelabel.Forexample,the input: .iplonglabel Thisparagraphhadalonglabel. Thefirstcharacteroftextonthefirstline willnotlineupwiththetextonsecondandsubsequentlines, althoughtheywilllineupwitheachother. willproduce: longlabel Thisparagraphhadalonglabel.Thefirstcharacteroftextonthefirstlinewillnot lineupwiththetextonsecondandsubsequentlines,althoughtheywilllineupwith eachother. Itispossibletochangethesizeofthelabelbyusingasecondargumentwhichisthe sizeofthelabel.Forexample,theaboveexamplecouldbedonecorrectlybysaying: .iplonglabel10 whichwillmaketheparagraphindent10spacesforthisparagraphonly.Ifyouhavemany paragraphstoindentallthesameamount,usethenumberregisterii.Forexample,to leaveoneinchofspaceforthelabel,type: .nrii1i somewherebeforethefirstcallto.ip.Refertothereferencemanualformoreinformation. If.ipisusedwithnoargumentatallnohangingtagwillbeprinted.Forexample, theinput:

USINGNROFFAND−ME 11 .ip[a] Thisisthefirstparagraphoftheexample. Wehaveseenthissortofexamplebefore. .ip Thisparagraphislinedupwiththepreviousparagraph, butithasnotaginthemargin. producesasoutput: [a]Thisisthefirstparagraphoftheexample.Wehaveseenthissortofexamplebefore. Thisparagraphislinedupwiththepreviousparagraph,butithasnotaginthemargin. Aspecialcaseof.ipis.np,whichautomaticallynumbersparagraphssequentially from1.Thenumberingisresetatthenext.pp,.lp,or.sh(tobedescribedinthenext section)request.Forexample,theinput: .np Thisisthefirstpoint. .np Thisisthesecondpoint. Pointsarejustregularparagraphs whicharegivensequencenumbersautomatically bythe.nprequest. .pp Thisparagraphwillresetnumberingby.np. .np Forexample, wehaverevertedtonumberingfromonenow. generates: (1)Thisisthefirstpoint. (2)Thisisthesecondpoint.Pointsarejustregularparagraphswhicharegiven sequencenumbersautomaticallybythe.nprequest. Thisparagraphwillresetnumberingby.np. (1)Forexample,wehaverevertedtonumberingfromonenow. 5.2.SectionHeadings Sectionnumbers(suchastheonesusedinthisdocument)canbeautomaticallygeneratedusingthe.shrequest.Youmusttell.shthedepthofthesectionnumberandasectiontitle.Thedepthspecifieshowmanynumbersaretoappear(separatedbydecimal points)inthesectionnumber.Forexample,thesectionnumber4.2.5hasadepthof three. Sectionnumbersareincrementedinafairlyintuitivefashion.Ifyouaddanumber (increasethedepth),thenewnumberstartsoutatone.Ifyousubtractsectionnumbers (orkeepthesamenumber)thefinalnumberisincremented.Forexample,theinput:

USINGNROFFAND−ME 12 .sh1"ThePreprocessor" .sh2"BasicConcepts" .sh2"ControlInputs" .sh3 .sh3 .sh1"CodeGeneration" .sh3 producesasoutputtheresult: 1.ThePreprocessor 1.1.BasicConcepts 1.2.ControlInputs 1.2.1. 1.2.2. 2.CodeGeneration 2.1.1. Youcanspecifythesectionnumbertobeginbyplacingthesectionnumberafterthe sectiontitle,usingspacesinsteadofdots.Forexample,therequest: .sh3"Anothersection"734 willbeginthesectionnumbered7.3.4;allsubsequent.shrequestswillnumberrelativeto thisnumber. Therearemorecomplexfeatureswhichwillcauseeachsectiontobeindentedproportionallytothedepthofthesection.Forexample,ifyouenter: .nrsiN eachsectionwillbeindentedbyanamountN.Nmusthaveascalingfactorattached,that is,itmustbeoftheformNx,wherexisacharactertellingwhatunitsNisin.Common valuesforxareiforinches,cforcentimeters,andnforens(thewidthofasinglecharacter).Forexample,toindenteachsectionone-halfinch,type: .nrsi0.5i Afterthis,sectionswillbeindentedbyone-halfinchperlevelofdepthinthesectionnum-ber.Forexample,thisdocumentwasproducedusingtherequest .nrsi3n atthebeginningoftheinputfile,givingthreespacesofindentpersectiondepth. Sectionheaderswithoutautomaticallygeneratednumberscanbedoneusing: .uh"Title" whichwilldoasectionheading,butwillputnonumberonthesection. 5.3.PartsoftheBasicPaper Therearesomerequestswhichassistinsettinguppapers.The.tprequestinitializes foratitlepage.Therearenoheadersorfootersonatitlepage,andunlikeotherpagesyou canspacedownandleaveblankspaceatthetop.Forexample,atypicaltitlepagemight appearas:

USINGNROFFAND−ME 13 .tp .sp2i .(lC THEGROWTHOFTOENAILS INUPPERPRIMATES .sp by .sp FrankN.Furter .)l .bp Therequest.thsetsuptheenvironmentoftheNROFFprocessortodoathesis,using therulesestablishedatBerkeley.Itdefinesthecorrectheadersandfooters(apagenumber intheupperrighthandcorneronly),setsthemarginscorrectly,anddoublespaces. The.+cTrequestcanbeusedtostartchapters.Eachchapterisautomatically numberedfromone,andaheadingisprintedatthetopofeachchapterwiththechapter numberandthechapternameT.Forexample,tobeginachaptercalled“Conclusions”, usetherequest: .+c"CONCLUSIONS" whichwillproduce,onanewpage,thelines CHAPTER5 CONCLUSIONS withappropriatespacingforathesis.Also,theheaderismovedtothefootofthepageon thefirstpageofachapter.Althoughthe.+crequestwasnotdesignedtoworkonlywith the.threquest,itistunedfortheformatacceptableforaPhDthesisatBerkeley. IfthetitleparameterTisomittedfromthe.+crequest,theresultisachapterwith noheading.Thiscanalsobeusedatthebeginningofapaper;forexample,.+cwasused togeneratepageoneofthisdocument. Althoughpaperstraditionallyhavetheabstract,tableofcontents,andsoforthatthe frontofthepaper,itismoreconvenienttoformatandprintthemlastwhenusingNROFF. Thisissothatindexentriescanbecollectedandthenprintedforthetableofcontents(or whatever).Attheendofthepaper,issuethe.++Prequest,whichbeginsthepreliminarypartofthepaper.Afterissuingthisrequest,the.+crequestwillbeginapreliminary sectionofthepaper.Mostnotably,thisprintsthepagenumberrestartedfromonein lowercaseRomannumbers..+cmaybeusedrepeatedlytobegindifferentpartsofthe frontmaterialforexample,theabstract,thetableofcontents,acknowledgments,listof illustrations,etc.Therequest.++Bmayalsobeusedtobeginthebibliographicsection attheendofthepaper.Forexample,thepapermightappearasoutlinedinfigure2.(In thisfigure,commentsbeginwiththesequence\".) 5.4.EquationsandTables TwospecialUNIXprogramsexisttoformatspecialtypesofmaterial.Eqnandneqn setequationsforthephototypesetterandNROFFrespectively.Tblarrangestoprint extremelyprettytablesinavarietyofformats.Thisdocumentwillonlydescribethe embellishmentstothestandardfeatures;consultthereferencemanualsforthoseprocessors foradescriptionoftheiruse. TheeqnandneqnprogramsaredescribedfullyinthedocumentTypesettingMathematics−Users’GuidebyBrianW.KernighanandLorindaL.Cherry.Equationsarecentered,andarekeptononepage.Theyareintroducedbythe.EQrequestandterminated USINGNROFFAND−ME 14 .th \"setforthesismode .fo´ ´ DRAFT´ ´ \"definefooterforeachpage .tp \"begintitlepage .(lC \"centeralargeblock THEGROWTHOFTOENAILS INUPPERPRIMATES .sp by .sp FrankFurter .)l \"endcenteredpart .+cINTRODUCTION\"beginchapternamed"INTRODUCTION" .(xt \"makeanentryintoindex‘t’ Introduction .)x \"endofindexentry textofchapterone .+c"NEXTCHAPTER"\"beginanotherchapter .(xt \"enterintoindex‘t’again NextChapter .)x textofchaptertwo .+cCONCLUSIONS .(xt Conclusions .)x textofchapterthree .++B \"beginbibliographicinformation .+cBIBLIOGRAPHY\"beginanother‘chapter’ .(xt Bibliography .)x textofbibliography .++P \"beginpreliminarymaterial .+c"TABLEOFCONTENTS" .xpt \"printindex‘t’collectedabove .+cPREFACE\"beginanotherpreliminarysection textofpreface Figure2.OutlineofaSamplePaper bythe.ENrequest. The.EQrequestmaytakeanequationnumberasanoptionalargument,whichis printedverticallycenteredontherighthandsideoftheequation.Iftheequationbecomes toolongitshouldbesplitbetweentwolines.Todothis,type:

USINGNROFFAND−ME 15 .EQ(eq34) textofequation34 .ENC .EQ continuationofequation34 .EN TheConthe.ENrequestspecifiesthattheequationwillbecontinued. Thetblprogramproducestables.Itisfullydescribed(includingnumerousexamples)inthedocumentTbl−AProgramtoFormatTablesbyM.E.Lesk.Tablesbegin withthe.TSrequestandendwiththe.TErequest.Tablesarenormallykeptonasingle page.Ifyouhaveatablewhichistoobigtofitonasinglepage,sothatyouknowitwill extendtoseveralpages,beginthetablewiththerequest.TSHandputtherequest.TH afterthepartofthetablewhichyouwantduplicatedatthetopofeverypagethatthe tableisprintedon.Forexample,atabledefinitionforalongtablemightlooklike: .TSH css nnn. THETABLETITLE .TH textofthetable .TE 5.5.TwoColumnOutput Youcangettwocolumnoutputautomaticallybyusingtherequest.2c.Thiscauses everythingafterittobeoutputintwo-columnform.Therequest.bcwillstartanewcol-umn;itdiffersfrom.bpinthat.bpmayleaveatotallyblankcolumnwhenitstartsanew page.Toreverttosinglecolumnoutput,use.1c. 5.6.DefiningMacros Amacroisacollectionofrequestsandtextwhichmaybeusedbystatingasimple request.Macrosbeginwiththeline.dexx(wherexxisthenameofthemacrotobe defined)andendwiththelineconsistingoftwodots.Afterdefiningthemacro,statingthe line.xxisthesameasstatingalltheotherlines.Forexample,todefineamacrothat spaces3linesandthencentersthenextinputline,enter: .deSS .sp3 .ce .. anduseitbytyping: .SS TitleLine (beginningoftext) Macronamesmaybeoneortwocharacters.Inordertoavoidconflictswithnamesin −me,alwaysuseuppercaselettersasnames.TheonlynamestoavoidareTS,TH,TE, EQ,andEN. 5.7.AnnotationsInsideKeeps Sometimesyoumaywanttoputafootnoteorindexentryinsideakeep.Forexample,ifyouwanttomaintaina“listoffigures”youwillwanttodosomethinglike:

USINGNROFFAND−ME 16 .(z .(c textoffigure .)c .ce Figure5. .(xf Figure5 .)x .)z whichyoumayhopewillgiveyouafigurewithalabelandanentryintheindexf(presumablyalistoffiguresindex).Unfortunately,theindexentryisreadandinterpreted whenthekeepisread,notwhenitisprinted,sothepagenumberintheindexislikelyto bewrong.Thesolutionistousethemagicstring\!atthebeginningofallthelinesdealingwiththeindex.Inotherwords,youshoulduse: .(z .(c Textoffigure .)c .ce Figure5. \!.(xf \!Figure5 \!.)x .)z whichwilldefertheprocessingoftheindexuntilthefigureisoutput.Thiswillguarantee thatthepagenumberintheindexiscorrect.Thesamecommentsapplytoblocks(with .(band.)b)aswell. 6.TROFFandthePhotosetter Withalittlecare,youcanpreparedocumentsthatwillprintnicelyoneitheraregular terminalorwhenphototypesetusingtheTROFFformattingprogram. 6.1.Fonts Afontisastyleoftype.Therearethreefontsthatareavailablesimultaneously, TimesRoman,TimesItalic,andTimesBold,plusthespecialmathfont.Thenormalfont isRoman.TextwhichwouldbeunderlinedinNROFFwiththe.ulrequestissetinitalics inTROFF. Therearewaysofswitchingbetweenfonts.Therequests.r,.i,and.bswitchto Roman,italic,andboldfontsrespectively.Youcansetasinglewordinsomefontbytyping(forexample): .iword whichwillsetwordinitalicsbutdoesnotaffectthesurroundingtext.InNROFF,italic andboldtextisunderlined. Noticethatifyouaresettingmorethanonewordinwhateverfont,youmustsurroundthatwordwithdoublequotemarks(‘"’)sothatitwillappeartotheNROFFprocessorasasingleword.Thequotemarkswillnotappearintheformattedtext.Ifyoudo wantaquotemarktoappear,youshouldquotetheentirestring(evenifasingleword), andusetwoquotemarkswhereyouwantonetoappear.Forexample,ifyouwanttoproducethetext:

USINGNROFFAND−ME 17 "MasterControl" initalics,youmusttype: .i"""MasterControl\|""" The\|producesaverynarrowspacesothatthe“l”doesnotoverlapthequotesignin TROFF,likethis: "MasterControl" Therearealsoseveral“pseudo-fonts”available.Theinput: .(b .uunderlined .bi"bolditalics" .bx"wordsinabox" .)b generates underlined bolditalics wordsinabox InNROFFthesealljustunderlinethetext.Noticethatpseudofontrequestssetonlythe singleparameterinthepseudofont;ordinaryfontrequestswillbeginsettingalltextinthe specialfontifyoudonotprovideaparameter.Nomorethanonewordshouldappearwith thesethreefontrequestsinthemiddleoflines.ThisisbecauseofthewayTROFFjustifies text.Forexample,ifyouweretoissuetherequests: .bi"somebolditalics" and .bx"wordsinabox" inthemiddleofalineTROFFwouldproducesomebolditalicsandwordsinabox, whichIthinkyouwillagreedoesnotlookgood. Thesecondparameterofallfontrequestsissetintheoriginalfont.Forexample,the fontrequest: .bboldface generates“bold”inboldfont,butsets“face”inthefontofthesurroundingtext,resulting in: boldface. Tosetthetwowordsboldandfacebothinboldface,type: .b"boldface" Youcanmixfontsinawordbyusingthespecialsequence\cattheendofalineto indicate“continuetextprocessing”;thisallowsinputlinestobejoinedtogetherwithouta spaceinbetweenthem.Forexample,theinput: .uunder\c .iitalics generatesunderitalics,butifwehadtyped: .uunder .iitalics theresultwouldhavebeenunderitalicsastwowords.

USINGNROFFAND−ME 18 6.2.PointSizes Thephototypesettersupportsdifferentsizesoftype,measuredinpoints.Thedefault pointsizeis10pointsformosttext,8pointsforfootnotes.Tochangethepointsize,type: .sz+N whereNisthesizewantedinpoints.Theverticalspacing(distancebetweenthebottomof mostletters(thebaseline)betweenadjacentlines)issettobeproportionaltothetypesize. Warning:changingpointsizesonthephototypesetterisaslowmechanicaloperation. Sizechangesshouldbeconsideredcarefully. 6.3.Quotes Itisconventionalwhenusingthetypesettertousepairsofgraveandacuteaccentsto generatedoublequotes,ratherthanthedoublequotecharacter(‘"’).Thisisbecauseit looksbettertousegraveandacuteaccents;forexample,compare"quote"to‘‘quote’’. Inordertomakequotescompatiblebetweenthetypesetterandterminals,youmay usethesequences\*(lqand\*(rqtostandfortheleftandrightquoterespectively.These bothappearas"onmostterminals,butaretypesetas‘‘and’’respectively.Forexample, use: \*(lqSomethingsaren´ ttrue eveniftheydidhappen.\*(rq togeneratetheresult: “Somethingsaren’ttrueeveniftheydidhappen.” Asashorthand,thespecialfontrequest: .q"quotedtext" willgenerate“quotedtext”.Noticethatyoumustsurroundthematerialtobequotedwith doublequotemarksifitismorethanoneword. Acknowledgments IwouldliketothankBobEpstein,BillJoy,andLarryRoweforhavingthecouragetouse the−memacrostoproducenon-trivialpapersduringthedevelopmentstages;RickiBlau,Pamela Humphrey,andJimJoycefortheirhelpwiththedocumentationphase;andtheplethoraofpeople whohavecontributedideasandhavegivensupportfortheproject. ThisdocumentwasTROFF’edonApril8,1993andappliestoversion1.1ofthe−memacros.

−MEREFERENCEMANUAL Release1.1/25 EricP.Allman ElectronicsResearchLaboratory UniversityofCalifornia,Berkeley Berkeley,California94720 Thisdocumentdescribesinextremelyterseformthefeaturesofthe−memacropackagefor versionsevenNROFF/TROFF.Somefamiliarityisassumedwiththoseprograms,specifically,the readershouldunderstandbreaks,fonts,pointsizes,theuseanddefinitionofnumberregistersand strings,howtodefinemacros,andscalingfactorsforens,points,v’s(verticallinespaces),etc. ForamorecasualintroductiontotextprocessingusingNROFF,refertothedocumentWritingPaperswithNROFFusing−me. Thereareanumberofmacroparametersthatmaybeadjusted.Fontsmaybesettoafont numberonly.InNROFFfont8isunderlined,andissetinboldfontinTROFF(althoughfont3, boldinTROFF,isnotunderlinedinNROFF).Font0isnofontchange;thefontofthesurroundingtextisusedinstead.Noticethatfonts0and8are“pseudo-fonts”;thatis,theyaresimulated bythemacros.Thismeansthatalthoughitislegaltosetafontregistertozerooreight,itisnot legaltousetheescapecharacterform,suchas: \f8 Alldistancesareinbasicunits,soitisnearlyalwaysnecessarytouseascalingfactor.For example,therequesttosettheparagraphindenttoeightone-enspacesis: .nrpi8n andnot .nrpi8 whichwouldsettheparagraphindenttoeightbasicunits,orabout0.02inch.Defaultparameter valuesaregiveninbracketsintheremainderofthisdocument. Registersandstringsoftheform$xmaybeusedinexpressionsbutshouldnotbechanged. Macrosoftheform$xperformsomefunction(asdescribed)andmayberedefinedtochangethis function.Thismaybeasensitiveoperation;lookatthebodyoftheoriginalmacrobeforechangingit. Allnamesin−mefollowarigidnamingconvention.Theusermaydefinenumberregisters, strings,andmacros,providedthats/heusessinglecharacteruppercasenamesordoublecharacternamesconsistingoflettersanddigits,withatleastoneuppercaseletter.Innocaseshould specialcharactersbeusedinuser-definednames. †NROFFandTROFFareTrademarksofBellLaboratories. −MEREFERENCEMANUAL 19 −MEREFERENCEMANUAL 20 Ondaisywheeltypeprintersintwelvepitch,the−rx1flagcanbestatedtomakelines defaulttooneeighthinch(thenormalspacingforanewlineintwelve-pitch).Thisisnormallytoo smallforeasyreadability,sothedefaultistospaceonesixthinch. ThisdocumentationwasTROFF’edonApril8,1993andappliestoversion1.1/25ofthe −memacros. 1.Paragraphing Thesemacrosareusedtobeginparagraphs.Thestandardparagraphmacrois.pp;the othersareallvariantstobeusedforspecialpurposes. Thefirstcalltooneoftheparagraphingmacrosdefinedinthissectionorthe.shmacro (definedinthenextsession)initializesthemacroprocessor.Afterinitializationitisnotpossibletouseanyofthefollowingrequests:.sc,.lo,.th,or.ac.Also,theeffectsofchanging parameterswhichwillhaveaglobaleffectontheformatofthepage(notablypagelengthand headerandfootermargins)arenotwelldefinedandshouldbeavoided. .lp\h’|86724u’\cBeginleft-justifiedparagraph.Centeringandunderliningareturnedoffif theywereon,thefontissetto\n(pf[1]thetypesizeissetto\n(pp [10p],anda\n(psspaceisinsertedbeforetheparagraph[0.35vin TROFF,1vor0.5vinNROFFdependingondeviceresolution].The indentisresetto\n($i[0]plus\n(po[0]unlesstheparagraphis insideadisplay.(see.ba).Atleastthefirsttwolinesoftheparagrapharekepttogetheronapage. .pp\h’|86724u’\cLike.lp,exceptthatitputs\n(pi[5n]unitsofindent.Thisisthestandard paragraphmacro. .ipTI\h’|86724u’\cIndentedparagraphwithhangingtag.ThebodyofthefollowingparagraphisindentedIspaces(or\n(ii[5n]spacesifIisnotspecified) morethananon-indentedparagraph(suchaswith.pp)is.Thetitle Tisexdented(oppositeofindented).Theresultisaparagraphwith anevenleftedgeandTprintedinthemargin.AnyspacesinTmust beunpaddable.IfTwillnotfitinthespaceprovided,.ipwillstarta newline. .np\h’|86724u’\cAvariantof.ipwhichnumbersparagraphs.Numberingisresetaftera.lp, .pp,or.sh.Thecurrentparagraphnumberisin\n($p. 2.SectionHeadings Numberedsectionsaresimiliartoparagraphsexceptthatasectionnumberisautomaticallygeneratedforeachone.Thesectionnumbersareoftheform1.2.3.Thedepthofthe sectionisthecountofnumbers(separatedbydecimalpoints)inthesectionnumber. Unnumberedsectionheadingsaresimilar,exceptthatnonumberisattachedtothe heading. .sh+NTabcdef\h’|86724u’\cBeginnumberedsectionofdepthN.IfNismissingthe currentdepth(maintainedinthenumberregister\n($0)isused. Thevaluesoftheindividualpartsofthesectionnumberaremaintainedin\n($1through\n($6.Thereisa\n(ss[1v]spacebefore thesection.Tisprintedasasectiontitleinfont\n(sf[8]andsize \n(sp[10p].The“name”ofthesectionmaybeaccessedvia\*($n. If\n(siisnon-zero,thebaseindentissetto\n(sitimesthesection depth,andthesectiontitleisexdented.(See.ba.)Also,anadditionalindentof\n(so[0]isaddedtothesectiontitle(butnottothe bodyofthesection).Thefontisthensettotheparagraphfont,so thatmoreinformationmayoccuronthelinewiththesectionnumber −MEREFERENCEMANUAL 21 andtitle..shinsuresthatthereisenoughroomtoprintthesection headplusthebeginningofaparagraph(about3linestotal).Ifa throughfarespecified,thesectionnumberissettothatnumber ratherthanincrementedautomatically.Ifanyofathroughfarea hyphenthatnumberisnotreset.IfTisasingleunderscore(“”) thenthesectiondepthandnumberingisreset,butthebaseindentis notresetandnothingisprintedout.Thisisusefultoautomatically coordinatesectionnumberswithchapternumbers. .sx+N\h’|86724u’\cGotosectiondepthN[−1],butdonotprintthenumberandtitle,and donotincrementthesectionnumberatlevelN.Thishastheeffectof startinganewparagraphatlevelN. .uhT\h’|86724u’\cUnnumberedsectionheading.ThetitleTisprintedwiththesamerules forspacing,font,etc.,asfor.sh. .$pTBN\h’|86724u’\cPrintsectionheading.Mayberedefinedtogetfancierheadings.T isthetitlepassedonthe.shor.uhline;Bisthesectionnumberfor thissection,andNisthedepthofthissection.Theseparametersare notalwayspresent;inparticular,.shpassesallthree,.uhpassesonly thefirst,and.sxpassesthree,butthefirsttwoarenullstrings.Care shouldbetakenifthismacroisredefined;itisquitecomplexandsubtle. .$0TBN\h’|86724u’\cThismacroiscalledautomaticallyaftereverycallto.$p.Itisnormallyundefined,butmaybeusedtoautomaticallyputeverysection titleintothetableofcontentsorforsomesimiliarfunction.Tisthe sectiontitleforthesectiontitlewhichwasjustprinted,Bisthesectionnumber,andNisthesectiondepth. .$1−.$6\h’|86724u’\cTrapscalledjustbeforeprintingthatdepthsection.Maybedefined to(forexample)givevariablespacingbeforesections.Thesemacros arecalledfrom.$p,soifyouredefinethatmacroyoumaylosethis feature. 3.HeadersandFooters Headersandfootersareputatthetopandbottomofeverypageautomatically.They aresetinfont\n(tf[3]andsize\n(tp[10p].Eachofthedefinitionsapplyasofthenext page.Three-parttitlesmustbequotediftherearetwoblanksadjacentanywhereinthetitle ormorethaneightblankstotal. Thespacingofheadersandfootersarecontrolledbythreenumberregisters.\n(hm[4v] isthedistancefromthetopofthepagetothetopoftheheader,\n(fm[3v]isthedistance fromthebottomofthepagetothebottomofthefooter,\n(tm[7v]isthedistancefromthe topofthepagetothetopofthetext,and\n(bm[6v]isthedistancefromthebottomofthe pagetothebottomofthetext(nominal).Themacros.m1,.m2,.m3,and.m4arealsosuppliedforcompatibilitywithROFFdocuments. .he´ l´ m´ r´ \h’|86724u’\cDefinethree-partheader,tobeprintedonthetopofeverypage. .fo´ l´ m´ r´ \h’|86724u’\cDefinefooter,tobeprintedatthebottomofeverypage. .eh´ l´ m´ r´ \h’|86724u’\cDefineheader,tobeprintedatthetopofeveryeven-numbered page. .oh´ l´ m´ r´ \h’|86724u’\cDefineheader,tobeprintedatthetopofeveryodd-numbered page. .ef´ l´ m´ r´ \h’|86724u’\cDefinefooter,tobeprintedatthebottomofeveryeven-numbered page.

−MEREFERENCEMANUAL 22 .of´ l´ m´ r´ \h’|86724u’\cDefinefooter,tobeprintedatthebottomofeveryodd-numbered page. .hx\h’|86724u’\cSuppressheadersandfootersonthenextpage. .m1+N\h’|86724u’\cSetthespacebetweenthetopofthepageandtheheader[4v]. .m2+N\h’|86724u’\cSetthespacebetweentheheaderandthefirstlineoftext[2v]. .m3+N\h’|86724u’\cSetthespacebetweenthebottomofthetextandthefooter[2v]. .m4+N\h’|86724u’\cSetthespacebetweenthefooterandthebottomofthepage[4v]. .ep\h’|86724u’\cEndthispage,butdonotbeginthenextpage.Usefulforforcingoutfootnotes,butotherthanthathardlyeveryused.Mustbefollowedbya .bportheendofinput. .$h\h’|86724u’\cCalledateverypagetoprinttheheader.Mayberedefinedtoprovidefancy (e.g.,multi-line)headers,butdoingsolosesthefunctionofthe.he, .fo,.eh,.oh,.ef,and.ofrequests,aswellasthechapter-styletitle featureof.+c. .$f\h’|86724u’\cPrintfooter;samecommentsapplyasin.$h. .$H\h’|86724u’\cAnormallyundefinedmacrowhichiscalledatthetopofeachpage(after outputingtheheader,initialsavedfloatingkeeps,etc.);inother words,thismacroiscalledimmediatelybeforeprintingtextona page.Itcanbeusedforcolumnheadingsandthelike. 4.Displays Alldisplaysexceptcenteredblocksandblockquotesarepreceededandfollowedbyan extra\n(bs[sameas\n(ps]space.Quotespacingisstoredinaseparateregister;centered blockshavenodefaultinitialortrailingspace.Theverticalspacingofalldisplaysexcept quotesandcenteredblocksisstoredinregister\n($Rinsteadof\n($r. .(lmf\h’|86724u’\cBeginlist.Listsaresinglespaced,unfilledtext.IffisF,thelistwillbe filled.Ifm[I]isIthelistisindentedby\n(bi[4n];ifMthelistis indentedtotheleftmargin;ifLthelistisleftjustifiedwithrespectto thetext(differentfromMonlyifthebaseindent(storedin\n($i andsetwith.ba)isnotzero);andifCthelistiscenteredonalineby-linebasis.Thelistissetinfont\n(df[0].Mustbematchedbya .)l.Thismacroisalmostlike.(bexceptthatnoattemptismadeto keepthedisplayononepage. .)l\h’|86724u’\cEndlist. .(q\h’|86724u’\cBeginmajorquote.Thesearesinglespaced,filled,movedinfromthetext onbothsidesby\n(qi[4n],preceededandfollowedby\n(qs[same as\n(bs]space,andaresetinpointsize\n(qp[onepointsmaller thansurroundingtext]. .)q\h’|86724u’\cEndmajorquote. .(bmf\h’|86724u’\cBeginblock.Blocksareaformofkeep,wherethetextofakeepiskept togetherononepageifpossible(keepsareusefulfortablesandfigures whichshouldnotbebrokenoverapage).Iftheblockwillnotfiton thecurrentpageanewpageisbegun,unlessthatwouldleavemore than\n(bt[0]whitespaceatthebottomofthetext.If\n(btis zero,thethresholdfeatureisturnedoff.Blocksarenotfilledunlessf isF,whentheyarefilled.Theblockwillbeleft-justifiedifmisL, indentedby\n(bi[4n]ifmisIorabsent,centered(line-for-line)ifm isC,andleftjustifiedtothemargin(nottothebaseindent)ifmis −MEREFERENCEMANUAL 23 M.Theblockissetinfont\n(df[0]. .)b\h’|86724u’\cEndblock. .(zmf\h’|86724u’\cBeginfloatingkeep.Like.(bexceptthatthekeepisfloatedtothebottomofthepageorthetopofthenextpage.Therefore,itsposition relativetothetextchanges.Thefloatingkeepispreceededandfollowedby\n(zs[1v]space.Also,itdefaultstomodeM. .)z\h’|86724u’\cEndfloatingkeep. .(c\h’|86724u’\cBegincenteredblock.Thenextkeepiscenteredasablock,ratherthanona line-by-linebasisaswith.(bC.Thiscallmaybenestedinsidekeeps. .)c\h’|86724u’\cEndcenteredblock. 5.Annotations .(d\h’|86724u’\cBegindelayedtext.Everythinginthenextkeepissavedforoutputlater with.pd,inamannersimilartofootnotes. .)dn\h’|86724u’\cEnddelayedtext.Thedelayedtextnumberregister\n($dandtheassociatedstring\*#areincrementedif\*#hasbeenreferenced. .pd\h’|86724u’\cPrintdelayedtext.Everythingdivertedvia.(disprintedandtruncated. Thismightbeusedattheendofeachchapter. .(f\h’|86724u’\cBeginfootnote.Thetextofthefootnoteisfloatedtothebottomofthepage andsetinfont\n(ff[1]andsize\n(fp[8p].Eachentryispreceeded by\n(fs[0.2v]space,isindented\n(fi[3n]onthefirstline,andis indented\n(fu[0]fromtherightmargin.Footnoteslineupunderneathtwocolumnedoutput.Ifthetextofthefootnotewillnotallfit ononepageitwillbecarriedovertothenextpage. .)fn\h’|86724u’\cEndfootnote.Thenumberregister\n($fandtheassociatedstring\** areincrementediftheyhavebeenreferenced. .$s\h’|86724u’\cThemacrotooutputthefootnoteseperator.Thismacromayberedefined togiveothersizelinesorothertypesofseparators.Currentlyit drawsa1.5iline. .(xx\h’|86724u’\cBeginindexentry.Indexentriesaresavedintheindexx[x]untilcalled upwith.xp.Eachentryispreceededbya\n(xs[0.2v]space.Each entryis“undented”by\n(xu[0.5i];thisregistertellshowfarthe pagenumberextendsintotherightmargin. .)xPA\h’|86724u’\cEndindexentry.TheindexentryisfinishedwitharowofdotswithA [null]rightjustifiedonthelastline(suchasforanauthor’sname), followedbyP[\n%].IfAisspecified,Pmustbespecified;\n%can beusedtoprintthecurrentpagenumber.IfPisanunderscore,no pagenumberandnorowofdotsareprinted. .xpx\h’|86724u’\cPrintindexx[x].Theindexisformatedinthefont,size,andsoforthin effectatthetimeitisprinted,ratherthanatthetimeitiscollected. 6.ColumnedOutput .2c+SN\h’|86724u’\cEntertwo-columnmode.Thecolumnseparationissetto+S[4n,0.5i inACMmode](savedin\n($s).Thecolumnwidth,calculatedtofill thesinglecolumnlinelengthwithbothcolumns,isstoredin\n($l. Thecurrentcolumnisin\n($c.Youcantestregister\n($m[1]to seeifyouareinsinglecolumnordoublecolumnmode.Actually,the requestentersN[2]columnedoutput.

−MEREFERENCEMANUAL 24 .1c\h’|86724u’\cReverttosingle-columnmode. .bc\h’|86724u’\cBegincolumn.Thisislike.bpexceptthatitbeginsanewcolumnonanew pageonlyifnecessary,ratherthanforcingawholenewpageifthereis anothercolumnleftonthecurrentpage. 7.FontsandSizes .sz+P\h’|86724u’\cThepointsizeissettoP[10p],andthelinespacingissetproportionally. Theratiooflinespacingtopointsizeisstoredin\n($r.Theratio usedinternallybydisplaysandannotationsisstoredin\n($R (althoughthisisnotusedby.sz). .rWX\h’|86724u’\cSetWinromanfont,appendingXinthepreviousfont.Toappenddifferentfontrequests,useX=\c.Ifnoparameters,changetoroman font. .iWX\h’|86724u’\cSetWinitalics,appendingXinthepreviousfont.Ifnoparameters, changetoitalicfont.UnderlinesinNROFF. .bWX\h’|86724u’\cSetWinboldfontandappendXinthepreviousfont.Ifnoparameters,switchtoboldfont.InNROFF,underlines. .rbWX\h’|86724u’\cSetWinboldfontandappendXinthepreviousfont.Ifnoparameters,switchtoboldfont..rbdiffersfrom.binthat.rbdoesnot underlineinNROFF. .uWX\h’|86724u’\cUnderlineWandappendX.Thisisatrueunderlining,asopposedto the.ulrequest,whichchangesto“underlinefont”(usuallyitalicsin TROFF).Itwon’tworkrightifWisspreadorbroken(including hyphenated).Inotherwords,itissafeinnofillmodeonly. .qWX\h’|86724u’\cQuoteWandappendX.InNROFFthisjustsurroundsWwithdouble quotemarks(‘"’),butinTROFFusesdirectedquotes. .biWX\h’|86724u’\cSetWinbolditalicsandappendX.Actually,setsWinitalicand overstrikesonce.UnderlinesinNROFF.Itwon’tworkrightifWis spreadorbroken(includinghyphenated).Inotherwords,itissafein nofillmodeonly. .bxWX\h’|86724u’\cSetsWinabox,withXappended.UnderlinesinNROFF.Itwon’t workrightifWisspreadorbroken(includinghyphenated).Inother words,itissafeinnofillmodeonly. 8.RoffSupport .ix+N\h’|86724u’\cIndent,nobreak.Equivalentto´ inN. .blN\h’|86724u’\cLeaveNcontiguouswhitespace,onthenextpageifnotenoughroomon thispage.Equivalenttoa.spNinsideablock. .pa+N\h’|86724u’\cEquivalentto.bp. .ro\h’|86724u’\cSetpagenumberinromannumerals.Equivalentto.af%i. .ar\h’|86724u’\cSetpagenumberinarabic.Equivalentto.af%1. .n1\h’|86724u’\cNumberlinesinmarginfromoneoneachpage. .n2N\h’|86724u’\cNumberlinesfromN,stopifN=0. .sk\h’|86724u’\cLeavethenextoutputpageblank,exceptforheadersandfooters.Thisis usedtoleavespaceforafull-pagediagramwhichisproducedexter-nallyandpastedinlater.Togetapartial-pagepaste-indisplay,say .svN,whereNistheamountofspacetoleave;thisspacewillbe −MEREFERENCEMANUAL 25 outputimmediatelyifthereisroom,andwillotherwisebeoutputat thetopofthenextpage.However,bewarned:ifNisgreaterthan theamountofavailablespaceonanemptypage,nospacewilleverbe output. 9.PreprocessorSupport .EQmT\h’|86724u’\cBeginequation.TheequationiscenteredifmisCoromitted, indented\n(bi[4n]ifmisI,andleftjustifiedifmisL.Tisatitle printedontherightmarginnexttotheequation.SeeTypesetting Mathematics−User’sGuidebyBrianW.KernighanandLorindaL. Cherry. .ENc\h’|86724u’\cEndequation.IfcisCtheequationmustbecontinuedbyimmediately followingwithanother.EQ,thetextofwhichcanbecenteredalong withthisone.Otherwise,theequationisprinted,alwaysononepage, with\n(es[0.5vinTROFF,1vinNROFF]spaceaboveandbelowit. .TSh\h’|86724u’\cTablestart.Tablesaresinglespacedandkeptononepageifpossible.If youhavealargetablewhichwillnotfitononepage,useh=Hand followtheheaderpart(tobeprintedoneverypageofthetable)with a.TH.SeeTbl−AProgramtoFormatTablesbyM.E.Lesk. .TH\h’|86724u’\cWith.TSH,endstheheaderportionofthetable. .TE\h’|86724u’\cTableend.Notethatthistabledoesnotfloat,infact,itisnotevenguaranteedtostayononepageifyouuserequestssuchas.spintermixed withthetextofthetable.Ifyouwantittofloat(orifyouuse requestsinsidethetable),surroundtheentiretable(includingthe .TSand.TErequests)withtherequests.(zand.)z. 10.Miscellaneous .re\h’|86724u’\cResettabs.Settoevery0.5iinTROFFandevery0.8iinNROFF. .ba+N\h’|86724u’\cSetthebaseindentto+N[0](savedin\n($i).Allparagraphs,sections,anddisplayscomeoutindentedbythisamount.Titlesand footnotesareunaffected.The.shrequestperformsa.barequestif \n(si[0]isnotzero,andsetsthebaseindentto\n(si*\n($0. .xl+N\h’|86724u’\cSetthelinelengthtoN[6.0i].Thisdiffersfrom.llbecauseitonly affectsthecurrentenvironment. .ll+N\h’|86724u’\cSetlinelengthinallenvironmentstoN[6.0i].Thisshouldnotbeused afteroutputhasbegun,andparticularlynotintwo-columnedoutput. Thecurrentlinelengthisstoredin\n($l. .hl\h’|86724u’\cDrawsahorizontallinethelengthofthepage.Thisisusefulinsidefloating keepstodifferentiatebetweenthetextandthefigure. .lo\h’|86724u’\cThismacroloadsanothersetofmacros(in/usr/lib/me/local.me)which isintendedtobeasetoflocallydefinedmacros.Thesemacrosshould allbeoftheform.*X,whereXisanyletter(upperorlowercase)or digit. 11.StandardPapers .tp\h’|86724u’\cBegintitlepage.Spacingatthetopofthepagecanoccur,andheadersand footersaresupressed.Also,thepagenumberisnotincrementedfor thispage.

−MEREFERENCEMANUAL 26 .th\h’|86724u’\cSetthesismode.ThisdefinesthemodesacceptableforadoctoraldissertationatBerkeley.Itdoublespaces,definestheheadertobeasingle pagenumber,andchangesthemarginstobe1.5inchontheleftand oneinchonthetop..++and.+cshouldbeusedwithit.This macromustbestatedbeforeinitialization,thatis,beforethefirstcall ofaparagraphingmacroor.sh. .++mH\h’|86724u’\cThisrequestdefinesthesectionofthepaperwhichweareentering. Thesectiontypeisdefinedbym.Cmeansthatweareenteringthe chapterportionofthepaper,Ameansthatweareenteringthe appendixportionofthepaper,Pmeansthatthematerialfollowing shouldbethepreliminaryportion(abstract,tableofcontents,etc.) portionofthepaper,ABmeansthatweareenteringtheabstract (numberedindependentlyfrom1inArabicnumerals),andBmeans thatweareenteringthebibliographicportionattheendofthepaper. Also,thevariantsRCandRAareallowed,whichspecifyrenumberingofpagesfromoneatthebeginningofeachchapterorappendix, respectively.TheHparameterdefinesthenewheader.Ifthereare anyspacesinit,theentireheadermustbequoted.Ifyouwantthe headertohavethechapternumberinit,Usethestring\\\\n(ch. Forexample,tonumberappendixesA.1etc.,type.++RA ´´´ \\\\n(ch.%´ .Eachsection(chapter,appendix,etc.)shouldbe preceededbythe.+crequest.Itshouldbementionedthatitiseasier whenusingTROFFtoputthefrontmaterialattheendofthepaper, sothatthetableofcontentscanbecollectedandoutput;thismaterialcanthenbephysicallymovedtothebeginningofthepaper. .+cT\h’|86724u’\cBeginchapterwithtitleT.Thechapternumberismaintainedin\n(ch. Thisregisterisincrementedeverytime.+ciscalledwithaparameter.Thetitleandchapternumberareprintedby.$c.Theheaderis movedtothefooteronthefirstpageofeachchapter.IfTisomitted, .$cisnotcalled;thisisusefulfordoingyourown“titlepage”atthe beginningofpaperswithoutatitlepageproper..$ccalls.$Casa hooksothatchaptertitlescanbeinsertedintoatableofcontents automatically.Thefootnotenumberingisresettoone. .$cT\h’|86724u’\cPrintchapternumber(from\n(ch)andT.Thismacrocanberedefined toyourliking.ItisdefinedbydefaulttobeacceptableforaPhD thesisatBerkeley.Thismacrocalls$C,whichcanbedefinedto makeindexentries,orwhatever. .$CKNT\h’|86724u’\cThismacroiscalledby.$c.Itisnormallyundefined,butcanbe usedtoautomaticallyinsertindexentries,orwhatever.Kisakeyword,either“Chapter”or“Appendix”(dependingonthe.++ mode);Nisthechapterorappendixnumber,andTisthechapteror appendixtitle. .acAN\h’|86724u’\cThismacro(shortfor.acm)setsuptheNROFFenvironmentforphotoreadypapersasusedbytheACM.Thisformatis25%larger,and hasnoheadersorfooters.Theauthor’snameAisprintedatthebottomofthepage(butoffthepartwhichwillbeprintedintheconferenceproceedings),togetherwiththecurrentpagenumberandthe totalnumberofpagesN.Additionally,thismacroloadsthefile /usr/lib/me/acm.me,whichmaylaterbeaugmentedwithother macrosusefulforprintingpapersforACMconferences.Itshouldbe notedthatthismacrowillnotworkcorrectlyinTROFF,sinceitsets −MEREFERENCEMANUAL 27 thepagelengthwiderthanthephysicalwidthofthephototypesetter roll. 12.PredefinedStrings \**\h’|86724u’\cFootnotenumber,actually\*[\n($f\*].Thismacroisincrementedafter eachcallto.)f. \*#\h’|86724u’\cDelayedtextnumber.Actually[\n($d]. \*[\h’|86724u’\cSuperscript.Thisstringgivesupwardmovementandachangetoasmaller pointsizeifpossible,otherwiseitgivestheleftbracketcharacter(‘[’). Extraspaceisleftabovethelinetoallowroomforthesuperscript. \*]\h’|86724u’\cUnsuperscript.Inverseto\*[.Forexample,toproduceasuperscriptyou mighttypex\*[2\*],whichwillproducex. \*<\h’|86724u’\cSubscript.Defaultsto‘<’ifhalf-carriagemotionnotpossible.Extra spaceisleftbelowthelinetoallowforthesubscript. \*>\h’|86724u’\cInverseto\*<. \*(dw\h’|86724u’\cThedayoftheweek,asaword. \*(mo\h’|86724u’\cThemonth,asaword. \*(td\h’|86724u’\cToday’sdate,directlyprintable.ThedateisoftheformApril8,1993. Otherformsofthedatecanbeusedbyusing\n(dy(thedayofthe month;forexample,8),\*(mo(asnotedabove)or\n(mo(thesame, butasanordinalnumber;forexample,Aprilis4),and\n(yr(the lasttwodigitsofthecurrentyear). \*(lq\h’|86724u’\cLeftquotemarks.DoublequoteinNROFF. \*(rq\h’|86724u’\cRightquote. \*−\h’|86724u’\c3/4emdashinTROFF;twohyphensinNROFF. 13.SpecialCharactersandMarks Thereareanumberofspecialcharactersanddiacriticalmarks(suchasaccents)available through−me.Toreferencethesecharacters,youmustcallthemacro.sctodefinethecharactersbeforeusingthem. .sc\h’|86724u’\cDefinespecialcharactersanddiacriticalmarks,asdescribedintheremainder ofthissection.Thismacromustbestatedbeforeinitialization. Thespecialcharactersavailablearelistedbelow. Name UsageExample Acuteaccent\*´ a\*´ a´ Graveaccent\*` e\*` e` Umlat \*:u\*:u.. Tilde \*˜ n\*˜ n˜ Caret \*ˆ e\*ˆ eˆ Cedilla \*,c\*,c, Czech \*ve\*vev Circle \*oA\*oA Thereexists\*(qe——— Forall \*(qa\/— −MEREFERENCEMANUAL 28 Acknowledgments IwouldliketothankBobEpstein,BillJoy,andLarryRoweforhavingthecourageto usethe−memacrostoproducenon-trivialpapersduringthedevelopmentstages;RickiBlau, PamelaHumphrey,andJimJoycefortheirhelpwiththedocumentationphase;andthe plethoraofpeoplewhohavecontributedideasandhavegivensupportfortheproject.