DragonFly On-Line Manual Pages

Search: Section:  


TBL(7)		  DragonFly Miscellaneous Information Manual		TBL(7)

NAME

tbl -- tbl language reference for mandoc

DESCRIPTION

The tbl language formats tables. It is used within mdoc(7) and man(7) pages. This manual describes the subset of the tbl language accepted by the mandoc(1) utility. Each table is started with a roff(7) TS macro, consist of at most one line of Options, one or more Layout lines, one or more Data lines, and ends with a TE macro. All input must be 7-bit ASCII. Options If the first input line of a table ends with a semicolon, it contains case-insensitive options separated by spaces, tabs, or commas. Other- wise, it is interpreted as the first Layout line. The following options are available. Some of them require arguments enclosed in parentheses: allbox Draw a single-line box around each table cell. box Draw a single-line box around the table. For GNU compatibility, this may also be invoked with frame. center Center the table instead of left-adjusting it. For GNU compati- bility, this may also be invoked with centre. decimalpoint Use the single-character argument as the decimal point with the n layout key. This is a GNU extension. delim Use the two characters of the argument as eqn(7) delimiters. Currently unsupported. doublebox Draw a double-line box around the table. For GNU compatibility, this may also be invoked with doubleframe. expand Increase the width of the table to the current line length. Cur- rently ignored. linesize Draw lines with the point size given by the unsigned integer argument. Currently ignored. nokeep Allow page breaks within the table. This is a GNU extension and currently ignored. nospaces Ignore leading and trailing spaces in data cells. This is a GNU extension and currently ignored. nowarn Suppress warnings about tables exceeding the current line length. This is a GNU extension and currently ignored. tab Use the single-character argument as a delimiter between data cells. By default, the horizontal tabulator character is used. Layout The table layout follows an Options line or a roff(7) TS or T& macro. Each layout line specifies how one line of Data is formatted. The last layout line ends with a full stop. It also applies to all remaining data lines. Multiple layout lines can be joined by commas on a single physi- cal input line. Each layout line consists of one or more layout cell specifications, optionally separated by whitespace. The following case-insensitive key characters start a new cell specification: c Center the string in this cell. r Right-justify the string in this cell. l Left-justify the string in this cell. n Justify a number around its last decimal point. If no decimal point is found in the number, it is assumed to trail the number. s Horizontally span columns from the last non-s layout cell. It is an error if a column span follows a _ or = cell, or comes first on a layout line. The combined cell as a whole consumes only one cell of the corresponding data line. a Left-justify a string and pad with one space. ^ Vertically span rows from the last non-^ layout cell. It is an error to invoke a vertical span on the first layout line. Unlike a hori- zontal span, a vertical span consumes a data cell and discards the content. _ Draw a single horizontal line in this cell. This consumes a data cell and discards the content. It may also be invoked with -. = Draw a double horizontal line in this cell. This consumes a data cell and discards the content. Each cell key may be followed by zero or more of the following case- insensitive modifiers: b Use a bold font for the contents of this cell. d Move content down to the last row of this vertical span. Currently ignored. e Make this column wider to match the maximum width of any other column also having the e modifier. f The next character selects the font to use for this cell. See the roff(7) manual for supported one-character font names. i Use an italic font for the contents of this cell. m Specify a cell start macro. This is a GNU extension and currently unsupported. p Set the point size to the following unsigned argument, or change it by the following signed argument. Currently ignored. v Set the vertical line spacing to the following unsigned argument, or change it by the following signed argument. Currently ignored. t Do not vertically center content in this vertical span, leave it in the top row. Currently ignored. u Move cell content up by half a table row. Currently ignored. w Specify a minimum column width. x After determining the width of all other columns, distribute the rest of the line length among all columns having the x modifier. z Do not use this cell for determining the width of this column. | Draw a single vertical line to the right of this cell. || Draw a double vertical line to the right of this cell. If a modifier consists of decimal digits, it specifies a minimum spacing in units of n between this column and the next column to the right. The default is 3. If there is a vertical line, it is drawn inside the spac- ing. Data The data section follows the last Layout line. Each data line consists of one or more data cells, delimited by tab characters. If a data cell contains only the two bytes `\^', the cell above spans to this row, as if the layout specification of this cell were ^. If a data cell contains only the single character `_' or `=', a single or double horizontal line is drawn across the cell, joining its neighbours. If a data cell contains only the two character sequence `\_' or `\=', a single or double horizontal line is drawn inside the cell, not joining its neighbours. If a data line contains nothing but the single character `_' or `=', a horizontal line across the whole table is inserted without consuming a layout row. In place of any data cell, a text block can be used. It starts with T{ at the end of a physical input line. Input line breaks inside the text block neither end the text block nor its data cell. It only ends if T} occurs at the beginning of a physical input line and is followed by an end-of-cell indicator. If the T} is followed by the end of the physical input line, the text block, the data cell, and the data line ends at this point. If the T} is followed by the tab character, only the text block and the data cell end, but the data line continues with the data cell following the tab character. If T} is followed by any other character, it does not end the text block, which instead continues to the following physical input line.

EXAMPLES

String justification and font selection: .TS rb c lb r ci l. r center l ri ce le right c left .TE r center l ri ce le right c left Some ports in OpenBSD 6.1 to show number alignment and line drawing: .TS box tab(:); r| l r n. software:version _ AFL:2.39b Mutt:1.8.0 Ruby:1.8.7.374 TeX Live:2015 .TE +---------+-----------+ |software | version | +---------+-----------+ | AFL 2.39b | | Mutt 1.8.0 | | Ruby 1.8.7.374 | |TeX Live 2015 | +---------------------+ Spans and skipping width calculations: .TS box tab(:); lz s | rt lt| cb| ^ ^ | rz s. left:r l:center: :right .TE +-----------+---+ |left | r | |l | center | | | | right | +--+------------+ Text blocks, specifying spacings and specifying and equalizing column widths, putting lines into individual cells, and overriding allbox: .TS allbox tab(:); le le||7 lw10. The fourth line:_:line 1 of this column:=:line 2 determines:_:line 3 the column width.:T{ This text is too wide to fit into a column of width 17. T}:line 4 T{ No break here. T}::line 5 .TE +--------------------+-----------------------++-------------+ |The fourth line +-----------------------+| line 1 | +--------------------+-----------------------++-------------+ |of this column +-----------------------+| line 2 | +--------------------+-----------------------++-------------+ |determines | -------------------- || line 3 | +--------------------+-----------------------++-------------+ |the column width. | This text is too || line 4 | | | wide to fit into a || | | | column of width 17. || | +--------------------+-----------------------++-------------+ |No break here. | || line 5 | +--------------------+-----------------------++-------------+ These examples were constructed to demonstrate many tbl features in a compact way. In real manual pages, keep tables as simple as possible. They usually look better, are less fragile, and are more portable.

COMPATIBILITY

The mandoc(1) implementation of tbl doesn't support mdoc(7) and man(7) macros and eqn(7) equations inside tables.

SEE ALSO

mandoc(1), man(7), mandoc_char(7), mdoc(7), roff(7) M. E. Lesk, Tbl--A Program to Format Tables, June 11, 1976.

HISTORY

The tbl utility, a preprocessor for troff, was originally written by M. E. Lesk at Bell Labs in 1975. The GNU reimplementation of tbl, part of the groff package, was released in 1990 by James Clark. A standalone tbl implementation was written by Kristaps Dzonsons in 2010. This formed the basis of the implementation that first appeared in OpenBSD 4.9 as a part of the mandoc(1) utility.

AUTHORS

This tbl reference was written by Kristaps Dzonsons <kristaps@bsd.lv> and Ingo Schwarze <schwarze@openbsd.org>.

BUGS

In -T utf8 output mode, heavy lines are drawn instead of double lines. This cannot be improved because the Unicode standard only provides an incomplete set of box drawing characters with double lines, whereas it provides a full set of box drawing characters with heavy lines. It is unlikely this can be improved in the future because the box drawing char- acters are already marked in Unicode as characters intended only for backward compatibility with legacy systems, and their use is not encour- aged. So it seems unlikely that the missing ones might get added in the future. DragonFly 5.5 March 2, 2019 DragonFly 5.5 TBL(7) DragonFly Miscellaneous Information Manual TBL(7)

NAME

tbl -- tbl language reference for mandoc

DESCRIPTION

The tbl language is a table-formatting language. It is used within mdoc(7) and man(7) UNIX manual pages. This manual describes the subset of the tbl language accepted by the mandoc(1) utility. Tables within mdoc(7) or man(7) are enclosed by the `TS' and `TE' macro tags, whose precise syntax is documented in roff(7). Tables consist of a series of options on a single line, followed by the table layout, fol- lowed by data. For example, the following creates a boxed table with digits centered in the cells. .TS tab(:) box; c5 c5 c5. 1:2:3 4:5:6 .TE When formatted, the following output is produced: +--------------+ |1 2 3 | |4 5 6 | +--------------+

TABLE STRUCTURE

Tables are enclosed by the `TS' and `TE' roff(7) macros. A table con- sists of an optional single line of table Options terminated by a semi- colon, followed by one or more lines of Layout specifications terminated by a period, then Data. All input must be 7-bit ASCII. Example: .TS box tab(:); c | c | c | c. 1:2 3:4 .TE Table data is pre-processed, that is, data rows are parsed then inserted into the underlying stream of input data. This allows data rows to be interspersed by arbitrary roff(7), mdoc(7), and man(7) macros such as .TS tab(:); c c c. 1:2:3 .Ao 3:2:1 .Ac .TE in the case of mdoc(7) or .TS tab(:); c c c. .ds ab 2 1:\*(ab:3 .I 3:2:1 .TE in the case of man(7). Options The first line of a table may contain options separated by spaces, tabs, or commas and terminated by a semicolon. If the first line does not have a terminating semicolon, it is assumed that no options are specified and instead a Layout is processed. Some options require arguments enclosed by parentheses. The following case-insensitive options are available: allbox Draw a single-line box around each table cell. Currently treated as a synonym for box. box Draw a single-line box around the table. For GNU compatibility, this may also be invoked with frame. center Center the table instead of left-adjusting it. For GNU compati- bility, this may also be invoked with centre. decimalpoint Use the single-character argument as the decimal point with the n layout key. This is a GNU extension. delim Use the two characters of the argument as eqn(7) delimiters. Currently unsupported. doublebox Draw a double-line box around the table. For GNU compatibility, this may also be invoked with doubleframe. expand Increase the width of the table to the current line length. Cur- rently ignored. linesize Draw lines with the point size given by the unsigned integer argument. Currently ignored. nokeep Allow page breaks within the table. This is a GNU extension and currently ignored. nospaces Ignore leading and trailing spaces in data cells. This is a GNU extension and currently ignored. nowarn Suppress warnings about tables exceeding the current line length. This is a GNU extension and currently ignored. tab Use the single-character argument as a delimiter between data cells. By default, the tab character is used. Layout The table layout follows Options or a `T&' macro invocation. Layout specifies how data rows are displayed on output. Each layout line corre- sponds to a line of data; the last layout line applies to all remaining data lines. Layout lines may also be separated by a comma. Each layout cell consists of one of the following case-insensitive keys: c Center a literal string within its column. r Right-justify a literal string within its column. l Left-justify a literal string within its column. n Justify a number around its last decimal point. If the decimal point is not found on the number, it's assumed to trail the number. s Horizontally span columns from the last non-s data cell. It is an error if spanning columns follow a - or | cell, or come first. This option is not supported by mandoc(1). a Left-justify a literal string and pad with one space. ^ Vertically span rows from the last non-^ data cell. It is an error to invoke a vertical span on the first layout row. Unlike a horizon- tal spanner, you must specify an empty cell (if it not empty, the data is discarded) in the corresponding data cell. - Replace the data cell (its contents will be lost) with a single hori- zontal line. This may also be invoked with _. = Replace the data cell (its contents will be lost) with a double hori- zontal line. | Emit a vertical bar instead of data. || Emit a double-vertical bar instead of data. Keys may be followed by a set of modifiers. A modifier is either a modi- fier key or a natural number for specifying the minimum width of a col- umn. The following case-insensitive modifier keys are available: b Use a bold font for the contents of this column. d Move cell content down to the last cell of a vertical span. Cur- rently ignored. e Make this column wider to match the maximum width of any other column also having the e modifier. f The next character selects the font to use for this column. See the roff(7) manual for supported one-character font names. i Use an italic font for the contents of this column. m Specify a cell start macro. This is a GNU extension and currently unsupported. p Set the point size to the following unsigned argument, or change it by the following signed argument. Currently ignored. v Set the vertical line spacing to the following unsigned argument, or change it by the following signed argument. Currently ignored. t Do not vertically center cell content in the vertical span, leave it at the top. Currently ignored. u Move cell content up by half a table line. Currently ignored. w Specify minimum column width. Currently ignored. x After determining the width of all other columns, distribute the rest of the line length among all columns having the x modifier. z Do not use this cell for determining the width of this column. For example, the following layout specifies a center-justified column of minimum width 10, followed by vertical bar, followed by a left-justified column of minimum width 10, another vertical bar, then a column using bold font justified about the decimal point in numbers: c10 | l10 | nfB Data The data section follows the last layout row. By default, cells in a data section are delimited by a tab. This behaviour may be changed with the tab option. If _ or = is specified, a single or double line, respec- tively, is drawn across the data field. If \- or \= is specified, a line is drawn within the data field (i.e. terminating within the cell and not draw to the border). If the last cell of a line is T{, all subsequent lines are included as part of the cell until T} is specified as its own data cell. It may then be followed by a tab (or as designated by tab) or an end-of-line to terminate the row.

COMPATIBILITY

The mandoc(1) implementation of tbl doesn't support mdoc(7) and man(7) macros and eqn(7) equations inside tables.

SEE ALSO

mandoc(1), man(7), mandoc_char(7), mdoc(7), roff(7) M. E. Lesk, Tbl--A Program to Format Tables, June 11, 1976.

HISTORY

The tbl utility, a preprocessor for troff, was originally written by M. E. Lesk at Bell Labs in 1975. The GNU reimplementation of tbl, part of the groff package, was released in 1990 by James Clark. A standalone tbl implementation was written by Kristaps Dzonsons in 2010. This formed the basis of the implementation that is part of the mandoc(1) utility.

AUTHORS

This tbl reference was written by Kristaps Dzonsons <kristaps@bsd.lv>. DragonFly 5.5 January 29, 2015 DragonFly 5.5

Search: Section: