1 '\" t -- preprocess: tbl(1)
5 Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
7 Copyright (C) 1989 - 1995, 2001 - 2004, 2006 - 2008
8 Free Software Foundation, Inc.
10 Permission is granted to make and distribute verbatim copies of
11 this manual provided the copyright notice and this permission notice
12 are preserved on all copies.
14 Permission is granted to copy and distribute modified versions of this
15 manual under the conditions for verbatim copying, provided that the
16 entire resulting derived work is distributed under the terms of a
17 permission notice identical to this one.
19 Permission is granted to copy and distribute translations of this
20 manual into another language, under the above conditions for modified
21 versions, except that this permission notice may be included in
22 translations approved by the Free Software Foundation instead of in
26 .do nr __compat \n[.C]
30 .TH @U_P_TBL@ @MAN1EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
34 @L_P_TBL@ \- format tables for @T_ROFF@
40 .RI [ files\~ .\|.\|.]
46 compiles descriptions of tables embedded within
48 input files into commands that are understood by
50 Normally, it should be invoked using the
54 It is highly compatible with Unix
56 The output generated by
58 cannot be processed with Unix
60 it must be processed with
62 If no files are given on the command line or a filename of
64 is given, the standard input is read.
70 Enable compatibility mode to
75 even when followed by a character other than space or newline.
76 Leader characters (\[rs]a) are handled as interpreted.
80 Print the version number.
85 expects to find table descriptions wrapped in the
93 The line immediately following the
95 macro may contain any of the following global options (ignoring the case of
96 characters \[en] Unix tbl only accepts options with all characters lowercase
97 or all characters uppercase), separated by spaces, tabs, or commas:
101 Enclose each item of the table in a box.
105 Enclose the table in a box.
109 Center the table (default is left-justified).
110 The alternative keyword name
112 is also recognized (this is a @L_P_TBL@ extension).
115 .BI decimalpoint( c )
116 Set the character to be recognized as the decimal point in numeric
117 columns (@L_P_TBL@ only).
125 as start and end delimiters for
126 .BR @L_P_EQN@ (@MAN1EXT@).
130 Enclose the table in a double box.
134 Same as doublebox (@L_P_TBL@ only).
138 Make the table as wide as the current line length (providing a column
140 Ignored if one or more `x' column specifiers are used (see below).
143 In case the sum of the column widths is larger than the current line length,
144 the column separation factor is set to zero; such tables extend into the
145 right margin, and there is no column separation at all.
149 Same as box (@L_P_TBL@ only).
153 Set lines or rules (e.g. from
161 Don't use diversions to prevent page breaks (@L_P_TBL@ only).
164 attempts to prevent undesirable breaks in boxed tables by using diversions.
165 This can sometimes interact badly with macro packages' own use of
166 diversions, when footnotes, for example, are used.
170 Ignore leading and trailing spaces in data items (@L_P_TBL@ only).
176 instead of a tab to separate items in a line of input data.
179 The global options must end with a semicolon.
180 There might be whitespace between an option and its argument in parentheses.
183 .SS Table format specification
184 After global options come lines describing the format of each line of
186 Each such format line describes one line of the table itself, except that
187 the last format line (which you must end with a period) describes all
188 remaining lines of the table.
189 A single-key character describes each column of each line of the table.
190 Key characters can be separated by spaces or tabs.
191 You may run format specifications for multiple lines together on the same
192 line by separating them with commas.
195 You may follow each key character with specifiers that determine the font
196 and point size of the corresponding item, that determine column width,
197 inter-column spacing, etc.
200 The longest format line defines the number of columns in the table; missing
201 format descriptors at the end of format lines are assumed to be\~\c
203 Extra columns in the data (which have no corresponding format entry) are
207 The available key characters are:
211 Center longest line in this column and then left-justifies all other lines
212 in this column with respect to that centered line.
213 The idea is to use such alphabetic subcolumns (hence the name of the key
214 character) in combination with\~
216 they are called subcolumns because
218 are indented by\~1n relative to
233 \&subitem twentytwo;22
234 \&subitem thirtythree;33
254 subitem thirtythree;33
260 Center item within the column.
264 Left-justify item within the column.
268 Numerically justify item in the column: Units positions of numbers are
270 If there is one or more dots adjacent to a digit, use the rightmost one for
272 If there is no dot, use the rightmost digit for vertical alignment;
273 otherwise, center the item within the column.
274 Alignment can be forced to a certain position using `\[rs]&'; if there is
275 one or more instances of this special (non-printing) character present
276 within the data, use the leftmost one for alignment.
308 If numerical entries are combined with
312 \[en] this can happen if the table format is changed with
317 (of the data entered under the
319 regime) relative to the widest
323 preserving the alignment of all numerical entries.
326 entries, there is no extra indentation.
329 Using equations (to be processed with
331 within columns which use the
333 is problematic in most cases due to
335 algorithm for finding the vertical alignment, as described above.
338 option, however, it is possible to make
340 ignore the data within
342 delimiters for that purpose.
347 Right-justify item within the column.
351 Span previous item on the left into this column.
352 Not allowed for the first column.
356 Span down entry from previous row in this column.
357 Not allowed for the first row.
361 Replace this entry with a horizontal line.
362 Note that `_' and `-' can be used for table fields only,
363 not for column separator lines.
367 Replace this entry with a double horizontal line.
368 Note that `=' can be used for table fields only,
369 not for column separator lines.
373 The corresponding column becomes a vertical rule (if two of these are
374 adjacent, a double vertical rule).
377 A vertical bar to the left of the first key letter or to the right of the
378 last one produces a line at the edge of the table.
381 To change the data format within a table, use the
383 command (at the start of a line).
384 It is followed by format and data lines (but no global options) similar to
390 .SS Column specifiers
391 Here are the specifiers that can appear in suffixes to column key letters
398 (make affected entries bold).
402 Start an item that vertically spans rows,
403 using the `^' column specifier or `\[rs]^' data item,
404 than vertically centering it (@L_P_TBL@ only).
461 Make equally-spaced columns.
462 All columns marked with this specifier get the same width; this happens
463 after the affected column widths have been computed (this means that the
464 largest width value rules).
468 Either of these specifiers may be followed by a font name (either one or two
469 characters long), font number (a single digit), or long name in parentheses
470 (the last form is a @L_P_TBL@ extension).
471 A one-letter font name must be separated by one or more blanks from whatever
478 (make affected entries italic).
482 This is a @L_P_TBL@ extension.
483 Either of these specifiers may be followed by a macro name
484 (either one or two characters long),
485 or long name in parentheses.
486 A one-letter macro name must be separated by one or more blanks
487 from whatever follows.
488 The macro which name can be specified here
489 must be defined before creating the table.
490 It is called just before the table's cell text is output.
491 As implemented currently, this macro is only called if block input is used,
492 that is, text between `T{' and `T}'.
493 The macro should contain only simple
495 requests to change the text block formatting, like text adjustment,
496 hyphenation, size, or font.
499 other cell modifications like
505 Thus the macro can overwrite other modification specifiers.
509 Followed by a number, this does a point size change for the affected fields.
510 If signed, the current point size is incremented or decremented (using a
511 signed number instead of a signed digit is a @L_P_TBL@ extension).
512 A point size specifier followed by a column separation number must be
513 separated by one or more blanks.
517 Start an item vertically spanning rows at the top of its range rather than
518 vertically centering it.
522 Move the corresponding column up one half-line.
526 Followed by a number, this indicates the vertical line spacing to be used in
527 a multi-line table entry.
528 If signed, the current vertical line spacing is incremented or decremented
529 (using a signed number instead of a signed digit is a @L_P_TBL@ extension).
530 A vertical line spacing specifier followed by a column separation number
531 must be separated by one or more blanks.
532 No effect if the corresponding table entry isn't a text block.
536 Minimal column width value.
537 Must be followed either by a
538 .BR @L_TROFF@ (@MAN1EXT@)
539 width expression in parentheses or a unitless integer.
540 If no unit is given, en units are used.
541 Also used as the default line length for included text blocks.
542 If used multiple times to specify the width for a particular column,
543 the last entry takes effect.
548 After computing all column widths without an
550 use the remaining line width for this column.
551 If there is more than one expanded column, distribute the remaining
552 horizontal space evenly among the affected columns (this is a @L_P_TBL@
554 This feature has the same effect as specifying a minimum column width.
558 Ignore the corresponding column for width-calculation purposes, this is,
559 don't use the fields but only the specifiers of this column to compute
563 A number suffix on a key character is interpreted as a column
564 separation in en units (multiplied in proportion if the
566 option is on \[en] in case of overfull tables this might be zero).
567 Default separation is 3n.
572 is mutually exclusive with
577 is not mutually exclusive
579 if specified multiple times for a particular column, the last entry takes
593 The format lines are followed by lines containing the actual data for the
594 table, followed finally by
596 Within such data lines, items are normally separated by tab characters (or
597 the character specified with the
600 Long input lines can be broken across multiple lines if the last character
601 on the line is `\[rs]' (which vanishes after concatenation).
606 computes the column widths line by line, applying \[rs]w on each entry
607 which isn't a text block.
608 As a consequence, constructions like
619 fail; you must either say
642 A dot starting a line, followed by anything but a digit is handled as a
643 troff command, passed through without changes.
644 The table position is unchanged in this case.
647 If a data line consists of only `_' or `=', a single or double line,
648 respectively, is drawn across the table at that point; if a single item in a
649 data line consists of only `_' or `=', then that item is replaced by a
650 single or double line, joining its neighbours.
651 If a data item consists only of `\[rs]_' or `\[rs]=', a single or double line,
652 respectively, is drawn across the field at that point which does not join
656 A data item consisting only of `\[rs]Rx' (`x' any character) is replaced by
657 repetitions of character `x' as wide as the column (not joining its
661 A data item consisting only of `\[rs]^' indicates that the field immediately
662 above spans downward over this row.
666 A text block can be used to enter data as a single entry which would be
667 too long as a simple string between tabs.
668 It is started with `T{' and closed with `T}'.
669 The former must end a line, and the latter must start a line, probably
670 followed by other data columns (separated with tabs or the character given
676 By default, the text block is formatted with the settings which were
677 active before entering the table, possibly overridden by the
682 @L_P_TBL@ specifiers.
683 For example, to make all text blocks ragged-right, insert
685 right before the starting
692 If either `w' or `x' specifiers are not given for
694 columns of a text block span, the default length of the text block (to be
695 more precise, the line length used to process the text block diversion) is
696 computed as L\[tmu]C/(N+1), where `L' is the current line length, `C' the
697 number of columns spanned by the text block, and `N' the total number of
698 columns in the table.
699 Note, however, that the actual diversion width as returned in register
701 is used eventually as the text block width.
702 If necessary, you can also control the text block width with a direct
705 request right after `T{'.
711 holds the table width; it can't be used within the table itself but is defined
714 so that this macro can make use of it.
720 which produces the bottom and side lines of a boxed table.
723 does call this macro itself at the end of the table, it can be used by
724 macro packages to create boxes for multi-page tables by calling it within the
726 An example of this is shown by the
728 macros which provide this functionality if a table starts with
730 instead of the standard call to the
735 .SH "INTERACTION WITH @L_P_EQN@"
736 .BR @L_P_TBL@ (@MAN1EXT@)
737 should always be called before
738 .BR @L_P_EQN@ (@MAN1EXT@)
739 .RB ( @L_ROFF@ (@MAN1EXT@)
740 automatically takes care of the correct order of preprocessors).
743 .SH "@L_P_TBL@ ENHANCEMENTS"
744 There is no limit on the number of columns in a table, nor any limit on the
745 number of text blocks.
746 All the lines of a table are considered in deciding column widths, not just
750 lines are not restricted to the first 200 lines.
753 Numeric and alphabetic items may appear in the same column.
756 Numeric and alphabetic items may span horizontally.
760 uses register, string, macro and diversion names beginning with the digit\~\c
764 you should avoid using any names beginning with a\~\c
768 .SH "@L_P_TBL@ WITHIN MACROS"
771 defines its own macros (right before each table) it is necessary to use
772 an `end-of-macro' macro. Additionally, the escape character has to be switched
773 off. Here an example.
786 \&.ATABLE Another table
787 \&.ATABLE And \[dq]another one\[dq]
791 Note, however, that not all features of
793 can be wrapped into a macro because
795 sees the input earlier than
797 For example, number formatting with vertically aligned decimal points
798 fails if those numbers are passed on as macro parameters because
799 decimal point alignment is handled by
801 itself: It only sees `\[rs]$1', `\[rs]$2', etc., and therefore can't
802 recognize the decimal point.
808 in conjunction with a supporting macro package for
810 multi-page boxed tables.
811 If there is no header that you wish to appear at the top of each page
812 of the table, place the
814 line immediately after the format section.
815 Do not enclose a multi-page table within keep/release macros,
816 or divert it in any other way.
819 A text block within a table must be able to fit on one page.
824 request cannot be used to force a page-break in a multi-page table.
832 \&. ie '\[rs]\[rs]n(.z'' .bp \[rs]\[rs]$1
833 \&. el \[rs]!.BP \[rs]\[rs]$1
844 Using \[rs]a directly in a table to get leaders does not work (except in
846 This is correct behaviour: \[rs]a is an
849 To get leaders use a real leader, either by using a control A or like
864 A leading and/or trailing `|' in a format line, such as
872 gives output which has a 1n\~space between the resulting
873 bordering vertical rule and the content of the adjacent column,
881 \&left column#right column
886 If it is desired to have zero space (so that the rule touches
887 the content), this can be achieved by introducing extra \[lq]dummy\[rq]
888 columns, with no content and zero separation, before and/or after,
896 \&#left column#right column#
901 The resulting \[lq]dummy\[rq] columns are invisible and have zero width;
902 note that such columns usually don't work with TTY devices.
906 Lesk, M.E.: "TBL \[en] A Program to Format Tables".
907 For copyright reasons it cannot be included in the groff distribution,
908 but copies can be found with a title search on the World Wide Web.
912 .BR @L_ROFF@ (@MAN1EXT@),
913 .BR @L_TROFF@ (@MAN1EXT@)