1'\" t
2.\" Sccsid @(#)tbl.1b	1.7 (gritter) 9/9/06
3.\" Derived from tbl(1), Unix 7th edition:
4.\" Copyright(C) Caldera International Inc. 2001-2002. All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\"   Redistributions of source code and documentation must retain the
10.\"    above copyright notice, this list of conditions and the following
11.\"    disclaimer.
12.\"   Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"   All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgement:
17.\"      This product includes software developed or owned by Caldera
18.\"      International, Inc.
19.\"   Neither the name of Caldera International, Inc. nor the names of
20.\"    other contributors may be used to endorse or promote products
21.\"    derived from this software without specific prior written permission.
22.\"
23.\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
24.\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
25.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27.\" ARE DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE
28.\" LIABLE FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR
29.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31.\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
33.\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
34.\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.Dd March 2, 2015
36.Dt TBL 1 "Heirloom Documentation Tools"
37.Sh NAME
38.Nm tbl
39.Nd format tables for nroff or troff
40.Sh SYNOPSIS
41.Nm
42.Op Fl g | Fl T Ar name
43.Op Fl me | Fl mm | Fl ms
44.Op Ar
45.Sh DESCRIPTION
46.Nm
47is a preprocessor for formatting tables for
48.Xr nroff
49or
50.Xr troff .
51The input files are copied to the standard output,
52except for lines between
53.Li .TS
54and
55.Li .TE
56command lines, which are assumed to describe tables
57and reformatted.
58Arbitrary whitespace can be inserted between the dot and the commands
59.Li .TS
60or
61.Li .TE .
62Macros with these names are ignored by tbl if
63.Sq '
64is used instead of
65.Sq \&. .
66.Sh OPTIONS
67.Bl -tag -width ".Fl T Ar name"
68.It Fl g
69.Nm
70normally uses line drawing commands with repeated
71underline and box rule characters
72(\el and \eL).
73With the
74.Fl g
75option,
76graphic drawing commands (\eD) are used instead.
77(This should only be used when processing troff input.)
78Option
79.Fl g
80overrides a previous
81.Fl T Ar name .
82.It Fl me | mm | ms
83With these options the respective macro packages
84are copied to the beginning of the output.
85Details are given in the reference manual.
86.It Fl T Ar name
87Configure nroff input processing.
88.Ar name
89can be one of:
90. Bl -tag -width ".Cm locale"
91. It Cm locale
92If
93. Nm
94is used to process nroff input in an UTF-8 locale and
95. Fl Tlocale
96is given lines are printed using Unicode box characters
97instead of underline and box rule characters.
98If the current locale does not support UTF-8 this Option
99has the same effect as
100. Fl Tlp .
101Option
102. Fl Tlocale
103overrides a previous
104. Fl g .
105. It Cm lp
106Use ASCII characters (\-, =, |, +)
107instead of underline and box rule characters.
108Overrides a previous
109. Fl g .
110. It Cm X
111The
112. Fl TX
113option causes
114. Nm
115not to produce fractional line motions.
116. El
117.El
118.Sh "EXTENSIONS TO THE AT&T TBL KEY LETTERS
119.Bl -tag -width ".Cm x , X"
120.It Cm x , X
121Expand column to make table as wide as the current line length.
122If there is more then one column with a x specifier these
123columns are expanded by the same amount.
124This feature had been a GNU tbl extension.
125.El
126.Sh EXAMPLE
127As an example, letting \(rst represent a tab (which should
128be typed as a genuine tab)
129the input
130.Bd -unfilled -literal -offset indent
131\&.TS
132c s s
133c c s
134c c c
135l n n.
136Household Population
137Town\\tHouseholds
138\\tNumber\\tSize
139Bedminster\\t789\\t3.26
140Bernards Twp.\\t3087\\t3.74
141Bernardsville\\t2018\\t3.30
142Bound Brook\\t3425\\t3.04
143Branchburg\\t1644\\t3.49
144Bridgewater\\t7897\\t3.81
145Far Hills\\t240\\t3.19
146\&.TE
147.Ed
148.Pp
149yields
150.Pp
151.TS
152c s s
153c c s
154c c c
155l n n.
156Household Population
157Town	Households
158	Number	Size
159Bedminster	789	3.26
160Bernards Twp.	3087	3.74
161Bernardsville	2018	3.30
162Bound Brook	3425	3.04
163Branchburg	1644	3.49
164Bridgewater	7897	3.81
165Far Hills	240	3.19
166.TE
167.Pp
168If no arguments are given,
169.Nm
170reads the standard input,
171so it may be used as a filter.
172When it is used with
173.Xr eqn
174or
175.Xr neqn
176the
177.Nm
178command should be first, to minimize the volume
179of data passed through
180pipes.
181.Sh SEE ALSO
182.Xr troff 1 ,
183.Xr eqn 1
184.Rs
185.%A "M. E. Lesk"
186.%T TBL
187.Re
188