Linux command
tbl 命令
文件
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Process a file containing tables
groff -t [file.roff] | [less]
Process tables with equation support
tbl [file.roff] | eqn | troff
Process from stdin
cat [file.roff] | tbl
Process a man page
tbl [page.man] | nroff -man | less
Enable AT&T compatibility mode
tbl -C [file.roff]
说明
tbl is a preprocessor for the groff/troff document formatting system that formats tables. It translates table descriptions embedded between .TS (table start) and .TE (table end) macros into troff formatting commands. Tables are defined with a format section specifying column alignment and a data section containing the content. Column classifiers include L (left), R (right), C (center), N (numeric alignment), and A (alphabetic). Modifiers like b (bold) and i (italic) can be applied to columns. Region options control table appearance: box draws a border, center horizontally centers the table, expand stretches it to fill the line width, and tab(c) sets the column separator character. tbl is typically invoked via groff -t rather than directly. When using multiple preprocessors, tbl should run before eqn (equations). The groff command handles ordering automatically.
参数
- -C
- Enable AT&T compatibility mode; recognize .TS and .TE even when followed by a character other than space or newline.
- -v, --version
- Print version information and exit
- --help
- Display usage information and exit
FAQ
What is the tbl command used for?
tbl is a preprocessor for the groff/troff document formatting system that formats tables. It translates table descriptions embedded between .TS (table start) and .TE (table end) macros into troff formatting commands. Tables are defined with a format section specifying column alignment and a data section containing the content. Column classifiers include L (left), R (right), C (center), N (numeric alignment), and A (alphabetic). Modifiers like b (bold) and i (italic) can be applied to columns. Region options control table appearance: box draws a border, center horizontally centers the table, expand stretches it to fill the line width, and tab(c) sets the column separator character. tbl is typically invoked via groff -t rather than directly. When using multiple preprocessors, tbl should run before eqn (equations). The groff command handles ordering automatically.
How do I run a basic tbl example?
Run `groff -t [file.roff] | [less]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -C do in tbl?
Enable AT&T compatibility mode; recognize .TS and .TE even when followed by a character other than space or newline.