Print this page
9718 update mandoc to 1.14.4
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man5/tbl.5.man.txt
+++ new/usr/src/man/man5/tbl.5.man.txt
1 1 TBL(5) Standards, Environments, and Macros TBL(5)
2 2
3 3 NAME
4 4 tbl - tbl language reference for mandoc
5 5
6 6 DESCRIPTION
7 7 The tbl language formats tables. It is used within mdoc(5) and man(5)
8 8 pages. This manual describes the subset of the tbl language accepted by
9 9 the mandoc(1) utility.
10 10
11 11 Each table is started with a mandoc_roff(5) TS macro, consist of at most
12 12 one line of Options, one or more Layout lines, one or more Data lines,
13 13 and ends with a TE macro. All input must be 7-bit ASCII.
14 14
15 15 Options
16 16 If the first input line of a table ends with a semicolon, it contains
17 17 case-insensitive options separated by spaces, tabs, or commas.
18 18 Otherwise, it is interpreted as the first Layout line.
19 19
20 20 The following options are available. Some of them require arguments
21 21 enclosed in parentheses:
22 22
23 23 allbox Draw a single-line box around each table cell.
24 24
25 25 box Draw a single-line box around the table. For GNU compatibility,
26 26 this may also be invoked with frame.
27 27
28 28 center Center the table instead of left-adjusting it. For GNU
29 29 compatibility, this may also be invoked with centre.
30 30
31 31 decimalpoint
32 32 Use the single-character argument as the decimal point with the n
33 33 layout key. This is a GNU extension.
34 34
35 35 delim Use the two characters of the argument as eqn(5) delimiters.
36 36 Currently unsupported.
37 37
38 38 doublebox
39 39 Draw a double-line box around the table. For GNU compatibility,
40 40 this may also be invoked with doubleframe.
41 41
42 42 expand Increase the width of the table to the current line length.
43 43 Currently ignored.
44 44
45 45 linesize
46 46 Draw lines with the point size given by the unsigned integer
47 47 argument. Currently ignored.
48 48
49 49 nokeep Allow page breaks within the table. This is a GNU extension and
50 50 currently ignored.
51 51
52 52 nospaces
53 53 Ignore leading and trailing spaces in data cells. This is a GNU
54 54 extension and currently ignored.
55 55
56 56 nowarn Suppress warnings about tables exceeding the current line length.
57 57 This is a GNU extension and currently ignored.
58 58
59 59 tab Use the single-character argument as a delimiter between data
60 60 cells. By default, the horizontal tabulator character is used.
61 61
62 62 Layout
63 63 The table layout follows an Options line or a mandoc_roff(5) TS or T&
64 64 macro. Each layout line specifies how one line of Data is formatted.
65 65 The last layout line ends with a full stop. It also applies to all
66 66 remaining data lines. Multiple layout lines can be joined by commas on a
67 67 single physical input line.
68 68
69 69 Each layout line consists of one or more layout cell specifications,
70 70 optionally separated by whitespace. The following case-insensitive key
71 71 characters start a new cell specification:
72 72
73 73 c Center the string in this cell.
74 74
75 75 r Right-justify the string in this cell.
76 76
77 77 l Left-justify the string in this cell.
78 78
79 79 n Justify a number around its last decimal point. If no decimal point
80 80 is found in the number, it is assumed to trail the number.
81 81
82 82 s Horizontally span columns from the last non-s layout cell. It is an
83 83 error if a column span follows a _ or = cell, or comes first on a
84 84 layout line. The combined cell as a whole consumes only one cell of
85 85 the corresponding data line.
86 86
87 87 a Left-justify a string and pad with one space.
88 88
89 89 ^ Vertically span rows from the last non-^ layout cell. It is an error
90 90 to invoke a vertical span on the first layout line. Unlike a
91 91 horizontal span, a vertical span consumes a data cell and discards
92 92 the content.
93 93
94 94 _ Draw a single horizontal line in this cell. This consumes a data
95 95 cell and discards the content. It may also be invoked with -.
96 96
97 97 = Draw a double horizontal line in this cell. This consumes a data
98 98 cell and discards the content.
99 99
100 100 Each cell key may be followed by zero or more of the following case-
101 101 insensitive modifiers:
102 102
103 103 b Use a bold font for the contents of this cell.
104 104
105 105 d Move content down to the last row of this vertical span. Currently
106 106 ignored.
107 107
108 108 e Make this column wider to match the maximum width of any other column
109 109 also having the e modifier.
110 110
111 111 f The next character selects the font to use for this cell. See the
112 112 mandoc_roff(5) manual for supported one-character font names.
113 113
114 114 i Use an italic font for the contents of this cell.
115 115
116 116 m Specify a cell start macro. This is a GNU extension and currently
117 117 unsupported.
118 118
119 119 p Set the point size to the following unsigned argument, or change it
120 120 by the following signed argument. Currently ignored.
121 121
122 122 v Set the vertical line spacing to the following unsigned argument, or
123 123 change it by the following signed argument. Currently ignored.
124 124
125 125 t Do not vertically center content in this vertical span, leave it in
126 126 the top row. Currently ignored.
127 127
128 128 u Move cell content up by half a table row. Currently ignored.
129 129
130 130 w Specify a minimum column width.
131 131
132 132 x After determining the width of all other columns, distribute the rest
133 133 of the line length among all columns having the x modifier.
134 134
135 135 z Do not use this cell for determining the width of this column.
136 136
137 137 | Draw a single vertical line to the right of this cell.
138 138
139 139 || Draw a double vertical line to the right of this cell.
140 140
141 141 If a modifier consists of decimal digits, it specifies a minimum spacing
142 142 in units of n between this column and the next column to the right. The
143 143 default is 3. If there is a vertical line, it is drawn inside the
144 144 spacing.
145 145
146 146 Data
147 147 The data section follows the last Layout line. Each data line consists
148 148 of one or more data cells, delimited by tab characters.
149 149
150 150 If a data cells contains only the single character `_' or `=', a single
151 151 or double horizontal line is drawn across the cell, joining its
152 152 neighbours. If a data cells contains only the two character sequence
153 153 `\_' or `\=', a single or double horizontal line is drawn inside the
154 154 cell, not joining its neighbours. If a data line contains nothing but
155 155 the single character `_' or `=', a horizontal line across the whole table
156 156 is inserted without consuming a layout row.
157 157
158 158 In place of any data cell, a text block can be used. It starts with T{
159 159 at the end of a physical input line. Input line breaks inside the text
160 160 block neither end the text block nor its data cell. It only ends if T}
161 161 occurs at the beginning of a physical input line and is followed by an
162 162 end-of-cell indicator. If the T} is followed by the end of the physical
163 163 input line, the text block, the data cell, and the data line ends at this
164 164 point. If the T} is followed by the tab character, only the text block
165 165 and the data cell end, but the data line continues with the data cell
166 166 following the tab character. If T} is followed by any other character,
167 167 it does not end the text block, which instead continues to the following
168 168 physical input line.
169 169
170 170 EXAMPLES
171 171 String justification and font selection:
172 172
173 173 .TS
174 174 rb c lb
175 175 r ci l.
176 176 r center l
177 177 ri ce le
178 178 right c left
179 179 .TE
180 180
181 181 r center l
182 182 ri ce le
183 183 right c left
184 184
185 185 Some ports in OpenBSD 6.1 to show number alignment and line drawing:
186 186
187 187 .TS
188 188 box tab(:);
189 189 r| l
190 190 r n.
191 191 software:version
192 192 _
193 193 AFL:2.39b
194 194 Mutt:1.8.0
195 195 Ruby:1.8.7.374
196 196 TeX Live:2015
197 197 .TE
198 198
199 199 +---------+---------------+
200 200 |software | version |
201 201 +---------+---------------+
202 202 | AFL 2.39b |
203 203 | Mutt 1.8.0 |
204 204 | Ruby 1.8.7.374 |
205 205 |TeX Live 2015 |
206 206 +-------------------------+
207 207
208 208 Spans and skipping width calculations:
209 209
210 210 .TS
211 211 box tab(:);
212 212 lz s | rt
213 213 lt| cb| ^
214 214 ^ | rz s.
215 215 left:r
216 216 l:center:
217 217 :right
218 218 .TE
219 219
220 220 +-----------+---+
221 221 |left | r |
222 222 |l | center | |
223 223 | | right |
224 224 +--+------------+
225 225
226 226 Text blocks, specifying spacings and specifying and equalizing column
227 227 widths, putting lines into individual cells, and overriding allbox:
228 228
229 229 .TS
230 230 allbox tab(:);
231 231 le le||7 lw10.
232 232 The fourth line:_:line 1
233 233 of this column:=:line 2
234 234 determines:_:line 3
235 235 the column width.:T{
236 236 This text is too wide to fit into a column of width 17.
237 237 T}:line 4
238 238 T{
239 239 No break here.
240 240 T}::line 5
241 241 .TE
242 242
243 243 +--------------------+-----------------------++-------------+
244 244 |The fourth line | ------------------- || line 1 |
245 245 +--------------------+-----------------------++-------------+
246 246 |of this column | =================== || line 2 |
247 247 +--------------------+-----------------------++-------------+
248 248 |determines | ------------------- || line 3 |
249 249 +--------------------+-----------------------++-------------+
250 250 |the column width. | This text is too || line 4 |
251 251 | | wide to fit into a || |
252 252 | | column of width 17. || |
253 253 +--------------------+-----------------------++-------------+
254 254 |No break here. | || line 5 |
255 255 +--------------------+-----------------------++-------------+
256 256
257 257 These examples were constructed to demonstrate many tbl features in a
258 258 compact way. In real manual pages, keep tables as simple as possible:
259 259 Like that, they usually look better, are less fragile, and more portable.
260 260
261 261 COMPATIBILITY
262 262 The mandoc(1) implementation of tbl doesn't support mdoc(5) and man(5)
263 263 macros and eqn(5) equations inside tables.
264 264
↓ open down ↓ |
264 lines elided |
↑ open up ↑ |
265 265 SEE ALSO
266 266 mandoc(1), man(5), mandoc_char(5), mandoc_roff(5), mdoc(5)
267 267
268 268 M. E. Lesk, Tbl--A Program to Format Tables, June 11, 1976.
269 269
270 270 HISTORY
271 271 The tbl utility, a preprocessor for troff, was originally written by M.
272 272 E. Lesk at Bell Labs in 1975. The GNU reimplementation of tbl, part of
273 273 the groff package, was released in 1990 by James Clark. A standalone tbl
274 274 implementation was written by Kristaps Dzonsons in 2010. This formed the
275 - basis of the implementation that is part of the mandoc(1) utility.
275 + basis of the implementation that first appeared in OpenBSD 4.9 as a part
276 + of the mandoc(1) utility.
276 277
277 278 AUTHORS
278 279 This tbl reference was written by Kristaps Dzonsons <kristaps@bsd.lv> and
279 280 Ingo Schwarze <schwarze@openbsd.org>.
280 281
281 -illumos June 28, 2017 illumos
282 +illumos October 17, 2017 illumos
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX