/contrib/groff/src/preproc/tbl/tbl.man

https://bitbucket.org/freebsd/freebsd-head/ · Unknown · 493 lines · 490 code · 3 blank · 0 comment · 0 complexity · 700283ce93225962dbda430574feef78 MD5 · raw file

  1. .ig
  2. Copyright (C) 1989-1995, 2001, 2002, 2003, 2004
  3. Free Software Foundation, Inc.
  4. Permission is granted to make and distribute verbatim copies of
  5. this manual provided the copyright notice and this permission notice
  6. are preserved on all copies.
  7. Permission is granted to copy and distribute modified versions of this
  8. manual under the conditions for verbatim copying, provided that the
  9. entire resulting derived work is distributed under the terms of a
  10. permission notice identical to this one.
  11. Permission is granted to copy and distribute translations of this
  12. manual into another language, under the above conditions for modified
  13. versions, except that this permission notice may be included in
  14. translations approved by the Free Software Foundation instead of in
  15. the original English.
  16. ..
  17. .TH @G@TBL @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
  18. .SH NAME
  19. @g@tbl \- format tables for troff
  20. .
  21. .
  22. .SH SYNOPSIS
  23. .B @g@tbl
  24. [
  25. .B \-Cv
  26. ]
  27. [
  28. .IR files \|.\|.\|.\&
  29. ]
  30. .
  31. .
  32. .SH DESCRIPTION
  33. This manual page describes the GNU version of
  34. .BR tbl ,
  35. which is part of the groff document formatting system.
  36. .B tbl
  37. compiles descriptions of tables embedded within
  38. .B troff
  39. input files into commands that are understood by
  40. .BR troff .
  41. Normally, it should be invoked using the
  42. .B \-t
  43. option of
  44. .B groff.
  45. It is highly compatible with Unix
  46. .BR tbl .
  47. The output generated by GNU
  48. .B tbl
  49. cannot be processed with Unix
  50. .BR troff ;
  51. it must be processed with GNU
  52. .BR troff .
  53. If no files are given on the command line, the standard input
  54. will be read.
  55. A filename of
  56. .B \-
  57. will cause the standard input to be read.
  58. .
  59. .
  60. .SH OPTIONS
  61. .TP
  62. .B \-C
  63. Enable compatibility mode to
  64. recognize
  65. .B .TS
  66. and
  67. .B .TE
  68. even when followed by a character other than space or newline.
  69. Leader characters (\[rs]a) are handled as interpreted.
  70. .TP
  71. .B \-v
  72. Print the version number.
  73. .
  74. .
  75. .SH USAGE
  76. .B tbl
  77. expects to find table descriptions wrapped in the
  78. .B .TS
  79. (table start) and
  80. .B .TE
  81. (table end) macros.
  82. The line immediately following the
  83. .B .TS
  84. macro may contain any of the following global options (ignoring the case
  85. of characters -- Unix tbl only accepts options with all characters lowercase
  86. or all characters uppercase):
  87. .
  88. .TP
  89. .B center
  90. Centers the table (default is left-justified).
  91. The alternative keyword name
  92. .B centre
  93. is also recognized (this is a GNU tbl extension).
  94. .
  95. .TP
  96. .BI delim( xy )
  97. Use
  98. .I x
  99. and
  100. .I y
  101. as start and end delimiters for
  102. .BR @g@eqn (@MAN1EXT@).
  103. .
  104. .TP
  105. .B expand
  106. Makes the table as wide as the current line length.
  107. .
  108. .TP
  109. .B box
  110. Encloses the table in a box.
  111. .
  112. .TP
  113. .B doublebox
  114. Encloses the table in a double box.
  115. .
  116. .TP
  117. .B allbox
  118. Encloses each item of the table in a box.
  119. .
  120. .TP
  121. .B frame
  122. Same as box (GNU tbl only).
  123. .
  124. .TP
  125. .B doubleframe
  126. Same as doublebox (GNU tbl only).
  127. .
  128. .TP
  129. .BI tab( x )
  130. Uses the character
  131. .I x
  132. instead of a tab to separate items in a line of input data.
  133. .
  134. .TP
  135. .BI linesize( n )
  136. Sets lines or rules (e.g. from
  137. .BR box )
  138. in
  139. .IR n -point
  140. type.
  141. .
  142. .TP
  143. .B nokeep
  144. Don't use diversions to prevent page breaks (GNU tbl only).
  145. Normally
  146. .B tbl
  147. attempts to prevent undesirable breaks in the table by using diversions.
  148. This can sometimes interact badly with macro packages' own use of
  149. diversions, when footnotes, for example, are used.
  150. .
  151. .TP
  152. .BI decimalpoint( c )
  153. Set the character to be recognized as the decimal point in numeric
  154. columns (GNU tbl only).
  155. .
  156. .TP
  157. .B nospaces
  158. Ignore leading and trailing spaces in data items (GNU tbl only).
  159. .
  160. .LP
  161. The global options must end with a semicolon.
  162. There might be whitespace after an option and its argument in parentheses.
  163. .LP
  164. After global options come lines describing the format of each line of
  165. the table.
  166. Each such format line describes one line of the table itself, except that
  167. the last format line (which you must end with a period) describes all
  168. remaining lines of the table.
  169. A single key character describes each column of each line of the table.
  170. You may run format specs for multiple lines together on the same line by
  171. separating them with commas.
  172. .LP
  173. You may follow each key character with specifiers that determine the font
  174. and point size of the corresponding item, that determine column width,
  175. inter-column spacing, etc.
  176. .LP
  177. The longest format line defines the number of columns in the table; missing
  178. format descriptors at the end of format lines are assumed to be `L'.
  179. Extra columns in the data (which have no corresponding format entry) are
  180. ignored.
  181. .LP
  182. The available key characters are:
  183. .
  184. .TP
  185. c,C
  186. Centers item within the column.
  187. .
  188. .TP
  189. r,R
  190. Right-justifies item within the column.
  191. .
  192. .TP
  193. l,L
  194. Left-justifies item within the column.
  195. .
  196. .TP
  197. n,N
  198. Numerically justifies item in the column: Units positions of numbers are
  199. aligned vertically.
  200. .
  201. .TP
  202. s,S
  203. Spans previous item on the left into this column.
  204. .
  205. .TP
  206. a,A
  207. Centers longest line in this column and then left-justifies all other lines
  208. in this column with respect to that centered line.
  209. .
  210. .TP
  211. ^
  212. Spans down entry from previous row in this column.
  213. .
  214. .TP
  215. _,-
  216. Replaces this entry with a horizontal line.
  217. .
  218. .TP
  219. =
  220. .
  221. Replaces this entry with a double horizontal line.
  222. .
  223. .TP
  224. |
  225. The corresponding column becomes a vertical rule (if two of these are
  226. adjacent, a double vertical rule).
  227. .
  228. .LP
  229. A vertical bar to the left of the first key-letter or to the right of the
  230. last one produces a line at the edge of the table.
  231. .LP
  232. Here are the specifiers that can appear in suffixes to column key letters:
  233. .
  234. .TP
  235. b,B
  236. Short form of fB (make affected entries bold).
  237. .
  238. .TP
  239. i,I
  240. Short form of fI (make affected entries italic).
  241. .
  242. .TP
  243. t,T
  244. Start an item vertically spanning rows at the top of its range rather than
  245. vertically centering it.
  246. .
  247. .TP
  248. d,D
  249. Start an item vertically spanning rows at the bottom of its range rather
  250. than vertically centering it (GNU tbl only).
  251. .
  252. .TP
  253. v,V
  254. Followed by a number, this indicates the vertical line spacing to be used in
  255. a multi-line table entry.
  256. If signed, the current vertical line spacing is incremented or decremented
  257. (using a signed number instead of a signed digit is a GNU tbl extension).
  258. A vertical line spacing specifier followed by a column separation number
  259. must be separated by one or more blanks.
  260. No effect if the corresponding table entry isn't a text block.
  261. .
  262. .TP
  263. f,F
  264. Either of these specifiers may be followed by a font name (either one or two
  265. characters long), font number (a single digit), or long name in parentheses
  266. (the last form is a GNU tbl extension).
  267. A one-letter font name must be separated by one or more blanks from whatever
  268. follows.
  269. .
  270. .TP
  271. p,P
  272. Followed by a number, this does a point size change for the affected fields.
  273. If signed, the current point size is incremented or decremented (using a
  274. signed number instead of a signed digit is a GNU tbl extension).
  275. A point size specifier followed by a column separation number must be
  276. separated by one or more blanks.
  277. .
  278. .TP
  279. w,W
  280. Minimal column width value.
  281. Must be followed either by a
  282. .BR @g@troff (@MAN1EXT@)
  283. width expression in parentheses or a unitless integer.
  284. If no unit is given, en units are used.
  285. Also used as the default line length for included text blocks.
  286. If used multiple times to specify the width for a particular column,
  287. the last entry takes effect.
  288. .
  289. .TP
  290. x,X
  291. This is a GNU tbl extension.
  292. Either of these specifiers may be followed by a macro name
  293. (either one or two characters long),
  294. or long name in parentheses.
  295. A one-letter macro name must be separated by one or more blanks
  296. from whatever follows.
  297. The macro which name can be specified here
  298. must be defined before creating the table.
  299. It is called just before the table's cell text is output.
  300. As implemented currently, this macro is only called if block input is used,
  301. that is, text between `T{' and `T}'.
  302. The macro should contain only simple
  303. .B troff
  304. requests to change the text block formatting, like text adjustment,
  305. hyphenation, size, or font.
  306. The macro is called
  307. .I after
  308. other cell modifications like
  309. .BR b ,
  310. .B f
  311. or
  312. .B v
  313. are output.
  314. Thus the macro can overwrite other modification specifiers.
  315. .
  316. .TP
  317. e,E
  318. Make equally-spaced columns.
  319. .
  320. .TP
  321. u,U
  322. Move the corresponding column up one half-line.
  323. .
  324. .TP
  325. z,Z
  326. Ignore the corresponding column for width-calculation purposes.
  327. .
  328. .LP
  329. A number suffix on a key character is interpreted as a column
  330. separation in ens (multiplied in proportion if the
  331. .B expand
  332. option is on).
  333. Default separation is 3n.
  334. .LP
  335. The format lines are followed by lines containing the actual data for the
  336. table, followed finally by
  337. .BR .TE .
  338. Within such data lines, items are normally separated by tab characters (or
  339. the character specified with the
  340. .B tab
  341. option).
  342. Long input lines can be broken across multiple lines if the last character
  343. on the line is `\e' (which vanishes after concatenation).
  344. .LP
  345. A dot starting a line, followed by anything but a digit is handled as a
  346. troff command, passed through without changes.
  347. The table position is unchanged in this case.
  348. .LP
  349. If a data line consists of only `_' or `=', a single or double line,
  350. respectively, is drawn across the table at that point; if a single item in a
  351. data line consists of only `_' or `=', then that item is replaced by a
  352. single or double line, joining its neighbours.
  353. If a data item consists only of `\e_' or `\e=', a single or double line,
  354. respectively, is drawn across the field at that point which does not join
  355. its neighbours.
  356. .LP
  357. A data item consisting only of `\eRx' (`x' any character) is replaced by
  358. repetitions of character `x' as wide as the column (not joining its
  359. neighbours).
  360. .LP
  361. A data item consisting only of `\e^' indicates that the field immediately
  362. above spans downward over this row.
  363. .LP
  364. A text block can be used to enter data as a single entry which would be
  365. too long as a simple string between tabs.
  366. It is started with `T{' and closed with `T}'.
  367. The former must end a line, and the latter must start a line, probably
  368. followed by other data columns (separated with tabs).
  369. By default, the text block is formatted with the settings which were
  370. active before entering the table, possibly overridden by the
  371. .B v
  372. and
  373. .B w
  374. tbl specifiers.
  375. For example, to make all text blocks ragged-right, insert
  376. .B .na
  377. right before the starting
  378. .B .TS
  379. (and
  380. .B .ad
  381. after the table).
  382. .LP
  383. To change the data format within a table, use the
  384. .B .T&
  385. command (at the start of a line).
  386. It is followed by format and data lines (but no global options) similar to
  387. the
  388. .B .TS
  389. request.
  390. .
  391. .
  392. .SH "INTERACTION WITH @G@EQN"
  393. .BR @g@tbl (@MAN1EXT@)
  394. should always be called before
  395. .BR @g@eqn (@MAN1EXT@)
  396. .RB ( groff (@MAN1EXT@)
  397. automatically takes care of the correct order of preprocessors).
  398. .
  399. .
  400. .SH "GNU TBL ENHANCEMENTS"
  401. There is no limit on the number of columns in a table, nor any limit on the
  402. number of text blocks.
  403. All the lines of a table are considered in deciding column widths, not just
  404. the first 200.
  405. Table continuation
  406. .RB ( .T& )
  407. lines are not restricted to the first 200 lines.
  408. .LP
  409. Numeric and alphabetic items may appear in the same column.
  410. .LP
  411. Numeric and alphabetic items may span horizontally.
  412. .LP
  413. .B @g@tbl
  414. uses register, string, macro and diversion names beginning with the digit\~\c
  415. .BR 3 .
  416. When using
  417. .B @g@tbl
  418. you should avoid using any names beginning with a\~\c
  419. .BR 3 .
  420. .
  421. .
  422. .SH BUGS
  423. You should use
  424. .BR .TS\ H / .TH
  425. in conjunction with a supporting macro package for
  426. .I all
  427. multi-page boxed tables.
  428. If there is no header that you wish to appear at the top of each page
  429. of the table, place the
  430. .B .TH
  431. line immediately after the format section.
  432. Do not enclose a multi-page table within keep/release macros,
  433. or divert it in any other way.
  434. .LP
  435. A text block within a table must be able to fit on one page.
  436. .LP
  437. The
  438. .B bp
  439. request cannot be used to force a page-break in a multi-page table.
  440. Instead, define
  441. .B BP
  442. as follows
  443. .IP
  444. .B .de BP
  445. .br
  446. .B .ie '\e\en(.z'' .bp \e\e$1
  447. .br
  448. .B .el \e!.BP \e\e$1
  449. .br
  450. .B ..
  451. .br
  452. .LP
  453. and use
  454. .B BP
  455. instead of
  456. .BR bp .
  457. .LP
  458. Using \ea directly in a table to get leaders will not work (except in
  459. compatibility mode).
  460. This is correct behaviour: \ea is an
  461. .B uninterpreted
  462. leader.
  463. To get leaders use a real leader, either by using a control A or like
  464. this:
  465. .IP
  466. .nf
  467. .ft B
  468. \&.ds a \ea
  469. \&.TS
  470. tab(;);
  471. lw(1i) l.
  472. A\e*a;B
  473. \&.TE
  474. .ft
  475. .fi
  476. .
  477. .
  478. .SH REFERENCE
  479. Lesk, M.E.: "TBL -- A Program to Format Tables".
  480. For copyright reasons it cannot be included in the groff distribution,
  481. but copies can be found with a title search on the World Wide Web.
  482. .
  483. .
  484. .SH "SEE ALSO"
  485. .BR groff (@MAN1EXT@),
  486. .BR @g@troff (@MAN1EXT@)
  487. .
  488. .\" Local Variables:
  489. .\" mode: nroff
  490. .\" End: