1TBL(1)                      General Commands Manual                     TBL(1)
2
3
4

NAME

6       tbl - format tables for troff
7

SYNOPSIS

9       tbl [ -Cv ] [ files... ]
10

DESCRIPTION

12       This manual page describes the GNU version of tbl, which is part of the
13       groff document formatting system.  tbl compiles descriptions of  tables
14       embedded  within troff input files into commands that are understood by
15       troff.  Normally, it should be invoked using the -t  option  of  groff.
16       It is highly compatible with Unix tbl.  The output generated by GNU tbl
17       cannot be processed with Unix troff; it  must  be  processed  with  GNU
18       troff.   If  no files are given on the command line, the standard input
19       will be read.  A filename of - will cause  the  standard  input  to  be
20       read.
21

OPTIONS

23       -C     Recognize  .TS  and  .TE even when followed by a character other
24              than space or newline.
25
26       -v     Print the version number.
27

USAGE

29       tbl expects to find table descriptions wrapped in the .TS (table start)
30       and  .TE  (table  end)  macros.  The line immediately following the .TS
31       macro may contain any of the following  global  options  (ignoring  the
32       case of characters -- Unix tbl only accepts options with all characters
33       lowercase or all characters uppercase):
34
35       center Centers the table (default is left-justified).  The  alternative
36              keyword name centre is also recognized (this is a GNU tbl exten‐
37              sion).
38
39       delim(xy)
40              Use x and y as start and end delimiters for eqn(1).
41
42       expand Makes the table as wide as the current line length.
43
44       box    Encloses the table in a box.
45
46       doublebox
47              Encloses the table in a double box.
48
49       allbox Encloses each item of the table in a box.
50
51       frame  Same as box (GNU tbl only).
52
53       doubleframe
54              Same as doublebox (GNU tbl only).
55
56       tab(x) Uses the character x instead of a tab to  separate  items  in  a
57              line of input data.
58
59       linesize(n)
60              Sets lines or rules (e.g. from box) in n-point type.
61
62       nokeep Don't  use  diversions  to  prevent  page breaks (GNU tbl only).
63              Normally tbl attempts to prevent undesirable breaks in the table
64              by  using  diversions.   This  can sometimes interact badly with
65              macro packages' own use of diversions, when footnotes, for exam‐
66              ple, are used.
67
68       decimalpoint(c)
69              Set  the  character  to  be  recognized  as the decimal point in
70              numeric columns (GNU tbl only).
71
72       nospaces
73              Ignore leading and trailing spaces in data items (GNU tbl only).
74
75       The global options must end with a semicolon.  There  might  be  white‐
76       space after an option and its argument in parentheses.
77
78       After  global  options come lines describing the format of each line of
79       the table.  Each such format line  describes  one  line  of  the  table
80       itself,  except  that  the  last format line (which you must end with a
81       period) describes all remaining lines of the table.  A single key char‐
82       acter  describes  each  column  of each line of the table.  You may run
83       format specs for multiple lines together on the same line by separating
84       them with commas.
85
86       You  may  follow  each key character with specifiers that determine the
87       font and point size of the corresponding item,  that  determine  column
88       width, inter-column spacing, etc.
89
90       The  longest  format  line  defines the number of columns in the table;
91       missing format descriptors at the end of format lines are assumed to be
92       `L'.   Extra  columns  in  the data (which have no corresponding format
93       entry) are ignored.
94
95       The available key characters are:
96
97       c,C    Centers item within the column.
98
99       r,R    Right-justifies item within the column.
100
101       l,L    Left-justifies item within the column.
102
103       n,N    Numerically justifies item in the  column:  Units  positions  of
104              numbers are aligned vertically.
105
106       s,S    Spans previous item on the left into this column.
107
108       a,A    Centers  longest line in this column and then left-justifies all
109              other lines in this column with respect to that centered line.
110
111       ^      Spans down entry from previous row in this column.
112
113       _,-    Replaces this entry with a horizontal line.
114
115       =      Replaces this entry with a double horizontal line.
116
117       |      The corresponding column becomes a  vertical  rule  (if  two  of
118              these are adjacent, a double vertical rule).
119
120       A  vertical  bar to the left of the first key-letter or to the right of
121       the last one produces a line at the edge of the table.
122
123       Here are the specifiers that can appear in suffixes to column key  let‐
124       ters:
125
126       b,B    Short form of fB (make affected entries bold).
127
128       i,I    Short form of fI (make affected entries italic).
129
130       t,T    Start  an  item vertically spanning rows at the top of its range
131              rather than vertically centering it.
132
133       d,D    Start an item vertically spanning rows  at  the  bottom  of  its
134              range rather than vertically centering it (GNU tbl only).
135
136       v,V    Followed  by  a number, this indicates the vertical line spacing
137              to be used in a multi-line table entry.  If signed, the  current
138              vertical  line  spacing  is  incremented or decremented (using a
139              signed number instead of a signed digit is a GNU tbl extension).
140              A  vertical  line spacing specifier followed by a column separa‐
141              tion number must be separated by one or more blanks.  No  effect
142              if the corresponding table entry isn't a text block.
143
144       f,F    Either  of  these  specifiers  may  be  followed  by a font name
145              (either one or two  characters  long),  font  number  (a  single
146              digit),  or long name in parentheses (the last form is a GNU tbl
147              extension).  A one-letter font name must be separated by one  or
148              more blanks from whatever follows.
149
150       p,P    Followed  by  a  number,  this  does a point size change for the
151              affected fields.  If signed, the current point  size  is  incre‐
152              mented or decremented (using a signed number instead of a signed
153              digit is a GNU tbl extension).  A point size specifier  followed
154              by  a  column separation number must be separated by one or more
155              blanks.
156
157       w,W    Minimal column width  value.   Must  be  followed  either  by  a
158              troff(1)  width expression in parentheses or a unitless integer.
159              If no unit is given, en  units  are  used.   Also  used  as  the
160              default  line length for included text blocks.  If used multiple
161              times, the last entry takes effect.
162
163       e,E    Make equally-spaced columns.
164
165       u,U    Move the corresponding column up one half-line.
166
167       z,Z    Ignore the corresponding column for width-calculation purposes.
168
169       A number suffix on a key character is interpreted as a  column  separa‐
170       tion  in  ens  (multiplied  in  proportion if the expand option is on).
171       Default separation is 3n.
172
173       The format lines are followed by lines containing the actual  data  for
174       the  table, followed finally by .TE.  Within such data lines, items are
175       normally separated by tab characters (or the character  specified  with
176       the  tab option).  Long input lines can be broken across multiple lines
177       if the last character on the line is `\' (which vanishes after concate‐
178       nation).
179
180       A dot starting a line, followed by anything but a digit is handled as a
181       troff command, passed through without changes.  The table  position  is
182       unchanged in this case.
183
184       If  a  data  line consists of only `_' or `=', a single or double line,
185       respectively, is drawn across the table at that point; if a single item
186       in  a data line consists of only `_' or `=', then that item is replaced
187       by a single or double line, joining its neighbours.   If  a  data  item
188       consists  only  of `\_' or `\=', a single or double line, respectively,
189       is drawn across the field at that point which does not join its  neigh‐
190       bours.
191
192       A data item consisting only of `\Rx' (`x' any character) is replaced by
193       repetitions of character `x' as wide as the  column  (not  joining  its
194       neighbours).
195
196       A  data  item  consisting only of `\^' indicates that the field immedi‐
197       ately above spans downward over this row.
198
199       A text block can be used to enter data as a single entry which would be
200       too  long as a simple string between tabs.  It is started with `T{' and
201       closed with `T}'.  The latter must start a line, probably  followed  by
202       other data columns (separated with tabs).
203
204       To  change  the data format within a table, use the .T& command (at the
205       start of a line).  It is followed by format  and  data  lines  (but  no
206       global options) similar to the .TS request.
207

INTERACTION WITH EQN

209       tbl(1)  should  always  be called before eqn(1) (groff(1) automatically
210       takes care of the correct order of preprocessors).
211

GNU TBL ENHANCEMENTS

213       There is no limit on the number of columns in a table, nor any limit on
214       the  number of text blocks.  All the lines of a table are considered in
215       deciding column widths, not just the  first  200.   Table  continuation
216       (.T&) lines are not restricted to the first 200 lines.
217
218       Numeric and alphabetic items may appear in the same column.
219
220       Numeric and alphabetic items may span horizontally.
221
222       tbl uses register, string, macro and diversion names beginning with the
223       digit 3.  When using tbl you should avoid  using  any  names  beginning
224       with a 3.
225

BUGS

227       You should use .TS H/.TH in conjunction with a supporting macro package
228       for all multi-page boxed tables.  If there is no header that  you  wish
229       to  appear  at  the  top  of each page of the table, place the .TH line
230       immediately after the format section.  Do not enclose a multi-page  ta‐
231       ble within keep/release macros, or divert it in any other way.
232
233       A text block within a table must be able to fit on one page.
234
235       The bp request cannot be used to force a page-break in a multi-page ta‐
236       ble.  Instead, define BP as follows
237
238              .de BP
239              .ie '\\n(.z'' .bp \\$1
240              .el \!.BP \\$1
241              ..
242
243       and use BP instead of bp.
244
245       Using \a directly in a table to get leaders will  not  work.   This  is
246       correct behaviour: \a is an uninterpreted leader.  To get leaders use a
247       real leader, either by using a control A or like this:
248
249              .ds a \a
250              .TS
251              tab(;);
252              lw(1i) l.
253              A\*a;B
254              .TE
255

REFERENCE

257       Lesk, M.E.: "TBL -- A Program to Format Tables".  For copyright reasons
258       it  cannot  be  included  in  the groff distribution, but copies can be
259       found with a title search on the World Wide Web.
260

SEE ALSO

262       groff(1), troff(1)
263
264
265
266Groff Version 1.18.1.4         16 September 2002                        TBL(1)
Impressum