troff.ms 118 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660
  1. .nr *% \n(%#u+7u
  2. .ds NR "\f2nroff\fP
  3. .ds TR "\f2troff\|\fP
  4. .ds Tr \f2Troff\|\fP
  5. .ds Nr \f2Nroff\fP
  6. . \" CW - constant width font not from -ms
  7. .de T&
  8. .X "END US
  9. .X "US T&
  10. ..
  11. .de CW
  12. .nr PQ \\n(.f
  13. .if \\n(.$=0 .ft CW
  14. .if \\n(.$>0 \%\&\\$3\f(CW\\$1\\f\\n(PQ\\$2
  15. ..
  16. .de BI
  17. .nr PQ \\n(.f
  18. .if \\n(.$=0 .ft 4
  19. .if \\n(.$>0 \%\&\\$3\f2\\$1\\f\\n(PQ\\$2
  20. ..
  21. .de UC
  22. \\$3\s-2\\$1\s+2\\$2
  23. ..
  24. .am NH
  25. .nr p \\np+1
  26. .nr s 0 1
  27. ..
  28. .fp 4 BI LucidaSansI
  29. .bd 4 3
  30. .de sc
  31. .LP
  32. \f4\\np.\\n+s.\ \ \\$1\f1\0
  33. ..
  34. .de bt
  35. .SP .25
  36. .LP
  37. .NE 2.1
  38. .ta 1.5i 2.5i 3.5i 4.5i
  39. \\$1 \\$2 \\$3 \\$4
  40. .IP "" 0.8i
  41. ....br
  42. \\$5
  43. ..
  44. .
  45. .
  46. .
  47. .
  48. .
  49. .
  50. .
  51. .TL
  52. Troff User's Manual
  53. .AU
  54. Joseph F. Ossanna
  55. Brian W. Kernighan
  56. .sp
  57. bwk@research.bell-labs.com
  58. .EQ
  59. delim @@
  60. define cw % "\&" font CW %
  61. .EN
  62. .SH
  63. Introduction
  64. .PP
  65. \*(Tr and \*(NR are text processors
  66. that format text for typesetter- and
  67. typewriter-like terminals, respectively.
  68. They accept lines of text interspersed with lines of
  69. format control information and
  70. format the text into a printable, paginated document
  71. having a user-designed style.
  72. \*(Tr and \*(NR offer
  73. unusual freedom in document styling:
  74. arbitrary style headers and footers;
  75. arbitrary style footnotes;
  76. multiple automatic sequence numbering for paragraphs, sections, etc;
  77. multiple column output;
  78. dynamic font and point-size control;
  79. arbitrary horizontal and vertical local motions at any point;
  80. and
  81. a family of automatic overstriking, bracket construction, and
  82. line-drawing functions.
  83. .
  84. .de TL
  85. .LP
  86. .ce
  87. .ps +2
  88. .ft B
  89. ..
  90. .
  91. .PP
  92. .I Troff
  93. produces its output in a device-independent form,
  94. although parameterized for a specific device;
  95. \*(TR output must be processed by a driver for that
  96. device to produce printed output.
  97. .PP
  98. \*(Tr and \*(NR are highly compatible with each other and it is almost always
  99. possible to prepare input acceptable to both.
  100. Conditional input is provided to enable
  101. the user to embed input expressly destined for either program.
  102. \*(Nr can prepare output directly for a variety of terminal types and
  103. is capable of utilizing the full resolution of each terminal.
  104. \*(Nr is the same program as \*(TR; in fact, on Plan 9
  105. \*(NR is a shell script that calls \*(TR with the
  106. .CW -N
  107. argument.
  108. .SH
  109. Background to the Plan 9 Edition
  110. .PP
  111. The primary change to \*(TR and \*(NR for Plan 9 is
  112. support of the Unicode Standard, which was added during
  113. 1992 and 1993. There are two results. First, there is much
  114. less need for the myriad of two-character names that are so
  115. much a part of \*(TR lore; in Plan 9, for example, one naturally uses the
  116. Unicode character ½ instead of \*(TR\|'s
  117. .CW \\e(12 .
  118. Second, the output device, though called
  119. .CW utf ,
  120. is almost always a form of PostScript printer;
  121. the panoply of special drivers for different typesetters
  122. has largely disappeared.
  123. Unfortunately, not all PostScript printers can cope
  124. with Unicode characters, so there remains a need for
  125. programs that synthesize PostScript characters from bitmaps;
  126. this is especially true for Asian languages.
  127. .SH
  128. Background to the Second Edition
  129. .PP
  130. \*(Tr
  131. was originally written by the late Joe Ossanna
  132. in about 1973, in assembly language for the
  133. .UC PDP -11,
  134. to drive the Graphic Systems CAT typesetter.
  135. It was rewritten in C around 1975,
  136. and underwent slow but steady evolution until
  137. Ossanna's death late in 1977.
  138. .PP
  139. In 1979, Brian Kernighan
  140. modified
  141. \*(TR
  142. so that it would produce output for a variety of typesetters,
  143. while retaining its input specifications.
  144. Over the decade from 1979 to 1989,
  145. the internals
  146. have been modestly revised,
  147. though much of the code remains as it was when Ossanna wrote it.
  148. .PP
  149. \*(Tr
  150. reads parameter files
  151. each time it is invoked, to
  152. set values for machine resolution,
  153. legal type sizes and fonts, and character names,
  154. character widths
  155. and the like.
  156. \*(Tr
  157. output is
  158. .UC ASCII
  159. characters
  160. in a simple language
  161. that describes where each character is to be placed
  162. and in what size and font.
  163. A post-processor must be written for each device
  164. to convert this typesetter-independent language
  165. into specific instructions for that device.
  166. .PP
  167. The output language contains information that was not readily
  168. identifiable in the older output.
  169. In the newer language, the beginning of each page, line, and word
  170. is marked,
  171. so post-processors can do device-specific optimizations
  172. such as sorting the data vertically or printing it boustrophedonically,
  173. independent of
  174. \*(TR.
  175. .PP
  176. Capabilities for graphics have been added:
  177. \*(TR
  178. recognizes commands for drawing diagonal lines,
  179. circles, ellipses, circular arcs,
  180. and quadratic B-splines.
  181. There are also ways to pass arbitrary information to the output,
  182. unprocessed by
  183. \*(TR.
  184. .PP
  185. A number of limitations have been eased or eliminated.
  186. A document may have an arbitrary number of fonts on any page
  187. (if the output device permits it, of course).
  188. Fonts may be accessed merely by naming them;
  189. ``mounting'' is no longer necessary.
  190. There are no limits on the number of characters.
  191. \H'8'Character height\H'10' and \S'-1'sl\S'0'a\S'1'nt\S'0' may be set
  192. independently of width.
  193. .PP
  194. The remainder of this document contains a description of
  195. usage and command-line options;
  196. a summary of requests, escape sequences, and pre-defined number registers;
  197. a reference manual;
  198. tutorial examples;
  199. and a list of commonly-available characters.
  200. .SH
  201. Acknowledgements
  202. .PP
  203. Joe Ossanna's
  204. \*(TR
  205. remains a remarkable accomplishment.
  206. For more than twenty years, it has proven a robust tool,
  207. taking unbelievable abuse from a variety of preprocessors
  208. and being forced into uses that were never conceived of
  209. in the original design,
  210. all with considerable grace under fire.
  211. .PP
  212. Recent versions of \*(TR have profited from
  213. significant code improvements by
  214. Jaap Akkerhuis, Dennis Ritchie, Ken Thompson, and Molly Wagner.
  215. UTF facilities owe much to Jaap Akkerhuis.
  216. Andrew Hume, Doug McIlroy, Peter Nelson and Ravi Sethi made valuable suggestions on the manual.
  217. I fear that the remaining bugs are my fault.
  218. .sp 100
  219. .BP
  220. .TL
  221. Usage
  222. .SP
  223. .PP
  224. \*(Tr or \*(NR is invoked as
  225. .P1
  226. troff \fIoptions files\fP
  227. nroff \fIoptions files\fP
  228. .P2
  229. where @options@ represents any of a number of option arguments
  230. and @files@ represents the list of files containing the document
  231. to be formatted.
  232. An argument consisting of a single minus
  233. .CW - ' `
  234. represents standard input.
  235. If no filenames are given input is taken from the standard input.
  236. The options, which may appear in any order so long as they appear
  237. before the files, are:
  238. .TS
  239. center;
  240. lfCW lw(4.5i).
  241. -m@name@ T{
  242. Read the macro file
  243. @cw /sys/lib/tmac. name@
  244. before the input @files@.
  245. T}
  246. -T@name@ T{
  247. Specifies
  248. the type of the output device.
  249. Specific devices are site-dependent.
  250. For
  251. \*(TR,
  252. the most useful name is
  253. .CW utf .
  254. For
  255. \*(NR,
  256. useful names include
  257. @cw "37"@ for the (default) Model 37 Teletype,
  258. @cw lp@ for ``dumb'' line printer terminals (no half-line motions,
  259. no reverse motions),
  260. and @cw think@ for the HP ThinkJet printer.
  261. T}
  262. -i T{
  263. Read standard input after the input files are exhausted.
  264. T}
  265. -o@list@ T{
  266. Print only pages whose page numbers appear in @list@,
  267. which consists of comma-separated numbers and number ranges.
  268. A number range has the form @N-M@
  269. and means pages @N@ through @M@;
  270. a initial @-N@ means
  271. from the beginning to page @N@; and a final @N-@ means
  272. from @N@ to the end.
  273. T}
  274. -n@N@ T{
  275. Number first generated page @N@.
  276. T}
  277. -r@aN@ T{
  278. Set number register @a@ (one-character) to @N@.
  279. T}
  280. -s@N@ T{
  281. Stop every @N@ pages.
  282. \*(Nr will halt prior to every @N@ pages (default @N=1@)
  283. to allow paper loading or
  284. changing, and will resume upon receipt of a newline.
  285. \*(Tr will include a ``pause'' code every @N@ pages;
  286. its meaning, if any, depends on the output device.
  287. T}
  288. -u@N@ T{
  289. Set amount of emboldening for the
  290. .CW bd
  291. request to @N@.
  292. T}
  293. -F@path@ T{
  294. Look in directory @path@ for font information;
  295. the defaults are
  296. .CW /sys/lib/troff/font
  297. and
  298. .CW /sys/lib/troff/term
  299. for \*(TR
  300. and \*(NR respectively.
  301. T}
  302. .sp .5
  303. T{
  304. \*(TR Only
  305. T}
  306. -a T{
  307. Send a printable approximation
  308. of the results to the standard output.
  309. T}
  310. .sp .5
  311. T{
  312. \*(NR Only
  313. T}
  314. -e T{
  315. Produce equally-spaced words in adjusted
  316. lines, using full terminal resolution.
  317. T}
  318. -h T{
  319. Use tabs instead of spaces
  320. to speed up printing.
  321. T}
  322. -q T{
  323. Invoke the simultaneous input-output mode of the @cw rd@ request.
  324. T}
  325. .TE
  326. .PP
  327. Each option is a separate argument;
  328. for example,
  329. .P1
  330. troff -Tutf -ms -mpictures -o4,6,8-10 \f2file1 file2\fP
  331. .P2
  332. requests formatting of pages 4, 6, and 8 through 10 of a document contained in the files
  333. named \f2file1\fP and \f2file2\fP,
  334. specifies the output in UTF,
  335. and invokes the macro packages
  336. .CW -ms
  337. and
  338. .CW -mpictures .
  339. .PP
  340. Various pre- and post-processors are available for use with \*(NR and \*(TR.
  341. These include the equation preprocessor
  342. .I eqn
  343. (for \*(TR only),
  344. the table-construction preprocessor
  345. .I tbl ,
  346. and
  347. .I pic
  348. and
  349. .I grap
  350. for various forms of graphics.
  351. .sp 100
  352. .BP
  353. .TL
  354. Request Summary
  355. .PP
  356. In the following table,
  357. the notation @+- N@ in the
  358. .BI "Request Form
  359. column means that the forms @N@, @+N@, or @-N@ are permitted,
  360. to set the parameter to @N@, increment it by @N@, or decrement it by @N@,
  361. respectively.
  362. Plain @N@ means that the value is used to set the parameter.
  363. .BI "Initial Values
  364. separated by
  365. .CW ;
  366. are for
  367. \*(TR
  368. and
  369. \*(NR
  370. respectively.
  371. In the
  372. .BI Notes
  373. column,
  374. .TS
  375. center;
  376. c lw(4.5i).
  377. B T{
  378. Request normally causes a break.
  379. The use of
  380. .CW ' \&
  381. as control character (instead of
  382. .CW . )\&
  383. suppresses the break function.
  384. T}
  385. D T{
  386. Mode or relevant parameters associated with current diversion level.
  387. T}
  388. E T{
  389. Relevant parameters are a part of the current environment.
  390. T}
  391. O T{
  392. Must stay in effect until logical output.
  393. T}
  394. P T{
  395. Mode must be still or again in effect at the time of physical output.
  396. T}
  397. T T{
  398. \*(TR only; no effect in \*(NR.
  399. T}
  400. @bold v@, @bold p@, @bold m@, @bold u@ T{
  401. Default scale indicator; if not specified, scale indicators are ignored.
  402. T}
  403. .TE
  404. .sp
  405. .tr &.
  406. .ps 9
  407. .vs 11
  408. .nr z 0 1
  409. .TS
  410. lf2 lf2 lf2 lf2 lf2
  411. lf2 lf2 lf2 lf2 lf2
  412. lfCW l l l l.
  413. Request Initial If No
  414. Form Value Argument Notes Explanation
  415. .sp .5
  416. .T&
  417. lf3 s s s s.
  418. \\n+z. General Information
  419. .sp .5
  420. .T&
  421. lf3 s s s s
  422. lfCW l l l l.
  423. \\n+z. Font and Character Size Control
  424. .sp .5
  425. &ps @+- N@ 10 point previous E,T Point size; also @cw "\es" +- N@.
  426. &ss @N@ 12/36\fBm\fP ignored E,T Space-character size set to @N/36@ em.
  427. &cs @ F~N~ M@ off - P,T Constant character space (width) mode (font @F@).
  428. &bd @F~N@ off - P,T Embolden font @F@ by @N-1@ units.
  429. &bd S@~F~N@ off - P,T Embolden Special Font when current font is @F@.
  430. &ft@~F@ Roman previous E Change to font @F@; also @cw "\ef" x@, @cw "\ef(" xx@, @cw "\ef" N@.
  431. &fp@~N~F~L@ R,I,B,...,S ignored - Mount font named @F@ on physical position @N <= 1@;
  432. long name is @L@ if given.
  433. .sp .5
  434. .T&
  435. lf3 s s s s
  436. lfCW l l l l.
  437. \\n+z. Page Control
  438. &pl @+- N@ 11i 11i @bold v@ Page length.
  439. &bp @+- N@ @N=1@ - B,@bold v@ Eject current page; next page number @N@.
  440. &pn @+- N@ @N=1@ ignored - Next page number @N@.
  441. &po @+- N@ 1i; 0 previous @bold v@ Page offset.
  442. &ne @N@ - @N=1 roman v@ D,@bold v@ Need @N@ vertical space.
  443. &mk @R@ none internal D Mark current vertical place in register @R@.
  444. &rt @+- N@ none internal D,@bold v@ Return (upward only) to marked vertical place.
  445. .sp .5
  446. .T&
  447. lf3 s s s s
  448. lfCW l l l l.
  449. \\n+z. Text Filling, Adjusting, and Centering
  450. &br - - B Break.
  451. &fi fill - B,E Fill output lines.
  452. &nf fill - B,E No filling or adjusting of output lines.
  453. &ad @c@ adj, both adjust E Adjust output lines with mode @c@; @c = cw l , cw r , cw c , cw b , none@
  454. &na adjust - E No output line adjusting.
  455. &ce @N@ off @N=1@ B,E Center next @N@ input text lines.
  456. .sp .5
  457. .T&
  458. lf3 s s s s
  459. lfCW l l l l.
  460. \\n+z. Vertical Spacing
  461. &vs @N@ 12p; 1/6i previous E,@bold p@ Vertical baseline spacing (@V@).
  462. &ls @N@ @N=1@ previous E Output @N-1@ @bold v@'s after each text output line.
  463. &sp @N@ - @N=1@v B,@bold v@ Space vertical distance @N@ in either direction.
  464. &sv @N@ - @N=1@v @bold v@ Save vertical distance @N@.
  465. &os - - - Output saved vertical distance.
  466. &ns space - D Turn no-space mode on.
  467. &rs - - D Restore spacing; turn no-space mode off.
  468. .sp .5
  469. .T&
  470. lf3 s s s s
  471. lfCW l l l l.
  472. \\n+z. Line Length and Indenting
  473. &ll @+- N@ 6.5i previous E,@bold m@ Line length.
  474. &in @+- N@ @N=0@ previous B,E,@bold m@ Indent.
  475. &ti @+- N@ - ignored B,E,@bold m@ Temporary indent.
  476. .sp .5
  477. .ne 2.1
  478. .T&
  479. lf3 s s s s
  480. lfCW l l l l.
  481. \\n+z. Macros, Strings, Diversion, and Position Traps
  482. &de @xx~yy@ - @.yy= cw ".."@ - Define or redefine macro @xx@; end at call of @yy@.
  483. &am @xx~yy@ - @.yy= cw ".."@ - Append to a macro.
  484. &ds @xx~string@ - ignored - Define a string @xx@ containing @string@.
  485. &as @xx~string@ - ignored - Append @string@ to string @xx@.
  486. &rm @xx@ - ignored - Remove request, macro, or string.
  487. &rn @xx~yy@ - ignored - Rename request, macro, or string @xx@ to @yy@.
  488. &di @xx@ - end D Divert output to macro @xx@.
  489. &da @xx@ - end D Divert and append to @xx@.
  490. &wh @N~xx@ - - @bold v@ Set location trap; negative is w.r.t. page bottom.
  491. &ch @xx~N@ - - @bold v@ Change trap location.
  492. &dt @N~xx@ - off D,@bold v@ Set a diversion trap.
  493. &it @N~xx@ - off E Set an input-line count trap.
  494. &em @xx@ none none - End macro is @xx@.
  495. .sp .5
  496. .T&
  497. lf3 s s s s
  498. lfCW l l l l.
  499. \\n+z. Number Registers
  500. &nr @R~+- N~M@ - @bold u@ Define and set number register @R@;
  501. auto-increment by @M@.
  502. &af @R~c@ arabic - - Assign format to register @R@ (@c= cw "1" , cw i , cw I , cw a , cw A@).
  503. &rr @R@ - - - Remove register @R@.
  504. .sp .5
  505. .T&
  506. lf3 s s s s
  507. lfCW l l l l.
  508. \\n+z. Tabs, Leaders, and Fields
  509. &ta@~Nt~. . .@ 0.5i; 0.8n none E,@bold m@ Tab settings; left-adjusting, unless
  510. @t= cw R@ (right), @cw C@ (centered).
  511. &tc@~c@ none none E Tab repetition character.
  512. &lc@~c@ @cw "."@ none E Leader repetition character.
  513. &fc@~a~b@ off off - Set field delimiter @a@ and pad character @b@.
  514. .sp .5
  515. .T&
  516. lf3 s s s s
  517. lfCW l l l l.
  518. \\n+z. Input and Output Conventions and Character Translations
  519. &ec@~c@ \e \e - Set escape character.
  520. &eo on - - Turn off escape character mechanism.
  521. &lg@~N@ on; - on T Ligature mode on if @N>0@.
  522. &ul@~N@ off @N=1@ E Underline (italicize in \*(TR\^) @N@ input lines.
  523. &cu@~N@ off @N=1@ E Continuous underline in \*(NR; in \*(TR, like @cw ul@.
  524. &uf@~F@ Italic Italic - Underline font set to @F@ (to be switched to by @cw ul@).
  525. &cc@~c@ @cw .@ @cw .@ E Set control character to @c@.
  526. &c2@~c@ @cw "'"@ @cw "'"@ E Set no-break control character to @c@.
  527. &tr@~abcd....@ none - O Translate @a@ to @b@, etc., on output.
  528. .sp .5
  529. .T&
  530. lf3 s s s s.
  531. \\n+z. Local Horizontal and Vertical Motions, and the Width Function
  532. .sp .5
  533. .T&
  534. lf3 s s s s.
  535. \\n+z. Overstrike, Bracket, Line-drawing, Graphics, and Zero-width Functions
  536. .sp .5
  537. .T&
  538. lf3 s s s s
  539. lfCW l l l l.
  540. \\n+z. Hyphenation.
  541. &nh hyphenate - E No hyphenation.
  542. &hy@~N@ hyphenate hyphenate E Hyphenate; @N =@ mode.
  543. &hc@~c@ @cw "\e%"@ @cw "\e%"@ E Hyphenation indicator character @c@.
  544. &hw@~word~. . .@ ignored - Add words to hyphenation dictionary.
  545. .sp .5
  546. .T&
  547. lf3 s s s s
  548. lfCW l l l l.
  549. \\n+z. Three-Part Titles.
  550. &tl@~'l'c'r'@ - - Three-part title; delimiter may be any character.
  551. &pc@~c@ @cw %@ off - Page number character.
  552. &lt@~+- N@ 6.5i previous E,@bold m@ Length of title.
  553. .sp .5
  554. .T&
  555. lf3 s s s s
  556. lfCW l l l l.
  557. \\n+z. Output Line Numbering.
  558. &nm@~+- N^M^S^I@ off E Number mode on or off, set parameters.
  559. &nn@~N@ - @N=1@ E Do not number next @N@ lines.
  560. .sp .5
  561. .ne 2
  562. .T&
  563. lf3 s s s s
  564. lfCW l l l l.
  565. \\n+z. Conditional Acceptance of Input
  566. &if@~c~any@ - - If condition @c@ true, accept @any@ as input;
  567. for multi-line, use @cw "\e{" any cw "\e}"@.
  568. &if !@c~any@ - - If condition @c@ false, accept @any@.
  569. &if@~N~any@ - @bold u@ If expression @N > 0@, accept @any@.
  570. &if !@N~any@ - @bold u@ If expression @N <= 0@ [sic], accept @any@.
  571. &if@~ 's1 's2 '~any@ - - If string @s1@ identical to @s2@, accept @any@.
  572. &if !@ 's1 's2 '~any@ - - If string @s1@ not identical to @s2@, accept @any@.
  573. &ie@~c~any@ - @bold u@ If portion of if-else; all above forms (like @cw "if"@).
  574. &el@~any@ - - Else portion of if-else.
  575. .sp .5
  576. .T&
  577. lf3 s s s s
  578. lfCW l l l l.
  579. \\n+z. Environment Switching
  580. &ev@~N@ @N=0@ previous - Environment switch (push down).
  581. .sp .5
  582. .T&
  583. lf3 s s s s
  584. lfCW l l l l.
  585. \\n+z. Insertions from the Standard Input
  586. &rd@~prompt@ - @prompt@=\s-1BEL\s+1 - Read insertion.
  587. &ex - - - Exit.
  588. .sp .5
  589. .T&
  590. lf3 s s s s
  591. lfCW l l l l.
  592. \\n+z. Input/Output File Switching
  593. &so@~filename@ - - Switch source file (push down).
  594. &nx@~filename@ end-of-file - Next file.
  595. &sy@~string@ - - Execute program @string@. Output not interpolated.
  596. &pi@~string@ - - Pipe output to program @string@.
  597. &cf@~filename@ - - Copy file contents to \*(TR output.
  598. .sp .5
  599. .T&
  600. lf3 s s s s
  601. lfCW l l l l.
  602. \\n+z. Miscellaneous
  603. &mc@~c~N@ - off E,@bold m@ Set margin character @c@ and separation @N@.
  604. &tm@~string@ - newline - Print @string@ on terminal (standard error).
  605. &ab@~string@ - newline - Print @string@ on standard error, exit program.
  606. &ig@~yy@ - @.yy= cw ".."@ - Ignore input until call of @yy@.
  607. &lf@~N ~f@ - - Set input line number to @N@ and filename to @f@.
  608. &pm@~t@ - all - Print macro names, sizes; if @t@ present, print total.
  609. &fl - - B Flush output buffer.
  610. .sp .5
  611. .T&
  612. lf3 s s s s.
  613. \\n+z. Output and Error Messages
  614. .sp .5
  615. \\n+z. Output Language
  616. .sp .5
  617. \\n+z. Device and Font Description Files
  618. .TE
  619. .br
  620. .nr zz 9
  621. .de cl
  622. .ie \\n+(cl<\n(zz \{\
  623. . po +\\n(.lu/\n(zzu
  624. . rt\}
  625. .el \{.po 1i\}
  626. ..
  627. .nr cl 0 1
  628. .di zz
  629. .ta .45iR
  630. ... was .35
  631. .nf
  632. .ps 9
  633. .vs 10.5
  634. \f(CWab\fP 20
  635. \f(CWad\fP 4
  636. \f(CWaf\fP 8
  637. \f(CWam\fP 7
  638. \f(CWas\fP 7
  639. \f(CWbd\fP 2
  640. \f(CWbp\fP 3
  641. \f(CWbr\fP 4
  642. \f(CWc2\fP 10
  643. \f(CWcc\fP 10
  644. \f(CWce\fP 4
  645. \f(CWcf\fP 19
  646. \f(CWch\fP 7
  647. \f(CWcs\fP 2
  648. \f(CWcu\fP 10
  649. \f(CWda\fP 7
  650. \f(CWde\fP 7
  651. \f(CWdi\fP 7
  652. \f(CWds\fP 7
  653. \f(CWdt\fP 7
  654. \f(CWec\fP 10
  655. \f(CWel\fP 16
  656. \f(CWem\fP 7
  657. \f(CWeo\fP 10
  658. \f(CWev\fP 17
  659. \f(CWex\fP 18
  660. \f(CWfc\fP 9
  661. \f(CWfi\fP 4
  662. \f(CWfl\fP 20
  663. \f(CWfp\fP 2
  664. \f(CWft\fP 2
  665. \f(CWhc\fP 13
  666. \f(CWhw\fP 13
  667. \f(CWhy\fP 13
  668. \f(CWie\fP 16
  669. \f(CWif\fP 16
  670. \f(CWig\fP 20
  671. \f(CWin\fP 6
  672. \f(CWit\fP 7
  673. \f(CWlc\fP 9
  674. \f(CWlg\fP 10
  675. \f(CWlf\fP 20
  676. \f(CWll\fP 6
  677. \f(CWls\fP 5
  678. \f(CWlt\fP 14
  679. \f(CWmc\fP 20
  680. \f(CWmk\fP 3
  681. \f(CWna\fP 4
  682. \f(CWne\fP 3
  683. \f(CWnf\fP 4
  684. \f(CWnh\fP 13
  685. \f(CWnm\fP 15
  686. \f(CWnn\fP 15
  687. \f(CWnr\fP 8
  688. \f(CWns\fP 5
  689. \f(CWnx\fP 19
  690. \f(CWos\fP 5
  691. \f(CWpc\fP 14
  692. \f(CWpi\fP 19
  693. \f(CWpl\fP 3
  694. \f(CWpm\fP 20
  695. \f(CWpn\fP 3
  696. \f(CWpo\fP 3
  697. \f(CWps\fP 2
  698. \f(CWrd\fP 18
  699. \f(CWrm\fP 7
  700. \f(CWrn\fP 7
  701. \f(CWrr\fP 8
  702. \f(CWrs\fP 5
  703. \f(CWrt\fP 3
  704. \f(CWso\fP 19
  705. \f(CWsp\fP 5
  706. \f(CWss\fP 2
  707. \f(CWsv\fP 5
  708. \f(CWsy\fP 19
  709. \f(CWta\fP 9
  710. \f(CWtc\fP 9
  711. \f(CWti\fP 6
  712. \f(CWtl\fP 14
  713. \f(CWtm\fP 20
  714. \f(CWtr\fP 10
  715. \f(CWuf\fP 10
  716. \f(CWul\fP 10
  717. \f(CWvs\fP 5
  718. \f(CWwh\fP 7
  719. .di
  720. .nr aa \n(dn/\n(zz
  721. .ne \\n(aau+10p
  722. .sp
  723. .SP 2
  724. .TL
  725. Alphabetical Request and Section Number Cross Reference
  726. .SP .5
  727. .LP
  728. .sp .5
  729. .nf
  730. .wh \n(nlu+\n(aau cl
  731. .nr qq \n(nlu+\n(aau
  732. .ps
  733. .vs
  734. .mk
  735. .zz
  736. .rt
  737. .sp \n(.tu
  738. .ch cl 12i
  739. .sp 100
  740. .BP
  741. .TL
  742. Escape Sequences for Characters, Indicators, and Functions
  743. .SP .5
  744. .LP
  745. .ps -1
  746. .vs -1
  747. .TS
  748. center;
  749. c2 l
  750. c2 l2 l
  751. n2 l2fCW l.
  752. .ft 4
  753. Section Escape
  754. Reference Sequence Meaning
  755. .ft
  756. .sp .5
  757. 10.1 \e\e \&\f(CW\e\fP prevents or delays the interpretation of \&\f(CW\e\fP
  758. 10.1 \ee Printable version of the current escape character.
  759. 2.1 \e' \' (acute accent); equivalent to \&\f(CW\e(aa\fP
  760. 2.1 \e` \` (grave accent); equivalent to \&\f(CW\e(ga\fP
  761. 2.1 \e\- \- Minus sign in the current font
  762. 7. \e\^. Period (dot) (see \&\f(CWde\fP)
  763. 11.1 \e\f2space\fP Unpaddable space-size space character
  764. 11.1 \e0 Digit width space
  765. 11.1 \e| 1/6 em narrow space character (zero width in \*(NR\^)
  766. 11.1 \e^ 1/12 em half-narrow space character (zero width in \*(NR\^)
  767. .tr &&
  768. 4.1 \e& Non-printing, zero width character
  769. .tr &.
  770. 10.6 \e! Transparent line indicator
  771. 10.8 \e" Beginning of comment; continues to end of line
  772. 13. \e% Default optional hyphenation character
  773. 2.1 \e(@xx@ Character named @xx@
  774. 7.1 \e*@x,~@\e*(@xx@ Interpolate string @x@ or @xx@
  775. 7.3 \e$@N@ Interpolate argument @1 <= N <= 9@
  776. 9.1 \ea Non-interpreted leader character
  777. 12.3 \eb'@abc...@' Bracket building function
  778. 4.2 \ec Connect to next input text
  779. 2.1 \eC'@xyz@' Character named @xyz@
  780. 11.1 \ed Downward 1/2 em vertical motion (1/2 line in \*(NR\^)
  781. 12.5 \eD'@c...@' Draw graphics function @c@ with parameters @. . .@; @c= cw l , cw c , cw e , cw a , cw "~"@
  782. 2.2 \ef@x,~@\ef(@xx,~@\ef@N@ Change to font named @x@ or @xx@, or position @N@
  783. 8. \eg@x,~@\eg(@xx@ Format of number register @x@ or @xx@
  784. 11.1 \eh'@N@' Local horizontal motion; move right @N@ (negative left)
  785. 2.3 \eH'@N@' Height of current font is @N@
  786. 11.3 \ek@x@ Mark horizontal input place in register @x@
  787. 12.4 \el'@Nc@' Horizontal line drawing function (optionally with @c@ )
  788. 12.4 \eL'@Nc@' Vertical line drawing function (optionally with @c@ )
  789. 8. \en@x,~@\en(@xx@ Contents of number register @x@ or @xx@
  790. 2.1 \eN'@N@' Character number @N@ on current font
  791. 12.1 \eo'@abc...@' Overstrike characters @a,~ b,~ c@, ...
  792. 4.1 \ep Break and spread output line
  793. 11.1 \er Reverse 1 em vertical motion (reverse line in \*(NR\^)
  794. 2.3 \es@N,~@\es@+- N@ Point-size change function; also @cw "\es(" nn@, @cw "\es" +- cw "(" nn@
  795. 2.2 \eS'@N@' Slant output @N@ degrees
  796. 9.1 \et Non-interpreted horizontal tab
  797. 11.1 \eu Reverse (up) 1/2 em vertical motion (1/2 line in \*(NR\^)
  798. 11.1 \ev'@N@' Local vertical motion; move down N (negative up)
  799. 11.2 \ew'@string@' Width of @string@
  800. 5.2 \ex'@N@' Extra line-space function (negative before, positive after)
  801. 10.7 \eX'@string@' Output @string@ as device control function
  802. 12.2 \ez@c@ Print @c@ with zero width (without spacing)
  803. 16. \e{ Begin conditional input
  804. 16. \e} End conditional input
  805. 10.8 \e@newline@ Concealed (ignored) newline
  806. - \e@Z@ @Z@, any character not listed above
  807. .TE
  808. .ps +1
  809. .vs +1
  810. .LP
  811. The escape sequences
  812. .CW \e\e ,
  813. .CW \e\^. ,
  814. .CW \e" ,
  815. .CW \e$ ,
  816. .CW \e* ,
  817. .CW \ea ,
  818. .CW \en ,
  819. .CW \et ,
  820. .CW \eg ,
  821. and
  822. .CW \e@newline@
  823. are interpreted in copy mode (§7.2).
  824. .SP .5i
  825. \0
  826. .sp 100
  827. .BP
  828. .TL
  829. Predefined Number Registers
  830. .LP
  831. .ps -1
  832. .vs -1
  833. .TS
  834. c2l
  835. c2 l2 l
  836. n2 l2fCW l.
  837. .ft 4
  838. Section Register
  839. Reference Name Description
  840. .ft
  841. .sp .5
  842. 3. % Current page number.
  843. 11.2 ct Character type (set by \&\f(CW\ew\fP function).
  844. 7.4 dl Width (maximum) of last completed diversion.
  845. 7.4 dn Height (vertical size) of last completed diversion.
  846. - dw Current day of the week (1-7).
  847. - dy Current day of the month (1-31).
  848. 15. ln Output line number.
  849. - mo Current month (1-12).
  850. 4.1 nl Vertical position of last printed text baseline.
  851. 11.2 sb Depth of string below baseline (generated by \&\f(CW\ew\fP function).
  852. 11.2 st Height of string above baseline (generated by \&\f(CW\ew\fP function).
  853. - yr Last two digits of current year.
  854. .TE
  855. .ps +1
  856. .vs +1
  857. .TL
  858. Predefined Read-Only Number Registers
  859. .LP
  860. .ps -1
  861. .vs -1
  862. .TS
  863. c2 l
  864. c2 l2 l
  865. n2 l2fCW l.
  866. .ft 4
  867. Section Register
  868. Reference Name Description
  869. .ft
  870. .sp .5
  871. 19. $$ Process id of \*(TR or \*(NR.
  872. 7.3 &$ Number of arguments available at the current macro level.
  873. 5.2 &a Post-line extra line-space most recently used in @cw "\ex'" N cw "'" @.
  874. - &A Set to 1 in \*(TR, if @cw -a@ option used; always 1 in \*(NR.
  875. 2.3 &b Emboldening level.
  876. 20. &c Number of lines read from current input file.
  877. 7.4 &d Current vertical place in current diversion; equal to @cw nl@, if no diversion.
  878. 2.2 &f Current font number.
  879. 20. &F Current input file name [sic].
  880. 4. &h Text baseline high-water mark on current page or diversion.
  881. 11.1 &H Available horizontal resolution in basic units.
  882. 6. &i Current indent.
  883. 4.2 &j Current @cw ad@ mode.
  884. 4.1 &k Current output horizontal position.
  885. 6. &l Current line length.
  886. 5.1 &L Current @cw ls@ value.
  887. 4. &n Length of text portion on previous output line.
  888. 3. &o Current page offset.
  889. 3. &p Current page length.
  890. 7.5 .R Number of unused number registers.
  891. - &T Set to 1 in \*(NR, if \&\f(CW-T\fP option used; always 0 in \*(TR.
  892. 2.3 &s Current point size.
  893. 7.5 &t Distance to the next trap.
  894. 4.1 &u Equal to 1 in fill mode and 0 in nofill mode.
  895. 5.1 &v Current vertical line spacing.
  896. 11.1 &V Available vertical resolution in basic units.
  897. 11.2 &w Width of previous character.
  898. - &x Reserved version-dependent register.
  899. - &y Reserved version-dependent register.
  900. 7.4 &z Name [sic] of current diversion.
  901. .TE
  902. .ps +1
  903. .vs +1
  904. .sp 100
  905. .BP
  906. .TL
  907. Reference Manual
  908. .NH
  909. General Explanation
  910. .sc "Form of input.
  911. Input consists of \fItext lines\fR, which are destined to be printed,
  912. interspersed with \fIcontrol lines\fR,
  913. which set parameters or otherwise control subsequent processing.
  914. Control lines begin with a \fIcontrol character\fR\(em\
  915. normally \&\f(CW.\fR (period) or \&\f(CW'\fR (single quote)\(em\
  916. followed by a one or two character name that specifies
  917. a basic \fIrequest\fR or the substitution of
  918. a user-defined \fImacro\fR in place of the control line.
  919. The control character \&\f(CW'\fR suppresses the \fIbreak\fR function\(em\
  920. the forced output of a partially filled line\(em\
  921. caused by certain requests.
  922. The control character may be separated from the request/macro name by
  923. white space (spaces and/or tabs) for aesthetic reasons.
  924. Names should be followed by either
  925. space or newline.
  926. Control lines with unrecognized names are ignored.
  927. .PP
  928. Various special functions may be introduced anywhere in the input by
  929. means of an \fIescape\fR character, normally \&\f(CW\e\fR.
  930. For example, the function
  931. .CW \en@R@
  932. causes the interpolation of the contents of the
  933. \fInumber register R\fR
  934. in place of the function;
  935. here @R@ is either a single character name
  936. as in \&\f(CW\en\fIx\fR,
  937. or a two-character name introduced by
  938. a left-parenthesis, as in \&\f(CW\en(\fIxx\fR.
  939. .sc "Formatter and device resolution.
  940. \*(Tr internally stores and processes dimensions in units that correspond to
  941. the particular device for which output is being prepared;
  942. values from 300 to 1200/inch are typical.
  943. See §23.
  944. \*(Nr internally uses 240 units/inch,
  945. corresponding to the least common multiple of the
  946. horizontal and vertical resolutions of various
  947. typewriter-like output devices.
  948. \*(Tr rounds horizontal/vertical numerical parameter input to the actual
  949. horizontal/vertical resolution of the output device indicated by the \&\f(CW-T\fR option
  950. (default
  951. .CW post ).
  952. \*(Nr similarly rounds numerical input to the actual resolution
  953. of its output device
  954. (default Model 37 Teletype).
  955. .sc "Numerical parameter input.
  956. Both \*(NR and \*(TR
  957. accept numerical input with the appended scale
  958. indicators
  959. shown in the following table,
  960. where
  961. \fIS\fR is the current type size in points and
  962. \fIV\fR is the current vertical line spacing in
  963. basic units.
  964. .TS
  965. center box;
  966. c|c
  967. c|c
  968. c|l.
  969. Scale
  970. Indicator Meaning
  971. _
  972. \&\f(CWi\fR Inch
  973. \&\f(CWc\fR Centimeter
  974. \&\f(CWP\fR Pica = 1/6 inch
  975. \&\f(CWm\fR Em = \fIS\fR points
  976. \&\f(CWn\fR En = Em/2
  977. \&\f(CWp\fR Point = 1/72 inch
  978. \&\f(CWu\fR Basic unit
  979. \&\f(CWv\fR Vertical line space \fIV\fR
  980. none Default, see below
  981. .TE
  982. In \*(NR, both the em and the en are taken to be equal to the
  983. nominal character width,
  984. which is output-device dependent;
  985. common values are 1/10 and 1/12 inch.
  986. Actual character widths in \*(NR need not be all the same and constructed characters
  987. such as -> (→) are often extra wide.
  988. The default scaling is
  989. .CW m
  990. for the horizontally-oriented requests
  991. and functions
  992. .CW ll ,
  993. .CW in ,
  994. .CW ti ,
  995. .CW ta ,
  996. .CW lt ,
  997. .CW po ,
  998. .CW mc ,
  999. .CW \eh ,
  1000. .CW \el ,
  1001. and horizontal coordinates of
  1002. .CW \eD ;
  1003. .CW v
  1004. for the vertically-oriented requests and functions
  1005. .CW pl ,
  1006. .CW wh ,
  1007. .CW ch ,
  1008. .CW dt ,
  1009. .CW sp ,
  1010. .CW sv ,
  1011. .CW ne ,
  1012. .CW rt ,
  1013. .CW \ev ,
  1014. .CW \ex ,
  1015. .CW \eL ,
  1016. and vertical coordinates of
  1017. .CW \eD ;
  1018. .CW p
  1019. for the
  1020. .CW vs
  1021. request;
  1022. and
  1023. .CW u
  1024. for the requests
  1025. .CW nr ,
  1026. .CW if ,
  1027. and
  1028. .CW ie .
  1029. \fIAll\fR other requests ignore any scale indicators.
  1030. When a number register containing an already appropriately scaled number
  1031. is interpolated to provide numerical input,
  1032. the unit scale indicator
  1033. \&\f(CWu\fR may need to be appended to prevent
  1034. an additional inappropriate default scaling.
  1035. The number, @N@, may be specified in decimal-fraction form
  1036. but the parameter finally stored is rounded to an integer number of basic units.
  1037. Internal computations are performed in integer arithmetic.
  1038. .PP
  1039. The \fIabsolute position\fR indicator \&\f(CW|\fR may be prefixed
  1040. to a number @N@
  1041. to generate the distance to the vertical or horizontal place @N@.
  1042. For vertically-oriented requests and functions, \&\f(CW|\fP@N@
  1043. becomes the distance in basic units from the current vertical place on the page or in a \fIdiversion\fR (§7.4)
  1044. to the vertical place @N@.
  1045. For \fIall\fR other requests and functions,
  1046. \&\f(CW|\fP@N@
  1047. becomes the distance from
  1048. the current horizontal place on the \fIinput\fR line to the horizontal place @N@.
  1049. For example,
  1050. .P1
  1051. \&.sp |3.2c
  1052. .P2
  1053. will space in the required direction to 3.2 centimeters from the top of the page.
  1054. .sc "Numerical expressions.
  1055. .tr &&
  1056. Wherever numerical input is expected,
  1057. an expression involving parentheses,
  1058. the arithmetic operators \&\f(CW+\fR, \&\f(CW-\fR, \&\f(CW/\fR, \&\f(CW\(**\fR, \&\f(CW%\fR (mod),
  1059. and the logical operators
  1060. \&\f(CW<\fR,
  1061. \&\f(CW>\fR,
  1062. \&\f(CW<=\fR,
  1063. \&\f(CW>=\fR,
  1064. \&\f(CW=\fR (or \&\f(CW==\fR),
  1065. \&\f(CW&\fR\ (and),
  1066. \&\f(CW:\fR\ (or)
  1067. may be used.
  1068. Except where controlled by parentheses, evaluation of expressions is left-to-right;
  1069. there is no operator precedence.
  1070. In the case of certain requests, an initial \&\f(CW+\fR or \&\f(CW-\fR is stripped
  1071. and interpreted as an increment or decrement indicator respectively.
  1072. In the presence of default scaling, the desired scale indicator must be
  1073. attached to \fIevery\fR number in an expression
  1074. for which the desired and default scaling differ.
  1075. For example,
  1076. if the number register \&\f(CWx\fR contains 2
  1077. and the current point size is 10,
  1078. then
  1079. .P1
  1080. \&.ll (4.25i+\enxP+3)/2u
  1081. .P2
  1082. will set the line length to 1/2 the sum of 4.25 inches + 2 picas + 3 ems.
  1083. .sc "Notation.
  1084. Numerical parameters are indicated in this manual in two ways.
  1085. @+- N@ means that the argument may take the forms @N@, @+N@, or @-N@ and
  1086. that the corresponding effect is to set the parameter
  1087. to @N@, to increment it by @N@, or to decrement it by @N@ respectively.
  1088. Plain @N@ means that an initial algebraic sign is \fInot\fR
  1089. an increment indicator,
  1090. but merely the sign of @N@.
  1091. Generally, unreasonable numerical input is either ignored
  1092. or truncated to a reasonable value.
  1093. For example,
  1094. most requests expect to set parameters to non-negative
  1095. values;
  1096. exceptions are
  1097. .CW sp ,
  1098. .CW wh ,
  1099. .CW ch ,
  1100. .CW nr ,
  1101. and
  1102. .CW if .
  1103. The requests
  1104. .CW ps ,
  1105. .CW ft ,
  1106. .CW po ,
  1107. .CW vs ,
  1108. .CW ls ,
  1109. .CW ll ,
  1110. .CW in ,
  1111. and
  1112. .CW lt
  1113. restore the previous parameter value in the absence
  1114. of an argument.
  1115. .PP
  1116. Single character arguments are indicated by single lower case letters
  1117. and
  1118. one/two character arguments are indicated by a pair of lower case letters.
  1119. Character string arguments are indicated by multi-character mnemonics.
  1120. .NH
  1121. Font and Character Size Control
  1122. .sc "Character set.
  1123. The \*(TR character set is defined by a description file specific to each output device (§23).
  1124. There are normally several regular fonts and one or more special fonts.
  1125. Characters are input as themselves,
  1126. as @cw "\e(" xx@, as @cw "\eC'" name cw "'"@,
  1127. or as
  1128. .CW \eN'@n@' .
  1129. The form
  1130. .CW \eC'@name@'
  1131. permits a name of any length;
  1132. the form
  1133. .CW \eN'@n@'
  1134. refers to the @n@-th character on the current font,
  1135. whether named or not.
  1136. .PP
  1137. Normally the input characters
  1138. .CW ` ,
  1139. .CW ' ,
  1140. and
  1141. .CW -
  1142. are printed as `, ', and - respectively;
  1143. .CW \e` ,
  1144. .CW \e' ,
  1145. and
  1146. .CW \e-
  1147. produce \`, \', and \-.
  1148. If the character does not exist in the font, \*(TR assumes the width is 1 em and
  1149. outputs the character with a
  1150. .CW C
  1151. name as defined in Section 22.
  1152. (This is independent of how the device handles characters unknown to it.)
  1153. .PP
  1154. \*(Nr has an analogous, but different, mechanism for defining legal characters
  1155. and how to print them.
  1156. By default all characters are valid.
  1157. There are such
  1158. additional characters as may be available on
  1159. the output device,
  1160. such characters as may be constructed
  1161. by overstriking or other combination,
  1162. and those that can reasonably be mapped
  1163. into other printable characters.
  1164. The exact behavior is determined by a driving
  1165. table prepared for each device.
  1166. .sc "Fonts.
  1167. \*(Tr
  1168. begins execution by reading information for a set of defaults fonts,
  1169. said to be
  1170. .I mounted ;
  1171. conventionally, the first four are
  1172. Times Roman (\&\f(CWR\fR),
  1173. Times Italic
  1174. (\&\f(CWI\fR),
  1175. Times Bold
  1176. (\&\f(CWB\fR),
  1177. and
  1178. Times Bold Italic
  1179. (\&\f(CWBI\fR) ,
  1180. and the last is a Special font
  1181. .CW S ) (
  1182. containing miscellaneous characters.
  1183. (This document uses Lucida Sans in place of Times.)
  1184. The set of fonts and positions is determined by the device description file,
  1185. described in §23.
  1186. .PP
  1187. The current font, initially Roman, may be changed
  1188. by the \&\f(CWft\fR request,
  1189. or by embedding at any desired point
  1190. \&\f(CW\ef\fIx\fR, \&\f(CW\ef(\fIxx\fR, or \&\f(CW\ef\fP@N@,
  1191. where
  1192. \fIx\fR and \fIxx\fR are the name of a font
  1193. and @N@ is a numerical font position.
  1194. .PP
  1195. It is not necessary to change to the Special font;
  1196. characters on that font are automatically handled
  1197. as if they were physically part of the current font.
  1198. The Special font may actually be several fonts;
  1199. the name
  1200. .CW S
  1201. is reserved and is generally used for one of these.
  1202. All special fonts must be mounted after regular fonts.
  1203. .PP
  1204. \*(Tr can be informed that any particular font is mounted
  1205. by use of the \&\f(CWfp\fR request.
  1206. The list of known fonts is installation dependent.
  1207. In the subsequent discussion of font-related requests,
  1208. @F@ represents either a one/two-character
  1209. font name or the numerical font position.
  1210. The current font is available (as a numerical position) in the read-only number register \&\f(CW.f\fR.
  1211. .PP
  1212. A request for a named but not-mounted font is honored
  1213. if the font description information exists.
  1214. In this way, there is no limit on the number of fonts that may be printed
  1215. in any part of a document.
  1216. Mounted fonts may be handled more efficiently,
  1217. and they may be referred to by their mount positions,
  1218. but there is no other difference.
  1219. Mention of an unmounted font loads it temporarily at font position
  1220. zero, which serves as a one-font cache.
  1221. .PP
  1222. The function
  1223. .CW \eS'@+- N@'
  1224. causes the current font to be slanted by
  1225. @+- N@
  1226. degrees.
  1227. Not all devices support slanting.
  1228. .PP
  1229. \*(Nr understands font control
  1230. and normally underlines italic characters (see §10.5).
  1231. .sc "Character size.
  1232. Character point sizes available depend on the specific output device;
  1233. a typical (historical) set of values is
  1234. 6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 28, and 36.
  1235. This is a range of 1/12 inch to 1/2 inch.
  1236. The \&\f(CWps\fR request is used to change or restore the point size.
  1237. Alternatively the point size may be changed between any two characters
  1238. by embedding a
  1239. .CW \es@N@
  1240. at the desired point
  1241. to set the size to @N@,
  1242. or a
  1243. .CW "\&\f(CW\es@+- N@
  1244. (@1 <= N <= 9@)
  1245. to increment/decrement the size by @N@;
  1246. .CW \es0
  1247. restores the previous size.
  1248. Requested point size values that are between two valid
  1249. sizes yield the larger of the two.
  1250. .PP
  1251. Note that through an accident of history, a construction like
  1252. .CW \es39
  1253. is parsed as size 39, and thus converted to size 36 (given the sizes above),
  1254. while
  1255. .CW \es40
  1256. is parsed as size 4 followed by
  1257. .CW 0 .
  1258. The forms
  1259. @cw "\es(" nn@ and @cw "\es" +- cw "(" nn@
  1260. permit specification of sizes that would otherwise be ambiguous.
  1261. .PP
  1262. The current size is available in the \&\f(CW.s\fR register.
  1263. \*(Nr ignores type size requests.
  1264. .PP
  1265. The function
  1266. .CW "\eH'@+- N@'
  1267. sets \H'+2'the height of the current font\H'0' to
  1268. @N@, or increments it by @+N@, or decrements it by @-N@;
  1269. if @N=0@, the height is restored to the current point size.
  1270. In each case, the width is unchanged.
  1271. Not all devices support independent height and width for characters.
  1272. .FS
  1273. *The fields have the same meaning as described earlier in the Request Summary.
  1274. .FE
  1275. .SP .5
  1276. .LP
  1277. .ne 2.1
  1278. .ta 1.5i 2.5i 3.5i 4.5i
  1279. \f2Request\fR \f2Initial\fR \f2If\ No\fR
  1280. .br
  1281. \f2Form\fR \f2Value\fR \f2Argument\fR \f2Notes\fR
  1282. .bt "\&\f(CW.ps\fI \(+-N\fR*" "10\|point" "previous" "E" "Point size
  1283. set to @+- N@.
  1284. Alternatively, embed
  1285. .CW \es@N@
  1286. or
  1287. .CW "\&\f(CW\es@+- N@" .
  1288. Any positive size value may be requested;
  1289. if invalid, the next larger valid size will result, with a
  1290. maximum of 36.
  1291. A paired sequence
  1292. @+N@, @-N@
  1293. will work because the previous requested value is also remembered.
  1294. Ignored in \*(NR.
  1295. .bt "\&\f(CW.ss\fI N\fR" "12/36\|em" "ignored" "E" "Space-character size
  1296. (i.e., inter-word gap)
  1297. is set to @N@/36 ems.
  1298. This size is the minimum word spacing in adjusted text.
  1299. Ignored in \*(NR.
  1300. .bt "\&\f(CW.cs\fI\|F\|N\|M\fR" "off" "-" "P" "Constant character space
  1301. (width) mode is
  1302. set on for font @F@ (if mounted); the width of every character will be
  1303. taken to be @N@/36 ems.
  1304. If @M@ is absent,
  1305. the em is that of the character's point size;
  1306. if @M@ is given,
  1307. the em is @M@ points.
  1308. All affected characters
  1309. are centered in this space, including those with an actual width
  1310. larger than this space.
  1311. Special Font characters occurring while the current font
  1312. is @F@ are also so treated.
  1313. If @N@ is absent, the mode is turned off.
  1314. The mode must be in effect when the characters are physically printed.
  1315. Ignored in \*(NR.
  1316. .bt "\&\f(CW.bd\fI F N\fR" "off" "-" "P" "The characters in font @F@ will be artificially
  1317. emboldened by printing each one twice, separated by @N-1@ basic units.
  1318. A reasonable value for @N@ is 3 when the character size is near 10 points.
  1319. If @N@ is missing the embolden mode is turned off.
  1320. The emboldening value @N@ is in the \&\f(CW.b\fP register.
  1321. .IP
  1322. .bd R 3
  1323. This paragraph is printed with \&\f(CW.bd R 3\fR.
  1324. The mode must be in effect when the characters are physically printed.
  1325. Ignored in \*(NR.
  1326. .br
  1327. .bd R
  1328. .bt "\&\f(CW.bd S \fIF N\fR" "off" "-" "P" "The characters in the Special font
  1329. will be emboldened whenever the current font is @F@.
  1330. The mode must be in effect when the characters are physically printed.
  1331. Ignored in \*(NR.
  1332. .bt "\&\f(CW.ft\fP @F@" "Roman" "previous" "E" "Font changed to
  1333. @F@.
  1334. Alternatively, embed
  1335. .CW \ef@F@ .
  1336. The font name \&\f(CWP\fR is reserved to mean the previous font,
  1337. and the name
  1338. .CW S
  1339. for the special font.
  1340. .bt "\&\f(CW.fp \fIN F L\fR" "R,I,B,...,S" "ignored" "-" "Font position.
  1341. This is a statement
  1342. that a font named @F@ is associated with position @N@.
  1343. It is a fatal error if @F@ is not known.
  1344. For fonts with names longer than two characters,
  1345. .I L
  1346. refers to the long name,
  1347. and
  1348. .I F
  1349. becomes a synonym.
  1350. There is generally a limit of about 10 mounted fonts.
  1351. .NH
  1352. Page control
  1353. .PP
  1354. Top and bottom margins are not automatically provided;
  1355. it is conventional to define two \fImacros\fR and to set \fItraps\fR
  1356. for them at vertical positions 0 (top) and @-N@ (distance @N@ up from the bottom).
  1357. See §7 and Tutorial Examples §T2.
  1358. A pseudo-page transition onto the first page occurs
  1359. either when the first \fIbreak\fR occurs or
  1360. when the first \fInon-diverted\fR text processing occurs.
  1361. Arrangements
  1362. for a trap to occur at the top of the first page
  1363. must be completed before this transition.
  1364. In the following, references to the \fIcurrent diversion\fR (§7.4)
  1365. mean that the mechanism being described works during both
  1366. ordinary and diverted output (the former considered as the top diversion level).
  1367. .PP
  1368. The limitations on \*(TR and \*(NR output dimensions
  1369. are device dependent.
  1370. .bt "\&\f(CW.pl\fI \(+-N\fR" "11\|in" "11\|in" "\fBv\fR" "Page length set to @+- N@.
  1371. The current page length is available in the \&\f(CW.p\fR register.
  1372. .bt "\&\f(CW.bp\fI \(+-N\fR" "\fIN\(eq\fR1" "-" "B,\fBv\fR" "Begin page.
  1373. The current page is ejected and a new page is begun.
  1374. If @+- N@ is given, the new page number will be @+- N@.
  1375. Also see request \&\f(CWns\fR.
  1376. .bt "\&\f(CW.pn\fI \(+-N\fR" "@N@\(eq1" "ignored" "-" "Page number.
  1377. The next page (when it occurs) will have the page number @+- N@.
  1378. A \&\f(CWpn\fR must occur before the initial pseudo-page transition
  1379. to affect the page number of the first page.
  1380. The current page number is in the \&\f(CW%\fR register.
  1381. .bt "\&\f(CW.po\fI \(+-N\fR" "1\|in; 0" "previous" "\fBv\fR" "Page offset.
  1382. The current \fIleft margin\fR is set to @+- N@.
  1383. The \*(TR initial value provides 1 inch of paper margin
  1384. on a typical device.
  1385. The current page offset is available in the \&\f(CW.o\fR register.
  1386. .bt "\&\f(CW.ne\fI N\fR" "-" "\fIN\(eq\fR1\|\fIV\fR" "D,\fBv\fR" "Need @N@ vertical space.
  1387. If the distance \fID\fR to the next trap position (see §7.5) is less than @N@,
  1388. a forward vertical space of size \fID\fR occurs,
  1389. which will spring the trap.
  1390. If there are no remaining
  1391. traps on the page,
  1392. \fID\fR is the distance to the bottom of the page.
  1393. If @D<V@, another line could still be output
  1394. and spring the trap.
  1395. In a diversion, \fID\fR is the distance to the \fIdiversion trap\fR, if any,
  1396. or is very large.
  1397. .bt "\&\f(CW.mk\fI R\fR" "none" "internal" "D" "Mark the current vertical place
  1398. in an internal register (both associated with the current diversion level),
  1399. or in register @R@, if given.
  1400. See \&\f(CWrt\fR request.
  1401. .bt "\&\f(CW.rt\fI \(+-N\fR" "none" "internal" "D,\fBv\fR" "Return \fIupward only\fR to a marked vertical place
  1402. in the current diversion.
  1403. If @+- N@ (with respect to current place) is given,
  1404. the place is @+- N@ from the top of the page or diversion
  1405. or, if @N@ is absent, to a
  1406. place marked by a previous \&\f(CWmk\fR.
  1407. The \&\f(CWsp\fR request (§5.3) may be used
  1408. instead of \&\f(CWrt\fR
  1409. by spacing to the absolute place stored in a explicit register,
  1410. e.g., using
  1411. .CW ".mk
  1412. @R@ ...\&
  1413. .CW ".sp
  1414. .CW |\en@R@u ;
  1415. this also works when the motion is downwards.
  1416. .NH
  1417. Text Filling, Adjusting, and Centering
  1418. .sc "Filling and adjusting.
  1419. Normally,
  1420. words are collected from input text lines
  1421. and assembled into a output text line
  1422. until some word does not fit.
  1423. An attempt is then made
  1424. to hyphenate the word to put part
  1425. of it into the output line.
  1426. The spaces between the words on the output line
  1427. are then increased to spread out the line
  1428. to the current \fIline length\fR
  1429. minus any current \fIindent\fR.
  1430. A \fIword\fR is any string of characters delimited by
  1431. the \fIspace\fR character or the beginning/end of the input line.
  1432. Any adjacent pair of words that must be kept together
  1433. (neither split across output lines nor spread apart
  1434. in the adjustment process)
  1435. can be tied together by separating them with the
  1436. \fIunpaddable space\fR character
  1437. ``\&\f(CW\e\ \fR'' (backslash-space).
  1438. The adjusted word spacings are uniform in \*(TR
  1439. and the minimum interword spacing can be controlled
  1440. with the \&\f(CWss\fR request (§2).
  1441. In \*(NR, they are normally nonuniform because of
  1442. quantization to character-size spaces;
  1443. however,
  1444. the command line option \&\f(CW-e\fR causes uniform
  1445. spacing with full output device resolution.
  1446. Filling, adjustment, and hyphenation (§13) can all be
  1447. prevented or controlled.
  1448. The text length on the last line output is available in the \&\f(CW.n\fR register,
  1449. and text baseline position on the page for this line is in the \&\f(CWnl\fR register.
  1450. The text baseline high-water mark (lowest place) on the current page is in
  1451. the \&\f(CW.h\fR register.
  1452. The current horizontal output position is in the \&\f(CW.k\fP register.
  1453. .PP
  1454. An input text line
  1455. .I ending
  1456. with \&\f(CW.\fR\^, \&\f(CW?\fR, or \&\f(CW!\fR,
  1457. optionally followed by any number of
  1458. .CW \&" ,
  1459. .CW ' ,
  1460. .CW ) ,
  1461. .CW ] ,
  1462. .CW * ,
  1463. or
  1464. †,
  1465. is taken
  1466. to be the end of a sentence, and an additional space character is
  1467. automatically provided during filling.
  1468. To prevent this, add
  1469. .CW \e&
  1470. to the end of the input line.
  1471. Multiple inter-word space characters found in the input are retained,
  1472. except for trailing spaces;
  1473. initial spaces also cause a break.
  1474. .PP
  1475. When filling is in effect, a \&\f(CW\ep\fR may be embedded or attached to a word to
  1476. cause a break at the end of the word and have the resulting output
  1477. line spread out to fill the current line length.
  1478. .PP
  1479. .tr &&
  1480. A text input line that happens to begin
  1481. with a control character can
  1482. be made not to look like a control line
  1483. by prefixing it with
  1484. the non-printing, zero-width filler character \&\f(CW\e&\fR.
  1485. Still another way is to specify output translation of some
  1486. convenient character into the control character
  1487. using \&\f(CWtr\fR (§10.5).
  1488. .tr &.
  1489. .sc "Interrupted text.
  1490. The copying of a input line in \fInofill\f (non-fill) mode can be interrupted
  1491. by terminating
  1492. the partial line with a \&\f(CW\ec\fR.
  1493. The next encountered input text line will be considered to be a continuation
  1494. of the same line of input text.
  1495. Similarly,
  1496. a word within \fIfilled\fR text may be interrupted by terminating the
  1497. word (and line) with \&\f(CW\ec\fR;
  1498. the next encountered text will be taken as a continuation of the
  1499. interrupted word.
  1500. If the intervening control lines cause a break,
  1501. any partial line will be forced out along with any partial word.
  1502. .bt "\&\f(CW.br\fR" "-" "-" "B" "Break.
  1503. The filling of the line currently
  1504. being collected is stopped and
  1505. the line is output without adjustment.
  1506. Text lines beginning with space characters
  1507. (but not tabs)
  1508. and empty text lines (blank lines) also cause a break.
  1509. .bt "\&\f(CW.fi\fR" "fill on" - B,E "Fill subsequent output lines.
  1510. The register \&\f(CW.u\fR is 1 in fill mode and 0 in nofill mode.
  1511. .bt "\&\f(CW.nf\fR" "fill on" "-" "B,E" "Nofill.
  1512. Subsequent output lines are neither filled nor adjusted.
  1513. Input text lines are copied directly to output lines
  1514. without regard for the current line length.
  1515. .bt "\&\f(CW.ad\fI c\fR" "adj, both" "adjust" "E" "Line adjustment is begun.
  1516. If fill mode is not on, adjustment will be deferred until
  1517. fill mode is back on.
  1518. If the type indicator @c@ is present,
  1519. the adjustment type is changed as shown in the following table.
  1520. .TS
  1521. center box;
  1522. c|c
  1523. c|l.
  1524. Indicator Adjust Type
  1525. _
  1526. \&\f(CWl\fR adjust left margin only
  1527. \&\f(CWr\fR adjust right margin only
  1528. \&\f(CWc\fR center
  1529. \&\f(CWb\fR or \&\f(CWn\fR adjust both margins
  1530. absent unchanged
  1531. .TE
  1532. The number register
  1533. .CW .j
  1534. contains the current value of the
  1535. .CW ad
  1536. setting;
  1537. its value can be recorded and used subsequently to set adjustment.
  1538. .bt "\&\f(CW.na\fR" "adjust" "-" "E" "Noadjust.
  1539. Adjustment is turned off;
  1540. the right margin will be ragged.
  1541. The adjustment type for \&\f(CWad\fR is not changed.
  1542. Output line filling still occurs if fill mode is on.
  1543. .bt "\&\f(CW.ce\fI N\fR" "off" "@N=1@" "B,E" "Center the next @N@ input text lines
  1544. within the current available horizontal space (line-length minus indent).
  1545. If @N=0@, any residual count is cleared.
  1546. A break occurs after each of the @N@ input lines.
  1547. If the input line is too long,
  1548. it will be left adjusted.
  1549. .NH
  1550. Vertical Spacing
  1551. .sc "Baseline spacing.
  1552. The vertical spacing @(V)@ between the baselines of successive
  1553. output lines can be set
  1554. using the \&\f(CWvs\fR request.
  1555. \fIV\fR should be large enough to accommodate the character sizes
  1556. on the affected output lines.
  1557. For the common type sizes (9-12 points),
  1558. usual typesetting practice is to set \fIV\fR to 2 points greater than the
  1559. point size;
  1560. \*(TR default is 10-point type on a 12-point spacing
  1561. (as in this document).
  1562. The current \fIV\fR is available in the \&\f(CW.v\fR register.
  1563. Multiple-\fIV\|\fR line separation (e.g., double spacing) may be requested
  1564. with \&\f(CWls\fR,
  1565. but it is better to use a large
  1566. .CW vs
  1567. instead;
  1568. certain preprocessors assume single spacing.
  1569. The current line spacing is available in the \&\f(CW.L\fP register.
  1570. .sc "Extra line-space.
  1571. If a word contains a tall construct requiring
  1572. the output line containing it to have extra vertical space
  1573. before and/or after it,
  1574. the \fIextra-line-space\fR function \&\f(CW\ex'\fIN\fP'\fR
  1575. can be embedded in or attached to that word.
  1576. If @N@ is negative,
  1577. the output line containing the word will
  1578. be preceded by @N@ extra vertical space;
  1579. if @N@ is positive,
  1580. the output line containing the word
  1581. will be followed by @N@ extra vertical space.
  1582. If successive requests for extra space apply to the same line,
  1583. the maximum values are used.
  1584. The most recently utilized post-line extra line-space is available in the \&\f(CW.a\fR register.
  1585. .PP
  1586. In
  1587. .CW \ex'\f2...\fP'
  1588. and other functions having a pair of delimiters around
  1589. their parameter,
  1590. the delimiter choice (here
  1591. .CW ' )
  1592. is arbitrary,
  1593. except that it can not look like the continuation of a number expression for @N@.
  1594. .sc "Blocks of vertical space.
  1595. A block of vertical space is ordinarily requested using \&\f(CWsp\fR,
  1596. which honors the \fIno-space\fR mode and which does
  1597. not space past a trap.
  1598. A contiguous block of vertical space may be reserved using \&\f(CWsv\fR.
  1599. .bt "\&\f(CW.vs \fIN\fR" "12pts; 1/6in" "previous" "E,\fBp\fR" "Set vertical baseline spacing size \fIV\fR.
  1600. Transient extra vertical space is available with \&\f(CW\ex\fI'N\|'\fR (see above).
  1601. .bt "\&\f(CW.ls \fIN\fR" "@N=1@" "previous" "E" "\fILine\fR spacing
  1602. set to @+- N@.
  1603. @N-1@ \fIV\fR\^s (blank lines) are
  1604. appended to each output text line.
  1605. Appended blank lines are omitted, if the text or previous appended blank line reached a trap position.
  1606. .bt "\&\f(CW.sp \fIN\fR" "-" "@N=1~V@" "B,\fBv\fR" "Space vertically in either direction.
  1607. If @N@ is negative, the motion is backward (upward)
  1608. and is limited to the distance to the top of the page.
  1609. Forward (downward) motion is truncated to the distance to the
  1610. nearest trap.
  1611. (Recall the use of
  1612. .CW ".sp |\f2N\fP
  1613. from §1.3.)
  1614. If the no-space mode is on,
  1615. no spacing occurs (see \&\f(CWns\fR and \&\f(CWrs\fR below).
  1616. .bt "\&\f(CW.sv\fI N\fR" "-" "@N=1~V@" "\fBv\fR" "Save a contiguous vertical block of size @N@.
  1617. If the distance to the next trap is greater
  1618. than @N@, @N@ vertical space is output.
  1619. No-space mode has no effect.
  1620. If this distance is less than @N@,
  1621. no vertical space is immediately output,
  1622. but @N@ is remembered for later output (see \&\f(CWos\fR).
  1623. Subsequent \&\f(CWsv\fR requests will overwrite any still remembered @N@.
  1624. .bt "\&\f(CW.os\fR" "-" "-" "-" "Output saved vertical space.
  1625. No-space mode has no effect.
  1626. Used to finally output a block of vertical space requested
  1627. by an earlier \&\f(CWsv\fR request.
  1628. .bt "\&\f(CW.ns\fR" "space" "-" "D" "No-space mode turned on.
  1629. When on, no-space mode inhibits \&\f(CWsp\fR requests and
  1630. \&\f(CWbp\fR requests \fIwithout\fR a next page number.
  1631. No-space mode is turned off when a line of
  1632. output occurs, or with \&\f(CWrs\fR.
  1633. .bt "\&\f(CW.rs\fR" "space" "-" "D" "Restore spacing.
  1634. The no-space mode is turned off.
  1635. .bt "\&Blank text line." "" "-" "B" "Causes a break and
  1636. output of a blank line exactly like \&\f(CWsp 1\fR.
  1637. .NH
  1638. Line Length and Indenting
  1639. .PP
  1640. The maximum line length for fill mode may be set with \&\f(CWll\fR.
  1641. The indent may be set with \&\f(CWin\fR;
  1642. an indent applicable to only the next output line may be set with \&\f(CWti\fR.
  1643. The line length includes indent space but not
  1644. page offset space.
  1645. The line length minus the indent is the basis for centering with \&\f(CWce\fR.
  1646. The effect of \&\f(CWll\fR, \&\f(CWin\fR, or \&\f(CWti\fR
  1647. is delayed, if a partially collected line exists,
  1648. until after that line is output.
  1649. In fill mode the length of text on an output line is less than or equal to
  1650. the line length minus the indent.
  1651. The current line length and indent are available in registers \&\f(CW.l\fR and \&\f(CW.i\fR respectively.
  1652. The length of \fIthree-part titles\fR produced by \&\f(CWtl\fR
  1653. (see §14) is independently set by \&\f(CWlt\fR.
  1654. .bt "\&\f(CW.ll\fI \(+-N\fR" "6.5\|in" "previous" "E,\fBm\fR" "Line length is set to \(+-@N@.
  1655. .bt "\&\f(CW.in\fI \(+-N\fR" "\fIN\(eq\^\fR0" "previous" "B,E,\fBm\fR" "Indent is set to @+- N@.
  1656. The indent is prefixed to each output line.
  1657. .bt "\&\f(CW.ti\fI \(+-N\fR" "-" "ignored" "B,E,\fBm\fR" "Temporary indent.
  1658. The next output text line will be indented a distance @+- N@
  1659. with respect to the current indent.
  1660. The resulting total indent may not be negative.
  1661. The current indent is not changed.
  1662. .NH
  1663. Macros, Strings, Diversion, and Position Traps
  1664. .sc "Macros and strings.
  1665. A \fImacro\fR is a named set of arbitrary \fIlines\fR that may be invoked by name or
  1666. with a \fItrap\fR.
  1667. A \fIstring\fR is a named string of \fIcharacters\fR,
  1668. not including a newline character,
  1669. that may be interpolated by name at any point.
  1670. Request, macro, and string names share the same name list.
  1671. Macro and string names
  1672. may be one or two characters long and may usurp previously defined
  1673. request, macro, or string names;
  1674. this implies that built-in operations may be (irrevocably) redefined.
  1675. Any of these entities may be renamed with \&\f(CWrn\fR
  1676. or removed with \&\f(CWrm\fR.
  1677. .PP
  1678. Macros are created by \&\f(CWde\fR and \&\f(CWdi\fR, and appended to by \&\f(CWam\fR and \&\f(CWda\fR;
  1679. \&\f(CWdi\fR and \&\f(CWda\fR cause normal output to be stored in a macro.
  1680. A macro is invoked in the same way as a request;
  1681. a control line beginning \&\f(CW.\fIxx\fR will interpolate the contents of macro \fIxx\fR.
  1682. The remainder of the line may contain up to nine \fIarguments\fR.
  1683. .PP
  1684. Strings are created by \&\f(CWds\fR and appended to by \&\f(CWas\fR.
  1685. The strings \fIx\fR and \fIxx\fR are interpolated at any desired point with
  1686. \&\f(CW\e\(**\fIx\fR and \&\f(CW\e\(**(\fIxx\fR respectively.
  1687. String references and macro invocations may be nested.
  1688. .sc "Copy mode input interpretation.
  1689. During the definition and extension
  1690. of strings and macros (not by diversion)
  1691. the input is read in \fIcopy mode\fR.
  1692. In copy mode, input is copied without interpretation
  1693. except that:
  1694. .IP
  1695. .ds + \v'-.1m'\s-4\(bu\s+4\v'+.1m'
  1696. .nf
  1697. \*+ The contents of number registers indicated by \&\f(CW\en\fR are interpolated.
  1698. \*+ Strings indicated by \&\f(CW\e\(**\fR are interpolated.
  1699. \*+ Arguments indicated by \&\f(CW\e$\fR are interpolated.
  1700. \*+ Concealed newlines indicated by \&\f(CW\e\fP\f2newline\fP are eliminated.
  1701. \*+ Comments indicated by \&\f(CW\e"\fR are eliminated.
  1702. \*+ \&\f(CW\et\fR and \&\f(CW\ea\fR are interpreted as \s-1ASCII\s+1 horizontal tab and \s-1SOH\s+1 respectively (§9).
  1703. \*+ \&\f(CW\e\e\fR is interpreted as \&\f(CW\e\fR.
  1704. \*+ \&\f(CW\e.\fR is interpreted as ``\&\f(CW.\fR''.
  1705. .LP
  1706. These interpretations can be suppressed by
  1707. prefixing
  1708. a \&\f(CW\e\fR.
  1709. For example, since \&\f(CW\e\e\fR maps into a \&\f(CW\e\fR, \&\f(CW\e\en\fR will copy as \&\f(CW\en\fR, which
  1710. will be interpreted as a number register indicator when the
  1711. macro or string is reread.
  1712. .sc "Arguments.
  1713. When a macro is invoked by name, the remainder of the line is
  1714. taken to contain up to nine arguments.
  1715. The argument separator is the space character (not tab), and arguments
  1716. may be surrounded by double quotes to permit embedded space characters.
  1717. Pairs of double quotes may be embedded in double-quoted arguments to
  1718. represent a single double-quote character.
  1719. The argument
  1720. .CW \&""
  1721. is explicitly null.
  1722. If the desired arguments won't fit on a line,
  1723. a concealed newline may be used to continue on the next line.
  1724. A trailing double quote may be omitted.
  1725. .PP
  1726. When a macro is invoked the \fIinput level\fR is \fIpushed down\fR and
  1727. any arguments available at the previous level become unavailable
  1728. until the macro is completely read and the previous level is restored.
  1729. A macro's own arguments can be interpolated at any point
  1730. within the macro with
  1731. .CW \e$@N@ ,
  1732. which interpolates the @N@\^th
  1733. argument
  1734. (@1 <= N <= 9@).
  1735. If an invoked argument does not exist,
  1736. a null string results.
  1737. For example, the macro \fIxx\fR may be defined by
  1738. .P1
  1739. .ta .75i
  1740. &de xx \e" begin definition
  1741. Today is \e\e$1 the \e\e$2.
  1742. &. \e" end definition
  1743. .P2
  1744. and called by
  1745. .P1
  1746. &xx Monday 14th
  1747. .P2
  1748. to produce the text
  1749. .P1
  1750. Today is Monday the 14th.
  1751. .P2
  1752. Note that each \&\f(CW\e$\fR
  1753. was concealed in the definition with a prefixed \&\f(CW\e\fR.
  1754. The number of
  1755. arguments is in the \&\f(CW.$\fR register.
  1756. .PP
  1757. No arguments are available at the top (non-macro) level,
  1758. within a string, or within a trap-invoked macro.
  1759. .PP
  1760. Arguments are copied in copy mode onto a stack
  1761. where they are available for reference.
  1762. It is advisable to
  1763. conceal string references (with an extra \&\f(CW\e\fR\|)
  1764. to delay interpolation until argument reference time.
  1765. .sc "Diversions.
  1766. Processed output may be diverted into a macro for purposes
  1767. such as footnote processing (see Tutorial §T5)
  1768. or determining the horizontal and vertical size of some text for
  1769. conditional changing of pages or columns.
  1770. A single diversion trap may be set at a specified vertical position.
  1771. The number registers \&\f(CWdn\fR and \&\f(CWdl\fR respectively contain the
  1772. vertical and horizontal size of the most
  1773. recently ended diversion.
  1774. Processed text that is diverted into a macro
  1775. retains the vertical size of each of its lines when reread
  1776. in \fInofill\fR mode
  1777. regardless of the current \fIV\fR.
  1778. Constant-spaced (\&\f(CWcs\fR) or emboldened (\&\f(CWbd\fR) text that is diverted
  1779. can be reread correctly only if these modes are again or still in effect
  1780. at reread time.
  1781. One way to do this is to embed in the diversion the appropriate
  1782. \&\f(CWcs\fR or \&\f(CWbd\fR requests with the \fItransparent\fR
  1783. mechanism described in §10.6.
  1784. .PP
  1785. Diversions may be nested
  1786. and certain parameters and registers
  1787. are associated
  1788. with the current diversion level
  1789. (the top non-diversion level may be thought of as the
  1790. 0th diversion level).
  1791. These are the diversion trap and associated macro,
  1792. no-space mode,
  1793. the internally-saved marked place (see \&\f(CWmk\fR and \&\f(CWrt\fR),
  1794. the current vertical place (\&\f(CW.d\fR register),
  1795. the current high-water text baseline (\&\f(CW.h\fR register),
  1796. and the current diversion name (\&\f(CW.z\fR register).
  1797. .sc "Traps.
  1798. Three types of trap mechanisms are available\(empage traps, a diversion trap, and
  1799. an input-line-count trap.
  1800. Macro-invocation traps may be planted using \&\f(CWwh\fR at any page position including the top.
  1801. This trap position may be changed using \&\f(CWch\fR.
  1802. Trap positions at or below the bottom of the page
  1803. have no effect unless or until
  1804. moved to within the page or rendered effective by an increase in page length.
  1805. Two traps may be planted at the same position only by first planting them at different
  1806. positions and then moving one of the traps;
  1807. the first planted trap will conceal the second unless and until the first one is moved
  1808. (see Tutorial Examples).
  1809. If the first one is moved back, it again conceals the second trap.
  1810. The macro associated with a page trap is automatically
  1811. invoked when a line of text is output whose vertical size reaches
  1812. or sweeps past the trap position.
  1813. Reaching the bottom of a page springs the top-of-page trap, if any,
  1814. provided there is a next page.
  1815. The distance to the next trap position is available in the \&\f(CW.t\fR register;
  1816. if there are no traps between the current position and the bottom of the page,
  1817. the distance returned is the distance to the page bottom.
  1818. .PP
  1819. A macro-invocation trap effective in the current diversion may be planted using \&\f(CWdt\fR.
  1820. The \&\f(CW.t\fR register works in a diversion; if there is no subsequent trap a large
  1821. distance is returned.
  1822. For a description of input-line-count traps, see \&\f(CWit\fR below.
  1823. .bt "\&\f(CW&de\fI xx yy\fR" "-" "\fI.yy=\&\f(CW..\fR" "-" "Define or redefine the macro \fIxx\fR.
  1824. The contents of the macro begin on the next input line.
  1825. Input lines are copied in \fIcopy mode\fR until the definition is terminated by a
  1826. line beginning with \&\f(CW.\fIyy\fR,
  1827. whereupon the macro \fIyy\fR is called.
  1828. In the absence of \fIyy\fR, the definition
  1829. is terminated by a
  1830. line beginning with ``\&\f(CW..\fR''.
  1831. A macro may contain \&\f(CWde\fR requests
  1832. provided the terminating macros differ
  1833. or the contained definition terminator is concealed.
  1834. \&``\&\f(CW..\fR'' can be concealed as
  1835. \&\f(CW\e\e..\fR which will copy as \&\f(CW\e..\fR and be reread as ``\&\f(CW..\fR''.
  1836. .bt "\&\f(CW&am\fI xx yy\fR" "-" "\fI.yy=\&\f(CW..\fR" "-" "Append to macro
  1837. .I xx
  1838. (append version of \&\f(CWde\fR).
  1839. .bt "\&\f(CW&ds\fI xx string\fR" "-" "ignored" "-" "Define a string
  1840. \fIxx\fR containing \fIstring\fR.
  1841. Any initial double quote in \fIstring\fR is stripped off to permit
  1842. initial blanks.
  1843. .bt "\&\f(CW&as\fI xx string\fR" "-" "ignored" "-" "Append
  1844. \fIstring\fR to string \fIxx\fR
  1845. (append version of \&\f(CWds\fR).
  1846. .bt "\&\f(CW&rm\fI xx\fR" "-" "ignored" "-" "Remove
  1847. request, macro, or string.
  1848. The name \fIxx\fR is removed from the name list and
  1849. any related storage space is freed.
  1850. Subsequent references will have no effect.
  1851. If many macros and strings are being created dynamically, it
  1852. may become necessary to remove unused ones
  1853. to recapture internal storage space for newer registers.
  1854. .bt "\&\f(CW&rn\fI xx yy\fR" "-" "ignored" "-" "Rename request, macro, or string
  1855. \fIxx\fR to \fIyy\fR.
  1856. If \fIyy\fR exists, it is first removed.
  1857. .bt "\&\f(CW&di\fI xx\fR" "-" "end" "D" "Divert output to macro \fIxx\fR.
  1858. Normal text processing occurs during diversion
  1859. except that page offsetting is not done.
  1860. The diversion ends when the request \&\f(CWdi\fR or \&\f(CWda\fR is encountered without an argument;
  1861. extraneous
  1862. requests of this type should not appear when nested diversions are being used.
  1863. .bt "\&\f(CW&da \fIxx\fR" "-" "end" "D" "Divert, appending to macro \fIxx\fR
  1864. (append version of \&\f(CWdi\fR).
  1865. .bt "\&\f(CW&wh\fI N xx\fR" "-" "-" "\fBv\fR" "Install
  1866. a trap to invoke \fIxx\fR at page position \fIN\fR;
  1867. a negative N will be interpreted as a distance from the
  1868. page bottom.
  1869. Any macro previously planted at @N@ is replaced by \fIxx\fR.
  1870. A zero @N@ refers to the top of a page.
  1871. In the absence of \fIxx\fR, the first trap found at @N@, if any, is removed.
  1872. .bt "\&\f(CW&ch\fI xx N\fR" "-" "-" "\fBv\fR" "Change
  1873. the trap position for macro \fIxx\fR to be @N@.
  1874. In the absence of @N@, the trap, if any, is removed.
  1875. .bt "\&\f(CW&dt\fI N xx\fR" "-" "off" "D,\fBv\fR" "Install a diversion trap
  1876. at position @N@ in the \fIcurrent\fR diversion to invoke
  1877. macro \fIxx\fR.
  1878. Another \&\f(CWdt\fR will redefine the diversion trap.
  1879. If no arguments are given, the diversion trap is removed.
  1880. .bt "\&\f(CW&it\fI N xx\fR" "-" "off" "E" "Set an input-line-count trap
  1881. to invoke the macro \fIxx\fR after @N@ lines of \fItext\fR input
  1882. have been read
  1883. (control or request lines do not count).
  1884. The text may be inline text or
  1885. text interpolated by inline or trap-invoked macros.
  1886. .bt "\&\f(CW&em\fI xx\fR" "none" "none" "-" "The
  1887. macro \fIxx\fR will be invoked
  1888. when all input has ended.
  1889. The effect is almost as if the contents of \fIxx\fR had been at the end
  1890. of the last file processed,
  1891. but all processing ceases at the next page eject.
  1892. .NH
  1893. Number Registers
  1894. .PP
  1895. A variety of parameters are available to the user as
  1896. predefined \fInumber registers\fR (see Summary, page \n(*%).
  1897. In addition, users may define their own registers.
  1898. Register names are one or two characters long and do not conflict
  1899. with request, macro, or string names.
  1900. Except for certain predefined read-only registers,
  1901. a number register can be read, written, automatically
  1902. incremented or decremented, and interpolated
  1903. into the input in a variety of formats.
  1904. One common use of user-defined registers is to
  1905. automatically number sections, paragraphs, lines, etc.
  1906. A number register may be used any time numerical input is expected or desired
  1907. and may be used in numerical \fIexpressions\fR (§1.4).
  1908. .PP
  1909. Number registers are created and modified using \&\f(CWnr\fR, which
  1910. specifies the name, numerical value, and the auto-increment size.
  1911. Registers are also modified, if accessed
  1912. with an auto-incrementing sequence.
  1913. If the registers \fIx\fR and \fIxx\fR both contain
  1914. @N@ and have the auto-increment size @M@,
  1915. the following access sequences have the effect shown:
  1916. .TS
  1917. center box;
  1918. c2|c2|c
  1919. c2|c2|c2
  1920. l2|c2|c2
  1921. l2|c2|c2
  1922. l2|l2|c2.
  1923. Effect on Value
  1924. Sequence Register Interpolated
  1925. _
  1926. \&\f(CW\en\fIx\fR none @N@
  1927. \&\f(CW\en(\fIxx\fR none @N@
  1928. \&\f(CW\en+\fIx\fR \fIx\fR incremented by @M@ \fIN+M\fR
  1929. \&\f(CW\en-\fIx\fR \fIx\fR decremented by @M@ \fIN-M\fR
  1930. \&\f(CW\en+(\fIxx\fR \fIxx\fR incremented by @M@ \fIN+M\fR
  1931. \&\f(CW\en-(\fIxx\fR \fIxx\fR decremented by @M@ \fIN-M\fR
  1932. .TE
  1933. When interpolated, a number register is converted to
  1934. decimal (default),
  1935. decimal with leading zeros,
  1936. lower-case Roman,
  1937. upper-case Roman,
  1938. lower-case sequential alphabetic,
  1939. or
  1940. upper-case sequential alphabetic
  1941. according to the format specified by \&\f(CWaf\fR.
  1942. .bt "\&\f(CW&nr\fI R \(+-N M\fR" "" "-" "\fBu\fR" "The number register
  1943. @R@ is assigned the value @+- N@
  1944. with respect to the previous value, if any.
  1945. The increment for auto-incrementing is set to @M@.
  1946. .bt "\&\f(CW&af\fI R c\fR" "arabic" "-" "-" "Assign
  1947. format @c@ to register @R@.
  1948. The available formats are:
  1949. .Tm number register format s
  1950. .TS
  1951. center box;
  1952. c2|c
  1953. c2|c
  1954. c2|l.
  1955. Numbering
  1956. Format Sequence
  1957. _
  1958. \&\f(CW1\fR 0, 1, 2, 3, 4, 5, ...
  1959. \&\f(CW001\fR 000, 001, 002, 003, 004, 005, ...
  1960. \&\f(CWi\fR 0, i, ii, iii, iv, v, ...
  1961. \&\f(CWI\fR 0, I, II, III, IV, V, ...
  1962. \&\f(CWa\fR 0, a, b, c, ..., z, aa, ab, ..., zz, aaa, ...
  1963. \&\f(CWA\fR 0, A, B, C, ..., Z, AA, AB, ..., ZZ, AAA, ...
  1964. .TE
  1965. An arabic format having @N@ digits
  1966. specifies a field width of @N@ digits (example 2 above).
  1967. The read-only registers and the width function
  1968. .CW \ew
  1969. (§11.2)
  1970. are always arabic.
  1971. Warning: the value of a number register in a non-Arabic format
  1972. is not numeric, and will not produce the expected results in expressions.
  1973. .IP
  1974. The function
  1975. .CW \eg@x@
  1976. or
  1977. .CW \eg(@xx@
  1978. returns the format of a number register in a form suitable for
  1979. .CW af ;
  1980. it returns nothing if the register has not been used.
  1981. .bt "\&\f(CW&rr\fI R\fR" "-" "ignored" "-" "Remove number register @R@.
  1982. If many registers are being created dynamically, it
  1983. may become necessary to remove unused registers
  1984. to recapture internal storage space for newer registers.
  1985. The register
  1986. .CW .R
  1987. contains the number of number registers still available.
  1988. .NH
  1989. Tabs, Leaders, and Fields
  1990. .sc "Tabs and leaders.
  1991. The \s-1ASCII\s+1 horizontal tab character and the \s-1ASCII\s+1
  1992. \s-1SOH\s+1 (control-A, hereafter called the \fIleader\fR character)
  1993. can both be used to generate either horizontal motion or
  1994. a string of repeated characters.
  1995. The length of the generated entity is governed
  1996. by internal \fItab stops\fR specifiable
  1997. with \&\f(CWta\fR.
  1998. The default difference is that tabs generate motion and leaders generate
  1999. a string of periods;
  2000. \&\f(CWtc\fR and \&\f(CWlc\fR
  2001. offer the choice of repeated character or motion.
  2002. There are three types of internal tab stops\(em\
  2003. \fIleft\fR adjusting, \fIright\fR adjusting,
  2004. and \fIcentering\fR.
  2005. In the following table,
  2006. \fID\fR is the distance from the current position on the \fIinput\fR line
  2007. (where a tab or leader was found)
  2008. to the next tab stop,
  2009. \fInext-string\fR consists
  2010. of the input characters following the tab (or leader) up to the next tab (or leader) or end of line,
  2011. and
  2012. \fIW\fR is the width of \fInext-string\fR.
  2013. .TS
  2014. center box;
  2015. c2|c2|c
  2016. c2|c2|c
  2017. c2|c2|l.
  2018. Tab Length of motion or Location of
  2019. type repeated characters \fInext-string\fR
  2020. _
  2021. Left \fID\fR Following \fID\fR
  2022. Right \fID-W\fR Right adjusted within \fID\fR
  2023. Centered \fID-W/\fR2 Centered on right end of \fID\fR
  2024. .TE
  2025. The length of generated motion is allowed to be negative, but
  2026. that of a repeated character string cannot be.
  2027. Repeated character strings contain an integer number of characters, and
  2028. any residual distance is prepended as motion.
  2029. Tabs or leaders found after the last tab stop are ignored, but may be used
  2030. as \fInext-string\fR terminators.
  2031. .PP
  2032. Tabs and leaders are not interpreted in copy mode.
  2033. \&\f(CW\et\fR and \&\f(CW\ea\fR always generate a non-interpreted
  2034. tab and leader respectively, and
  2035. are equivalent to actual tabs and leaders in copy mode.
  2036. .sc "Fields.
  2037. A \fIfield\fR is contained between
  2038. a pair of \fIfield delimiter\fR characters,
  2039. and consists of substrings
  2040. separated by \fIpadding\fR indicator characters.
  2041. The field length is the distance on the
  2042. \fIinput\fR line from the position where the field begins to the next tab stop.
  2043. The difference between the total length of all the substrings
  2044. and the field length is incorporated as horizontal
  2045. padding space that is divided among the indicated
  2046. padding places.
  2047. The incorporated padding is allowed to be negative.
  2048. For example,
  2049. if the field delimiter is \&\f(CW#\fR and the padding indicator is \&\f(CW^\fR,
  2050. \&\f(CW#^\fIxxx\&\f(CW^\fIright\|\&\f(CW#\fR
  2051. specifies a right-adjusted string with the string \fIxxx\fR centered
  2052. in the remaining space.
  2053. .h1
  2054. .bt "\&\f(CW&ta\fI Nt ...\fR" "0.8; 0.5in" "none" "E,\fBm\fR" "Set tab stops and types.
  2055. \fIt=\&\f(CWR\fR, right adjusting;
  2056. \fIt=\&\f(CWC\fR, centering;
  2057. \fIt\fR absent, left adjusting.
  2058. \*(Tr tab stops are preset every 0.5in.,
  2059. \*(NR every 0.8in.
  2060. The stop values are separated by spaces, and
  2061. a value preceded by \&\f(CW+\fR
  2062. is treated as an increment to the previous stop value.
  2063. .bt "\&\f(CW&tc\fI c\fR" "none" "none" "E" "The tab repetition character
  2064. becomes @c@,
  2065. or is removed, thus specifying motion.
  2066. .bt "\&\f(CW&lc\fI c\fR" "\&\f(CW.\fR" "none" "E" "The leader repetition character
  2067. becomes @c@,
  2068. or is removed, thus specifying motion.
  2069. .bt "\&\f(CW&fc\fI a b\fR" "off" "off" "-" "The field delimiter
  2070. is set to \fIa\fR;
  2071. the padding indicator is set to the space character or to
  2072. \fIb\fR, if given.
  2073. In the absence of arguments the field mechanism is turned off.
  2074. .NH
  2075. Input and Output Conventions and Character Translations
  2076. .sc "Input character translations.
  2077. Ways of inputting the valid character set were
  2078. discussed in §2.1.
  2079. The \s-1ASCII\s+1 control characters horizontal tab (§9.1),
  2080. \s-1SOH\s+1 (§9.1), and backspace (§10.3) are discussed elsewhere.
  2081. The newline delimits input lines.
  2082. In addition,
  2083. \s-1STX\s+1, \s-1ETX\s+1, \s-1ENQ\s+1, \s-1ACK\s+1, and \s-1BEL\s+1
  2084. are accepted,
  2085. and may be used as delimiters or translated into a graphic with \&\f(CWtr\fR (§10.5).
  2086. All others are ignored.
  2087. .PP
  2088. The \fIescape\fR character \&\f(CW\e\fR
  2089. introduces \fIescape sequences\fR,
  2090. which cause the following character to mean
  2091. another character, or to indicate
  2092. some function.
  2093. .nr %% \n(*%-1
  2094. A complete list of such sequences is given in the Summary on page \n(*%.
  2095. The escape character \&\f(CW\e\fR
  2096. should not be confused with the \s-1ASCII\s+1 control character \s-1ESC\s+1.
  2097. The escape character \&\f(CW\e\fR can be input with the sequence \&\f(CW\e\e\fR.
  2098. The escape character can be changed with \&\f(CWec\fR,
  2099. and all that has been said about the default \&\f(CW\e\fR becomes true
  2100. for the new escape character.
  2101. \&\f(CW\ee\fR can be used to print whatever the current escape character is.
  2102. The escape mechanism may be turned off with \&\f(CWeo\fR,
  2103. and restored with \&\f(CWec\fR.
  2104. .h1
  2105. .bt "\&\f(CW&ec\fI c\fR" "\&\f(CW\e\fR" "\&\f(CW\e\fR" "-" "Set escape character
  2106. to \&\f(CW\e\fR, or to @c@, if given.
  2107. .bt "\&\f(CW&eo\fR" "on" "-" "-" "Turn escape mechanism off.
  2108. .sc "Ligatures.
  2109. .lg0
  2110. The set of available ligatures is device and font dependent,
  2111. but is often a subset of
  2112. \&\fBfi\fR, \&\fBfl\fR, \&\fBff\fR, \&\fBffi\fR, and \&\fBffl\fR.
  2113. They may be input by
  2114. \&\f(CW\e(fi\fR, \&\f(CW\e(fl\fR, \&\f(CW\e(ff\fR, \&\f(CW\e(Fi\fR, and \&\f(CW\e(Fl\fR respectively.
  2115. .lg
  2116. The ligature mode is normally on in \*(TR, and automatically invokes
  2117. ligatures during input.
  2118. .h1
  2119. .bt "\&\f(CW&lg\fI N\fR" "on; off" "on" "-" "Ligature mode
  2120. is turned on if @N@ is absent or non-zero,
  2121. and turned off if @N=0@.
  2122. If @N=2@, only the two-character ligatures are automatically invoked.
  2123. Ligature mode is inhibited for
  2124. request, macro, string, register, or file names,
  2125. and in copy mode.
  2126. No effect in \*(NR.
  2127. .sc "Backspacing, underlining, overstriking, etc.
  2128. Unless in copy mode, the \s-1ASCII\s+1 backspace character is replaced
  2129. by a backward horizontal motion having the width of the
  2130. space character.
  2131. Underlining as a form of line-drawing is discussed in §12.4.
  2132. A generalized overstriking function is described in §12.1.
  2133. .PP
  2134. \*(Nr automatically underlines
  2135. characters in the \fIunderline\fR font,
  2136. specifiable with \&\f(CWuf\fR,
  2137. normally that on font position 2.
  2138. In addition to \&\f(CWft\fR and
  2139. .CW \ef@F@ ,
  2140. the underline font may be selected by \&\f(CWul\fR and \&\f(CWcu\fR.
  2141. Underlining is restricted to an output-device-dependent
  2142. subset of reasonable characters.
  2143. .bt "\&\f(CW&ul\fI N\fR" "off" "@N=1@" "E" "Italicize in \*(TR
  2144. (underline in \*(NR) the next @N@
  2145. input text lines.
  2146. Actually, switch to underline font, saving the
  2147. current font for later restoration;
  2148. other font changes within the span of a \&\f(CWul\fR
  2149. will take effect,
  2150. but the restoration will undo the last change.
  2151. Output generated by \&\f(CWtl\fR (§14) is affected by the
  2152. font change, but does not decrement @N@.
  2153. If @N>1@, there is the risk that
  2154. a trap interpolated macro may provide text
  2155. lines within the span;
  2156. environment switching can prevent this.
  2157. .bt "\&\f(CW&cu\fI N\fR" "off" "@N=1@" "E" "Continuous underline.
  2158. A variant
  2159. of \&\f(CWul\fR that causes \fIevery\fR character to be underlined in \*(NR.
  2160. Identical to \&\f(CWul\fR in \*(TR.
  2161. .bt "\&\f(CW&uf\fI F\fR" "Italic" "Italic" "-" "Underline font set to @F@.
  2162. In \*(NR,
  2163. @F@ may not be on position 1.
  2164. .sc "Control characters.
  2165. Both the control character \&\f(CW.\fR and the \fIno-break\fR
  2166. control character \&\f(CW'\fR may be changed.
  2167. Such a change must be compatible with the design
  2168. of any macros used in the span of the change,
  2169. and
  2170. particularly of any trap-invoked macros.
  2171. .bt "\&\f(CW&cc\fI c\fR" "\&\f(CW.\fR" "\&\f(CW.\fR" "E" "The basic control character
  2172. is set to @c@,
  2173. or reset to ``\&\f(CW.\fR''.
  2174. .bt "\&\f(CW&c2\fI c\fR" "\&\f(CW'" "'\fR" "E" "The \fIno-break\fR control character is set
  2175. to @c@, or reset to ``\&\f(CW'\fR''.
  2176. .sc "Output translation.
  2177. One character can be made a stand-in for another character using \&\f(CWtr\fR.
  2178. All text processing (e.g., character comparisons) takes place
  2179. with the input (stand-in) character, which appears to have the width of the final
  2180. character.
  2181. The graphic translation occurs at the moment of output
  2182. (including diversion).
  2183. .bt "\&\f(CW&tr\fI abcd....\fR" "none" "-" "O" "Translate
  2184. \fIa\fR into \fIb\fR, @c@ into \fId\fR, etc.
  2185. If an odd number of characters is given,
  2186. the last one will be mapped into the space character.
  2187. To be consistent, a particular translation
  2188. must stay in effect from \fIinput\fR to \fIoutput\fR time.
  2189. .sc "Transparent throughput.
  2190. An input line beginning with a \&\f(CW\e!\fR is read in copy mode and \fItrans\%parently\fR output
  2191. (without the initial \&\f(CW\e!\fR);
  2192. the text processor is otherwise unaware of the line's presence.
  2193. This mechanism may be used to pass control information to a post-processor
  2194. or to embed control lines in a macro created by a diversion.
  2195. .sc "Transparent output
  2196. The sequence
  2197. .CW \eX'@anything@'
  2198. copies
  2199. .I anything
  2200. to the output, as a device control function of the form
  2201. .CW x
  2202. .CW X
  2203. .I anything
  2204. (§22).
  2205. Escape sequences in
  2206. .I anything
  2207. are processed.
  2208. .sc "Comments and concealed newlines.
  2209. An uncomfortably long input line that must stay
  2210. one line (e.g., a string definition, or nofilled text)
  2211. can be split into several physical lines by ending all but
  2212. the last one with the escape \&\f(CW\e\fR.
  2213. The sequence \&\f(CW\e\fR@newline@ is always ignored,
  2214. except in a comment.
  2215. Comments may be embedded at the end of any line by
  2216. prefacing them with \&\f(CW\e"\fR.
  2217. The newline at the end of a comment cannot be concealed.
  2218. A line beginning with \&\f(CW\e"\fR will appear as a blank line and
  2219. behave like
  2220. .CW ".sp\ 1" ;
  2221. a comment can be on a line by itself by beginning the line with \&\f(CW.\e"\fR.
  2222. .NH
  2223. Local Horizontal and Vertical Motions, and the Width Function
  2224. .sc "Local Motions.
  2225. The functions \&\f(CW\ev'\fIN\&\f(CW'\fR and
  2226. \&\f(CW\eh'\fIN\&\f(CW'\fR
  2227. can be used for \fIlocal\fR vertical and horizontal motion respectively.
  2228. The distance @N@ may be negative; the positive directions
  2229. are rightward and downward.
  2230. A local motion is one contained within a line.
  2231. To avoid unexpected vertical dislocations, it is necessary that
  2232. the net vertical local motion within a word in filled text
  2233. and otherwise within a line balance to zero.
  2234. The escape sequences providing local motion are
  2235. summarized in the following table.
  2236. .ds Y \0\0\0
  2237. .KS
  2238. .TS
  2239. center box;
  2240. c2|cs2||c2|cs2
  2241. c1|c2c2||c2|c2c2.
  2242. Vertical Effect in Horizontal Effect in
  2243. Local Motion \*(TR \*(NR Local Motion \*(TR \*(NR
  2244. _
  2245. .sp.4
  2246. .TC
  2247. l2|ls2||l2|ls2.
  2248. \&\f(CW\*Y\ev'\fIN\|\f(CW'\fR Move distance @N@ \
  2249. \&\f(CW\*Y\eh'\fIN\|\f(CW'\fR Move distance @N@
  2250. .TC
  2251. _2|_2_2||l2|ls2.
  2252. x x x \&\f(CW\*Y\e\fP\f2space\fP Unpaddable space-size space
  2253. .TC
  2254. l2|l2|l2||l2|ls2.
  2255. \&\f(CW\*Y\eu\fR ½ em up ½ line up \&\f(CW\*Y\e0\fR Digit-size space
  2256. .TC
  2257. l2|l2|l2||_2|_2_2.
  2258. \&\f(CW\*Y\ed\fR ½ em down ½ line down x x x
  2259. .TC
  2260. l2|l2|l2||l2|l2|l2.
  2261. \&\f(CW\*Y\er\fR 1 em up 1 line up \&\f(CW\*Y\e|\fR 1/6 em space ignored
  2262. \&\f(CW\*Y\e^\fR 1/12 em space ignored
  2263. .sp.4
  2264. .TE
  2265. .KE
  2266. As an example,
  2267. \&\f(CWE\s-2\v'-.4m'2\v'.4m'\s+2\fR
  2268. could be generated by a sequence of size changes and motions:
  2269. \&\f(CWE\es-2\ev'-0.4m'2\ev'0.4m'\es+2\fR;
  2270. note that
  2271. the 0.4 em vertical motions are at the smaller size.
  2272. .sc "Width Function.
  2273. The \fIwidth\fR function \&\f(CW\ew'\fIstring\&\f(CW'\fR
  2274. generates the numerical width of \fIstring\fR (in basic units).
  2275. Size and font changes may be embedded in \fIstring\fR,
  2276. and will not affect the current environment.
  2277. For example,
  2278. \&\&\f(CW.ti\ -\ew'\efB1.\ 'u\fR could be used to
  2279. temporarily indent leftward a distance equal to the
  2280. size of the string ``\&\f(CW1.\ \fR'' in font
  2281. .CW B .
  2282. .PP
  2283. The width function also sets three number registers.
  2284. The registers \&\f(CWst\fR and \&\f(CWsb\fR are set respectively to the highest and
  2285. lowest extent of \fIstring\fR relative to the baseline;
  2286. then, for example,
  2287. the total height of the string is \&\f(CW\en(stu-\en(sbu\fR.
  2288. In \*(TR the number register \&\f(CWct\fR is set to a value
  2289. between 0 and 3.
  2290. The value
  2291. 0 means that all of the characters in \fIstring\fR were short lower
  2292. case characters without descenders (like \&\f(CWe\fR);
  2293. 1 means that at least one character has a descender (like \&\f(CWy\fR);
  2294. 2 means that at least one character is tall (like \&\f(CWH\fR);
  2295. and 3 means that both tall characters and characters with
  2296. descenders are present.
  2297. .sc "Mark horizontal place.
  2298. The function \&\f(CW\ek\fIx\fR causes the current horizontal
  2299. position in the \fIinput line\fR to be stored in register \fIx\fR.
  2300. For example,
  2301. the construction \&\f(CW\ekx\fIword\f(CW\eh'|\enxu+3u'\fIword\&\f(CW\fR
  2302. will embolden \fIword\fR by backing up to almost its beginning and overprinting it,
  2303. resulting in \kz\fIword\fR\h'|\nzu+3u'\fIword\fR.
  2304. .NH
  2305. Overstrike, Bracket, Line-drawing, Graphics, and Zero-width Functions
  2306. .sc "Overstriking.
  2307. Automatically centered overstriking of up to nine characters
  2308. is provided by the \fIoverstrike\fR function
  2309. \&\f(CW\eo'\fIstring\&\f(CW\|'\fR.
  2310. The characters in \fIstring\fR are overprinted with centers aligned; the total width
  2311. is that of the widest character.
  2312. \fIstring\fR may not contain local vertical motion.
  2313. As examples,
  2314. \&\f(CW\eo'e\e''\fR produces \o'e\'', and
  2315. \&\f(CW\eo'\e(mo\e(sl'\fR produces \o'\(mo\(sl'.
  2316. .sc "Zero-width characters.
  2317. The function
  2318. .CW \ez@c@
  2319. will output @c@ without spacing over
  2320. it, and can be used to produce left-aligned overstruck
  2321. combinations.
  2322. As examples,
  2323. \&\f(CW\ez□+\fR will produce \z□+, and
  2324. \&\f(CW\e(br\ez\e(rn\e(ul\e(br\fR will produce a small
  2325. badly constructed box \&\(br\z\(rn\(ul\(br\|.
  2326. .sc "Large Brackets.
  2327. The Special Font usually contains a number of bracket construction pieces
  2328. \|\|\(lt\|\|\(lb\|\|\(rt\|\|\(rb\|\|\(lk\|\|\(rk\|\|\(bv\|\|\(lf\|\|\(rf\|\|\(lc\|\|\(rc\|\|
  2329. that can be combined into various bracket styles.
  2330. The function \&\f(CW\eb'\fIstring\&\f(CW\|'\fR may be used to pile
  2331. up vertically the characters in \fIstring\fR
  2332. (the first character on top and the last at the bottom);
  2333. the characters are vertically separated by 1 em and the total
  2334. pile is centered 1/2 em above the current baseline
  2335. (½ line in \*(NR).
  2336. For example,
  2337. .P1
  2338. \eb'\e(lc\e(lf'E\eb'\e(rc\e(rf'\ex'-0.5m'\ex'0.5m'
  2339. .P2
  2340. produces
  2341. \x'-.5m'\x'.5m'\b'\(lc\(lf'E\b'\(rc\(rf'.
  2342. .sc "Line drawing.
  2343. .tr &&
  2344. The function \&\f(CW\el'\fINc\f(CW'\fR (backslash-ell) draws a string of repeated @c@'s towards the right for a distance @N@.
  2345. If @c@ looks like a continuation of
  2346. an expression for @N@, it may be insulated from @N@ with \&\f(CW\e&\fR.
  2347. If @c@ is not specified, the \&\f(CW\(ru\fR (baseline rule) is used
  2348. (underline character in \*(NR).
  2349. If @N@ is negative, a backward horizontal motion
  2350. of size @N@ is made before drawing the string.
  2351. Any space resulting from @N@/(size of @c@) having a remainder is put at the beginning (left end)
  2352. of the string.
  2353. If @N@ is less than the width of @c@,
  2354. a single @c@ is centered on a distance @N@.
  2355. In the case of characters
  2356. that are designed to be connected, such as
  2357. baseline-rule\ \&\f(CW\(ru\fR\|,
  2358. under-rule\ \&\f(CW\(ul\fR\|,
  2359. and
  2360. root-en\ \&\f(CW\(rn\fR\|,
  2361. the remainder space is covered by overlapping.
  2362. As an example, a macro to underscore a string can be written
  2363. .tr &.
  2364. .P1
  2365. .ne 2.1
  2366. &de us
  2367. \e\e$1\e\|l\|'|0\e(ul'
  2368. &&
  2369. .P2
  2370. .ne2.1
  2371. .de xu
  2372. \\$1\l'|0\(ul'
  2373. ..
  2374. or one to draw a box around a string
  2375. .P1
  2376. &de bx
  2377. \e(br\e|\e\e$1\e|\e(br\e\|l\|'|0\e(rn'\e\|l\|'|0\e(ul'
  2378. &&
  2379. .P2
  2380. .de bx
  2381. \(br\|\\$1\|\(br\l'|0\(rn'\l'|0\(ul'
  2382. ..
  2383. such that
  2384. .P1
  2385. &ul "underlined words"
  2386. .P2
  2387. and
  2388. .P1
  2389. &bx "words in a box"
  2390. .P2
  2391. yield
  2392. .xu "underlined words"
  2393. and
  2394. .bx "words in a box"
  2395. \h'-\w'.'u'.
  2396. .PP
  2397. The function \&\f(CW\eL'\fINc\&\f(CW'\fR draws a vertical line consisting
  2398. of the (optional) character @c@ stacked vertically apart 1\|em
  2399. (1 line in \*(NR),
  2400. with the first two characters overlapped,
  2401. if necessary, to form a continuous line.
  2402. The default character is the \fIbox rule\fR \|\(br\| (\&\f(CW\|\e(br\fR);
  2403. the other suitable character is the \fIbold vertical\fR \|\(bv\| (\&\f(CW\|\e(bv\fR).
  2404. The line is begun without any initial motion relative to the
  2405. current baseline.
  2406. A positive @N@ specifies a line drawn downward and
  2407. a negative @N@ specifies a line drawn upward.
  2408. After the line is drawn no compensating
  2409. motions are made;
  2410. the instantaneous baseline is at the end of the line.
  2411. .PP
  2412. .de eb
  2413. .sp -1
  2414. .nf
  2415. \h'-.5n'\L'|\\nzu-1'\l'\\n(.lu+1n\(ul'\L'-|\\nzu+1'\l'|0u-.5n\(ul'
  2416. .fi
  2417. ..
  2418. .ne 2i
  2419. .mk z
  2420. .nr z \nz+1
  2421. The horizontal and vertical line drawing functions may be used
  2422. in combination to produce large boxes.
  2423. The zero-width \fIbox-rule\fR and the ½-em wide \fIunder-rule\fR
  2424. were designed to form corners when using 1-em vertical
  2425. spacings.
  2426. For example the macro
  2427. .nr x \n(DV
  2428. .nr DV 0
  2429. .P1 .15i
  2430. .ps -1
  2431. \&.de eb
  2432. \&.sp -1 \e"compensate for next automatic baseline spacing
  2433. \&.nf \e"avoid possibly overflowing word buffer
  2434. \&\eh'-.5n'\eL'|\e\enau-1'\el'\e\en(.lu+1n\e(ul'\eL'-|\e\enau+1'\el'|0u-.5n\e(ul'
  2435. \&.fi
  2436. \&..
  2437. .ps +1
  2438. .P2
  2439. .nr DV \nx
  2440. will draw a box around some text whose beginning vertical place was
  2441. saved in number register \fIa\fR
  2442. (e.g., using \&\f(CW.mk\ a\fR)
  2443. as was done for this paragraph.
  2444. .eb
  2445. .sc "Graphics.
  2446. The function
  2447. .CW \eD'@c...@'
  2448. draws a graphic object of type @c@
  2449. according to a sequence of parameters,
  2450. which are generally pairs of numbers.
  2451. .IP
  2452. .nf
  2453. .ta 1.7i
  2454. \f(CW\eD'l @dh~ dv@' \f1draw line from current position by @dh,~dv@\f(CW
  2455. \f(CW\eD'c @d@' \f1draw circle of diameter @d@ with left side at current position\f(CW
  2456. \f(CW\eD'e @d sub 1 d sub 2@' \f1draw ellipse of diameters @d sub 1@ and @d sub 2@\f(CW
  2457. \f(CW\eD'a @dh sub 1~ dv sub 1~ dh sub 2~ dv sub 2@'\f(CW \f1draw arc from current position to @dh sub 1 +dh sub 2@, @dv sub 1 +dv sub 2@,\f(CW
  2458. \f1with center at @dh sub 1 ,~ dv sub 1@ from current position\f(CW
  2459. \f(CW\eD'~ @dh sub 1 dv sub 1 dh sub 2 dv sub 2 "..."@'\f(CW \f1draw B-spline from current position by @dh sub 1, dv sub 1@,\f(CW
  2460. \f1then by @dh sub 2 , dv sub 2@, then by @dh sub 2 , dv sub 2@, then ...\f(CW
  2461. .LP
  2462. For example,
  2463. .CW "\eD'e0.2i 0.1i'"
  2464. draws the ellipse
  2465. \D'e.2i .1i'\|,
  2466. and
  2467. .CW "\eD'l.2i -.1i'\eD'l.1i .1i'"
  2468. the line
  2469. \D'l.2i -.1i'\D'l.1i .1i'\|.
  2470. A
  2471. .CW \\eD
  2472. with an unknown @c@ is processed and copied through to the output
  2473. for unspecified interpretation;
  2474. coordinates are interpreted alternately as horizontal and vertical
  2475. values.
  2476. .PP
  2477. Numbers taken as horizontal (first, third, etc.) have default scaling of ems;
  2478. vertical numbers (second, fourth, etc.) have default scaling of @V^@s (§1.3).
  2479. The position after a graphical object has been drawn is
  2480. at its end; for circles and ellipses, the ``end''
  2481. is at the right side.
  2482. .NH
  2483. Hyphenation.
  2484. .PP
  2485. Automatic hyphenation may be switched off and on.
  2486. When switched on with \&\f(CWhy\fR,
  2487. several variants may be set.
  2488. A \fIhyphenation indicator\fR character may be embedded in a word to
  2489. specify desired hyphenation points,
  2490. or may be prefixed to suppress hyphenation.
  2491. In addition,
  2492. the user may specify a small list of exception words.
  2493. .PP
  2494. Only words that consist of a central alphabetic string
  2495. surrounded by (usually null) non-alphabetic strings
  2496. are candidates for automatic hyphenation.
  2497. Words that contain hyphens
  2498. (minus),
  2499. em-dashes (\&\f(CW\e(em\fR),
  2500. or hyphenation indicator characters
  2501. are always subject to splitting after those characters,
  2502. whether automatic hyphenation is on or off.
  2503. .bt "\&\f(CW&nh\fR" "hyphenate" "-" "E" "Automatic hyphenation is turned off.
  2504. .bt "\&\f(CW&hy\fP@~N@" "on, @N=1@" "on, @N=1@" "E" "Automatic hyphenation is turned on
  2505. for @N >= 1@, or off for @N=0@.
  2506. If @N=2@, last lines (ones that will cause a trap)
  2507. are not hyphenated.
  2508. For @N=4@ and 8, the last and first two characters
  2509. respectively of a word are not split off.
  2510. These values are additive;
  2511. i.e., @N=14@ will invoke all three restrictions.
  2512. .bt "\&\f(CW&hc\fI c\fR" "\&\f(CW\e%" "\e%\fR" "E" "Hyphenation indicator character is set
  2513. to @c@ or to the default \&\f(CW\e%\fR.
  2514. The indicator does not appear in the output.
  2515. .bt "\&\f(CW&hw\fI word ...\fR" "" "ignored" "-" "Specify
  2516. hyphenation points in words
  2517. with embedded minus signs.
  2518. Versions of a word with terminal \fIs\fR are implied;
  2519. i.e.,
  2520. .CW dig-it
  2521. implies
  2522. .CW dig-its .
  2523. This list is examined initially and after
  2524. each suffix stripping.
  2525. The space available is small.
  2526. .NH
  2527. Three-Part Titles.
  2528. .PP
  2529. The titling function \&\f(CWtl\fR provides for automatic placement
  2530. of three fields at the left, center, and right of a line
  2531. with a title length
  2532. specifiable with \&\f(CWlt\fR.
  2533. \&\f(CWtl\fR may be used anywhere, and is independent of the
  2534. normal text collecting process.
  2535. A common use is in header and footer macros.
  2536. .h1
  2537. .bt "\&\f(CW&tl '\fIleft\fP'\fIcenter\fP'\fIright\fP'\fR" "-" "-" "" "The strings
  2538. \fIleft\fR, \fIcenter\fR, and \fIright\fR are
  2539. respectively left-adjusted, centered, and right-adjusted
  2540. in the current title length.
  2541. Any of the strings may be empty,
  2542. and overlapping is permitted.
  2543. If the page-number character (initially \&\f(CW%\fR) is found within any of the fields it is replaced
  2544. by the current page number in the format assigned to register \&\f(CW%\fR.
  2545. Any character may be used in place of
  2546. .CW '
  2547. as the string delimiter.
  2548. .bt "\&\f(CW&pc\fI c\fR" "\&\f(CW%\fR" "off" "-" "The page number character is set to @c@,
  2549. or removed.
  2550. The page number register remains \&\f(CW%\fR.
  2551. .bt "\&\f(CW&lt\fI \(+-N\fR" "6.5\|in" "previous" "E,\fBm\fR" "Length of title
  2552. is set to @+- N@.
  2553. The line length and the title length are independent.
  2554. Indents do not apply to titles; page offsets do.
  2555. .NH
  2556. Output Line Numbering.
  2557. .PP
  2558. .ll -\w'0000'u
  2559. .nm 1 3
  2560. Automatic sequence numbering of output lines may be
  2561. requested with \&\f(CWnm\fR.
  2562. When in effect,
  2563. a three-digit, arabic number plus a digit-space
  2564. is prefixed to output text lines.
  2565. The text lines are thus offset by four digit-spaces,
  2566. and otherwise retain their line length;
  2567. a reduction in line length may be desired to keep the right margin
  2568. aligned with an earlier margin.
  2569. Blank lines, other vertical spaces, and lines generated by \&\f(CWtl\fR
  2570. are not numbered.
  2571. Numbering can be temporarily suspended with \&\f(CWnn\fR,
  2572. or with an \&\f(CW.nm\fR followed by a later \&\f(CW.nm +0\fR.
  2573. In addition,
  2574. a line number indent \fII\fR, and the number-text separation \fIS\fR
  2575. may be specified in digit-spaces.
  2576. Further, it can be specified that only those line numbers that are
  2577. multiples of some number @M@ are to be printed (the others will appear
  2578. as blank number fields).
  2579. .br
  2580. .nm
  2581. .ll
  2582. .bt "\&\f(CW&nm\fI \(+-N M S I\fR" "" "off" "E" "Line number mode.
  2583. If @+- N@ is given,
  2584. line numbering is turned on,
  2585. and the next output line numbered is numbered @+- N@.
  2586. Default values are @M=1@, @S=1@, and @I=0@.
  2587. Parameters corresponding to missing arguments are unaffected;
  2588. a non-numeric argument is considered missing.
  2589. In the absence of all arguments, numbering is turned off;
  2590. the next line number is preserved for possible further use
  2591. in number register \&\f(CWln\fR.
  2592. .bt "\&\f(CW&nn\fI N\fR" "-" "@N=1@" "E" "The next @N@ text output lines are not
  2593. numbered.
  2594. .PP
  2595. .ll -\w'0000'u
  2596. .nm +0
  2597. As an example, the paragraph portions of this section
  2598. are numbered with \fIM=\fR\|3:
  2599. \&\&\f(CW.nm\ 1\ 3\fR was placed at the beginning;
  2600. \&\&\f(CW.nm\fR was placed at the end of the first paragraph;
  2601. and \&\f(CW.nm\ +0\fR was placed in front of this paragraph;
  2602. and \&\f(CW.nm\fR finally placed at the end.
  2603. Line lengths were also changed (by \&\f(CW\ew'0000'u\fR) to keep the right side aligned.
  2604. Another example is
  2605. .CW .nm
  2606. .CW +5
  2607. .CW 5
  2608. .CW x
  2609. .CW 3 ,
  2610. which turns on numbering with the line number of the next
  2611. line to be 5 greater than the last numbered line,
  2612. with @M=5@, with spacing \fIS\fR untouched, and with the indent \fII\fR set to 3.
  2613. .br
  2614. .ll
  2615. .nm
  2616. .NH
  2617. Conditional Acceptance of Input
  2618. .PP
  2619. In the following,
  2620. @c@ is a one-character built-in \fIcondition\fR name,
  2621. \&\f(CW!\fR signifies \fInot\fR,
  2622. @N@ is a numerical expression,
  2623. \fIstring1\fR and \fIstring2\fR are strings delimited by any non-blank, non-numeric character not in the strings,
  2624. and
  2625. \fIanything\fR represents what is conditionally accepted.
  2626. .bt "\&\f(CW&if\fI c anything\fR" "-" "-" "" "If condition
  2627. @c@ true, accept \fIanything\fR as input;
  2628. in multi-line case use \e{\fIanything\|\fR\e}.
  2629. .bt "\&\f(CW&if !\fIc anything\fR" "-" "-" "" "If condition @c@ false, accept \fIanything\fR.
  2630. .bt "\&\f(CW&if\fI N anything\fR" "" "-" "\fBu\fR" "If expression @N@ > 0, accept \fIanything\fR.
  2631. .bt "\&\f(CW&if !\fIN anything\fR" "" "-" "\fBu\fR" "If expression @N@ ≤ 0 [sic], accept \fIanything\fR.
  2632. .bt "\&\f(CW&if '\fIstring1\f(CW'\fIstring2\f(CW'\fI anything\fR" "-" "" "" "If \fIstring1\fR identical to \fIstring2\fR,
  2633. accept \fIanything\fR.
  2634. .bt "\&\f(CW&if !'\fIstring1\f(CW'\fIstring2\f(CW'\fI anything\fR" "-" "" "" "If \fIstring1\fR not identical to \fIstring2\fR,
  2635. accept \fIanything\fR.
  2636. .bt "\&\f(CW&ie\fI c anything\fR" "" "-" "\fBu\fR" "If portion of if-else;
  2637. all of the forms for \&\f(CWif\fR above are valid.
  2638. .bt "\&\f(CW&el\fI anything\fR" "-" "-" "" "Else portion of if-else.
  2639. .PP
  2640. The built-in condition names are:
  2641. .TS
  2642. center box;
  2643. c2|c2
  2644. c2|c2
  2645. c2|l2.
  2646. Condition
  2647. Name True If
  2648. _
  2649. \&\f(CWo\fR Current page number is odd
  2650. \&\f(CWe\fR Current page number is even
  2651. \&\f(CWt\fR Formatter is \*(TR
  2652. \&\f(CWn\fR Formatter is \*(NR
  2653. .TE
  2654. If the condition @c@ is true, or if the number @N@ is greater than zero,
  2655. or if the strings compare identically (including motions and character size and font),
  2656. \fIanything\fR is accepted as input.
  2657. If a \&\f(CW!\fR precedes the condition, number, or string comparison,
  2658. the sense of the acceptance is reversed.
  2659. .PP
  2660. Any spaces between the condition and the beginning of \fIanything\fR are skipped over.
  2661. The \fIanything\fR can be either a single input line (text, macro, or whatever)
  2662. or a number of input lines.
  2663. In the multi-line case,
  2664. the first line must begin with a left delimiter \&\f(CW\e{\fR and
  2665. the last line must end with a right delimiter \&\f(CW\e}\fR.
  2666. .PP
  2667. The request \&\f(CWie\fR (if-else) is identical to \&\f(CWif\fR
  2668. except that the acceptance state is remembered.
  2669. A subsequent and matching \&\f(CWel\fR (else) request then uses the reverse sense of that state.
  2670. \&\f(CWie\fR-\&\f(CWel\fR pairs may be nested.
  2671. .PP
  2672. Some examples are:
  2673. .P1
  2674. &if e .tl '\|Even Page %'''
  2675. .P2
  2676. which outputs a title if the page number is even; and
  2677. .P1
  2678. &ie \en%>1 \e{\e
  2679. \&' sp 0.5i
  2680. & tl 'Page %'''
  2681. \&' sp |1.2i \e}
  2682. &el .sp |2.5i
  2683. .P2
  2684. which treats page 1 differently from other pages.
  2685. .NH
  2686. Environment Switching.
  2687. .PP
  2688. A number of the parameters that
  2689. control the text processing are gathered together into an
  2690. \fIenvironment\fR, which can be switched by the user.
  2691. The environment parameters are those associated
  2692. with requests noting E in their \fINotes\fR column;
  2693. in addition, partially collected lines and words are in the environment.
  2694. Everything else is global; examples are page-oriented parameters,
  2695. diversion-oriented parameters, number registers, and macro and string definitions.
  2696. All environments are initialized with default parameter values.
  2697. .bt "\&\f(CW&ev\fI N\fR" "@N=0@" "previous" "-" "Environment switched to
  2698. environment @0 <= N <= 2@.
  2699. Switching is done in push-down fashion so that
  2700. restoring a previous environment \fImust\fR be done with \&\f(CW.ev\fR
  2701. rather than specific reference.
  2702. Note that what is pushed down and restored is the environment
  2703. .I number,
  2704. not its contents.
  2705. .NH
  2706. Insertions from the Standard Input
  2707. .PP
  2708. The input can be temporarily switched to the system standard input
  2709. with \&\f(CWrd\fR,
  2710. which will switch back when two consecutive newlines
  2711. are found (the extra blank line is not used).
  2712. This mechanism is intended for insertions in form-letter-like documentation.
  2713. The standard input can be the user's keyboard,
  2714. a pipe, or a file.
  2715. .bt "\&\f(CW&rd\fI prompt\fR" "-" "\fIprompt=\fR\s-1BEL\s+1" "-" "Read insertion
  2716. from the standard input until two newlines in a row are found.
  2717. If the standard input is the user's keyboard, \fIprompt\fR (or a \s-1BEL\s+1)
  2718. is written onto the standard output.
  2719. \&\f(CWrd\fR behaves like a macro,
  2720. and arguments may be placed after \fIprompt\fR.
  2721. .bt "\&\f(CW&ex\fR" "-" "-" "-" "Exit from \*(NR/\*(TR.
  2722. Text processing is terminated exactly as if all input had ended.
  2723. .PP
  2724. If insertions are to be
  2725. taken from the terminal keyboard while output is being printed
  2726. on the terminal, the command line option \&\f(CW-q\fR will turn off the echoing
  2727. of keyboard input and prompt only with \s-1BEL\s+1.
  2728. The regular input and insertion input cannot
  2729. simultaneously come from the standard input.
  2730. .PP
  2731. As an example,
  2732. multiple copies of a form letter may be prepared by entering the insertions
  2733. for all the copies in one file to be used as the standard input,
  2734. and causing the file containing the letter to reinvoke itself with \&\f(CWnx\fR (§19);
  2735. the process would ultimately be ended by an \&\f(CWex\fR in the insertion file.
  2736. .NH
  2737. Input/Output File Switching
  2738. .bt "\&\f(CW&so\fI filename\fR" "" "-" "-" "Switch source file.
  2739. The top input (file reading) level is switched to \fIfilename\fR.
  2740. When the new file ends,
  2741. input is again taken from the original file.
  2742. \&\f(CWso\fR's may be nested.
  2743. .bt "\&\f(CW&nx\fI filename\fR" "" "end-of-file" "-" "Next file is \fIfilename\fR.
  2744. The current file is considered ended, and the input is immediately switched
  2745. to \fIfilename\fR.
  2746. .bt "\&\f(CW&sy\fI string\fR" "" "-" "-" "Execute program from \fIstring\fR,
  2747. which is the rest of the input line.
  2748. The output is not collected automatically.
  2749. The number register
  2750. .CW $$ ,
  2751. which contains the process id of the \*(TR process,
  2752. may be useful in generating unique filenames for output.
  2753. .bt "\&\f(CW&pi\fI string\fR" "" "-" "-" "Pipe output to \fIstring\fR,
  2754. which is the rest of the input line.
  2755. This request must occur before any printing occurs;
  2756. typically it is the first line of input.
  2757. .bt "\&\f(CW&cf\fI filename\fR" "" "-" "-" "Copy
  2758. contents of file
  2759. .I filename
  2760. to output, completely unprocessed.
  2761. The file is assumed to contain something meaningful
  2762. to subsequent processes.
  2763. .NH
  2764. Miscellaneous
  2765. .br
  2766. .mc \s12\(br\s0
  2767. .bt "\&\f(CW.mc\fI c N\fR" - off E,\fBm\fR "Specifies
  2768. that a \fImargin\fR character @c@ appear a distance
  2769. @N@ to the right of the right margin
  2770. after each non-empty text line (except those produced by \&\f(CWtl\fR).
  2771. If the output line is too long (as can happen in nofill mode)
  2772. the character will be appended to the line.
  2773. If @N@ is not given, the previous @N@ is used; the initial @N@ is
  2774. 0.2 inches in \*(NR and 1 em in \*(TR.
  2775. The margin character used with this paragraph was a 12-point box-rule.
  2776. .br
  2777. .mc
  2778. .bt "\&\f(CW.tm\fI string\fR" "-" "newline" "-" "After skipping initial blanks,
  2779. \fIstring\fR (rest of the line) is read in copy mode
  2780. and written on the standard error.
  2781. .bt "\&\f(CW&ab\fI string\fR" "-" "newline" "-" "After skipping initial blanks,
  2782. \fIstring\fR (rest of the line) is read in copy mode
  2783. and written on the standard error.
  2784. \*(Tr or \*(NR then exit.
  2785. .bt "\&\f(CW.ig\fI yy\fR" "-" "\fI.yy=\&\f(CW..\fR" "-" "Ignore
  2786. input lines.
  2787. \&\f(CWig\fR behaves exactly like \&\f(CWde\fR (§7) except that the
  2788. input is discarded.
  2789. The input is read in copy mode, and any auto-incremented
  2790. registers will be affected.
  2791. .bt "\&\f(CW.lf\fI N filename\fR" "" "-" "-" "Set
  2792. line number to @N@ and filename to @filename@
  2793. for purposes of subsequent error messages, etc.
  2794. The number register [sic]
  2795. .CW .F
  2796. contains the name of the current input file,
  2797. as set by command line argument,
  2798. .CW so ,
  2799. .CW nx ,
  2800. or
  2801. .CW lf .
  2802. The number register
  2803. .CW .c
  2804. contains the number of input lines read from the current file,
  2805. again perhaps as modified by
  2806. .CW lf .
  2807. .CW
  2808. .bt "\&\f(CW.pm\fI t\fR" "-" "all" "-" "Print macros.
  2809. The names and sizes of all of the defined macros and strings are printed
  2810. on the standard error;
  2811. if \fIt\fR is given, only the total of the sizes is printed.
  2812. The sizes is given in blocks
  2813. of 128 characters.
  2814. .bt "\&\f(CW.fl\fR" - - B "Flush output buffer.
  2815. Force output, including any pending position information.
  2816. ......
  2817. .NH
  2818. Output and Error Messages.
  2819. .PP
  2820. The output from \&\f(CWtm\fR, \&\f(CWpm\fR, and the prompt from \&\f(CWrd\fR,
  2821. as well as various error messages, are written onto
  2822. the standard error.
  2823. The latter is different from the standard output,
  2824. where formatted text goes.
  2825. By default, both are written onto the user's terminal,
  2826. but they can be independently redirected.
  2827. .PP
  2828. Various error conditions may occur during
  2829. the operation of \*(NR and \*(TR.
  2830. Certain less serious errors having only local impact do not
  2831. cause processing to terminate.
  2832. Two examples are \fIword overflow\fR, caused by a word that is too large
  2833. to fit into the word buffer (in fill mode), and
  2834. \fIline overflow\fR, caused by an output line that grew too large
  2835. to fit in the line buffer.
  2836. In both cases, a message is printed, the offending excess
  2837. is discarded,
  2838. and the affected word or line is marked at the point of truncation
  2839. with a \(** in \*(NR and a \(lh in \*(TR.
  2840. Processing continues if possible,
  2841. on the grounds that output useful for debugging may be produced.
  2842. If a serious error occurs, processing terminates,
  2843. and a message is printed, along with a list of the macro names currently active.
  2844. Examples of serious errors include the inability to create, read, or write files,
  2845. and the exceeding of certain internal limits that
  2846. make future output unlikely to be useful.
  2847. .NH
  2848. Output Language
  2849. .PP
  2850. \*(Tr
  2851. produces its output in a language that is independent of any
  2852. specific output device,
  2853. except that the numbers in it have been computed on the basis
  2854. of the resolution of the device,
  2855. and the sizes, fonts, and characters that that device can print.
  2856. Nevertheless it is quite possible to interpret that output
  2857. on a different device, within the latter's capabilities.
  2858. .IP
  2859. .nf
  2860. .ta .7i
  2861. @cw s n@ set point size to @n@
  2862. @cw f n@ set font to @n@
  2863. @cw c c@ print character @c@
  2864. @cw C name@ print the character called @name@; terminate @name@ by white space
  2865. @cw N n@ print character @n@ on current font
  2866. @cw H n@ go to absolute horizontal position \f2n\fP (@n >= 0@)
  2867. @cw V n@ go to absolute vertical position \f2n\fP (@n >= 0@, down is positive)
  2868. @cw h n@ go \f2n\fP units horizontally; @n < 0@ is to the left
  2869. @cw v n@ go \f2n\fP units vertically; @n < 0@ is up
  2870. @nnc@ move right \f2nn\fP, then print \s-1UTF\s0 character \f2c\fP; \f2nn\fP must be exactly 2 digits
  2871. @cw p n@ new page \f2n\fP begins\(emset vertical position to 0
  2872. @cw n b~a@ end of line (information only\(emno action); \f2b\fP = space before line, \f2a\fP = after
  2873. @cw w@ paddable word space (information only\(emno action)
  2874. @cw D c@ ...\en graphics function @c@; see below
  2875. @cw x@ ...\en device control functions; see below
  2876. @cw "#"@ ...\en comment
  2877. .LP
  2878. All position values are in units.
  2879. Sequences that end in digits must be followed by a non-digit.
  2880. Blanks, tabs and newlines may occur as separators
  2881. in the input, and are mandatory to separate constructions
  2882. that would otherwise be confused.
  2883. Graphics functions, device control functions, and comments extend to the
  2884. end of the line they occur on.
  2885. .PP
  2886. The device control and graphics commands are intended as open-ended
  2887. families, to be expanded as needed.
  2888. The graphics functions coincide directly with the
  2889. .CW \eD
  2890. sequences:
  2891. .IP
  2892. .nf
  2893. .ta 1.7i
  2894. @cw Dl@ \f2dh dv\fP draw line from current position by @dh,~ dv@
  2895. @cw Dc@ \f2d\fP draw circle of diameter \f2d\fP with left side here
  2896. @cw De@ @dh sub 1~dv sub 2@ draw ellipse of diameters @dh sub 1@ and @ dv sub 2@\fP
  2897. @cw Da ~dh sub 1~ dv sub 1 ~ dh sub 2 ~dv sub 2@ draw arc from current position to @dh sub 1 +dh sub 2 ,~ dv sub 1 +dv sub 2@,
  2898. center at @dh sub 1 ,~ dv sub 1@ from current position
  2899. @cw "D~" ~dh sub 1 ~dv sub 1 ~dh sub 2 ~dv sub 2@ ... draw B-spline from current position to @dh sub 1 ,~ dv sub 1@,
  2900. then to @dh sub 2 , ~dv sub 2@, then to ...
  2901. @cw "D"z ~dh sub 1 ~dv sub 1 ~dh sub 2 ~dv sub 2@ ... for any other @z@ is uninterpreted
  2902. .LP
  2903. In all of these, @dh, ~dv@ is an increment on the current horizontal and
  2904. vertical position,
  2905. with down and right positive.
  2906. All distances and dimensions are in units.
  2907. .PP
  2908. The device control functions begin with
  2909. .CW x ,
  2910. then a command, then other parameters.
  2911. .IP
  2912. .ta .8i 1.2i
  2913. .nf
  2914. .ft CW
  2915. x T \f2s\fP \f1name of typesetter is @s@\f(CW
  2916. x r \f2n h v\fP \f1resolution is @n@ units/inch;\f(CW
  2917. \f1@h@ = minimum horizontal motion, @v@ = minimum vertical\f(CW
  2918. x i \f1initialize\fP
  2919. x f \f2n s\fP \f1mount font @s@ on font position @n@\f(CW
  2920. x p \f1pause\(emcan restart\f(CW
  2921. x s \f1stop\(emdone forever\f(CW
  2922. x t \f1generate trailer information, if any\f(CW
  2923. x H \f2n\fP \f1set character height to @n@\f(CW
  2924. x S \f2n\fP \f1set slant to @n@\f(CW
  2925. x X \f2any\fP \f1generated by the \&\f(CW\eX\fP function\f(CW
  2926. x \f2any\fP \f1to be ignored if not recognized\f(CW
  2927. .LP
  2928. Subcommands like
  2929. .CW i '' ``
  2930. may be spelled out like
  2931. .CW init ''. ``
  2932. .PP
  2933. The commands
  2934. .CW "x T" ,
  2935. .CW "x r " ...,
  2936. and
  2937. .CW "x i"
  2938. must occur first;
  2939. fonts must be mounted before they can be used;
  2940. .CW "x s
  2941. comes last.
  2942. There are no other order requirements.
  2943. .PP
  2944. The following is the output from
  2945. .CW hello, "" ``
  2946. .CW world ''
  2947. for a typical printer,
  2948. as described in §23:
  2949. .P1
  2950. x T utf
  2951. x res 720 1 1
  2952. x init
  2953. V0
  2954. p1
  2955. .P2
  2956. .P1
  2957. x font 1 R
  2958. x font 2 I
  2959. x font 3 B
  2960. x font 4 BI
  2961. x font 5 CW
  2962. x font 6 H
  2963. x font 7 HB
  2964. x font 8 HX
  2965. x font 9 S1
  2966. x font 10 S
  2967. .P2
  2968. .P1
  2969. s10
  2970. f1
  2971. H0
  2972. s10
  2973. f1
  2974. V0
  2975. H720
  2976. V120
  2977. ch
  2978. 50e44l28l28o50,w58w72o50r33l28dn120 0
  2979. x trailer
  2980. V7920
  2981. x stop
  2982. .P2
  2983. .PP
  2984. \*(Tr output is normally not redundant;
  2985. size and font changes and position information are not included
  2986. unless needed.
  2987. Nevertheless, each page is self-contained, for the benefit of postprocessors
  2988. that re-order pages or process only a subset.
  2989. .NH
  2990. Device and Font Description Files
  2991. .PP
  2992. The parameters that describe a output device
  2993. .I name
  2994. are read
  2995. from the directory
  2996. .CW /sys/lib/troff/font/dev@name@ ,
  2997. each time
  2998. \*(TR
  2999. is invoked.
  3000. The device name is provided by default,
  3001. by the environment variable
  3002. .CW TYPESETTER ,
  3003. or by a command-line argument
  3004. .CW -T@name@ .
  3005. The default device name is
  3006. .CW utf ,
  3007. for \s-1UTF\s0-encoded Unicode characters.
  3008. The pre-defined string
  3009. .CW .T
  3010. contains the name of the device.
  3011. The
  3012. .CW -F
  3013. command-line option may be used to change the default directory.
  3014. .......
  3015. .sc "Device description file.
  3016. General parameters of the device are stored, one per line, in
  3017. the file
  3018. .CW /sys/lib/troff/font/dev@name@/DESC ,
  3019. as a sequence of names and values.
  3020. \*(Tr recognizes these parameters, and ignores any
  3021. others that may be present for specific drivers:
  3022. .IP
  3023. .nf
  3024. .ta 1i
  3025. @cw fonts ~ n ~ F sub 1 ~F sub 2 ~. . .~ F sub n@
  3026. @cw sizes ~ s sub 1 ~ s sub 2 ~ . . . cw 0@
  3027. @cw res ~n@
  3028. @cw hor ~n@
  3029. @cw vert ~n@
  3030. @cw unitwidth ~n@
  3031. @cw charset@
  3032. \f2list of multi-character character names (optional)\fP
  3033. .LP
  3034. The @F sub i@ are font names
  3035. to be initially mounted.
  3036. The list of sizes is a set of integers representing
  3037. some or all of the legal sizes the device can produce,
  3038. terminated by a zero.
  3039. The
  3040. .CW res
  3041. parameter gives the resolution of the machine in units per inch;
  3042. .CW hor
  3043. and
  3044. .CW ver
  3045. give the minimum number of units that can be moved
  3046. horizontally and vertically.
  3047. .PP
  3048. Character widths for each font are assumed to be given in machine units
  3049. at point size
  3050. .CW unitwidth .
  3051. (In other words, a character with a width of
  3052. @n@ is @n@ units wide at size
  3053. .CW unitwidth .)
  3054. All widths are integers at all sizes.
  3055. .PP
  3056. A list of valid character names may be introduced by
  3057. .CW charset ;
  3058. the list of names is optional.
  3059. .PP
  3060. A line whose first non-blank character is
  3061. .CW #
  3062. is a comment.
  3063. Except that
  3064. .CW charset
  3065. must occur last, parameters may appear in any order.
  3066. .PP
  3067. Here is a subset of the
  3068. .CW DESC
  3069. file for a typical Postscript printer:
  3070. .P1
  3071. # Description file for Postscript printers.
  3072. fonts 10 R I B BI CW H HB HX S1 S
  3073. sizes 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
  3074. 24 25 26 27 28 29 30 31 32 33 34 35 36 38 40 44 48 54 60 72 0
  3075. res 720
  3076. hor 1
  3077. vert 1
  3078. unitwidth 10
  3079. charset
  3080. hy ct fi fl ff Fi Fl dg em 14 34 12 en aa
  3081. ga ru sc dd -> br Sl ps cs cy as os =. ld
  3082. rd le ge pp -+ ob vr
  3083. sq bx ci fa te ** pl mi eq ~= *A *B *X *D
  3084. *E *F *G *Y *I *K *L *M *N *O *P *R *H *S *T *U *W
  3085. *C *Q *Z ul rn *a *b *x *d *e *f *g *y *i *k
  3086. *l *m *n *o *p *h *r *s *t *u *w *c *q *z
  3087. .P2
  3088. .sc "Font description files.
  3089. Each font is described by an analogous description file,
  3090. which begins with parameters of the font, one per line, followed by a
  3091. list of characters and widths.
  3092. The file for font
  3093. .I f
  3094. is
  3095. .CW /sys/lib/troff/font/dev@name@/@f@ .
  3096. .IP
  3097. .ta 1.7i
  3098. .nf
  3099. @cw name ~str@ name of font is @str@
  3100. @cw ligatures ~ ". . ." ~ cw "0"@ list of ligatures
  3101. @cw spacewidth ~n@ width of a space on this font
  3102. @cw special@ this is a special font
  3103. @cw charset@
  3104. \f2list of character name, width, ascender/descender, code\fP, tab separated
  3105. .LP
  3106. The
  3107. .CW name
  3108. and
  3109. .CW charset
  3110. fields are mandatory;
  3111. .CW charset
  3112. must be last.
  3113. Comments are permitted,
  3114. as are other unrecognized parameters.
  3115. .PP
  3116. Each line following
  3117. .CW charset
  3118. describes one character: its name, its width in units as described above,
  3119. ascender/descender information, and a decimal, octal or hexadecimal value
  3120. by which the output device knows it
  3121. (the
  3122. .CW \eN
  3123. ``number'' of the character).
  3124. The character name is arbitrary, except that
  3125. .CW ---
  3126. signifies an unnamed character.
  3127. If the width field contains
  3128. .CW \&" ,
  3129. the name is a synonym for the previous character.
  3130. The ascender/descender field is 1 if
  3131. the character has a descender (hangs below the baseline, like
  3132. .CW y ),
  3133. is 2 if it has an ascender (is tall, like
  3134. .CW Y ),
  3135. is 3 if both,
  3136. and is 0 if neither.
  3137. The value is returned
  3138. in the
  3139. .CW ct
  3140. register, as computed by the
  3141. .CW \ew
  3142. function (§11.2).
  3143. .PP
  3144. Here are excerpts from a typical font description file
  3145. for the same Postscript printer.
  3146. .P1
  3147. hy 33 0 45 hyphen \e(hy
  3148. - " - is a synonym for \e(hy
  3149. .sp .3
  3150. Q 72 3 81
  3151. .sp .3
  3152. a 44 0 97
  3153. b 50 2 98
  3154. c 44 0 99
  3155. d 50 2 100
  3156. y 50 1 121
  3157. .sp .3
  3158. em 100 0 208
  3159. --- 44 2 220 Pound symbol £, \eN'220'
  3160. --- 36 0 221 centered dot \eN'221'
  3161. .P2
  3162. This says, for example, that the width of the letter
  3163. .CW a
  3164. is 44 units at point size 10,
  3165. the value of
  3166. .CW unitwidth .
  3167. Point sizes are scaled linearly and rounded, so the width of
  3168. .CW a
  3169. will be 44 at size 10, 40 at size 9, 35 at size 8,
  3170. and so on.
  3171. .sp 100
  3172. .BP
  3173. .fp 8 C CW
  3174. .tr &.
  3175. .tr |
  3176. .tr ~|
  3177. .TL
  3178. Tutorial Examples
  3179. .SP
  3180. ....2C
  3181. .sp .25i
  3182. .SH
  3183. Introduction
  3184. .PP
  3185. It is almost always necessary to
  3186. prepare at least a small set of macro definitions
  3187. to describe a document.
  3188. Such common formatting needs
  3189. as page margins and footnotes
  3190. are deliberately not built into \*(NR and \*(TR.
  3191. Instead,
  3192. the macro and string definition, number register, diversion,
  3193. environment switching, page-position trap, and conditional input mechanisms
  3194. provide the basis for user-defined implementations.
  3195. .PP
  3196. For most uses, a standard package like
  3197. .CW -ms
  3198. or
  3199. .CW -mm
  3200. is the right choice.
  3201. The next stage is to augment that,
  3202. or to selectively replace macros from the standard package.
  3203. The last stage, much harder,
  3204. is to write one's own from scratch.
  3205. This is not a task for the novice.
  3206. .PP
  3207. The examples discussed here are intended to be useful and somewhat realistic,
  3208. but will not necessarily cover all relevant contingencies.
  3209. Explicit numerical parameters are used
  3210. in the examples
  3211. to make them easier to read and to
  3212. illustrate typical values.
  3213. In many cases, number registers would be used
  3214. to reduce the number of places where numerical
  3215. information is kept,
  3216. and to concentrate conditional parameter initialization
  3217. like that which depends on whether \*(TR or \*(NR is being used.
  3218. .SH
  3219. Page Margins
  3220. .PP
  3221. As discussed in §3,
  3222. header and footer macros are usually defined
  3223. to describe the top and bottom page margin areas respectively.
  3224. A trap is planted at page position 0 for the header, and at
  3225. \fI-N\fR (\fIN\fR from the page bottom) for the footer.
  3226. The simplest such definitions might be
  3227. .P1 .1i
  3228. &de hd \e"define header
  3229. \&'sp 1i
  3230. && \e"end definition
  3231. &de fo \e"define footer
  3232. \&'bp
  3233. && \e"end definition
  3234. &wh 0 hd
  3235. &wh -1i fo
  3236. .P2
  3237. which provide blank 1 inch top and bottom margins.
  3238. The header will occur on the \fIfirst\fR page
  3239. only if the definition and trap exist prior to
  3240. the initial pseudo-page transition (§3).
  3241. In fill mode, the output line that springs the footer trap
  3242. was typically forced out because some part or whole word didn't fit on it.
  3243. If anything in the footer and header that follows causes a break,
  3244. that word or part word will be forced out.
  3245. In this and other examples,
  3246. requests like \&\f(CWbp\fR and \&\f(CWsp\fR that normally cause breaks are invoked using
  3247. the no-break control character \&\f(CW'\fR
  3248. to avoid this.
  3249. When the header/footer design contains material
  3250. requiring independent text processing, the
  3251. environment may be switched, avoiding
  3252. most interaction with the running text.
  3253. .PP
  3254. A more realistic example would be
  3255. .P1 .1i
  3256. &de hd \e"header
  3257. &if \e\en%>1 \e{\e
  3258. \&'sp ~0.5i-1 \e"tl base at 0.5i
  3259. &tl ''- % -'' \e"centered page number
  3260. &ps \e"restore size
  3261. &ft \e"restore font
  3262. &vs \e} \e"restore vs
  3263. \&'sp ~1.0i \e"space to 1.0i
  3264. &ns \e"turn on no-space mode
  3265. &&
  3266. &de fo \e"footer
  3267. &ps 10 \e"set footer/header size
  3268. &ft R \e"set font
  3269. &vs 12p \e"set baseline spacing
  3270. &if \e\en%=1 \e{\e
  3271. \&'sp ~\e\en(.pu-0.5i-1 \e"tl base 0.5i up
  3272. &tl ''- % -'' \e} \e"first page number
  3273. \&'bp
  3274. &&
  3275. &wh 0 hd
  3276. &wh -1i fo
  3277. .P2
  3278. which sets the size, font, and baseline spacing for the
  3279. header/footer material, and ultimately restores them.
  3280. The material in this case is a page number at the bottom of the
  3281. first page and at the top of the remaining pages.
  3282. The \&\f(CWsp\fR's refer to absolute positions to avoid
  3283. dependence on the baseline spacing.
  3284. Another reason for doing this in the footer
  3285. is that the footer is invoked by printing a line whose
  3286. vertical spacing swept past the trap position by possibly
  3287. as much as the baseline spacing.
  3288. No-space mode is turned on at the end of \&\f(CWhd\fR
  3289. to render ineffective
  3290. accidental occurrences of \&\f(CWsp\fR at the top of the running text.
  3291. .PP
  3292. This method of restoring size, font, etc., presupposes
  3293. that such requests (that set \fIprevious\fR value) are \fInot\fR
  3294. used in the running text.
  3295. A better scheme is to save and restore both the current \fIand\fR
  3296. previous values as shown for size in the following:
  3297. .P1 .1i
  3298. &de fo
  3299. &nr s1 \e\en(.s \e"current size
  3300. &ps
  3301. &nr s2 \e\en(.s \e"previous size
  3302. & --- \e"rest of footer
  3303. &&
  3304. &de hd
  3305. & --- \e"header stuff
  3306. &ps \e\en(s2 \e"restore previous size
  3307. &ps \e\en(s1 \e"restore current size
  3308. &&
  3309. .P2
  3310. Page numbers may be printed in the bottom margin
  3311. by a separate macro triggered during the footer's
  3312. page ejection:
  3313. .P1 .1i
  3314. &de bn \e"bottom number
  3315. &tl ''- % -'' \e"centered page number
  3316. &&
  3317. &wh -0.5i-1v bn \e"tl base 0.5i up
  3318. .P2
  3319. .SH
  3320. Paragraphs and Headings
  3321. .PP
  3322. The housekeeping
  3323. associated with starting a new paragraph should be collected
  3324. in a paragraph macro
  3325. that, for example,
  3326. does the desired preparagraph spacing,
  3327. forces the correct font, size, baseline spacing, and indent,
  3328. checks that enough space remains for \fImore than one\fR line,
  3329. and
  3330. requests a temporary indent.
  3331. .P1 .1i
  3332. &de pg \e"paragraph
  3333. &br \e"break
  3334. &ft R \e"force font,
  3335. &ps 10 \e"size,
  3336. &vs 12p \e"spacing,
  3337. &in 0 \e"and indent
  3338. &sp 0.4 \e"prespace
  3339. &ne 1+\e\en(.Vu \e"want more than 1 line
  3340. &ti 0.2i \e"temp indent
  3341. &&
  3342. .P2
  3343. The first break in \&\f(CWpg\fR
  3344. will force out any previous partial lines,
  3345. and must occur before the \&\f(CWvs\fR.
  3346. The forcing of font, etc., is
  3347. partly a defense against prior error and
  3348. partly to permit
  3349. things like section heading macros to
  3350. set parameters only once.
  3351. The prespacing parameter is suitable for \*(TR;
  3352. a larger space, at least as big as the output device vertical resolution, would be
  3353. more suitable in \*(NR.
  3354. The choice of remaining space to test for in the \&\f(CWne\fR
  3355. is the smallest amount greater than one line
  3356. (the \&\f(CW.V\fR is the available vertical resolution).
  3357. .PP
  3358. A macro to automatically number section headings
  3359. might look like:
  3360. .P1 .1i
  3361. &de sc \e"section
  3362. & --- \e"force font, etc.
  3363. &sp 0.4 \e"prespace
  3364. &ne 2.4+\e\en(.Vu \e"want 2.4+ lines
  3365. .lg 0
  3366. &fi
  3367. .lg
  3368. \e\en+S.
  3369. &&
  3370. &nr S 0 1 \e"init S
  3371. .P2
  3372. The usage is \&\f(CW.sc\fR,
  3373. followed by the section heading text,
  3374. followed by \&\f(CW.pg\fR.
  3375. The \&\f(CWne\fR test value includes one line of heading,
  3376. 0.4 line in the following \&\f(CWpg\fR, and
  3377. one line of the paragraph text.
  3378. A word consisting of the next section number and a period is
  3379. produced to begin the heading line.
  3380. The format of the number may be set by \&\f(CWaf\fR (§8).
  3381. .PP
  3382. Another common form is the labeled, indented paragraph,
  3383. where the label protrudes left into the indent space.
  3384. .P1 .1i
  3385. &de lp \e"labeled paragraph
  3386. &pg
  3387. &in 0.5i \e"paragraph indent
  3388. &ta 0.2i 0.5i \e"label, paragraph
  3389. &ti 0
  3390. \et\e\e$1\et\ec \e"flow into paragraph
  3391. &&
  3392. .P2
  3393. The intended usage is ``\&\f(CW.lp\fR \fIlabel\fR\|'';
  3394. \fIlabel\fR will begin at 0.2 inch, and
  3395. cannot exceed a length of 0.3 inch without intruding into
  3396. the paragraph.
  3397. The label could be right adjusted against 0.4 inch by
  3398. setting the tabs instead with \&\f(CW.ta|0.4iR|0.5i\fR.
  3399. The last line of \&\f(CWlp\fR ends with \&\f(CW\ec\fR so that
  3400. it will become a part of the first line of the text
  3401. that follows.
  3402. .SH
  3403. Multiple Column Output
  3404. .PP
  3405. The production of multiple column pages requires
  3406. the footer macro to decide whether it was
  3407. invoked by other than the last column,
  3408. so that it will begin a new column rather than
  3409. produce the bottom margin.
  3410. The header can initialize a column register that
  3411. the footer will increment and test.
  3412. The following is arranged for two columns, but
  3413. is easily modified for more.
  3414. .P1 .1i
  3415. &de hd \e"header
  3416. & ---
  3417. &nr cl 0 1 \e"init column count
  3418. &mk \e"mark top of text
  3419. &&
  3420. .P2
  3421. .P1 .1i
  3422. &de fo \e"footer
  3423. &ie \e\en+(cl<2 \e{\e
  3424. &po +3.4i \e"next column; 3.1+0.3
  3425. &rt \e"back to mark
  3426. &ns \e} \e"no-space mode
  3427. &el \e{\e
  3428. &po \e\enMu \e"restore left margin
  3429. & ---
  3430. \&'bp \e}
  3431. &&
  3432. &ll 3.1i \e"column width
  3433. &nr M \e\en(.o \e"save left margin
  3434. .P2
  3435. Typically a portion of the top of the first page
  3436. contains full width text;
  3437. the request for the narrower line length,
  3438. as well as another \&\f(CW.mk\fR would
  3439. be made where the two column output was to begin.
  3440. .SH
  3441. Footnotes
  3442. .PP
  3443. The footnote mechanism to be described is used by
  3444. embedding the footnotes in the input text at the
  3445. point of reference,
  3446. demarcated by an initial \&\f(CW.fn\fR and a terminal \&\f(CW.ef\fR:
  3447. .P1 .1i
  3448. &fn
  3449. \fIFootnote text and control lines...\fP
  3450. &ef
  3451. .P2
  3452. In the following,
  3453. footnotes are processed in a separate environment and diverted
  3454. for later printing in the space immediately prior to the bottom
  3455. margin.
  3456. There is provision for the case where the last collected
  3457. footnote doesn't completely fit in the available space.
  3458. .P1 .1i
  3459. &de hd \e"header
  3460. & ---
  3461. &nr x 0 1 \e"init footnote count
  3462. &nr y 0-\e\enb \e"current footer place
  3463. &ch fo -\e\enbu \e"reset footer trap
  3464. &if \e\en(dn .fz \e"leftover footnote
  3465. &&
  3466. .P2
  3467. .P1 .1i
  3468. &de fo \e"footer
  3469. &nr dn 0 \e"zero last diversion size
  3470. &if \e\enx \e{\e
  3471. &ev 1 \e"expand footnotes in ev1
  3472. &nf \e"retain vertical size
  3473. &FN \e"footnotes
  3474. &rm FN \e"delete it
  3475. .P2
  3476. .P1 .1i
  3477. &if "\e\en(.z"fy" .di \e"end overflow di
  3478. &nr x 0 \e"disable fx
  3479. &ev \e} \e"pop environment
  3480. & ---
  3481. \&'bp
  3482. &&
  3483. .P2
  3484. .P1 .1i
  3485. &de fx \e"process footnote overflow
  3486. &if \e\enx .di fy \e"divert overflow
  3487. &&
  3488. .P2
  3489. .P1 .1i
  3490. &de fn \e"start footnote
  3491. &da FN \e"divert (append) footnote
  3492. &ev 1 \e"in environment 1
  3493. &if \e\en+x=1 .fs \e"if 1st, separator
  3494. &fi \e"fill mode
  3495. &&
  3496. .P2
  3497. .P1 .1i
  3498. &de ef \e"end footnote
  3499. &br \e"finish output
  3500. &nr z \e\en(.v \e"save spacing
  3501. &ev \e"pop ev
  3502. &di \e"end diversion
  3503. &nr y -\e\en(dn \e"new footer position,
  3504. &if \e\enx=1 .nr y -(\e\en(.v-\e\enz) \e
  3505. \e"uncertainty correction
  3506. &ch fo \e\enyu \e"y is negative
  3507. &if (\e\en(nl+1v)>(\e\en(.p+\e\eny) \e
  3508. &ch fo \e\en(nlu+1v \e"didn't fit
  3509. &&
  3510. .P2
  3511. .P1 .1i
  3512. &de fs \e"separator
  3513. \el'1i' \e"1 inch rule
  3514. &br
  3515. &&
  3516. .P2
  3517. .P1 .1i
  3518. &de fz \e"get leftover footnote
  3519. &fn
  3520. &nf \e"retain vertical size
  3521. &fy \e"where fx put it
  3522. &ef
  3523. &&
  3524. .P2
  3525. .P1 .1i
  3526. &nr b 1.0i \e"bottom margin size
  3527. &wh 0 hd \e"header trap
  3528. &wh 12i fo \e"footer trap->temp pos
  3529. &wh -\e\enbu fx \e"fx at footer position
  3530. &ch fo -\e\enbu \e"conceal fx with fo
  3531. .P2
  3532. .PP
  3533. The header \&\f(CWhd\fR initializes a footnote count register \&\f(CWx\fR,
  3534. and sets both the current footer trap position register \&\f(CWy\fR and
  3535. the footer trap itself to a nominal position specified in
  3536. register \&\f(CWb\fR.
  3537. In addition, if the register \&\f(CWdn\fR indicates a leftover footnote,
  3538. \&\f(CWfz\fR is invoked to reprocess it.
  3539. The footnote start macro \&\f(CWfn\fR begins a diversion (append) in environment 1,
  3540. and increments the count \&\f(CWx\fR; if the count is one, the footnote separator \&\f(CWfs\fR
  3541. is interpolated.
  3542. The separator is kept in a separate macro to permit user redefinition.
  3543. .PP
  3544. The footnote end macro \&\f(CWef\fR restores
  3545. the previous environment and ends the diversion after saving the spacing size in register \&\f(CWz\fR.
  3546. \&\f(CWy\fR is then decremented by the size of the footnote, available in \&\f(CWdn\fR;
  3547. then on the first footnote, \&\f(CWy\fR is further decremented by the difference
  3548. in vertical baseline spacings of the two environments, to
  3549. prevent the late triggering of the footer trap from causing the last
  3550. line of the combined footnotes to overflow.
  3551. The footer trap is then set to the lower (on the page) of \&\f(CWy\fR or the current page position (\&\f(CWnl\fR)
  3552. plus one line, to allow for printing the reference line.
  3553. .PP
  3554. If indicated by \&\f(CWx\fR, the footer \&\f(CWfo\fR rereads the footnotes from \&\f(CWFN\fR in nofill mode
  3555. in environment 1,
  3556. and deletes \&\f(CWFN\fR.
  3557. If the footnotes were too large to fit, the macro \&\f(CWfx\fR will be trap-invoked to redivert
  3558. the overflow into \&\f(CWfy\fR,
  3559. and the register \&\f(CWdn\fR will later indicate to the header whether \&\f(CWfy\fR is empty.
  3560. .PP
  3561. Both \&\f(CWfo\fR and \&\f(CWfx\fR are planted in the nominal footer trap position in an order
  3562. that causes \&\f(CWfx\fR to be concealed unless the \&\f(CWfo\fR trap is moved.
  3563. The footer then terminates the overflow diversion, if necessary, and
  3564. zeros \&\f(CWx\fR to disable \&\f(CWfx\fR,
  3565. because the uncertainty correction
  3566. together with a not-too-late triggering of the footer can result
  3567. in the footnote rereading finishing before reaching the \&\f(CWfx\fR trap.
  3568. .PP
  3569. A good exercise for the student is to combine the multiple-column and footnote mechanisms.
  3570. .SH
  3571. The Last Page
  3572. .PP
  3573. After the last input file has ended, \*(NR and \*(TR
  3574. invoke the \fIend macro\fR (§7), if any,
  3575. and when it finishes, eject the remainder of the page.
  3576. During the eject, any traps encountered are processed normally.
  3577. At the end of this last page, processing terminates
  3578. unless a partial line, word, or partial word remains.
  3579. If it is desired that another page be started, the end-macro
  3580. .P1 .1i
  3581. &de en \e"end-macro
  3582. \ec
  3583. \&'bp
  3584. &&
  3585. &em en
  3586. .P2
  3587. will deposit a null partial word,
  3588. and produce another last page.
  3589. ....1C
  3590. .sp 100
  3591. .BP
  3592. ........
  3593. .TL
  3594. Special Character Names
  3595. .SP
  3596. .PP
  3597. The following table lists names for a set of characters,
  3598. most of which have traditionally been provided by \*(TR using
  3599. the `special' or `symbol' font.
  3600. Many of these sequences are old ways to get what are now Unicode
  3601. characters;
  3602. Lucida Sans, for example, has glyphs corresponding to many of these
  3603. but does not have the special sequences.
  3604. Therefore
  3605. the \*(TR sequence
  3606. .CW \e(*F
  3607. gives the character \(*F from the Times font instead of the
  3608. character Φ from the current font, in this case Lucida Sans.
  3609. Not all sequences print on any particular device, including this one; Peter
  3610. faces appear in their place.
  3611. .TS
  3612. center;
  3613. l l20fCW l l20fCW l l20fCW.
  3614. \&\' \e' \(*m \e(*m \(~= \e(~=
  3615. \` \e` \(*n \e(*n \(ap \e(ap
  3616. \(em \e(em \(*c \e(*c \(!= \e(!=
  3617. \(en \e(en \(*o \e(*o \(-> \e(->
  3618. \(hy \e(hy \(*p \e(*p \(<- \e(<-
  3619. \- \e- \(*r \e(*r \(ua \e(ua
  3620. \(bu \e(bu \(*s \e(*s \(da \e(da
  3621. \(sq \e(sq \(ts \e(ts \(mu \e(mu
  3622. \(ru \e(ru \(*t \e(*t \(di \e(di
  3623. \(14 \e(14 \(*u \e(*u \(+- \e(+-
  3624. \(12 \e(12 \(*f \e(*f \(cu \e(cu
  3625. \(34 \e(34 \(*x \e(*x \(ca \e(ca
  3626. \(fi \e(fi \(*q \e(*q \(sb \e(sb
  3627. \(fl \e(fl \(*w \e(*w \(sp \e(sp
  3628. \(ff \e(ff \(*A \e(*A \(ib \e(ib
  3629. \(Fi \e(Fi \(*B \e(*B \(ip \e(ip
  3630. \(Fl \e(Fl \(*G \e(*G \(if \e(if
  3631. \(de \e(de \(*D \e(*D \(pd \e(pd
  3632. \(dg \e(dg \(*E \e(*E \(gr \e(gr
  3633. \(fm \e(fm \(*Z \e(*Z \(no \e(no
  3634. \(ct \e(ct \(*Y \e(*Y \(is \e(is
  3635. \(rg \e(rg \(*H \e(*H \(pt \e(pt
  3636. \(co \e(co \(*I \e(*I \(es \e(es
  3637. \(pl \e(pl \(*K \e(*K \(mo \e(mo
  3638. \(mi \e(mi \(*L \e(*L \(br \e(br
  3639. \(eq \e(eq \(*M \e(*M \(dd \e(dd
  3640. \(** \e(** \(*N \e(*N \(rh \e(rh
  3641. \(sc \e(sc \(*C \e(*C \(lh \e(lh
  3642. \(aa \e(aa \(*O \e(*O \(L1 \e(bs
  3643. \(ga \e(ga \(*P \e(*P \(or \e(or
  3644. \(ul \e(ul \(*R \e(*R \(ci \e(ci
  3645. \(sl \e(sl \(*S \e(*S \(lt \e(lt
  3646. \(*a \e(*a \(*T \e(*T \(lb \e(lb
  3647. \(*b \e(*b \(*U \e(*U \(rt \e(rt
  3648. \(*g \e(*g \(*F \e(*F \(rb \e(rb
  3649. \(*d \e(*d \(*X \e(*X \(lk \e(lk
  3650. \(*e \e(*e \(*Q \e(*Q \(rk \e(rk
  3651. \(*z \e(*z \(*W \e(*W \(bv \e(bv
  3652. \(*y \e(*y \(sr \e(sr \(lf \e(lf
  3653. \(*h \e(*h \(rn \e(rn \(rf \e(rf
  3654. \(*i \e(*i \(>= \e(>= \(lc \e(lc
  3655. \(*k \e(*k \(<= \e(<= \(rc \e(rc
  3656. \(*l \e(*l \(== \e(== \d\h'-5m'\(LH\u \e(LH
  3657. .TE