3 Copyright (C) 1989-1995, 2001, 2002, 2003, 2004, 2006, 2007, 2008
4 Free Software Foundation, Inc.
6 Permission is granted to make and distribute verbatim copies of
7 this manual provided the copyright notice and this permission notice
8 are preserved on all copies.
10 Permission is granted to copy and distribute modified versions of this
11 manual under the conditions for verbatim copying, provided that the
12 entire resulting derived work is distributed under the terms of a
13 permission notice identical to this one.
15 Permission is granted to copy and distribute translations of this
16 manual into another language, under the above conditions for modified
17 versions, except that this permission notice may be included in
18 translations approved by the Free Software Foundation instead of in
23 .TH @G@TBL @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
27 @g@tbl \- format tables for troff
33 .RI [ files\~ .\|.\|.]
38 This manual page describes the GNU version of
40 which is part of the groff document formatting system.
42 compiles descriptions of tables embedded within
44 input files into commands that are understood by
46 Normally, it should be invoked using the
50 It is highly compatible with Unix
52 The output generated by GNU
54 cannot be processed with Unix
56 it must be processed with GNU
58 If no files are given on the command line or a filename of
60 is given, the standard input is read.
66 Enable compatibility mode to
71 even when followed by a character other than space or newline.
72 Leader characters (\[rs]a) are handled as interpreted.
76 Print the version number.
81 expects to find table descriptions wrapped in the
89 The line immediately following the
91 macro may contain any of the following global options (ignoring the case of
92 characters \[en] Unix tbl only accepts options with all characters lowercase
93 or all characters uppercase), separated by spaces, tabs, or commas:
97 Enclose each item of the table in a box.
101 Enclose the table in a box.
105 Center the table (default is left-justified).
106 The alternative keyword name
108 is also recognized (this is a GNU tbl extension).
111 .BI decimalpoint( c )
112 Set the character to be recognized as the decimal point in numeric
113 columns (GNU tbl only).
121 as start and end delimiters for
122 .BR @g@eqn (@MAN1EXT@).
126 Enclose the table in a double box.
130 Same as doublebox (GNU tbl only).
134 Make the table as wide as the current line length (providing a column
136 Ignored if one or more `x' column specifiers are used (see below).
139 In case the sum of the column widths is larger than the current line length,
140 the column separation factor is set to zero; such tables extend into the
141 right margin, and there is no column separation at all.
145 Same as box (GNU tbl only).
149 Set lines or rules (e.g. from
157 Don't use diversions to prevent page breaks (GNU tbl only).
160 attempts to prevent undesirable breaks in boxed tables by using diversions.
161 This can sometimes interact badly with macro packages' own use of
162 diversions, when footnotes, for example, are used.
166 Ignore leading and trailing spaces in data items (GNU tbl only).
172 instead of a tab to separate items in a line of input data.
175 The global options must end with a semicolon.
176 There might be whitespace between an option and its argument in parentheses.
179 .SS Table format specification
180 After global options come lines describing the format of each line of
182 Each such format line describes one line of the table itself, except that
183 the last format line (which you must end with a period) describes all
184 remaining lines of the table.
185 A single-key character describes each column of each line of the table.
186 Key characters can be separated by spaces or tabs.
187 You may run format specifications for multiple lines together on the same
188 line by separating them with commas.
191 You may follow each key character with specifiers that determine the font
192 and point size of the corresponding item, that determine column width,
193 inter-column spacing, etc.
196 The longest format line defines the number of columns in the table; missing
197 format descriptors at the end of format lines are assumed to be\~\c
199 Extra columns in the data (which have no corresponding format entry) are
203 The available key characters are:
207 Center longest line in this column and then left-justifies all other lines
208 in this column with respect to that centered line.
209 The idea is to use such alphabetic subcolumns (hence the name of the key
210 character) in combination with\~
212 they are called subcolumns because
214 are indented by\~1n relative to
229 \&subitem twentytwo;22
230 \&subitem thirtythree;33
250 subitem thirtythree;33
256 Center item within the column.
260 Left-justify item within the column.
264 Numerically justify item in the column: Units positions of numbers are
266 If there is one or more dots adjacent to a digit, use the rightmost one for
268 If there is no dot, use the rightmost digit for vertical alignment;
269 otherwise, center the item within the column.
270 Alignment can be forced to a certain position using `\[rs]&'; if there is
271 one or more instances of this special (non-printing) character present
272 within the data, use the leftmost one for alignment.
304 If numerical entries are combined with
308 \[en] this can happen if the table format is changed with
313 (of the data entered under the
315 regime) relative to the widest
319 preserving the alignment of all numerical entries.
322 entries, there is no extra indentation.
325 Using equations (to be processed with
327 within columns which use the
329 is problematic in most cases due to
331 algorithm for finding the vertical alignment, as described above.
334 option, however, it is possible to make
336 ignore the data within
338 delimiters for that purpose.
343 Right-justify item within the column.
347 Span previous item on the left into this column.
348 Not allowed for the first column.
352 Span down entry from previous row in this column.
353 Not allowed for the first row.
357 Replace this entry with a horizontal line.
362 Replace this entry with a double horizontal line.
366 The corresponding column becomes a vertical rule (if two of these are
367 adjacent, a double vertical rule).
370 A vertical bar to the left of the first key letter or to the right of the
371 last one produces a line at the edge of the table.
374 To change the data format within a table, use the
376 command (at the start of a line).
377 It is followed by format and data lines (but no global options) similar to
383 .SS Column specifiers
384 Here are the specifiers that can appear in suffixes to column key letters
391 (make affected entries bold).
395 Start an item vertically spanning rows at the bottom of its range rather
396 than vertically centering it (GNU tbl only).
400 Make equally-spaced columns.
401 All columns marked with this specifier get the same width; this happens
402 after the affected column widths have been computed (this means that the
403 largest width value rules).
407 Either of these specifiers may be followed by a font name (either one or two
408 characters long), font number (a single digit), or long name in parentheses
409 (the last form is a GNU tbl extension).
410 A one-letter font name must be separated by one or more blanks from whatever
417 (make affected entries italic).
421 This is a GNU tbl extension.
422 Either of these specifiers may be followed by a macro name
423 (either one or two characters long),
424 or long name in parentheses.
425 A one-letter macro name must be separated by one or more blanks
426 from whatever follows.
427 The macro which name can be specified here
428 must be defined before creating the table.
429 It is called just before the table's cell text is output.
430 As implemented currently, this macro is only called if block input is used,
431 that is, text between `T{' and `T}'.
432 The macro should contain only simple
434 requests to change the text block formatting, like text adjustment,
435 hyphenation, size, or font.
438 other cell modifications like
444 Thus the macro can overwrite other modification specifiers.
448 Followed by a number, this does a point size change for the affected fields.
449 If signed, the current point size is incremented or decremented (using a
450 signed number instead of a signed digit is a GNU tbl extension).
451 A point size specifier followed by a column separation number must be
452 separated by one or more blanks.
456 Start an item vertically spanning rows at the top of its range rather than
457 vertically centering it.
461 Move the corresponding column up one half-line.
465 Followed by a number, this indicates the vertical line spacing to be used in
466 a multi-line table entry.
467 If signed, the current vertical line spacing is incremented or decremented
468 (using a signed number instead of a signed digit is a GNU tbl extension).
469 A vertical line spacing specifier followed by a column separation number
470 must be separated by one or more blanks.
471 No effect if the corresponding table entry isn't a text block.
475 Minimal column width value.
476 Must be followed either by a
477 .BR @g@troff (@MAN1EXT@)
478 width expression in parentheses or a unitless integer.
479 If no unit is given, en units are used.
480 Also used as the default line length for included text blocks.
481 If used multiple times to specify the width for a particular column,
482 the last entry takes effect.
487 After computing all column widths without an
489 use the remaining line width for this column.
490 If there is more than one expanded column, distribute the remaining
491 horizontal space evenly among the affected columns (this is a GNU
493 This feature has the same effect as specifying a minimum column width.
497 Ignore the corresponding column for width-calculation purposes, this is,
498 don't use the fields but only the specifiers of this column to compute
502 A number suffix on a key character is interpreted as a column
503 separation in en units (multiplied in proportion if the
505 option is on \[en] in case of overfull tables this might be zero).
506 Default separation is 3n.
511 is mutually exclusive with
516 is not mutually exclusive
518 if specified multiple times for a particular column, the last entry takes
532 The format lines are followed by lines containing the actual data for the
533 table, followed finally by
535 Within such data lines, items are normally separated by tab characters (or
536 the character specified with the
539 Long input lines can be broken across multiple lines if the last character
540 on the line is `\[rs]' (which vanishes after concatenation).
545 computes the column widths line by line, applying \[rs]w on each entry
546 which isn't a text block.
547 As a consequence, constructions like
558 fail; you must either say
581 A dot starting a line, followed by anything but a digit is handled as a
582 troff command, passed through without changes.
583 The table position is unchanged in this case.
586 If a data line consists of only `_' or `=', a single or double line,
587 respectively, is drawn across the table at that point; if a single item in a
588 data line consists of only `_' or `=', then that item is replaced by a
589 single or double line, joining its neighbours.
590 If a data item consists only of `\[rs]_' or `\[rs]=', a single or double line,
591 respectively, is drawn across the field at that point which does not join
595 A data item consisting only of `\[rs]Rx' (`x' any character) is replaced by
596 repetitions of character `x' as wide as the column (not joining its
600 A data item consisting only of `\[rs]^' indicates that the field immediately
601 above spans downward over this row.
605 A text block can be used to enter data as a single entry which would be
606 too long as a simple string between tabs.
607 It is started with `T{' and closed with `T}'.
608 The former must end a line, and the latter must start a line, probably
609 followed by other data columns (separated with tabs or the character given
615 By default, the text block is formatted with the settings which were
616 active before entering the table, possibly overridden by the
622 For example, to make all text blocks ragged-right, insert
624 right before the starting
631 If either `w' or `x' specifiers are not given for
633 columns of a text block span, the default length of the text block (to be
634 more precise, the line length used to process the text block diversion) is
635 computed as L\[tmu]C/(N+1), where `L' is the current line length, `C' the
636 number of columns spanned by the text block, and `N' the total number of
637 columns in the table.
638 Note, however, that the actual diversion width as returned in register
640 is used eventually as the text block width.
641 If necessary, you can also control the text block width with a direct
644 request right after `T{'.
650 holds the table width; it can't be used within the table itself but is defined
653 so that this macro can make use of it.
659 which produces the bottom and side lines of a boxed table.
662 does call this macro itself at the end of the table, it can be used by
663 macro packages to create boxes for multi-page tables by calling it within the
665 An example of this is shown by the
667 macros which provide this functionality if a table starts with
669 instead of the standard call to the
674 .SH "INTERACTION WITH @G@EQN"
675 .BR @g@tbl (@MAN1EXT@)
676 should always be called before
677 .BR @g@eqn (@MAN1EXT@)
678 .RB ( groff (@MAN1EXT@)
679 automatically takes care of the correct order of preprocessors).
682 .SH "GNU TBL ENHANCEMENTS"
683 There is no limit on the number of columns in a table, nor any limit on the
684 number of text blocks.
685 All the lines of a table are considered in deciding column widths, not just
689 lines are not restricted to the first 200 lines.
692 Numeric and alphabetic items may appear in the same column.
695 Numeric and alphabetic items may span horizontally.
699 uses register, string, macro and diversion names beginning with the digit\~\c
703 you should avoid using any names beginning with a\~\c
707 .SH "GNU TBL WITHIN MACROS"
710 defines its own macros (right before each table) it is necessary to use
711 an `end-of-macro' macro. Additionally, the escape character has to be switched
712 off. Here an example.
725 \&.ATABLE Another table
726 \&.ATABLE And \[dq]another one\[dq]
730 Note, however, that not all features of
732 can be wrapped into a macro because
734 sees the input earlier than
736 For example, number formatting with vertically aligned decimal points
737 fails if those numbers are passed on as macro parameters because
738 decimal point alignment is handled by
740 itself: It only sees `\[rs]$1', `\[rs]$2', etc., and therefore can't
741 recognize the decimal point.
747 in conjunction with a supporting macro package for
749 multi-page boxed tables.
750 If there is no header that you wish to appear at the top of each page
751 of the table, place the
753 line immediately after the format section.
754 Do not enclose a multi-page table within keep/release macros,
755 or divert it in any other way.
758 A text block within a table must be able to fit on one page.
763 request cannot be used to force a page-break in a multi-page table.
771 \&. ie '\[rs]\[rs]n(.z'' .bp \[rs]\[rs]$1
772 \&. el \[rs]!.BP \[rs]\[rs]$1
783 Using \[rs]a directly in a table to get leaders does not work (except in
785 This is correct behaviour: \[rs]a is an
788 To get leaders use a real leader, either by using a control A or like
803 Lesk, M.E.: "TBL \[en] A Program to Format Tables".
804 For copyright reasons it cannot be included in the groff distribution,
805 but copies can be found with a title search on the World Wide Web.
809 .BR groff (@MAN1EXT@),
810 .BR @g@troff (@MAN1EXT@)