Home

NROFF⁄TROFF User`s Manual

image

Contents

1. a n t and newline are interpreted in copy mode 7 2 NROFF TROFF User s Manual October 11 1976 Predefined General Number Registers Section Reference 3 11 2 74 74 11 3 15 4 1 11 2 11 2 Register Name ct dl dn dw dy hp In mo nl sb st yr Description Current page number Character type set by width function Width maximum of last completed diversion Height vertical size of last completed diversion Current day of the week 1 7 Current day of the month 1 31 Current horizontal place on input line Output line number Current month 1 12 Vertical position of last printed text base line Depth of string below base line generated by width function Height of string above base line generated by width function Last two digits of current year Predefined Read Only Number Registers Section Reference 73 11 1 11 1 5 2 74 VAAD W 2 3 7 5 4 1 5 1 11 2 Register Name k ukkukhhbbob EMN EH EEE ELEY Description Number of arguments available at the current macro level Set to 1 in TROFF if a option used always 1 in NROFF Available horizontal resolution in basic units Set to 1 in NROFF if T option used always 0 in TROFF Available vertical resolution in basic units Post line extra line space most recently utilized using x N Number of lines read from current input file Current vertical place in current d
2. restore vs sp 1 0i space to 1 0i ns turn on no space mode de fo footer ps 10 set footer header size ft R set font vs 12p set base line spacing if n 1 sp n pu 0 5i 1 tl base 0 5i up tl 7 first page number bp wh 0 hd wh 1i fo which sets the size font and base line spacing for the headerfooter material and ultimately restores them The material in this case is a page number at the bot tom of the first page and at the top of the remaining pages If TROFF is used a cut mark is drawn in the form of root en s at each margin The sp s refer to absolute positions to avoid dependence on the base line spacing Another reason for this in the footer is that the footer is invoked by printing a line whose vertical spacing swept past the trap position by possi bly as much as the base line spacing The no space mode is turned on at the end of hd to render ineffec tive accidental occurrences of sp at the top of the run ning text NROFF TROFF User s Manual October 11 1976 The above method of restoring size font etc presup poses that such requests that set previous value are not used in the running text A better scheme is save and restore both the current and previous values as shown for size in the following de fo nr s1 n s ps nr s2 n s previous size rest of footer current size de hd eo header stuff ps n s2 restor
3. Output saved vertical space No space mode has no effect Used to finally output a block of vertical space requested by an earlier sv request ns space D No space mode turned on When on the no space mode inhi bits sp requests and bp requests without a next page number The no space mode is turned off when a line of output occurs or with rs Jf Bhs NROFF TROFF User s Manual October 11 1976 rs space D Restore spacing The no space mode is turned off Blank text line B Causes a break and output of a blank line exactly like sp 1 6 Line Length and Indenting The maximum line length for fill mode may be set with Il The indent may be set with in an indent applicable to only the next output line may be set with ti The line length includes indent space but not page offset space The line length minus the indent is the basis for centering with ce The effect of Il in or ti is delayed if a par tially collected line exists until after that line is output In fill mode the length of text on an output line is less than or equal to the line length minus the indent The current line length and indent are available in registers l and i respectively The length of three part titles produced by tl see 14 is independently set by It Request Initial If No Form Value Argument Notes Explanation J N 6 5 in previous E m Line length is set to N In TROFF the maximum line length page offset is about 7 54 inches in N N 0 pre
4. NROFF TROFF User s Manual October 11 1976 If an invoked argument doesn t exist a null string results For example the macro xx may be defined by de xx begin definition Today is 1 the 2 end definition and called by xx Monday 14th to produce the text Today is Monday the 14th Note that the was concealed in the definition with a prepended The number of currently available arguments is in the register No arguments are available at the top non macro level in this implementation Because string referencing is implemented as a input level push down no arguments are available from within a string No arguments are available within a trap invoked macro Arguments are copied in copy mode onto a stack where they are available for reference The mechanism does not allow an argument to contain a direct reference to a Jong string interpolated at copy time and it is advisable to conceal string references with an extra to delay interpolation until argument reference time 7 4 Diversions Processed output may be diverted into a macro for purposes such as footnote processing see Tutorial T5 or determining the horizontal and vertical size of some text for conditional changing of pages or columns A single diversion trap may be set at a specified vertical position The number registers dn and dl respectively contain the vertical and horizontal size of the most recently ended diversion Processed text that is divert
5. Remove register R Tab settings left type unless t R right C centered Tab repetition character Leader repetition character Set field delimiter a and pad character b 10 Input and Output Conventions and Character Translations ta Nt 0 8 0 5in none tec none none le c none fe a b off off ecc 0 on dg N on on ul N off N 1 cu N off N 1 uf F Italic Italic C C 2c 7 i tr abcd none m m Ommi Set escape character Turn off escape character mechanism Ligature mode on if N gt 0 Underline italicize in TROFF N input lines Continuous underline in NROFF like ul in TROFF Underline font set to F to be switched to by ul Set control character to c Set nobreak control character to c Translate a to b etc on output 11 Local Horizontal and Vertical Motions and the Width Function 12 Overstrike Bracket Line drawing and Zero width Functions 13 Hyphenation nh hyphenate hy N hyphenate ehe c hw wordl ignored 14 Three Part Titles tl left center right pec At N 6 5 in hyphenate off previous 15 Output Line Numbering nm tN MSI nn N off N 1 E E E No hyphenation Hyphenate N mode Hyphenation indicator character c Exception words Three part title Page number character Length of title Number mode on or off set parameters Do not number next N lines NROFF TROFF User s Manual October 11
6. c the next encountered text will be taken as a continuation of the interrupted word If the intervening control lines cause a break any partial line will be forced out along with any partial word Request Initial If No Form Value Argument Notes Explanation br B Break The filling of the line currently being collected is stopped and the line is output without adjustment Text lines beginning with space characters and empty text lines blank lines also cause a break fi fill on B E Fill subsequent output lines The register u is 1 in fill mode and 0 in nofill mode nf fill on B E Nofill Subsequent output lines are neither filled nor adjusted Input text lines are copied directly to output lines without regard for the current line length ad c adj both adjust E Line adjustment is begun If fill mode is not on adjustment will be deferred until fill mode is back on If the type indica tor c is present the adjustment type is changed as shown in the following table Indicator Adjust Type l adjust left margin only r adjust right margin only c center born adjust both margins absent unchanged 12 NROFF TROFF User s Manual October 11 1976 na adjust E Noadjust Adjustment is turned off the right margin will be ragged The adjustment type for ad is not changed Output line filling still occurs if fill mode is on ce N off N 1 B E Center the next N input text lines within the current line length
7. 1 1 v Vertical line space V V none Default see below In NROFF both the em and the en are taken to be equal to the C which is output device dependent common values are 1 10 and 1 12 inch Actual character widths in NROFF need not be all the same and constructed char acters such as gt are often extra wide The default scaling is ems for the horizontally oriented requests and functions Il in ti ta It po mc h and l Vs for the vertically oriented requests and functions pl wh ch dt sp Sv ne rt v x and L p for the vs request and u for the requests nr if and ie Al other requests ignore any scale indicators When a number register containing an already appropriately scaled number is interpolated to provide numerical input the unit scale indicator u may need to be appended to prevent an additional inap propriate default scaling The number N may be specified in decimal fraction form but the parameter finally stored is rounded to an integer number of basic units NROFF TROFF User s Manual October 11 1976 The absolute position indicator may be prepended to a number N to generate the distance to the vertical or hor izontal place N For vertically oriented requests and functions N becomes the distance in basic units from the current vertical place on the page or in a diversion 7 4 to the the vertical place N For all other requests and functions N becomes the distance from the curre
8. 6 nm 0 In addition a line number indent and the number text separation S may be specified in digit spaces Further it can be specified that only those line numbers that are multiples of some number M are to be printed the others will appear as blank number fields 05 Request Initial If No Form Value Argument Notes Explanation nm N MSI off E Line number mode If N is given line numbering is turned on and the next output line numbered is numbered N Default values are M 1 S 1 and ZJ 0 Parameters corresponding to missing arguments are unaffected a non numeric argument is considered missing In the absence of all arguments numbering is turned off the next line number is preserved for possible further use in number register In ann N N 1 E The next N text output lines are not numbered 9 As an example the paragraph portions of this section are numbered with M 3 nm 1 3 was placed at the beginning nm was placed at the end of the first paragraph and nm 0 was placed in front of this para graph and nm finally placed at the end Line lengths were also changed by w 0000 u to keep the right 12 side aligned Another example is nm 5 5 x 3 which turns on numbering with the line number of the next line to be 5 greater than the last numbered line with M 5 with spacing S untouched and with the indent J a DD NROFF TROFF User s Manual October 11 1976 set to 3 16 Conditional Acceptance of Input In th
9. Tabs and leaders The ASCII horizontal tab character and the ASCII SOH hereafter known as the leader character can both be used to generate either horizontal motion or a string of repeated characters The length of the generated entity is governed by internal tab stops specifiable with ta The default difference is that tabs gen erate motion and leaders generate a string of periods te and Ie offer the choice of repeated character or motion There are three types of internal tab stops left adjusting right adjusting and centering In the following table D is the distance from the current position on the input line where a tab or leader was found to the next tab stop next string consists of the input characters following the tab or leader up to the next tab or leader or end of line and W is the width of next string Tab Length of motion or Location of type repeated characters next string Left D Following D Right D W Right adjusted within D Centered D W2 Centered on right end of D me ee NROFF TROFF User s Manual October 11 1976 The length of generated motion is allowed to be negative but that of a repeated character string cannot be Repeated character strings contain an integer number of characters and any residual distance is prepended as motion Tabs or leaders found after the last tab stop are ignored but may be used as next string terminators Tabs and leaders are not interpreted in copy mode t and a always
10. footnote overflow if nx di fy divert overflow de fn start footnote da FN divert append footnote ev 1 in environment 1 if n x 1 fs if first include separator fi fill mode de ef end footnote br finish output anr z n v save spacing eV pop ev di end diversion nr y n dn new footer position if nx 1 nr y n v nz uncertainty correction ch fo nyu y is negative if n al 1v gt n p ny ch fo n nlu 1ly it didn t fit de fs separator 1i 1 inch rule br de fz get leftover footnote fn nf retain vertical size fy where fx put it ef nr b 1 0i bottom margin size wh 0 hd header trap wh 12i fo footer trap temp position wh nbu fx fx at footer position ch fo nbu conceal fx with fo The header hd initializes a footnote count register x and sets both the current footer trap position register y and the footer trap itself to a nominal position specified in register b In addition if the register dn indicates a leftover footnote fz is invoked to repro cess it The footnote start macro fn begins a diver sion append in environment 1 and increments the count x if the count is one the footnote separator fs is interpolated The separator is kept in a separate macro to permit user redefinition The footnote end macro ef restores the previous environment and ends the diversion after saving the spacing siz
11. minus indent If N 0 any residual count is cleared A break occurs after each of the N input lines If the input line is too long it will be left adjusted 5 Vertical Spacing 5 1 Base line spacing The vertical spacing V between the base lines of successive output lines can be set using the vs request with a resolution of 1 144inch 1 2 point in TROFF and to the output device resolution in NROFF V must be large enough to accommodate the character sizes on the affected output lines For the com mon type sizes 9 12 points usual typesetting practice is to set V to 2 points greater than the point size TROFF default is 10 point type on a 12 point spacing as in this document The current V is available in the v register Multiple V line separation e g double spacing may be requested with Is 5 2 Extra line space If a word contains a vertically tall construct requiring the output line containing it to have extra vertical space before andr after it the extra line space function x N can be imbedded in or attached to that word In this and other functions having a pair of delimiters around their parameter here the delimiter choice is arbitrary except that it can t look like the continuation of a number expression for N If N is negative the output line containing the word will be preceded by N extra vertical space if N is positive the output line containing the word will be followed by N extra vertical space If successi
12. previous mk Note that the sp request 5 3 may be used in all cases instead of rt by spacing to the absolute place stored in a explicit register e g using the sequence mk R sp nRu The use of as control character instead of suppresses the break function Values separated by are for NROFF and TROFF respectively 211 NROFF TROFF User s Manual October 11 1976 4 Text Filling Adjusting and Centering 4 1 Filling and adjusting Normally words are collected from input text lines and assembled into a output text line until some word doesn t fit An attempt is then made the hyphenate the word in effort to assemble a part of it into the output line The spaces between the words on the output line are then increased to spread out the line to the current line length minus any current indent A word is any string of characters delimited by the space character or the beginning end of the input line Any adjacent pair of words that must be kept together neither split across output lines nor spread apart in the adjustment process can be tied together by separating them with the unpaddable space character backslash space The adjusted word spacings are uniform in TROFF and the minimum interword spacing can be controlled with the ss request 2 In NROFF they are normally nonuni form because of quantization to character size spaces however the command line option e causes uniform spacing with full outp
13. size if M is given the em is M points All affected characters are centered in this space including those with an actual width larger than this space Special Font characters occurring while the current font is F are also so treated If N is absent the mode is turned off The mode must be still or again in effect when the characters are physically printed Ignored in NROFF bd F N off P The characters in font F will be artificially emboldened by printing each one twice separated by N 1 basic units A rea sonable value for N is 3 when the character size is in the vicinity of 10 points If N is missing the embolden mode is turned off The column heads above were printed with bd I 3 The mode must be still or again in effect when the characters are physically printed Ignored in NROFF bdSFN off P The characters in the Special Font will be emboldened when ever the current font is F This manual was printed with bdSB3 The mode must be still or again in effect when the characters are physically printed ft F Roman previous E Font changed to F Alternatively imbed fF The font name P is reserved to mean the previous font fp N F R I B S ignored Font position This is a statement that a font named F is mounted on position N 1 4 It is a fatal error if F is not known The phototypesetter has four fonts physically mounted Each font consists of a film strip which can be Notes are explained at the end of the Summary and Ind
14. 1976 Request Initial If No Form Value Argument Notes Explanation 16 Conditional Acceptance of Input if c anything If condition c true accept anything as input for multi line use anything if c anything If condition c false accept anything if N anything u If expression N gt 0 accept anything if N anything u If expression N lt 0 accept anything if string string2 anything If string identical to string2 accept anything dif string string2 anything If string not identical to string2 accept anything eile c anything u If portion of if else all above forms like if el anything Else portion of if else 17 Environment Switching ev N N 0 previous Environment switched push down 18 Insertions from the Standard Input rd prompt prompt BEL Read insertion ex Exit from NROFF TROFF 19 InputOutput File Switching So filename Switch source file push down nx filename end of file Next file pi program Pipe output to program NROFF only 20 Miscellaneous mc c N off E m Set margin character c and separation N tm string newline Print string on terminal UNIX standard message output ig yy y Ignore till call of yy pm all Print macro names and sizes if t present print only total of sizes fl B Flush output buffer 21 Output and Error Messages Notes B Request normally causes a break D Mode or relevant paramet
15. 7 except that the input is discarded The input is read in copy mode and any auto incremented registers will be affected pm all Print macros The names and sizes of all of the defined mac ros and strings are printed on the user s terminal if t is given only the total of the sizes is printed The sizes is given in blocks of 128 characters fl B Flush output buffer Used in interactive debugging to force output 21 Output and Error Messages The output from tm pm and the prompt from rd as well as various error messages are written onto UNIX s standard message output The latter is different from the standard output where NROFF formatted output goes By default both are written onto the user s terminal but they can be independently redirected Various error conditions may occur during the operation of NROFF and TROFF Certain less serious errors hav ing only local impact do not cause processing to terminate Two examples are word overflow caused by a word that is too large to fit into the word buffer in fill mode and line overflow caused by an output line that grew too large to fit in the line buffer in both cases a message is printed the offending excess is discarded and the affected word or line is marked at the point of truncation with a in NROFF and a in TROFF The philosophy is to continue processing if possible on the grounds that output useful for debugging may be produced If a serious error o
16. 9 InputOutput File Switching Request Initial If No Form Value Argument Notes Explanation So filename Switch source file The top input file reading level is switched to filename The effect of an so encountered in a macro is not felt until the input level returns to the file level When the new file ends input is again taken from the original file so s may be nested nx filename end of file Next file is filename The current file is considered ended and the input is immediately switched to filename pi program Pipe output to program NROFF only This request must occur before any printing occurs No arguments are transmit ted to program 20 Miscellaneous Request Initial If No Form Value Argument Notes Explanation sme c N off E m Specifies that a margin character c appear a distance N to the right of the right margin after each non empty text line except those produced by tl If the output line is too long as can happen in nofill mode the character will be appended to the 24 NROFF TROFF User s Manual October 11 1976 line If N is not given the previous N is used the initial N is 0 2 inches in NROFF and 1 em in TROFF The margin charac ter used with this paragraph was a 12 point box rule tm string newline After skipping initial blanks string rest of the line is read in copy mode and written on the user s terminal ig yy Yy E Ignore input lines ig behaves exactly like de
17. FF understands the entire TROFF character set but can in general print only ASCII characters additional characters as may be available on the output device such characters as may be able to be constructed by over striking or other combination and those that can reasonably be mapped into other printable characters The exact behavior is determined by a driving table prepared for each device The characters and _ print as them selves 2 2 Fonts The default mounted fonts are Times Roman R Times Italic I Times Bold B and the Special Mathematical Font S on physical typesetter positions 1 2 3 and 4 respectively These fonts are used in this document The current font initially Roman may be changed among the mounted fonts by use of the ft request or by imbedding at any desired point either fx f xx or WN where x and xx are the name of a mounted 9 NROFF TROFF User s Manual October 11 1976 font and N is a numerical font position It is not necessary to change to the Special font characters on that font are automatically handled A request for a named but not mounted font is ignored TROFF can be informed that any particular font is mounted by use of the fp request The list of known fonts is installation dependent In the subsequent discussion of font related requests F represents either a onetwo character font name or the numerical font position 1 4 The current font is available as numerical position in the read o
18. Model 37 Teletype escape sequences that NROFF produces by default TK is a 37 Teletype simulator postprocessor for printing NROFF output on a Tektronix 4014 TCAT is phototypesetter simulator postprocessor for TROFF that produces an approximation of phototypesetter output on a Tektronix 4014 For example in tbl files eqn troff t options teat the first indicates the piping of TBL s output to EQN s input the second the piping of EQN s output to TROFF s input and the third indicates the piping of TROFF s output to TCAT GCAT can be used to send TROFF g output to the Murray Hill Computation Center The remainder of this manual consists of a Summary and Index a Reference Manual keyed to the index and a set of Tutorial Examples Another tutorial is 5 Joseph F Ossanna References 1 K Thompson D M Ritchie UNIX Programmer s Manual Sixth Edition May 1975 2 B W Kernighan L L Cherry Typesetting Mathematics User s Guide Second Edition Bell Laboratories internal memorandum 3 M E Lesk Tb A Program to Format Tables Bell Laboratories internal memorandum 4 Internal on line documentation on UNIX 5 B W Kernighan A TROFF Tutorial Bell Laboratories internal memorandum NROFF TROFF User s Manual October 11 1976 SUMMARY AND INDEX Request Initial If No Form Value Argument Notes Explanation 1 General Explanation 2 Font and Character Size Control ps N 10 poi
19. N N or N For example fz 3 2 will cause an implicit s 2 every time font 3 is entered and a corresponding s 2 when it is left Special font characters occurring during the reign of font F will have the same size modification If special characters are to be treated differently fzSFN may be used to specify the size treatment of special characters during font F For example fz 3 3 fz S 3 0 will cause automatic reduction of font 3 by 3 points while the special characters would not be affected Any fp request specifying a font on some position must precede fz requests relating to that position New Predefined Number Registers k Read only Contains the horizontal size of the text portion without indent of the current par tially collected output line if any in the current environment Read only A number representing the current adjustment mode and type Can be saved and later given to the ad request to restore a previous mode Read only 1 if the current page is being printed and zero otherwise Read only Contains the current line spacing parameter Is General register access to the input line number in the current input file Contains the same wow value as the read only c register
20. NROFFE TROFF User s Manual Joseph F Ossanna Bell Laboratories Murray Hill New Jersey 07974 Introduction NROFF and TROFF are text processors under the PDP 11 UNIX Time Sharing System that format text for typewriter like terminals and for a Graphic Systems phototypesetter respectively They accept lines of text inter spersed with lines of format control information and format the text into a printable paginated document having a user designed style NROFF and TROFF offer unusual freedom in document styling including arbitrary style headers and footers arbitrary style footnotes multiple automatic sequence numbering for paragraphs sections etc multiple column output dynamic font and point size control arbitrary horizontal and vertical local motions at any point and a family of automatic overstriking bracket construction and line drawing functions NROFF and TROFF are highly compatible with each other and it is almost always possible to prepare input acceptable to both Conditional input is provided that enables the user to embed input expressly destined for either program NROFF can prepare output directly for a variety of terminal types and is capable of utilizing the full resolution of each terminal Usage The general form of invoking NROFF or TROFF at UNIX command level is nroff options files or troff options files where options represents any of a number of option arguments and files represents the list of files conta
21. ROFF by fi fl ff Fi and FI respectively The ligature mode is normally on in TROFF and automatically invokes ligatures during input Request Initial If No Form Value Argument Notes Explanation Jg N off on on Ligature mode is turned on if N is absent or non zero and turned off if N 0 If N 2 only the two character ligatures are automatically invoked Ligature mode is inhibited for request 18 NROFF TROFF User s Manual October 11 1976 macro string register or file names and in copy mode No effect in NROFF 10 3 Backspacing underlining overstriking etc Unless in copy mode the ASCII backspace character is replaced by a backward horizontal motion having the width of the space character Underlining as a form of line drawing is discussed in 12 4 A generalized overstriking function is described in 12 1 NROFF automatically underlines characters in the underline font specifiable with uf normally that on font posi tion 2 normally Times Italic see 2 2 In addition to ft and fF the underline font may be selected by ul and cu Underlining is restricted to an output device dependent subset of reasonable characters Request Initial If No Form Value Argument Notes Explanation cul N off N 1 E Underline in NROFF italicize in TROFF the next N input text lines Actually switch to underline font saving the current font for later restoration other font changes within the span of a ul will take effec
22. can be either a single input line text macro or whatever or a number of input lines In the multi line case the first line must begin with a left delimiter and the last line must end with a right delimiter The request ie if else is identical to if except that the acceptance state is remembered A subsequent and matching el else request then uses the reverse sense of that state ie el pairs may be nested Some examples are pee if e tl Even Page which outputs a title if the page number is even and ie n gt 1 sp 0 5i tl Page sp 1 2i el sp 2 5i which treats page 1 differently from other pages 17 Environment Switching A number of the parameters that control the text processing are gathered together into an environment which can be switched by the user The environment parameters are those associated with requests noting E in their Notes column in addition partially collected lines and words are in the environment Everything else is global ee NROFF TROFF User s Manual October 11 1976 examples are page oriented parameters diversion oriented parameters number registers and macro and string definitions All environments are initialized with default parameter values Request Initial If No Form Value Argument Notes Explanation ev N N 0 previous Environment switched to environment OSNS lt 2 Switching is done in push down fashion so that restoring a previous e
23. ccurs processing terminates and an appropriate message is printed Examples are the inability to create read or write files and the exceeding of certain internal limits that make future output unlikely to be use ful 25 NROFF TROFF User s Manual October 11 1976 TUTORIAL EXAMPLES T1 Introduction Although NROFF and TROFF have by design a syntax reminiscent of earlier text processors with the intent of easing their use it is almost always necessary to prepare at least a small set of macro definitions to describe most documents Such common formatting needs as page margins and footnotes are deliberately not built into NROFF and TROFF Instead the macro and string definition number register diversion environment switching page position trap and condi tional input mechanisms provide the basis for user defined implementations The examples to be discussed are intended to be use ful and somewhat realistic but won t necessarily cover all relevant contingencies Explicit numerical parameters are used in the examples to make them easier to read and to illustrate typical values In many cases number registers would really be used to reduce the number of places where numerical infor mation is kept and to concentrate conditional parame ter initialization like that which depends on whether TROFF or NROFF is being used T2 Page Margins As discussed in 3 header and footer macros are usually defined to describe
24. characters in string the first character on top and the last at the bottom the characters are vertically separated by 1 em and the total pile is centered 1 2em above the current baseline line in NROFF For example b c df E b re rf x 0 5m x 0 5m produces E 12 4 Line drawing The function l Nc will draw a string of repeated c s towards the right for a distance N l is dower case L If c looks like a continuation of an expression for N it may insulated from N with a amp If c is not specified the _ baseline rule is used underline character in NROFF If N is negative a backward horizontal motion of size N is made before drawing the string Any space resulting from NAsize of c having a remainder is put at the beginning left end of the string In the case of characters that are designed to be con nected such as baseline rule _ underrule _ and root en the remainder space is covered by over lapping If N 20 NROFF TROFF User s Manual October 11 1976 is Jess than the width of c a single c is centered on a distance N As an example a macro to underscore a string can be written de us 1 1 A or one to draw a box around a string de bx br 1 br 1 O a 1 O ul such that ul underlined words and bx words in a box yield underlined words and words in a box The function L Nc will draw a vertical line consisting of the optional charact
25. count mk mark top of text de fo footer ie n cl lt 2 po 3 4i next column 3 1 0 3 rt back to mark a 2 NROFF TROFF User s Manual October 11 1976 ns no space mode el po nMu restore left margin bp J 3 1i column width nr M n o0 save left margin Typically a portion of the top of the first page con tains full width text the request for the narrower line length as well as another mk would be made where the two column output was to begin T5 Footnote Processing The footnote mechanism to be described is used by imbedding the footnotes in the input text at the point of reference demarcated by an initial fn and a termi nal ef fn Footnote text and control lines ef In the following footnotes are processed in a separate environment and diverted for later printing in the space immediately prior to the bottom margin There is provision for the case where the last collected foot note doesn t completely fit in the available space de hd header nrx01 init footnote count nr y 0 nb current footer place ch fo nbu reset footer trap if n dn fz leftover footnote de fo footer nr dn 0 zero last diversion size df nx ev 1 expand footnotes in ev1 nf retain vertical size FN footnotes rm FN delete it if n z fy di end overflow diversion cnr x 0 disable fx ev pop environment bp de fx process
26. cter 10 6 Transparent line indicator 10 7 AS Beginning of comment 7 3 N Interpolate argument 1 lt N lt 9 13 Default optional hyphenation character 2 1 xx Character named xx 7 1 ex Vax Interpolate string x or xx 9 1 a Non interpreted leader character 12 3 b abc Bracket building function 4 2 c Interrupt text processing 11 1 d Forward down 1 2 em vertical motion 1 2 line in NROFF 2 2 fx f x fN Change to font named x or xx or position N 11 1 n N Local horizontal motion move right N negative left 11 3 kx Mark horizontal input place in register x 12 4 MNc Horizontal line drawing function optionally with c 12 4 L Ne Vertical line drawing function optionally with c 8 nx n xx Interpolate number register x or xx 12 1 o abc Overstrike characters a b c 4 1 p Break and spread output line 11 1 r Reverse em vertical motion reverse line in NROFF 2 3 sN stN Point size change function 9 1 t Non interpreted horizontal tab 11 1 u Reverse up 1 2 em vertical motion 1 2 line in NROFF 11 1 WN Local vertical motion move down N negative up 11 2 w string Interpolate width of string 5 2 xN Extra line space function negative before positive after 12 2 zc Print c with zero width without spacing 16 Begin conditional input 16 End conditional input 10 7 newline Concealed ignored newline x X any character not listed above The escape sequences
27. der of the page During the eject any traps encountered are processed normally At the end of this last page processing terminates unless a partial line word or partial word remains If it is desired that another page be started the end macro de en end macro c bp em en will deposit a null partial word and effect another last page 29 NROFF TROFF User s Manual October 11 1976 Table I Font Style Examples The following fonts are printed in 12 point with a vertical spacing of 14 point and with non alphanumeric char acters separated by em space The Special Mathematical Font was specially prepared for Bell Laboratories by Graphic Systems Inc of Hudson New Hampshire The Times Roman Italic and Bold are among the many standard fonts available from that company Times Roman abcdefghijkImnopgqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 1 amp 4 5 9 eg _ 4 fifi ff fifi ge O Times Italic abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 iymek tanye eO _ AURA HM T EO Times Bold abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ 1234567890 1 amp 6 4 3 2T om YAYAK MM O Special Mathematical Font lt gt aBydseCnOrKAUveomtpostvoxyva TAQOAENLY POS Q V 2 lt s e45eTlxttUNcrcDd d 30 NROFF TROFF User s Manual October 11 1976 Table I I
28. e following c is a one character built in condition name signifies not N is a numerical expression stringI and string2 are strings delimited by any non blank non numeric character not in the strings and anything represents what is conditionally accepted Request Initial If No Form Value Argument Notes Explanation if c anything If condition c true accept anything as input in multi line case use anything if c anything If condition c false accept anything if N anything u If expression N gt 0 accept anything if N anything u If expression N lt 0 accept anything if string1 string2 anything If string identical to string2 accept anything dif string string2 anything If string not identical to string2 accept anything je c anything u If portion of if else all above forms like if el anything Else portion of if else The built in condition names are Condition Name True If o Current page number is odd e Current page number is even t Formatter is TROFF n Formatter is NROFF If the condition c is true or if the number N is greater than zero or if the strings compare identically including motions and character size and font anything is accepted as input If a precedes the condition number or string comparison the sense of the acceptance is reversed Any spaces between the condition and the beginning of anything are skipped over The anything
29. e font etc sp 0 4 prespace ne 2 4 n Vu want 2 4 lines fi n S nrS01 init S The usage is sc followed by the section heading text followed by pg The ne test value includes one line of heading 0 4 line in the following pg and one line of the paragraph text A word consisting of the next section number and a period is produced to begin the heading line The format of the number may be set by af 8 Another common form is the labeled indented para graph where the label protrudes left into the indent space de Ip Iabeled paragraph Ps in 0 5i paragraph indent ta 0 21 0 5 label paragraph ti 0 t 1 t c flow into paragraph The intended usage is Ip label label will begin at 0 2inch and cannot exceed a length of 0 3inch without intruding into the paragraph The label could be right adjusted against 0 4inch by setting the tabs instead with ta 0 4iR 0 5i The last line of Ip ends with c so that it will become a part of the first line of the text that follows T4 Multiple Column Output The production of multiple column pages requires the footer macro to decide whether it was invoked by other than the last column so that it will begin a new column rather than produce the bottom margin The header can initialize a column register that the footer will increment and test The following is arranged for two columns but is easily modified for more de hd header nr cl 01 init column
30. e in register Zz y is then decremented by the size of the footnote available in dn then on the first footnote y is further decremented by the difference in vertical base line spacings of the two environments to prevent the late triggering the footer trap from causing the last line of the combined footnotes to overflow The footer trap is then set to the lower on the page of y or the current page position nl plus one line to allow for printing the reference line If indicated by x the footer fo rereads the footnotes from FN in nofill mode in environment 1 and deletes FN If the foot notes were too large to fit the macro fx will be trap invoked to redivert the overflow into fy and the 28 NROFF TROFF User s Manual October 11 1976 register dn will later indicate to the header whether fy is empty Both fo and fx are planted in the nominal footer trap position in an order that causes fx to be concealed unless the fo trap is moved The footer then terminates the overflow diversion if necessary and zeros x to disable fx because the uncertainty correction together with a not too late triggering of the footer can result in the footnote rereading finish ing before reaching the fx trap A good exercise for the student is to combine the multiple column and footnote mechanisms T6 The Last Page After the last input file has ended NROFF and TROFF invoke the end macro 7 if any and when it finishes eject the remain
31. e new page number will be N Also see request ns pn N N 1 ignored Page number The next page when it occurs will have the page number N A pn must occur before the initial pseudo page transition to effect the page number of the first page The current page number is in the register po N 0 2627inf previous v Page offset The current left margin is set to N The TROFF initial value provides about 1 inch of paper margin including the physical typesetter margin of 1 27 inch In TROFF the maximum line length page offset is about 7 54 inches See 6 The current page offset is available in the o register ne N N 1 V D v Need N vertical space If the distance D to the next trap position see 7 5 is less than N a forward vertical space of size D occurs which will spring the trap If there are no remaining traps on the page D is the distance to the bottom of the page If D lt V another line could still be output and spring the trap In a diversion D is the distance to the diver sion trap if any or is very large mk R none internal D Mark the current vertical place in an internal register both associated with the current diversion level or in register R if given See rt request rt N none internal D v Return upward only to a marked vertical place in the current diversion If N w r t current place is given the place is N from the top of the page or diversion or if N is absent to a place marked by a
32. e previous size ps n s1 restore current size Page numbers may be printed in the bottom margin by a separate macro triggered during the footer s page ejection de bn tl p 7 bottom number centered page number wh 0 5i 1v bn tl base 0 5i up T3 Paragraphs and Headings The housekeeping associated with starting a new paragraph should be collected in a paragraph macro that for example does the desired preparagraph spac ing forces the correct font size base line spacing and indent checks that enough space remains for more than one line and requests a temporary indent de pg paragraph br break ft R force font ps 10 size vs 12p spacing in 0 and indent sp 0 4 prespace ne 1 n Vu_ want more than 1 line ti 0 23 temp indent The first break in pg will force out any previous par tial lines and must occur before the vs The forcing of font etc is partly a defense against prior error and partly to permit things like section heading macros to set parameters only once The prespacing parameter is suitable for TROFF a larger space at least as big as the output device vertical resolution would be more suitable in NROFF The choice of remaining space to test for in the ne is the smallest amount greater than one line the V is the available vertical resolution A macro to automatically number section headings might look like de sc section forc
33. ecessary that the net vertical local motion within a word in filled text and otherwise within a line balance to zero The above and certain other escape sequences providing local motion are summarized in the following table Vertical Effect in Horizontal Effect in Local Motion TROFF NROFF Local Motion TROFF NROFF wN Move distance N h N Move distance N space Unpaddable space size space u 2 em up line up 0 Digit size space d em down line down r 1 em up 1 line up 14 em space ignored Y 112 em space ignored As an example E could be generated by the sequence E s 2 v 0 4m 2 v 0 4m s 2 it should be noted in this example that the 0 4 em vertical motions are at the smaller size 11 2 Width Function The width function w string generates the numerical width of string in basic units Size and font changes may be safely imbedded in string and will not affect the current environment For exam ple ti w 1 u could be used to temporarily indent leftward a distance equal to the size of the string 1 The width function also sets three number registers The registers st and sb are set respectively to the highest and lowest extent of string relative to the baseline then for example the total height of the string is n stu n sbu In TROFF the number register ct is set to a value between 0 and 3 0 means that all of the char acters in string were short lower case charac
34. ed into a macro retains the vertical size of each of its lines when reread in nofill mode regardless of the current V Constant spaced cs or emboldened bd text that is diverted can be reread correctly only if these modes are again or still in effect at reread time One way to do this is to imbed in the diversion the appropriate cs or bd requests with the transparent mechanism described in 10 6 Diversions may be nested and certain parameters and registers are associated with the current diversion level the top non diversion level may be thought of as the Oth diversion level These are the diversion trap and associated macro no space mode the internally saved marked place see mk and rt the current vertical place d register the current high water text base line h register and the current diversion name z register 7 5 Traps Three types of trap mechanisms are available page traps a diversion trap and an input line count trap Macro invocation traps may be planted using wh at any page position including the top This trap position may be changed using ch Trap positions at or below the bottom of the page have no effect unless or until moved to within the page or rendered effective by an increase in page length Two traps may be planted at the same position only by first planting them at different positions and then moving one of the traps the first planted trap will conceal the second unless and until the first one is moved see Tut
35. er c stacked vertically apart 1 em 1 line in NROFF with the first two characters overlapped if necessary to form a continuous line The default character is the box rule br the other suitable character is the bold vertical bv The line is begun without any initial motion relative to the current base line A positive N specifies a line drawn downward and a negative N specifies a line drawn upward After the line is drawn no compensating motions are made the instan taneous baseline is at the end of the line The horizontal and vertical line drawing functions may be used in combination to produce large boxes The zero width box rule and the 2 em wide underrule were designed to form corners when using 1 em vertical spac ings For example the macro de eb sp 1 compensate for next automatic base line spacing nf avoid possibly overflowing word buffer h 5n L nau 1 W n lu In ul AL nau 1 WV Ou 5n ul draw box fi will draw a box around some text whose beginning vertical place was saved in number register a e g using mk a as done for this paragraph 13 Hyphenation The automatic hyphenation may be switched off and on When switched on with hy several variants may be set A hyphenation indicator character may be imbedded in a word to specify desired hyphenation points or may be prepended to suppress hyphenation In addition the user may specify a small exception word lis
36. ers associated with current diversion level E Relevant parameters are a part of the current environment O Must stay in effect until logical output P Mode must be still or again in effect at the time of physical output v p m u Default scale indicator if not specified scale indicators are ignored Alphabetical Request and Section Number Cross Reference ad 4 ce 10 ds 7 fe 9 ie 16 l 6 nh 13 pi 19 m 7 ta 9 vs af 8 ce 4 dt 7 fi 4 if 16 Is 5 nm 15 pl 3 m 8 te 9 wh am 7 ch 7 ec 10 fl 20 ig 20 lt 14 nn 15 pm 20 rs 5 ti 6 as 7 cs 2 el 16 fp 2 in 6 mc 20 nr 8 pn 3 t 3 to 14 bd 2 cu 10 em 7 ft 2 it 7 mk 3 ns 5 po 3 so 19 tm 20 bp 3 da 7 eo 10 hc 13 Ie 9 na 4 nx 19 ps 2 sp 5 tr 10 br 4 de 7 ev 17 hw 13 Ig 10 ne 3 os 5 rd 18 ss 2 uf 10 c2 10 di 7 ex 18 hy 13 li 10 nf 4 pe 14 m 7 sv 5 ul 10 NROFF TROFF User s Manual October 11 1976 Escape Sequences for Characters Indicators and Functions Section Escape Reference Sequence Meaning 10 1 to prevent or delay the interpretation of 10 1 e Printable version of the current escape character 2 1 YV acute accent equivalent to aa 2 1 Y grave accent equivalent to ga 2 1 Minus sign in the current font 7 Period dot see de 11 1 space Unpaddable space size space character 11 1 0 Digit width space 11 1 lem narrow space character zero width in NROFF 11 1 Y 112 em half narrow space character zero width in NROFF 4 1 amp Non printing zero width chara
37. ex above 10 NROFF TROFF User s Manual October 11 1976 mounted on a numbered quadrant of a wheel The default mounting sequence assumed by TROFF is R I B and S on positions 1 2 3 and 4 3 Page control Top and bottom margins are not automatically provided it is conventional to define two macros and to set traps for them at vertical positions 0 top and N N from the bottom See 7 and Tutorial Examples T2 A pseudo page transition onto the first page occurs either when the first break occurs or when the first non diverted text processing occurs Arrangements for a trap to occur at the top of the first page must be completed before this transition In the following references to the current diversion 7 4 mean that the mechanism being described works during both ordinary and diverted output the former considered as the top diversion level The useable page width on the Graphic Systems phototypesetter is about 7 54 inches beginning about 1 27 inch from the left edge of the 8 inch wide continuous roll paper The physical limitations on NROFF output are output device dependent Request Initial If No Form Value Argument Notes Explanation pl N llin llin v Page length set to N The internal limitation is about 75 inches in TROFF and about 136 inches in NROFF The current page length is available in the p register bp N N 1 B v Begin page The current page is ejected and a new page is begun If N is given th
38. g access sequences have the effect shown 16 NROFF TROFF User s Manual October 11 1976 Effect on Value Sequence Register Interpolated nx none N n xx none N n x x incremented by M N M n x x decremented by M N M n xx xx incremented by M N M n xx xx decremented by M N M When interpolated a number register is converted to decimal default decimal with leading zeros lower case Roman upper case Roman lower case sequential alphabetic or upper case sequential alphabetic according to the format specified by af Request Initial If No Form Value Argument Notes Explanation nrR NM u The number register R is assigned the value N with respect to the pre vious value if any The increment for auto incrementing is set to M af Rc arabic Assign format c to register R The available formats are Numbering Format Sequence 1 0 1 2 3 4 5 001 000 001 002 003 004 005 i 0 i 11 1i1 iV V I O LILULIV V a 0 a b c 2 aa ab 2Z aaa A 0 A B C Z AA AB ZZ AAA An arabic format having N digits specifies a field width of N digits example 2 above The read only registers and the width function 11 2 are always arabic arr R ignored Remove register R If many registers are being created dynamically it may become necessary to remove no longer used registers to recapture internal storage space for newer registers 9 Tabs Leaders and Fields 9 1
39. generate a non interpreted tab and leader respectively and are equivalent to actual tabs and leaders in copy mode 9 2 Fields A field is contained between a pair of field delimiter characters and consists of sub strings separated by padding indicator characters The field length is the distance on the input line from the position where the field begins to the next tab stop The difference between the total length of all the sub strings and the field length is incorporated as horizontal padding space that is divided among the indicated padding places The incor porated padding is allowed to be negative For example if the field delimiter is and the padding indicator is xxx right specifies a right adjusted string with the string xxx centered in the remaining space Request Initial If No Form Value Argument Notes Explanation ta Nt 0 8 0 5in none E m Set tab stops and types t R right adjusting t C centering t absent left adjusting TROFF tab stops are preset every 0 5in NROFF every 0 8in The stop values are separated by spaces and a value preceded by is treated as an increment to the previous stop value te c none none E The tab repetition character becomes c or is removed specify ing motion de c none E The leader repetition character becomes c or is removed specifying motion feab off off The field delimiter is set to a the padding indicator is set to the space character or to b if given In the absence of ar
40. gu ments the field mechanism is turned off 10 Input and Output Conventions and Character Translations 10 1 Input character translations Ways of inputting the graphic character set were discussed in 2 1 The ASCII control characters horizontal tab 9 1 SOH 9 1 and backspace 10 3 are discussed elsewhere The newline delimits input lines In addition STX ETX ENQ ACK and BEL are accepted and may be used as del imiters or translated into a graphic with tr 10 5 Al others are ignored The escape character introduces escape sequences causes the following character to mean another character or to indicate some function A complete list of such sequences is given in the Summary and Index on page 6 should not be confused with the ASCII control character ESC of the same name The escape character can be input with the sequence The escape character can be changed with ec and all that has been said about the default becomes true for the new escape character e can be used to print whatever the current escape character is If necessary or convenient the escape mechanism may be turned off with eo and restored with ec Request Initial If No Form Value Argument Notes Explanation CCC Set escape character to or to c if given 0 on Turn escape mechanism off 10 2 Ligatures Five ligatures are available in the current TROFF character set fi fl ff ffi and ffl They may be input even in N
41. h specifiable with It tl may be used anywhere and is independent of the normal text collecting pro cess A common use is in header and footer macros Request Initial If No Form Value Argument Notes Explanation tl left center right The strings left center and right are respectively left adjusted centered and right adjusted in the current title length Any of the strings may be empty and overlapping is permitted If the page number character initially is found within any of the fields it is replaced by the current page number having the for mat assigned to register Any character may be used as the string delimiter pec off The page number character is set to c or removed The page number register remains dt N 6 5 in previous E m Length of title set to N The line length and the title length are independent Indents do not apply to titles page offsets do 15 Output Line Numbering Automatic sequence numbering of output lines may be requested with nm When in effect a three digit arabic number plus a digit space is prepended to output text lines The text lines are thus offset by four digit spaces and otherwise retain their line length a reduction in line length may be desired to keep the right margin aligned with an earlier margin Blank lines other vertical spaces and lines generated by tl are not numbered Numbering can be temporarily suspended with nn or with an nm followed by a later
42. ical rule double dagger 239 Character Name right hand left hand Bell System logo or circle left top of big curly bracket left bottom right top right bot left center of big curly bracket right center of big curly bracket bold vertical left floor left bottom of big square bracket right floor right bottom left ceiling left top right ceiling right top May 15 1977 Options h Z Old Requests cad c SO name New Request ab text fzFN Summary of Changes to N TROFF Since October 1976 Manual Nroff only Output tabs used during horizontal spacing to speed output as well as reduce out put byte count Device tab settings assumed to be every 8 nominal character widths The default settings of input logical tabs is also initialized to every 8 nominal character widths Efficiently suppresses formatted output Only message output will occur from tm s and diag nostics The adjustment type indicator c may now also be a number previously obtained from the j register see below The contents of file name will be interpolated at the point the so is encountered Previ ously the interpolation was done upon return to the file reading input level Prints text on the message output and terminates without further processing If text is miss ing User Abort is printed Does not cause a break The output buffer is flushed forces font F to be in size N N may have the form
43. ining the document to be formatted An argument consisting of a single minus is taken to be a file name correspond ing to the standard input If no file names are given input is taken from the standard input The options which may appear in any order so long as they appear before the files are Option Effect olist Print only pages whose page numbers appear in list which consists of comma separated numbers and number ranges A number range has the form N M and means pages N through M a initial N means from the beginning to page N and a final N means from N to the end nN Number first generated page N sN Stop every N pages NROFF will halt prior to every N pages default N 1 to allow paper loading or changing and will resume upon receipt of a newline TROFF will stop the pho totypesetter every N pages produce a trailer to allow changing cassettes and will resume after the phototypesetter START button is pressed mname Prepends the macro file Aisrlibtmac name to the input files raN Register a one character is set to N i Read standard input after the input files are exhausted q Invoke the simultaneous input output mode of the rd request NROFF TROFF User s Manual October 11 1976 NROFF Only Tname Specifies the name of the output terminal type Currently defined names are 37 for the default Model 37 Teletype tn300 for the GE TermiNet 300 or any terminal without half line capabilities 300S f
44. iversion equal to nl if no diversion Current font as physical quadrant 1 4 Text base line high water mark on current page or diversion Current indent Current line length Length of text portion on previous output line Current page offset Current page length Current point size Distance to the next trap Equal to 1 in fill mode and 0 in nofill mode Current vertical line spacing Width of previous character Reserved version dependent register Reserved version dependent register Name of current diversion NROFF TROFF User s Manual October 11 1976 REFERENCE MANUAL 1 General Explanation 1 1 Form of input Input consists of text lines which are destined to be printed interspersed with control lines which set parameters or otherwise control subsequent processing Control lines begin with a control character normally period or acute accent followed by a one or two character name that specifies a basic request or the substitution of a user defined macro in place of the control line The control character suppresses the break function the forced output of a partially filled line caused by certain requests The con trol character may be separated from the request macro name by white space spaces and or tabs for esthetic rea sons Names must be followed by either space or newline Control lines with unrecognized names are ignored Various special functions may be introduced anywhere in the in
45. l be mapped into the space char acter To be consistent a particular translation must stay in effect from input to output time 10 6 Transparent throughput An input line beginning with a is read in copy mode and transparently output without the initial the text processor is otherwise unaware of the line s presence This mechanism may be used to pass control information to a post processor or to imbed control lines in a macro created by a diversion 10 7 Comments and concealed newlines An uncomfortably long input line that must stay one line e g a string definition or nofilled text can be split into many physical lines by ending all but the last one with the escape The sequence newline is always ignored except in a comment Comments may be imbedded at the end of any line by prefacing them with The newline at the end of a comment cannot be concealed A line begin ning with will appear as a blank line and behave like sp 1 a comment can be on a line by itself by beginning the line with 19 NROFF TROFF User s Manual October 11 1976 11 Local Horizontal and Vertical Motions and the Width Function 11 1 Local Motions The functions v N and h N can be used for local vertical and horizontal motion respec tively The distance N may be negative the positive directions are rightward and downward A local motion is one contained within a line To avoid unexpected vertical dislocations it is n
46. nly number register f NROFF understands font control and normally underlines Italic characters see 10 5 2 3 Character size Character point sizes available on the Graphic Systems typesetter are 6 7 8 9 10 11 12 14 16 18 20 22 24 28 and 36 This is a range of 1 12 inch to 1 2 inch The ps request is used to change or restore the point size Alternatively the point size may be changed between any two characters by imbedding a sN at the desired point to set the size to N or a stN 1SNS9 to incrementdecrement the size by N s0 restores the previous size Requested point size values that are between two valid sizes yield the larger of the two The current size is available in the s register NROFF ignores type size control Request Initial If No Form Value Argument Notes Explanation ps N 10 point previous E Point size set to N Alternatively imbed sN or stN Any positive size value may be requested if invalid the next larger valid size will result with a maximum of 36 A paired sequence N N will work because the previous requested value is also remembered Ignored in NROFF ss N 1236em ignored E Space character size is set to N36ems This size is the minimum word spacing in adjusted text Ignored in NROFF sk NM off P Constant character space width mode is set on for font F if mounted the width of every character will be taken to be N36 ems If M is absent the em is that of the character s point
47. nput Naming Conventions for and and for Non ASCII Special Characters Non ASCII characters and minus on the standard fonts Char Non ASCII characters and The ASCII characters lt gt and _ exist only on the special font and are printed as a 1 em space if that font is not mounted The following characters exist only on the special font except for the upper case Greek letter names followed by f which are mapped into upper case English letters in whatever font is mounted on font position one default Times Roman The special math plus minus and equals are provided to Input Character Name Name i close quote open quote em 3 4 Em dash hyphen or hy hyphen current font minus bu bullet sq square ru rule 14 1 4 12 2 34 34 Input Char Name fi fl ff Fi Fl de dg fm ct rg co s oo FREER RR oh O s Character Name fi fl ff ffi ffl degree dagger foot mark cent sign registered copyright _ and on the special font insulate the appearance of equations from the choice of standard fonts Char Lm Il A DBwrNMN DRA NI Input Character Name Name l math plus mi math minus eq math equals math star sc section aa acute accent ga grave accent al underrule Gl slash matching backslash a alpha b beta g gamma d delta e epsilon z ze
48. nt horizontal place on the input line to the horizontal place N For example sp 3 2 will space in the required direction to 3 2 centimeters from the top of the page 1 4 Numerical expressions Wherever numerical input is expected an expression involving parentheses the arith metic operators mod and the logical operators lt gt lt gt or amp and or may be used Except where controlled by parentheses evaluation of expressions is left to right there is no operator pre cedence In the case of certain requests an initial or is stripped and interpreted as an increment or decrement indicator respectively In the presence of default scaling the desired scale indicator must be attached to every number in an expression for which the desired and default scaling differ For example if the number register x contains 2 and the current point size is 10 then Jl 4 25i nxP 3 y2u will set the line length to 1 2 the sum of 4 25 inches 2 picas 30 points 1 5 Notation Numerical parameters are indicated in this manual in two ways N means that the argument may take the forms N N or N and that the corresponding effect is to set the affected parameter to N to increment it by N or to decrement it by N respectively Plain N means that an initial algebraic sign is not an increment indicator but merely the sign of N Generally unreasonable numerical input is either ignored or truncated to a reas
49. nt previous E Point size also stN ss N 1236em ignored E Space character size set to N36em csF NM off P Constant character space width mode font F bd F N off P Embolden font F by N 1 units bd SFN off P Embolden Special Font when current font is F ft F Roman previous E Change to font F x xx or 1 4 Also fx f xx fN fp N F R I B S ignored Font named F mounted on physical position 1 lt N lt 4 3 Page Control pl NV llin llin v Page length bp N N 1 Bi v Eject current page next page number N pn N N 1 ignored Next page number N po N 0 2627in previous v Page offset ene N N 1V D v Need N vertical space V vertical spacing mk R none internal D Mark current vertical place in register R rt N none internal D v Return upward only to marked vertical place 4 Text Filling Adjusting and Centering br B Break fi fill B E Fill output lines nf fill B E No filling or adjusting of output lines ad c adj both adjust E Adjust output lines with mode c na adjust E No output line adjusting ce N off N 1 B E Center following N input text lines 5 Vertical Spacing vs N Vin 12pts previous E p Vertical base line spacing V As N N 1 previous E Output N 1 Vs after each text output line sp N N 1V B v Space vertical distance N in either direction sv N N 1V v Save vertical distance N OS Output saved vertical distance ns space D Turn no space mode on rs D Re
50. nvironment must be done with ev rather than specific refer ence 18 Insertions from the Standard Input The input can be temporarily switched to the system standard input with rd which will switch back when two newlines in a row are found the extra blank line is not used This mechanism is intended for insertions in form letter like documentation On UNIX the standard input can be the user s keyboard a pipe or a file Request Initial If No Form Value Argument Notes Explanation rd prompt prompt BEL Read insertion from the standard input until two newlines in a row are found If the standard input is the user s keyboard prompt or a BEL is written onto the user s terminal rd behaves like a macro and arguments may be placed after prompt ex Exit from NROFE TROFF Text processing is terminated exactly as if all input had ended If insertions are to be taken from the terminal keyboard while output is being printed on the terminal the com mand line option q will turn off the echoing of keyboard input and prompt only with BEL The regular input and insertion input cannot simultaneously come from the standard input As an example multiple copies of a form letter may be prepared by entering the insertions for all the copies in one file to be used as the standard input and causing the file containing the letter to reinvoke itself using nx 19 the process would ultimately be ended by an ex in the insertion file 1
51. onable value For example most requests expect to set parameters to non negative values exceptions are sp wh ch nr and if The requests ps ft po vs Is Il in and It restore the previous parameter value in the absence of an argument Single character arguments are indicated by single lower case letters and one two character arguments are indi cated by a pair of lower case letters Character string arguments are indicated by multi character mnemonics 2 Font and Character Size Control 2 1 Character set The TROFF character set consists of the Graphics Systems Commercial II character set plus a Special Mathematical Font character set each having 102 characters These character sets are shown in the attached Table I All ASCII characters are included with some on the Special Font With three exceptions the ASCII characters are input as themselves and non ASCII characters are input in the form xx where xx is a two character name given in the attached Table II The three ASCII exceptions are mapped as follows ASCII Input Printed by TROFF Character Name Character Name gt acute accent close quote grave accent open quote minus hyphen The characters and may be input by V V and respectively or by their names Table II The ASCII characters lt gt and _ exist only on the Special Font and are printed as a l em space if that Font is not mounted NRO
52. or the DASI 300S 300 for the DASI 300 and 450 for the DASI 450 Diablo Hyterm e Produce equally spaced words in adjusted lines using full terminal resolution TROFF Only t Direct output to the standard output instead of the phototypesetter f Refrain from feeding out paper and stopping phototypesetter at the end of the run W Wait until phototypesetter is available if currently busy b TROFF will report whether the phototypesetter is busy or available No text processing is done a Send a printable ASCII approximation of the results to the standard output pN Print all characters in point size N while retaining all prescribed spacings and motions to reduce phototypesetter elasped time g Prepare output for the Murray Hill Computation Center phototypesetter and direct it to the standard output Each option is invoked as a separate argument for example nroff 04 8 10 T300S mabc filel file2 requests formatting of pages 4 8 9 and 10 of a document contained in the files named file and file2 specifies the output terminal as a DASI 300S and invokes the macro package abc Various pre and post processors are available for use with NROFF and TROFF These include the equation preprocessors NEQN and EQN for NROFF and TROFF respectively and the table construction preprocessor TBL A reverse line postprocessor COL is available for multiple column NROFF output on terminals without reverse line ability COL expects the
53. orial Examples T5 If the first one is moved back it again conceals the second trap The macro associated with a page trap is automatically invoked when a line of text is output whose vertical size reaches or sweeps past the trap position Reaching the bottom of a page springs the top of page trap if any provided there is a next page The distance to the next trap position is available in the t register if there are no traps between the current position and the bottom of the page the distance returned is the distance to the page bottom A macro invocation trap effective in the current diversion may be planted using dt The t register works in a diversion if there is no subsequent trap a large distance is returned For a description of input line count traps see it below Request Initial If No Form Value Argument Notes Explanation de xx yy VWV 0 Define or redefine the macro xx The contents of the macro begin on the next input line Input lines are copied in copy mode until the definition is terminated by a line beginning with yy whereupon the macro yy is called In the absence of wow yy the definition is terminated by a line beginning with 25x NROFF TROFF User s Manual October 11 1976 am xx yy y ds xx string ignored as xx string ignored rm xx ignored rn XX yy ignored di xx end da xx end wh N xx ch xx N ddt N xx off it N xx off em xx none none 8 Number Register
54. put by means of an escape character normally For example the function nR causes the interpolation of the contents of the number register R in place of the function here R is either a single character name as in nx or left parenthesis introduced two character name as in n xx 1 2 Formatter and device resolution TROFF internally uses 432 units inch corresponding to the Graphic Sys tems phototypesetter which has a horizontal resolution of 1432 inch and a vertical resolution of 1 144 inch NROFF internally uses 240 units inch corresponding to the least common multiple of the horizontal and vertical resolutions of various typewriter like output devices TROFF rounds horizontaWertical numerical parameter input to the actual horizontavertical resolution of the Graphic Systems typesetter NROFF similarly rounds numerical input to the actual resolution of the output device indicated by the T option default Model 37 Teletype 1 3 Numerical parameter input Both NROFF and TROFF accept numerical input with the appended scale indica tors shown in the following table where S is the current type size in points V is the current vertical line spacing in basic units and C is a nominal character width in basic units Scale Number of basic units Indicator Meaning TROFF NROFF i Inch 432 240 c Centimeter 432x501127 240x50127 P Pica 1 inch 72 240 m Em S points 6xS C n En Em2 3xS C same as Em p Point 1 72 inch 6 240 72 u Basic unit
55. put is copied without interpretation except that The contents of number registers indicated by n are interpolated Strings indicated by are interpolated Arguments indicated by are interpolated e Concealed newlines indicated by newline are eliminated e Comments indicated by are eliminated t and a are interpreted as ASCII horizontal tab and SOH respectively 9 e is interpreted as wou is interpreted as These interpretations can be suppressed by prepending a For example since maps into a n will copy as n which will be interpreted as a number register indicator when the macro or string is reread 7 3 Arguments When a macro is invoked by name the remainder of the line is taken to contain up to nine argu ments The argument separator is the space character and arguments may be surrounded by double quotes to permit imbedded space characters Pairs of double quotes may be imbedded in double quoted arguments to represent a single double quote If the desired arguments won t fit on a line a concealed newline may be used to continue on the next line When a macro is invoked the input level is pushed down and any arguments available at the previous level become unavailable until the macro is completely read and the previous level is restored A macro s own argu ments can be interpolated at any point within the macro with N which interpolates the Nth argument 1 lt N lt 9 14
56. s A macro may contain de requests provided the terminating macros differ or the contained definition terminator is con mow cealed can be concealed as which will copy as and wow be reread as Append to macro append version of de Define a string xx containing string Any initial double quote in string is stripped off to permit initial blanks Append string to string xx append version of ds Remove request macro or string The name xx is removed from the name list and any related storage space is freed Subsequent references will have no effect Rename request macro or string xx to yy If yy exists it is first removed Divert output to macro xx Normal text processing occurs dur ing diversion except that page offsetting is not done The diversion ends when the request di or da is encountered without an argument extraneous requests of this type should not appear when nested diversions are being used Divert appending to xx append version of di Install a trap to invoke xx at page position N a negative N will be interpreted with respect to the page bottom Any macro previously planted at N is replaced by xx A zero N refers to the top of a page In the absence of xx the first found trap at N if any is removed Change the trap position for macro xx to be N In the absence of N the trap if any is removed Install a diversion trap at position N in the current diversion to invoke macro x
57. store spacing turn no space mode off 6 Line Length and Indenting ALN 6 5 in previous Em Line length in N N 0 previous B E m Indent ti tN ignored B E m Temporary indent 7 Macros Strings Diversion and Position Traps de xx yy Yy e Define or redefine macro xx end at call of yy am xx yy Yy Append to a macro ds xx string ignored Define a string xx containing string Values separated by are for NROFF and TROFF respectively Notes are explained at the end of this Summary and Index No effect in NROFF The use of as control character instead of suppresses the break function NROFF TROFF User s Manual October 11 1976 Request Initial Form Value as xx string rm xx IM xx yy di xx da xx z wh N xx ch xx N ddt N xx it N xx em xx none 8 Number Registers nr RINM af Rc arabic rr R If No Argument ignored ignored ignored end end off off none u 9 Tabs Leaders and Fields Notes mo lt lt O00 Explanation Append string to string xx Remove request macro or string Rename request macro or string xx to yy Divert output to macro xx Divert and append to xx Set location trap negative is w r t page bottom Change trap location Set a diversion trap Set an input line count trap End macro is xx Define and set number register R auto increment by M E m E E Assign format to register R c 1 i I a A
58. t Only words that consist of a central alphabetic string surrounded by usually null non alphabetic strings are con sidered candidates for automatic hyphenation Words that were input containing hyphens minus em dashes em or hyphenation indicator characters such as mother in law are always subject to splitting after those characters whether or not automatic hyphenation is on or off Request Initial If No Form Value Argument Notes Explanation nh hyphenate E Automatic hyphenation is turned off ehyN on N 1 on N 1 E Automatic hyphenation is turned on for N21 or off for N 0 If N 2 last lines ones that will cause a trap are not hyphenated For N 4 and 8 the last and first two characters respectively of a word are not split off These values are addi tive i e N 14 will invoke all three restrictions 21s NROFF TROFF User s Manual October 11 1976 he c E Hyphenation indicator character is set to c or to the default The indicator does not appear in the output hw wordl ignored Specify hyphenation points in words with imbedded minus signs Ver sions of a word with terminal s are implied i e dig it implies dig its This list is examined initially and after each suffix stripping The space available is small about 128 characters 14 Three Part Titles The titling function tl provides for automatic placement of three fields at the left center and right of a line with a title lengt
59. t but the restoration will undo the last change Output generated by tl 14 is affected by the font change but does not decrement N If N gt 1 there is the risk that a trap interpolated macro may provide text lines within the span environment switching can prevent this cu N off N 1 E A variant of ul that causes every character to be underlined in NROFF Identical to ul in TROFF uf F Italic Italic Underline font set to F In NROFF F may not be on position 1 initially Times Roman 10 4 Control characters Both the control character and the no break control character may be changed if desired Such a change must be compatible with the design of any macros used in the span of the change and particularly of any trap invoked macros Request Initial If No Form Value Argument Notes Explanation CCC x 3 E The basic control character is set to c or reset to 2c 7 f E The nobreak control character is set to c or reset to 10 5 Output translation One character can be made a stand in for another character using tr All text process ing e g character comparisons takes place with the input stand in character which appears to have the width of the final character The graphic translation occurs at the moment of output including diversion Request Initial If No Form Value Argument Notes Explanation tr abcd none O Translate a into b c into d etc If an odd number of charac ters is given the last one wil
60. ta y eta h theta i iota k kappa Input Char Name A l m n c o p r s ts t u f x q w A B GG D ProWwreenxnecanqQgrva our lt t 31 5 Character Name lambda mu nu xi omicron pi rho sigma terminal sigma tau upsilon phi chi psi omega Alpha Betat Gamma Delta NROFF TROFF User s Manual October 11 1976 Char AOE EMH MDH OMZEe AH OHNE Il IA IV It xe OT LR H MQRTI1AVIEUNUNAIDICHH Input Name E GZ GY H GI G K GL GM GN GC FO P GR GS T GU GF GX FQ GW sr rn C lt C ap gt lt ua da mu di cu ca sb sp Gb Gp af pd gr no ds pt es mo br dd Character Input Name Char Name Epsilon c rh Zetat h Etat bs Theta or Iota O ci Kappa dt Lambda L Adb Mut rt Nut J b Xi i dk Omicron rk Pi bv Rhot L qf Sigma Taut ef Upsilon de Phi ac Chit Psi Omega square root root en extender gt lt identically equal approx approximates not equal right arrow left arrow up arrow down arrow multiply divide plus minus cup union cap intersection subset of superset of improper subset improper superset infinity partial derivative gradient not integral sign proportional to empty set member of box vert
61. ters without descenders like e 1 means that at least one character has a descender like y 2 means that at least one character is tall like H and 3 means that both tall characters and characters with descenders are present 11 3 Mark horizontal place The escape sequence kx will cause the current horizontal position in the input line to be stored in register x As an example the construction kxword h nxu 2u word will embolden word by backing up to almost its beginning and overprinting it resulting in word 12 Overstrike Bracket Line drawing and Zero width Functions 12 1 Overstriking Automatically centered overstriking of up to nine characters is provided by the overstrike function o string The characters in string overprinted with centers aligned the total width is that of the widest character string should not contain local vertical motion As examples o e produces and o mo sI pro duces 12 2 Zero width characters The function zc will output c without spacing over it and can be used to produce left aligned overstruck combinations As examples z ci pl will produce and br z rn ul br will produce the smallest possible constructed box 12 3 Large Brackets The Special Mathematical Font contains a number of bracket construction pieces fb 54 1L Jf 1 that can be combined into various bracket styles The function b string may be used to pile up vertically the
62. the top and bottom page margin areas respectively A trap is planted at page position 0 for the header and at N N from the page bottom for the footer The simplest such definitions might be de hd define header sp li R end definition de fo define footer bp R end definition wh 0 hd wh 1i fo which provide blank 1 inch top and bottom margins The header will occur on the first page only if the definition and trap exist prior to the initial pseudo page transition 3 In fill mode the output line that springs the footer trap was typically forced out For example P A Crisman Ed The Compatible Time Sharing System MIT Press 1965 Section AH9 01 Description of RUNOFF program on MIT s CTSS system 26 because some part or whole word didn t fit on it If anything in the footer and header that follows causes a break that word or part word will be forced out In this and other examples requests like bp and sp that normally cause breaks are invoked using the no break control character to avoid this When the headerfooter design contains material requiring independent text processing the environment may be switched avoiding most interaction with the running text A more realistic example would be de hd header if t tl n rn troff cut mark if n gt 1 sp 0 5i 1 tl base at 0 5i tl 7 centered page number ps restore size ft restore font vs
63. ut device resolution Filling adjustment and hyphenation 13 can all be prevented or controlled The text length on the last line output is available in the n register and text base line position on the page for this line is in the nl register The text base line high water mark lowest place on the current page is in the h register An input text line ending with or is taken to be the end of a sentence and an additional space character is automatically provided during filling Multiple inter word space characters found in the input are retained except for trailing spaces initial spaces also cause a break When filling is in effect a p may be imbedded or attached to a word to cause a break at the end of the word and have the resulting output line spread out to fill the current line length A text input line that happens to begin with a control character can be made to not look like a control line by prefacing it with the non printing zero width filler character amp Still another way is to specify output transla tion of some convenient character into the control character using tr 10 5 4 2 Interrupted text The copying of a input line in nofill non fill mode can be interrupted by terminating the partial line with a c The next encountered input text line will be considered to be a continuation of the same line of input text Similarly a word within filled text may be interrupted by terminating the word and line with
64. ve requests for extra space apply to the same line the maximum values are used The most recently utilized post line extra line space is available in the a register 5 3 Blocks of vertical space A block of vertical space is ordinarily requested using sp which honors the no space mode and which does not space past a trap A contiguous block of vertical space may be reserved using SV Request Initial If No Form Value Argument Notes Explanation eys N V6in 12pts previous E p Set vertical base line spacing size V Transient extra vertical space available with x N see above ls N N 1 previous E Line spacing set to N N 1 Vs blank lines are appended to each output text line Appended blank lines are omitted if the text or previous appended blank line reached a trap position sp N N 1V B v Space vertically in either direction If N is negative the motion is backward upward and is limited to the distance to the top of the page Forward downward motion is truncated to the distance to the nearest trap If the no space mode is on no spacing occurs see ns and rs below sv N N 1V v Save a contiguous vertical block of size N If the distance to the next trap is greater than N N vertical space is output No space mode has no effect If this distance is less than N no vertical space is immediately output but N is remembered for later output see os Subsequent sv requests will overwrite any still remembered N 0S
65. vious B E m Indent is set to N The indent is prepended to each output line ti tN ignored B E m_ Temporary indent The next output text line will be indented a distance N with respect to the current indent The resulting total indent may not be negative The current indent is not changed 7 Macros Strings Diversion and Position Traps 7 1 Macros and strings A macro is a named set of arbitrary lines that may be invoked by name or with a trap A String is a named string of characters not including a newline character that may be interpolated by name at any point Request macro and string names share the same name list Macro and string names may be one or two characters long and may usurp previously defined request macro or string names Any of these entities may be renamed with rn or removed with rm Macros are created by de and di and appended to by am and da di and da cause normal output to be stored in a macro Strings are created by ds and appended to by as A macro is invoked in the same way as a request a control line beginning xx will interpolate the contents of macro xx The remainder of the line may contain up to nine arguments The strings x and xx are interpolated at any desired point with x and xx respectively String references and macro invocations may be nested 7 2 Copy mode input interpretation During the definition and extension of strings and macros not by diversion the input is read in copy mode The in
66. x Another dt will redefine the diversion trap If no arguments are given the diversion trap is removed Set an input line count trap to invoke the macro xx after N lines of text input have been read control or request lines don t count The text may be in line text or text interpolated by inline or trap invoked macros The macro xx will be invoked when all input has ended The effect is the same as if the contents of xx had been at the end of the last file processed A variety of parameters are available to the user as predefined named number registers see Summary and Index page 7 In addition the user may define his own named registers Register names are one or two characters long and do not conflict with request macro or string names Except for certain predefined read only registers a number register can be read written automatically incremented or decremented and interpolated into the input in a variety of formats One common use of user defined registers is to automatically number sections paragraphs lines etc A number register may be used any time numerical input is expected or desired and may be used in numerical expressions 1 4 Number registers are created and modified using nr which specifies the name numerical value and the auto increment size Registers are also modified if accessed with an auto incrementing sequence If the registers x and xx both contain N and have the auto increment size M the followin

Download Pdf Manuals

image

Related Search

Related Contents

Hikvision Digital Technology DS-1H05-R  UVD-EVRDNR(-P) Camera User Manual  HL2-32 PHOTOCELL - TAG Heuer Timing Systems  TLMe User Guide  Incipio SA-463  

Copyright © All rights reserved.
Failed to retrieve file