home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V7 / usr / doc / troff / m3 < prev    next >
Encoding:
Text File  |  1979-01-10  |  16.4 KB  |  483 lines

  1. .tr |
  2. .rm mx
  3. .mh
  4. Tabs, Leaders, and Fields
  5. .sc
  6. Tabs and leaders.
  7. The \s-1ASCII\s+1 horizontal tab character and the \s-1ASCII\s+1
  8. \s-1SOH\s+1 (hereafter known as the \fIleader\fR character)
  9. can both be used to generate either horizontal motion or
  10. a string of repeated characters.
  11. The length of the generated entity is governed
  12. by internal \fItab stops\fR specifiable
  13. with \fBta\fR.
  14. The default difference is that tabs generate motion and leaders generate
  15. a string of periods;
  16. \fBtc\fR and \fBlc\fR
  17. offer the choice of repeated character or motion.
  18. There are three types of internal tab stops\(em\
  19. \fIleft\fR adjusting, \fIright\fR adjusting,
  20. and \fIcentering\fR.
  21. In the following table:
  22. \fID\fR is the distance from the current position on the \fIinput\fR line
  23. (where a tab or leader was found)
  24. to the next tab stop;
  25. \fInext-string\fR consists
  26. of the input characters following the tab (or leader) up to the next tab (or leader) or end of line;
  27. and
  28. \fIW\fR is the width of \fInext-string\fR.
  29. .TS
  30. center box;
  31. c2|c2|c
  32. c2|c2|c
  33. c2|c2|l.
  34. Tab    Length of motion or    Location of
  35. type    repeated characters    \fInext-string\fR
  36. _
  37. Left    \fID\fR    Following \fID\fR
  38. Right    \fID\-W\fR    Right adjusted within \fID\fR
  39. Centered    \fID\-W\(sl\fR2    Centered on right end of \fID\fR
  40. .TE
  41. The length of generated motion is allowed to be negative, but
  42. that of a repeated character string cannot be.
  43. Repeated character strings contain an integer number of characters, and
  44. any residual distance is prepended as motion.
  45. Tabs or leaders found after the last tab stop are ignored, but may be used
  46. as \fInext-string\fR terminators.
  47. .pg
  48. Tabs and leaders are not interpreted in \fIcopy mode\fR.
  49. \fB\et\fR and \fB\ea\fR always generate a non-interpreted
  50. tab and leader respectively, and
  51. are equivalent to actual tabs and leaders in \fIcopy mode\fR.
  52. .sc
  53. Fields.
  54. A \fIfield\fR is contained between
  55. a \fIpair\fR of \fIfield delimiter\fR characters,
  56. and consists of sub-strings
  57. separated by \fIpadding\fR indicator characters.
  58. The field length is the distance on the
  59. \fIinput\fR line from the position where the field begins to the next tab stop.
  60. The difference between the total length of all the sub-strings
  61. and the field length is incorporated as horizontal
  62. padding space that is divided among the indicated
  63. padding places.
  64. The incorporated padding is allowed to be negative.
  65. For example,
  66. if the field delimiter is \fB#\fR and the padding indicator is \fB^\fR,
  67. \fB#^\fIxxx\fB^\fIright\|\fB#\fR
  68. specifies a right-adjusted string with the string \fIxxx\fR centered
  69. in the remaining space.
  70. .h1
  71. .bt
  72. \fB&ta\fI|Nt|...\fR    0.8;|0.5in    none    E,\fBm\fR    \
  73. Set tab stops and types.
  74. \fIt=\fBR\fR, right adjusting;
  75. \fIt=\fBC\fR, centering;
  76. \fIt\fR absent, left adjusting.
  77. \*(TR tab stops are preset every 0.5in.;
  78. \*(NR every 0.8in.
  79. The stop values are separated by spaces, and
  80. a value preceded by \fB+\fR
  81. is treated as an increment to the previous stop value.
  82. .bt
  83. \fB&tc\fI|c\fR    none    none    E    \
  84. The tab repetition character becomes \fIc\fR,
  85. or is removed specifying motion.
  86. .bt
  87. \fB&lc\fI|c\fR    \fB.\fR    none    E    \
  88. The leader repetition character becomes \fIc\fR,
  89. or is removed specifying motion.
  90. .bt
  91. \fB&fc\fI|a|b\fR    off    off    -    \
  92. The field delimiter is set to \fIa\fR;
  93. the padding indicator is set to the \fIspace\fR character or to
  94. \fIb\fR, if given.
  95. In the absence of arguments the field mechanism is turned off.
  96. .mh
  97. Input and Output Conventions and Character Translations
  98. .sc
  99. Input character translations.
  100. Ways of inputting the graphic character set were
  101. discussed in \(sc2.1.
  102. The \s-1ASCII\s+1 control characters horizontal tab (\(sc9.1),
  103. \s-1SOH\s+1 (\(sc9.1), and backspace (\(sc10.3) are discussed elsewhere.
  104. The newline delimits input lines.
  105. In addition,
  106. \s-1STX\s+1, \s-1ETX\s+1, \s-1ENQ\s+1, \s-1ACK\s+1, and \s-1BEL\s+1
  107. are accepted,
  108. and may be used as delimiters or translated into a graphic with \fBtr\fR (\(sc10.5).
  109. \fIAll\fR others are ignored.
  110. .pg
  111. The \fIescape\fR character \fB\e\fR
  112. introduces \fIescape sequences\fR\(em\
  113. causes the following character to mean
  114. another character, or to indicate
  115. some function.
  116. A complete list of such sequences is given in the Summary and Index on page 6.
  117. \fB\e\fR
  118. should not be confused with the \s-1ASCII\s+1 control character \s-1ESC\s+1 of the
  119. same name.
  120. The escape character \fB\e\fR can be input with the sequence \fB\e\e\fR.
  121. The escape character can be changed with \fBec\fR,
  122. and all that has been said about the default \fB\e\fR becomes true
  123. for the new escape character.
  124. \fB\ee\fR can be used to print whatever the current escape character is.
  125. If necessary or convenient, the escape mechanism may be turned off with \fBeo\fR,
  126. and restored with \fBec\fR.
  127. .h1
  128. .bt
  129. \fB&ec\fI|c\fR    \fB\e\fR    \fB\e\fR    -    \
  130. Set escape character to \fB\e\fR, or to \fIc\fR, if given.
  131. .bt
  132. \fB&eo\fR    on    -    -    Turn escape mechanism off.
  133. .sc
  134. Ligatures.
  135. .lg0
  136. Five ligatures are available
  137. in the current \*(TR character set \(em
  138. \fB\(fi\fR, \fB\(fl\fR, \fB\(ff\fR, \fB\(Fi\fR, and \fB\(Fl\fR.
  139. They may be input (even in \*(NR) by
  140. \fB\e(fi\fR, \fB\e(fl\fR, \fB\e(ff\fR, \fB\e(Fi\fR, and \fB\e(Fl\fR respectively.
  141. .lg
  142. The ligature mode is normally on in \*(TR, and \fIautomatically\fR invokes 
  143. ligatures during input.
  144. .h1
  145. .bt
  146. \fB&lg\fI|N\fR    off;|on    on    -    Ligature mode
  147. is turned on if \fIN\fR is absent or non-zero,
  148. and turned off if \fIN\(eq\^\fR0.
  149. If \fIN\fR\(eq\^2, only the two-character ligatures are automatically invoked.
  150. Ligature mode is inhibited for
  151. request, macro, string, register, or file names,
  152. and in \fIcopy mode\fR.
  153. No effect in \*(NR.
  154. .sc
  155. Backspacing, underlining, overstriking, etc.
  156. Unless in \fIcopy mode\fR, the \s-1ASCII\s+1 backspace character is replaced
  157. by a backward horizontal motion having the width of the
  158. space character.
  159. Underlining as a form of line-drawing is discussed in \(sc12.4.
  160. A generalized overstriking function is described in \(sc12.1.
  161. .pg
  162. \*(NR automatically underlines
  163. characters in the \fIunderline\fR font,
  164. specifiable with \fBuf\fR,
  165. normally that on font position 2 (normally Times Italic, see \(sc2.2).
  166. In addition to \fBft\fR and \fB\ef\fIF\fR,
  167. the underline font may be selected by \fBul\fR and \fBcu\fR.
  168. Underlining is restricted to an output-device-dependent
  169. subset of \fIreasonable\fR characters.
  170. .h1
  171. .bt
  172. \fB&ul\fI|N\fR    off    \fIN\(eq\fR1    E    \
  173. Underline in \*(NR (italicize in \*(TR) the next \fIN\fR
  174. input text lines.
  175. Actually, switch to \fIunderline\fR font, saving the
  176. current font for later restoration;
  177. \fIother\fR font changes within the span of a \fBul\fR
  178. will take effect,
  179. but the restoration will undo the last change.
  180. Output generated by \fBtl\fR (\(sc14) \fIis\fR affected by the
  181. font change, but does \fInot\fR decrement \fIN\fR.
  182. If \fIN\fR\^>\^1, there is the risk that
  183. a trap interpolated macro may provide text
  184. lines within the span;
  185. environment switching can prevent this.
  186. .bt
  187. \fB&cu\fI|N\fR    off    \fIN\(eq\fR1    E    \
  188. A variant of \fBul\fR that causes \fIevery\fR character to be underlined in \*(NR.
  189. Identical to \fBul\fR in \*(TR.
  190. .bt
  191. \fB&uf\fI|F\fR    Italic    Italic    -    \
  192. Underline font set to \fIF\fR.
  193. In \*(NR,
  194. \fIF\fR may \fInot\fR be on position 1 (initially Times Roman).
  195. .sc
  196. Control characters.
  197. Both the control character \fB.\fR and the \fIno-break\fR
  198. control character \fB\'\fR may be changed, if desired.
  199. Such a change must be compatible with the design
  200. of any macros used in the span of the change,
  201. and
  202. particularly of any trap-invoked macros.
  203. .h1
  204. .bt
  205. \fB&cc\fI|c\fR    \fB.\fR    \fB.\fR    E    \
  206. The basic control character is set to \fIc\fR,
  207. or reset to "\fB.\fR".
  208. .bt
  209. \fB&c2\fI|c\fR    \fB\'    \'\fR    E    The \fInobreak\fR control character is set
  210. to \fIc\fR, or reset to "\fB\'\fR".
  211. .sc
  212. Output translation.
  213. One character can be made a stand-in for another character using \fBtr\fR.
  214. All text processing (e. g. character comparisons) takes place
  215. with the input (stand-in) character which appears to have the width of the final
  216. character.
  217. The graphic translation occurs at the moment of output
  218. (including diversion).
  219. .h1
  220. .bt
  221. \fB&tr\fI|abcd....\fR    none    -    O    Translate \
  222. \fIa\fR into \fIb\fR, \fIc\fR into \fId\fR, etc.
  223. If an odd number of characters is given,
  224. the last one will be mapped into the space character.
  225. To be consistent, a particular translation
  226. must stay in effect from \fIinput\fR to \fIoutput\fR time.
  227. .sc
  228. Transparent throughput.
  229. An input line beginning with a \fB\e!\fR is read in \fIcopy mode\fR and \fItransparently\fR output
  230. (without the initial \fB\e!\fR);
  231. the text processor is otherwise unaware of the line's presence.
  232. This mechanism may be used to pass control information to a post-processor
  233. or to imbed control lines in a macro created by a diversion.
  234. .sc
  235. Comments and concealed newlines.
  236. An uncomfortably long input line that must stay
  237. one line (e. g. a string definition, or nofilled text)
  238. can be split into many physical lines by ending all but
  239. the last one with the escape \fB\e\fR.
  240. The sequence \fB\e\fR(newline) is \fIalways\fR ignored\(em\
  241. except in a comment.
  242. Comments may be imbedded at the \fIend\fR of any line by
  243. prefacing them with \fB\e"\fR.
  244. The newline at the end of a comment cannot be concealed.
  245. A line beginning with \fB\e"\fR will appear as a blank line and
  246. behave like \fB.sp|1\fR;
  247. a comment can be on a line by itself by beginning the line with \fB.\e"\fR.
  248. .mh
  249. Local Horizontal and Vertical Motions, and the Width Function
  250. .sc
  251. Local Motions.
  252. The functions \fB\ev\'\fIN\fB\|\'\fR and
  253. \fB\eh\'\fIN\fB\|\'\fR
  254. can be used for \fIlocal\fR vertical and horizontal motion respectively.
  255. The distance \fIN\fR may be negative; the \fIpositive\fR directions
  256. are \fIrightward\fR and \fIdownward\fR.
  257. A \fIlocal\fR motion is one contained \fIwithin\fR a line.
  258. To avoid unexpected vertical dislocations, it is necessary that
  259. the \fInet\fR vertical local motion within a word in filled text
  260. and otherwise within a line balance to zero.
  261. The above and certain other escape sequences providing local motion are
  262. summarized in the following table.
  263. .tr ||
  264. .ds X \0\0\0
  265. .TS
  266. center box;
  267. c2|cs2||c2|cs2
  268. c1|c2c2||c2|c2c2.
  269. Vertical    Effect in    Horizontal    Effect in
  270. Local Motion    \*(TR    \*(NR    Local Motion    \*(TR    \*(NR
  271. _
  272. .sp.4
  273. .TC
  274. l2|ls2||l2|ls2.
  275. \fB\*X\ev\'\fIN\|\^\fB\'\fR    Move distance \fIN\fR    \
  276. \fB\*X\eh\'\fIN\|\^\fB\'\fR    Move distance \fIN\fR
  277. .TC
  278. _2|_2_2||l2|ls2.
  279. x    x    x    \fB\*X\e\fR(space)    Unpaddable space-size space
  280. .TC
  281. l2|l2|l2||l2|ls2.
  282. \fB\*X\eu\fR    \(12 em up    \(12 line up    \fB\*X\e0\fR    Digit-size space
  283. .TC
  284. l2|l2|l2||_2|_2_2.
  285. \fB\*X\ed\fR    \(12 em down    \(12 line down    x    x    x
  286. .TC
  287. l2|l2|l2||l2|l2|l2.
  288. \fB\*X\er\fR    1 em up    1 line up    \fB\*X\e\||\fR    1\(sl6 em space    ignored
  289.             \fB\*X\e^\fR    1\(sl12 em space    ignored
  290. .sp.4
  291. .TE
  292. .rm X
  293. .tr |
  294. As an example,
  295. \fBE\s-2\v'-.4m'2\v'.4m'\s+2\fR
  296. could be generated by the sequence
  297. \fBE\es\-2\ev\'\-0.4m\'2\ev\'0.4m\'\es+2\fR;
  298. it should be noted in this example that
  299. the 0.4|em vertical motions are at the smaller size.
  300. .sc
  301. Width Function.
  302. The \fIwidth\fR function \fB\ew\'\fIstring\fB\|\'\fR
  303. generates the numerical width of \fIstring\fR (in basic units).
  304. Size and font changes may be safely imbedded in \fIstring\fR,
  305. and will not affect the current environment.
  306. For example,
  307. \&\fB.ti|\-\\w\'1.|\'u\fR could be used to
  308. temporarily indent leftward a distance equal to the
  309. size of the string "\fB1.|\fR".
  310. .pg
  311. The width function also sets three number registers.
  312. The registers \fBst\fR and \fBsb\fR are set respectively to the highest and
  313. lowest extent of \fIstring\fR relative to the baseline;
  314. then, for example,
  315. the total \fIheight\fR of the string is \fB\en(stu\-\en(sbu\fR.
  316. In \*(TR the number register \fBct\fR is set to a value
  317. between 0|and|3:
  318. 0 means that all of the characters in \fIstring\fR were short lower
  319. case characters without descenders (like \fBe\fR);
  320. 1 means that at least one character has a descender (like \fBy\fR);
  321. 2 means that at least one character is tall (like \fBH\fR);
  322. and 3 means that both tall characters and characters with
  323. descenders are present.
  324. .sc
  325. Mark horizontal place.
  326. The escape sequence \fB\ek\fIx\fR will cause the \fIcurrent\fR horizontal
  327. position in the \fIinput line\fR to be stored in register \fIx\fR.
  328. As an example,
  329. the construction \fB\ekx\fIword\|\fB\eh\'\|~\|\enxu+2u\'\fIword\fB\fR
  330. will embolden \fIword\fR by backing up to almost its beginning and overprinting it,
  331. resulting in \kz\fIword\fR\h'|\nzu+2u'\fIword\fR.
  332. .mh
  333. Overstrike, Bracket, Line-drawing, and Zero-width Functions
  334. .sc
  335. Overstriking.
  336. Automatically centered overstriking of up to nine characters
  337. is provided by the \fIoverstrike\fR function
  338. \fB\eo\'\fIstring\fB\|\'\fR.
  339. The characters in \fIstring\fR overprinted with centers aligned; the total width
  340. is that of the widest character.
  341. \fIstring\fR should \fInot\fR contain local vertical motion.
  342. As examples,
  343. \fB\eo\'e\e\'\'\fR produces \fB\o'e\''\fR, and
  344. \fB\eo\'\e(mo\e(sl\'\fR produces \fB\o'\(mo\(sl'\fR.
  345. .sc
  346. Zero-width characters.
  347. The function \fB\ez\fIc\fR will output \fIc\fR without spacing over
  348. it, and can be used to produce left-aligned overstruck
  349. combinations.
  350. As examples,
  351. \fB\ez\e(ci\e(pl\fR will produce \fB\z\(ci\(pl\fR, and
  352. \fB\e(br\ez\e(rn\e(ul\e(br\fR will produce the smallest possible
  353. constructed box \fB\(br\z\(rn\(ul\(br\fR\|.
  354. .sc
  355. Large Brackets.
  356. The Special Mathematical Font contains a number of bracket construction pieces
  357. (\|\|\(lt\|\|\(lb\|\|\(rt\|\|\(rb\|\|\(lk\|\|\(rk\|\|\(bv\|\|\(lf\|\|\(rf\|\|\(lc\|\|\(rc\|\|)
  358. that can be combined into various bracket styles.
  359. The function \fB\eb\'\fIstring\fB\|\'\fR may be used to pile
  360. up vertically the characters in \fIstring\fR
  361. (the first character on top and the last at the bottom);
  362. the characters are vertically separated by 1|em and the total
  363. pile is centered 1\(sl2\|em above the current baseline
  364. (\(12 line in \*(NR).
  365. For example,
  366. \fB\eb\'\|\e(lc\e(lf\|\'E\e\|~\|\eb\'\|\e(rc\e(rf\|\'\|\ex\'\|\-0.5m\'\|\ex\'0.5m\'\|\fR
  367. produces
  368. \x'-.5m'\x'.5m'\fB\b'\(lc\(lf'E\|\b'\(rc\(rf'\fR.
  369. .sc
  370. Line drawing.
  371. .tr &&
  372. The function \fB\e\|l\|\'\fINc\fB\|\'\fR will draw a string of repeated \fIc\fR\|'s towards the right for a distance \fIN\fR.
  373. (\|\fB\el\fR is \fB\e\fR(lower case L).
  374. If \fIc\fR looks like a continuation of
  375. an expression for \fIN\fR, it may insulated from \fIN\fR with a \fB\e&\fR.
  376. If \fIc\fR is not specified, the \fB\(ru\fR (baseline rule) is used
  377. (underline character in \*(NR).
  378. If \fIN\fR is negative, a backward horizontal motion
  379. of size \fIN\fR is made \fIbefore\fR drawing the string.
  380. Any space resulting from \fIN\fR\|\(sl(size of \fIc\fR) having a remainder is put at the beginning (left end)
  381. of the string.
  382. In the case of characters
  383. that are designed to be connected such as
  384. baseline-rule\ \fB\(ru\fR\|,
  385. underrule\ \fB\(ul\fR\|,
  386. and
  387. root-en\ \fB\(rn\fR\|,
  388. the remainder space is covered by over-lapping.
  389. If \fIN\fR is \fIless\fR than the width of \fIc\fR,
  390. a single \fIc\fR is centered on a distance \fIN\fR.
  391. As an example, a macro to underscore a string can be written
  392. .br
  393. .tr &.
  394. .x1
  395. .ftB
  396. .ne 2.1
  397. &de us
  398. \e\e$1\e\|l\|\'\|~\|0\e(ul\'
  399. &&
  400. .ftR
  401. .x2
  402. .ne2.1
  403. .de xu
  404. \\$1\l'|0\(ul'
  405. ..
  406. or one to draw a box around a string
  407. .x1
  408. .ftB
  409. &de bx
  410. \e(br\e\|~\|\e\e$1\e\|~\|\e(br\e\|l\|\'\|~\|0\e(rn\'\e\|l\|\'\|~\|0\e(ul\'
  411. &&
  412. .ftR
  413. .x2
  414. .de bx
  415. \(br\|\\$1\|\(br\l'|0\(rn'\l'|0\(ul'
  416. ..
  417. such that
  418. .x1
  419. .ftB
  420. &ul "underlined words"
  421. .ftR
  422. .x2
  423. and
  424. .x1
  425. .ftB
  426. &bx "words in a box"
  427. .ftR
  428. .x2
  429. yield
  430. .xu "underlined words"
  431. and
  432. .bx "words in a box"
  433. \h'-\w'.'u'.
  434. .pg
  435. The function \fB\eL\'\|\fINc\fB\|\'\fR will draw a vertical line consisting
  436. of the (optional) character \fIc\fR stacked vertically apart 1\|em
  437. (1 line in \*(NR),
  438. with the first two characters overlapped,
  439. if necessary, to form a continuous line.
  440. The default character is the \fIbox rule\fR |\(br| (\fB\|\e(br\fR);
  441. the other suitable character is the \fIbold vertical\fR \|\(bv\| (\fB\|\e(bv\fR).
  442. The line is begun without any initial motion relative to the
  443. current base line.
  444. A positive \fIN\fR specifies a line drawn downward and
  445. a negative \fIN\fR specifies a line drawn upward.
  446. After the line is drawn \fIno\fR compensating
  447. motions are made;
  448. the instantaneous baseline is at the \fIend\fR of the line.
  449. .pg
  450. .de eb
  451. .sp -1
  452. .nf
  453. \h'-.5n'\L'|\\nzu-1'\l'\\n(.lu+1n\(ul'\L'-|\\nzu+1'\l'|0u-.5n\(ul'
  454. .fi
  455. ..
  456. .ne 2i
  457. .mk z
  458. The horizontal and vertical line drawing functions may be used
  459. in combination to produce large boxes.
  460. The zero-width \fIbox-rule\fR and the \(12-em wide \fIunderrule\fR
  461. were \fIdesigned\fR to form corners when using 1-em vertical
  462. spacings.
  463. For example the macro
  464. .x1
  465. .ftB
  466. \&.de eb
  467. \&.sp \-1    \e"compensate for next automatic base-line spacing
  468. \&.nf    \e"avoid possibly overflowing word buffer
  469. .tr ||
  470. \&\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
  471. .tr |
  472. .lg0
  473. \&.fi
  474. .lg
  475. \&..
  476. .ftR
  477. .x2
  478. will draw a box around some text whose beginning vertical place was
  479. saved in number register \fIa\fR
  480. (e. g. using \fB.mk|a\fR)
  481. as done for this paragraph.
  482. .eb
  483.