⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m2

📁 unix v7是最后一个广泛发布的研究型UNIX版本
💻
字号:
.tr |.rm mx.br.mhLine Length and Indenting.pgThe maximum line length for fill mode may be set with \fBll\fR.The indent may be set with \fBin\fR;an indent applicable to \fIonly\fR the \fInext\fR output line may be set with \fBti\fR.The line length includes indent space but \fInot\fRpage offset space.The line-length minus the indent is the basis for centering with \fBce\fR.The effect of \fBll\fR, \fBin\fR, or \fBti\fRis delayed, if a partially 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 tothe line length minus the indent.The current line length and indent are available in registers \fB.l\fR and \fB.i\fR respectively.The length of \fIthree-part titles\fR produced by \fBtl\fR(see \(sc14) is \fIindependently\fR set by \fBlt\fR..h1.bt\fB&ll\fI|\(+-N\fR	6.5\|in	previous	E,\fBm\fR	Line length is set to \(+-\fIN\fR.In \*(TR the maximum (line-length)+(page-offset) is about 7.54 inches..bt\fB&in\fI|\(+-N\fR	\fIN\(eq\^\fR0	previous	B,E,\fBm\fR	Indent is set to \fI\(+-N\fR.The indent is prepended to each output line..bt\fB&ti\fI|\(+-N\fR	-	ignored	B,E,\fBm\fR	Temporary indent.The \fInext\fR output text line will be indented a distance \fI\(+-N\fRwith respect to the current indent.The resulting total indent may not be negative.The current indent is not changed..mhMacros, Strings, Diversion, and Position Traps.scMacros and strings.A \fImacro\fR is a named set of arbitrary \fIlines\fR that may be invoked by name orwith a \fItrap\fR.A \fIstring\fR is a named string of \fIcharacters\fR,\fInot\fR including a newline character,that may be interpolated by name at any point.Request, macro, and string names share the \fIsame\fR name list.Macro and string namesmay be one or two characters long and may usurp previously definedrequest, macro, or string names.Any of these entities may be renamed with \fBrn\fRor removed with \fBrm\fR.Macros are created by \fBde\fR and \fBdi\fR, and appended to by \fBam\fR and \fBda\fR;\fBdi\fR and \fBda\fR cause normal output to be stored in a macro.Strings are created by \fBds\fR and appended to by \fBas\fR.A macro is invoked in the same way as a request;a control line beginning \fB.\fIxx\fR will interpolate the contents of macro \fIxx\fR.The remainder of the line may contain up to nine \fIarguments\fR.The strings \fIx\fR and \fIxx\fR are interpolated at any desired point with\fB\e\(**\fIx\fR and \fB\e\(**(\fIxx\fR respectively.String references and macro invocations may be nested..scCopy mode input interpretation.During the definition and extensionof strings and macros (not by diversion)the input is read in \fIcopy mode\fR.The input is copied without interpretation\fIexcept\fR that:.x1.ds + \v'-.1m'\s-4\(bu\s+4\v'+.1m'\*+ The contents of number registers indicated by \fB\en\fR are interpolated.\*+ Strings indicated by \fB\e\(**\fR are interpolated.\*+ Arguments indicated by \fB\e$\fR are interpolated.\*+ Concealed newlines indicated by \fB\e\fR(newline) are eliminated.\*+ Comments indicated by \fB\e"\fR are eliminated.\*+ \fB\et\fR and \fB\ea\fR are interpreted as \s-1ASCII\s+1 horizontal tab and \s-1SOH\s+1 respectively (\(sc9).\*+ \fB\e\e\fR is interpreted as \fB\e\fR.\*+ \fB\e.\fR is interpreted as "\fB.\fR"..x2These interpretations can be suppressed byprependinga \fB\e\fR.For example, since \fB\e\e\fR maps into a \fB\e\fR, \fB\e\en\fR will copy as \fB\en\fR whichwill be interpreted as a number register indicator when themacro or string is reread..scArguments.When a macro is invoked by name, the remainder of the line istaken to contain up to nine arguments.The argument separator is the space character, and argumentsmay be surrounded by double-quotes to permit imbedded space characters.Pairs of double-quotes may be imbedded in double-quoted arguments torepresent 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..pgWhen a macro is invoked the \fIinput level\fR is \fIpushed down\fR andany arguments available at the previous level become unavailableuntil the macro is completely read and the previous level is restored.A macro's own arguments can be interpolated at \fIany\fR pointwithin the macro with \fB\e$\fIN\fR, which interpolates the \fIN\fR\^thargument(1\(<=\fIN\fR\^\(<=9).If an invoked argument doesn't exist,a null string results.For example, the macro \fIxx\fR may be defined by.x1.ftB.ta .75i&de xx	\e"begin definitionToday is \e\e$1 the \e\e$2.&.	\e"end definition.ftR.x2and called by.x1.ftB&xx Monday 14th.ftR.x2to produce the text.x1.ftBToday is Monday the 14th..ftR.x2Note that the \fB\e$\fRwas concealed in the definition with a prepended \fB\e\fR.The number of currently availablearguments is in the \fB.$\fR register..pgNo arguments are available at the top (non-macro) levelin this implementation.Because string referencing is implementedas a input-level push down,no arguments are available from \fIwithin\fR a string.No arguments are available within a trap-invoked macro..pgArguments are copied in \fIcopy mode\fR onto a stackwhere they are available for reference.The mechanism does not allow an argument to containa direct reference to a \fIlong\fR string(interpolated at copy time) and it is advisable toconceal string references (with an extra \fB\e\fR\|)to delay interpolation until argument reference time..scDiversions.Processed output may be diverted into a macro for purposessuch as footnote processing (see Tutorial \(scT5)or determining the horizontal and vertical size of some text forconditional changing of pages or columns.A single diversion trap may be set at a specified vertical position.The number registers \fBdn\fR and \fBdl\fR respectively contain thevertical and horizontal size of the mostrecently ended diversion.Processed text that is diverted into a macroretains the vertical size of each of its lines when rereadin \fInofill\fR moderegardless of the current \fIV\fR.Constant-spaced (\fBcs\fR) or emboldened (\fBbd\fR) text that is divertedcan be reread correctly only if these modes are again or still in effectat reread time.One way to do this is to imbed in the diversion the appropriate\fBcs\fR or \fBbd\fR requests with the \fItransparent\fRmechanism described in \(sc10.6..pgDiversions may be nestedand certain parameters and registersare associatedwith the current diversion level(the top non-diversion level may be thought of as the0th diversion level).These are the diversion trap and associated macro,no-space mode,the internally-saved marked place (see \fBmk\fR and \fBrt\fR),the current vertical place (\fB.d\fR register),the current high-water text base-line (\fB.h\fR register),and the current diversion name (\fB.z\fR register)..scTraps.Three types of trap mechanisms are available\(empage traps, a diversion trap, andan input-line-count trap.Macro-invocation traps may be planted using \fBwh\fR at any page position including the top.This trap position may be changed using \fBch\fR.Trap positions at or below the bottom of the pagehave no effect unless or untilmoved to within the page or rendered effective by an increase in page length.Two traps may be planted at the \fIsame\fR position only by first planting them at differentpositions and then moving one of the traps;the first planted trap will conceal the second unless and until the first one is moved(see Tutorial Examples \(scT5).If the first one is moved back, it again conceals the second trap.The macro associated with a page trap is automaticallyinvoked when a line of text is output whose vertical size \fIreaches\fRor \fIsweeps past\fR 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 \fB.t\fR 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..pgA macro-invocation trap effective in the current diversion may be planted using \fBdt\fR.The \fB.t\fR register works in a diversion; if there is no subsequent trap a \fIlarge\fRdistance is returned.For a description of input-line-count traps, see \fBit\fR below..h1.bt\fB&de\fI|xx|yy\fR	-	\fI.yy=\fB..\fR	-	Define or redefine the macro \fIxx\fR.The contents of the macro begin on the next input line.Input lines are copied in \fIcopy mode\fR until the definition is terminated by aline beginning with \fB.\fIyy\fR,whereupon the macro \fIyy\fR is called.In the absence of \fIyy\fR, the definitionis terminated by aline beginning with "\fB..\fR".A macro may contain \fBde\fR requestsprovided the terminating macros differor the contained definition terminator is concealed.\&"\fB..\fR" can be concealed as\fB\e\e..\fR which will copy as \fB\e..\fR and be reread as "\fB..\fR"..bt\fB&am\fI|xx|yy\fR	-	\fI.yy=\fB..\fR	-	Append to macro (append version of \fBde\fR)..bt\fB&ds\fI|xx|string\fR	-	ignored	-	Define a string\fIxx\fR containing \fIstring\fR.Any initial double-quote in \fIstring\fR is stripped off to permitinitial blanks..bt\fB&as\fI|xx|string\fR	-	ignored	-	Append\fIstring\fR to string \fIxx\fR(append version of \fBds\fR)..bt\fB&rm\fI|xx\fR	-	ignored	-	Removerequest, macro, or string.The name \fIxx\fR is removed from the name list andany related storage space is freed.Subsequent references will have no effect..bt\fB&rn\fI|xx|yy\fR	-	ignored	-	Rename request, macro, or string\fIxx\fR to \fIyy\fR.If \fIyy\fR exists, it is first removed..bt\fB&di|\fIxx\fR	-	end	D	Divert output to macro \fIxx\fR.Normal text processing occurs during diversionexcept that page offsetting is not done.The diversion ends when the request \fBdi\fR or \fBda\fR is encountered without an argument;extraneousrequests of this type should not appear when nested diversions are being used..bt\fB&da|\fIxx\fR	-	end	D	Divert, appending to \fIxx\fR(append version of \fBdi\fR)..bt\fB&wh\fI|N|xx\fR	-	-	\fBv\fR	Installa trap to invoke \fIxx\fR at page position \fIN;\fRa \fInegative N\fR will be interpreted with respect to thepage \fIbottom\fR.Any macro previously planted at \fIN\fR is replaced by \fIxx\fR.A zero \fIN\fR refers to the \fItop\fR of a page.In the absence of \fIxx\fR, the first found trap at \fIN\fR, if any, is removed..bt\fB&ch\fI|xx|N\fR	-	-	\fBv\fR	Changethe trap position for macro \fIxx\fR to be \fIN\fR.In the absence of \fIN\fR, the trap, if any, is removed..bt\fB&dt\fI|N|xx\fR	-	off	D,\fBv\fR	Install a diversion trapat position \fIN\fR in the \fIcurrent\fR diversion to invokemacro \fIxx\fR.Another \fBdt\fR will redefine the diversion trap.If no arguments are given, the diversion trap is removed..bt\fB&it\fI|N|xx\fR	-	off	E	Set an input-line-count trapto invoke the macro \fIxx\fR after \fIN\fR lines of \fItext\fR inputhave been read(control or request lines don't count).The text may be in-line text ortext interpolated by inline or trap-invoked macros..bt\fB&em\fI|xx\fR	none	none	-	Themacro \fIxx\fR will be invokedwhen all input has ended.The effect is the same as if the contents of \fIxx\fR had been at the endof the last file processed..mhNumber Registers.pgA variety of parameters are available to the user aspredefined, named \fInumber registers\fR (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 \fIdo not\fR conflictwith request, macro, or string names.Except for certain predefined read-only registers,a number register can be read, written, automaticallyincremented or decremented, and interpolatedinto the input in a variety of formats.One common use of user-defined registers is toautomatically number sections, paragraphs, lines, etc.A number register may be used any time numerical input is expected or desiredand may be used in numerical \fIexpressions\fR (\(sc1.4)..pgNumber registers are created and modified using \fBnr\fR, whichspecifies the name, numerical value, and the auto-increment size.Registers are also modified, if accessedwith an auto-incrementing sequence.If the registers \fIx\fR and \fIxx\fR both contain\fIN\fR and have the auto-increment size \fIM\fR,the following access sequences have the effect shown:.TScenter box;c2|c2|cc2|c2|c2l2|c2|c2l2|c2|c2l2|l2|c2.	Effect on	ValueSequence	Register	Interpolated_\fB\en\fIx\fR	none	\fIN\fR\fB\en(\fIxx\fR	none	\fIN\fR\fB\en+\fIx\fR	\fIx\fR incremented by \fIM\fR	\fIN+M\fR\fB\en\-\fIx\fR	\fIx\fR decremented by \fIM\fR	\fIN\-M\fR\fB\en+(\fIxx\fR	\fIxx\fR incremented by \fIM\fR	\fIN+M\fR\fB\en\-(\fIxx\fR	\fIxx\fR decremented by \fIM\fR	\fIN\-M\fR.TEWhen interpolated, a number register is converted todecimal (default),decimal with leading zeros,lower-case Roman,upper-case Roman,lower-case sequential alphabetic,orupper-case sequential alphabeticaccording to the format specified by \fBaf\fR..h1.bt\fB&nr\fI|R|\(+-N|M\fR	-	\fBu\fR	\The number register \fIR\fR is assigned the value \fI\(+-N\fRwith respect to the previous value, if any.The increment for auto-incrementing is set to \fIM\fR..bt\fB&af\fI|R|c\fR	arabic	-	-	Assign format \fIc\fR to register \fIR\fR.The available formats are:.TScenter box;c2|cc2|cc2|l.	NumberingFormat	Sequence_\fB1\fR	0,1,2,3,4,5,...\fB001\fR	000,001,002,003,004,005,...\fBi\fR	0,i,ii,iii,iv,v,...\fBI\fR	0,I,II,III,IV,V,...\fBa\fR	0,a,b,c,...,z,aa,ab,...,zz,aaa,...\fBA\fR	0,A,B,C,...,Z,AA,AB,...,ZZ,AAA,....TEAn arabic format having \fIN\fR digitsspecifies a field width of \fIN\fR digits (example 2 above).The read-only registers and the \fIwidth\fR function (\(sc11.2)are always arabic..bt\fB&rr\fI|R\fR	-	ignored	-	Remove register \fIR\fR.If many registers are being created dynamically, itmay become necessary to remove no longer used registersto recapture internal storage space for newer registers.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -