xref: /original-bsd/old/roff/USD.doc/troff/m3 (revision 95ecee29)
%sccs.include.proprietary.roff%

@(#)m3 8.1 (Berkeley) 08/14/93

.tr | .mh Tabs, Leaders, and Fields .sc Tabs and leaders. The \s-1ASCII\s+1 horizontal tab character and the \s-1ASCII\s+1 \s-1SOH\s+1 (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 generate motion and leaders generate a string of periods; tc and lc offer the choice of repeated character or motion. There are three types of internal tab stops\(em\ 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-W\(sl2 Centered on right end of D
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. .pg Tabs and leaders are not interpreted in copy mode. \et and \ea always generate a non-interpreted tab and leader respectively, and are equivalent to actual tabs and leaders in copy mode. .sc 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 incorporated 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. .h1 .bt &ta|Nt|... 8n;|0.5in none E,m \ Set tab stops and types. t=R, right adjusting; t=C, centering; t absent, left adjusting. \*(TR tab stops are preset every 0.5in.; \*(NR every 8 character widths. The stop values are separated by spaces, and a value preceded by + is treated as an increment to the previous stop value. .bt &tc|c none none E \ The tab repetition character becomes c, or is removed specifying motion. .bt &lc|c . none E \ The leader repetition character becomes c, or is removed specifying motion. .bt &fc|a|b 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 arguments the field mechanism is turned off. .mh Input and Output Conventions and Character Translations .sc Input character translations. Ways of inputting the graphic character set were discussed in \(sc2.1. The \s-1ASCII\s+1 control characters horizontal tab (\(sc9.1), \s-1SOH\s+1 (\(sc9.1), and backspace (\(sc10.3) are discussed elsewhere. The newline delimits input lines. In addition, \s-1STX\s+1, \s-1ETX\s+1, \s-1ENQ\s+1, \s-1ACK\s+1, and \s-1BEL\s+1 are accepted, and may be used as delimiters or translated into a graphic with tr (\(sc10.5). All others are ignored. .pg The escape character \e introduces escape sequences\(em\ 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. \e should not be confused with the \s-1ASCII\s+1 control character \s-1ESC\s+1 of the same name. The escape character \e can be input with the sequence \e\e. The escape character can be changed with ec, and all that has been said about the default \e becomes true for the new escape character. \ee 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. .h1 .bt &ec|c \e \e - \ Set escape character to \e, or to c, if given. .bt &eo on - - Turn escape mechanism off. .sc Ligatures. .lg 0 Five ligatures are available in the current \*(TR character set \(em \(fi, \(fl, \(ff, \(Fi, and \(Fl. They may be input (even in \*(NR) by \e(fi, \e(fl, \e(ff, \e(Fi, and \e(Fl respectively. .lg The ligature mode is normally on in \*(TR, and automatically invokes ligatures during input. .h1 .bt &lg|N off;|on on - Ligature mode is turned on if N is absent or non-zero, and turned off if N\(eq\^0. If N\(eq\^2, only the two-character ligatures are automatically invoked. Ligature mode is inhibited for request, macro, string, register, or file names, and in copy mode. No effect in \*(NR. .sc Backspacing, underlining, overstriking, etc. Unless in copy mode, the \s-1ASCII\s+1 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 \(sc12.4. A generalized overstriking function is described in \(sc12.1. .pg \*(NR automatically underlines characters in the underline font, specifiable with uf, normally Times Italic on font position 2 (see \(sc2.2). In addition to ft and \efF, the underline font may be selected by ul and cu. Underlining is restricted to an output-device-dependent subset of reasonable characters. .h1 .bt &ul|N off N\(eq1 E \ Underline in \*(NR (italicize in \*(TR) 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 effect, but the restoration will undo the last change. Output generated by tl (\(sc14) is affected by the font change, but does not decrement N. If N\^>\^1, there is the risk that a trap interpolated macro may provide text lines within the span; environment switching can prevent this. .bt &cu|N off N\(eq1 E \ A variant of ul that causes every character to be underlined in \*(NR. Identical to ul in \*(TR. .bt &uf|F Italic Italic - \ Underline font set to F. In \*(NR, F may not be on position 1 (initially Times Roman). .sc 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. .h1 .bt &cc|c . . E \ The basic control character is set to c, or reset to ".". .bt &c2|c \' \' E The nobreak control character is set to c, or reset to "\'". .sc Output translation. One character can be made a stand-in for another character using tr. All text processing (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). .h1 .bt &tr|abcd.... none - O Translate \ a into b, c into d, etc. If an odd number of characters is given, the last one will be mapped into the space character. To be consistent, a particular translation must stay in effect from input to output time. .sc Transparent throughput. An input line beginning with a \e! is read in copy mode and transparently output (without the initial \e!); 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. .sc 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 \e. The sequence \e(newline) is always ignored\(em\ except in a comment. Comments may be imbedded at the end of any line by prefacing them with \e". The newline at the end of a comment cannot be concealed. A line beginning with \e" 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 .\e". .mh Local Horizontal and Vertical Motions, and the Width Function .sc Local Motions. The functions \ev\'N\|\' and \eh\'N\|\' can be used for local vertical and horizontal motion respectively. 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 necessary 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. .tr ||
Vertical Effect in Horizontal Effect in
Local Motion \*(TR \*(NR Local Motion \*(TR \*(NR
.T&
l2|ls2||l2|ls.
\*X\ev\'N\|\^\' Move distance N \
\*X\eh\'N\|\^\' Move distance N
.T&
_2|_2_2||l2|ls.
\*X\e(space) Unpaddable space-size space
.T&
l2|l2|l2||l2|ls.
\*X\eu \(12 em up \(12 line up \*X\e0 Digit-size space
.T&
l2|l2|l2||_2|_2_.
\*X\ed \(12 em down \(12 line down
.T&
l2|l2|l2||l2|l2|l.
\*X\er 1 em up 1 line up \*X\e\|| 1\(sl6 em space ignored
\*X\e^ 1\(sl12 em space ignored
.tr | As an example, E\s-2\v'-.4m'2\v'.4m'\s+2 could be generated by the sequence E\es-2\ev\'-0.4m\'2\ev\'0.4m\'\es+2; it should be noted in this example that the 0.4|em vertical motions are at the smaller size. .sc Width Function. The width function \ew\'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 example, \fB.ti|-\\w\'1.|\'u could be used to temporarily indent leftward a distance equal to the size of the string "1.|". .pg 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 \en(stu-\en(sbu. In \*(TR the number register ct is set to a value between 0|and|3: 0 means that all of the characters in string were short lower case characters 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. .sc Mark horizontal place. The escape sequence \ekx will cause the current horizontal position in the input line to be stored in register x. As an example, the construction \ekxword\|\eh\'\|~\|\enxu+2u\'word will embolden word by backing up to almost its beginning and overprinting it, resulting in \kzword\h'|\nzu+2u'word. .mh Overstrike, Bracket, Line-drawing, and Zero-width Functions .sc Overstriking. Automatically centered overstriking of up to nine characters is provided by the overstrike function \eo\'string\|\'. The characters in string are overprinted with centers aligned; the total width is that of the widest character. string should not contain local vertical motion. As examples, \eo\'e\e\'\' produces \o'e\'', and \eo\'\e(mo\e(sl\' produces \o'\(mo\(sl'. .sc Zero-width characters. The function \ezc will output c without spacing over it, and can be used to produce left-aligned overstruck combinations. As examples, \ez\e(ci\e(pl will produce \z\(ci\(pl, and \e(br\ez\e(rn\e(ul\e(br will produce the smallest possible constructed box \(br\z\(rn\(ul\(br\|. .sc Large Brackets. The Special Mathematical Font contains a number of bracket construction pieces (\|\|\|\(lt\|\|\|\(lb\|\|\|\(rt\|\|\|\(rb\|\|\|\(lk\|\|\|\(rk\|\|\|\(bv\|\|\|\(lf\|\|\|\(rf\|\|\|\(lc\|\|\|\(rc\|\|) that can be combined into various bracket styles. The function \eb\'string\|\' may be used to pile up vertically the 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\(sl2\|em above the current baseline (\(12 line in \*(NR). For example, \eb\'\|\e(lc\e(lf\|\'E\e\|~\|\eb\'\|\e(rc\e(rf\|\'\|\ex\'\|-0.5m\'\|\ex\'0.5m\'\| produces \x'-.5m'\x'.5m'\b'\(lc\(lf'E\|\b'\(rc\(rf'. .sc Line drawing. .tr && The function \e\|l\|\'Nc\|\' will draw a string of repeated c\|'s towards the right for a distance N. (\|\el is \e(lower case L). If c looks like a continuation of an expression for N, it may insulated from N with a \e&. If c is not specified, the \(ru (baseline rule) is used (underline character in \*(NR). If N is negative, a backward horizontal motion of size N is made before drawing the string. Any space resulting from N\|\(sl(size 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 connected such as baseline-rule \(ru\|, underrule \(ul\|, and root-en \(rn\|, the remainder space is covered by over-lapping. If N is less 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

.tr &. .x1 &de us \e\e$1\e\|l\|\'\|~\|0\e(ul\' && .x2 \\$1\l'|0\(ul' .. or one to draw a box around a string .x1 &de bx \e(br\e\|~\|\e\e$1\e\|~\|\e(br\e\|l\|\'\|~\|0\e(rn\'\e\|l\|\'\|~\|0\e(ul\' && .x2 \(br\|\\$1\|\(br\l'|0\(rn'\l'|0\(ul' .. such that .x1 &us "underlined words" .x2 and .x1 &bx "words in a box" .x2 yield .xu "underlined words" and .bx "words in a box" \h'-\w'.'u'. .pg The function \eL\'\|Nc\|\' will draw a vertical line consisting of the (optional) character c stacked vertically apart 1\|em (1 line in \*(NR), with the first two characters overlapped, if necessary, to form a continuous line. The default character is the box rule |\(br| (\|\e(br); the other suitable character is the bold vertical \|\(bv\| (\|\e(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 instantaneous baseline is at the end of the line. .pg

\h'-.5n'\L'|\\nzu-1'\l'\\n(.lu+1n\(ul'\L'-|\\nzu+1'\l'|0u-.5n\(ul'
..

z The horizontal and vertical line drawing functions may be used in combination to produce large boxes. The zero-width box-rule and the \(12-em wide underrule were designed to form corners when using 1-em vertical spacings. For example the macro .x1 .de eb .sp -1 \e"compensate for next automatic base-line spacing .nf \e"avoid possibly overflowing word buffer .tr || \eh\'-.5n\'\eL\'\||\|\e\enau-1\'\el\'\e\en(.lu+1n\e(ul\'\eL\'-\||\|\e\enau+1\'\el\'\||\|0u-.5n\e(ul\' \e"draw box .tr | .lg 0 .fi .lg .. .x2 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. .eb