Section: User Commands (1)
Updated: 04 September 2014
[ -abcegijklpstzCEGNRSUVXZ ] [ -d cs ] [ -D arg ] [ -f fam ] [ -F dir ] [ -I dir ] [ -K arg ] [ -L arg ] [ -m name ] [ -M dir ] [ -n num ] [ -o list ] [ -P arg ] [ -r cn ] [ -T dev ] [ -w name ] [ -W name ] [file~...] -h | --help -v | --version [option~...]
This document describes the groff program, the main front-end for the groff document formatting system. The groff program and macro suite is the implementation of a roff?(7) system within the free software collection GNU The groff system has all features of the classical roff, but adds many extensions.
The command line is parsed according to the usual GNU convention. The whitespace between a command line option and its argument is optional. Options can be grouped behind a single `-' (minus character). A filename of - (minus character) denotes the standard input.
As groff is a wrapper program for troff both programs share a set of options. But the groff program has some additional, native options and gives a new meaning to some troff options. On the other hand, not all troff options can be fed into groff.
The following options either do not exist for troff or are differently interpreted by groff.
:is equivalent to
The groff system implements the infrastructure of classical roff; see roff?(7) for a survey on how a roff system works in general. Due to the front-end programs available within the groff system, using groff is much easier than classical roff. This section gives an overview of the parts that constitute the groff system. It complements roff?(7) with groff-specific features. This section can be regarded as a guide to the documentation around the groff system.
The virtual paper size used by troff to format the input is controlled globally with the requests .po, .pl, and .ll. See groff_tmac?(5) for the `papersize' macro package which provides a convenient interface.
The physical paper size, giving the actual dimensions of the paper sheets, is controlled by output devices like grops with the command line options -p and -l. See groff_font?(5) and the man pages of the output devices for more details. groff uses the command line option -P to pass options to output devices; for example, the following selects A4 paper in landscape orientation for the PS device:
The groff program is a wrapper around the troff?(1) program. It allows to specify the preprocessors by command line options and automatically runs the postprocessor that is appropriate for the selected device. Doing so, the sometimes tedious piping mechanism of classical roff?(7) can be avoided.
The groff preprocessors are reimplementations of the classical preprocessors with moderate extensions. The standard preprocessors distributed with the groff package are
Macro packages can be included by option -m. The groff system implements and extends all classical macro packages in a compatible way and adds some packages of its own. Actually, the following macro packages come with groff:
The central roff formatter within the groff system is troff?(1). It provides the features of both the classical troff and nroff, as well as the groff extensions. The command line option -C switches troff into compatibility mode which tries to emulate classical roff as much as possible.
In roff, the output targets are called devices. A device can be a piece of hardware, e.g., a printer, or a software file format. A device is specified by the option -T. The groff devices are as follows.
groff provides 3~hardware postprocessors:
Today, most printing or drawing hardware is handled by the operating system, by device drivers, or by software interfaces, usually accepting PostScript. Consequently, there isn't an urgent need for more hardware device postprocessors.
The groff software devices for conversion into other document file formats are
The following utility programs around groff are available.
Normally, the path separator in the following environment variables is the colon; this may vary depending on the operating system. For example, DOS and Windows use a semicolon instead.
There are some directories in which groff installs all of its data files. Due to different installation habits on different operating systems, their locations are not absolutely fixed, but their function is clearly defined and coincides on all systems.
This contains all information related to macro packages. Note that more than a single directory is searched for those files as documented in groff_tmac?(5). For the groff installation corresponding to this document, it is located at /usr/share/groff/1.22.2/tmac. The following files contained in the groff macro directory have a special meaning:
This contains all information related to output devices. Note that more than a single directory is searched for those files; see troff?(1). For the groff installation corresponding to this document, it is located at /usr/share/groff/1.22.2/font. The following files contained in the groff font directory have a special meaning:
The following example illustrates the power of the groff program as a wrapper around troff.
To process a roff file using the preprocessors tbl and pic and the me macro set, classical troff had to be called by
Using groff, this pipe can be shortened to the equivalent command
The simplest way is to view the contents in an automated way by calling
On EBCDIC hosts (e.g., OS/390 Unix), output devices ascii and latin1 aren't available. Similarly, output for EBCDIC code page cp1047 is not available on ASCII based operating systems.
Information on how to get groff and related information is available at the groff GNU website The most recent released version of groff is available at the groff development site
Three groff mailing lists are available:
Details on CVS access and much more can be found in the file README at the top directory of the groff source package.
Copyright © 2011 Free Software Foundation, Inc.
This document is distributed under the terms of the FDL (GNU Free Documentation License) version 1.3 or later. You should have received a copy of the FDL on your system, it is also available on-line at the GNU copyleft site
This document is based on the original groff man page written by James Clark It was rewritten, enhanced, and put under the FDL license by Bernd Warken <firstname.lastname@example.org>. It is maintained by Werner Lemberg
groff is a GNU free software project. All parts of the groff package are protected by GNU copyleft licenses. The software files are distributed under the terms of the GNU General Public License (GPL), while the documentation files mostly use the GNU Free Documentation License (FDL).
Tutoriais de Tecnologia Web