| Linux / Unix Command: groffer |
NAME
groffer - display groff files and man~pages on X and ttySYNOPSIS
nopsis groffer [viewing_options] [man_options] [groff_options] [t_[--]] [filespecEllipsis]]nopsis groffer [t_alt - h -- help]
nopsis groffer [t_alt - v -- version]
- viewing_options
-
These options determine and configure the display mode.
They were synchronized with the options of both
groff(1)
and GNU
man(1).
As groff uses almost any letter in its option set, only long option
names are available for most features.
If none of these options is used groffer tries to find a suitable
display mode automatically.
- [t_[alt] - Q -- source] [t_[alt] - T -- device device] [t_[alt] -- auto-modes mode1,mode2,Ellipsis]] [t_[alt] -- debug] [t_[alt] -- default] [t_[alt] -- dvi] [t_[alt] -- dvi-viewer prog] [t_[alt] -- groff] [t_[alt] -- location] [t_[alt] -- mode display_mode] [t_[alt] -- pager program] [t_[alt] -- pdf] [t_[alt] -- pdf-viewer prog] [t_[alt] -- ps] [t_[alt] -- ps-viewer prog] [t_[alt] -- shell] [t_[alt] -- tty] [t_[alt] -- www] [t_[alt] -- www-viewer prog] [t_[alt] -- x] [t_[alt] -- x-viewer prog] The following long options were adapted from the corresponding X Toolkit options with a single leading minus; see X(1). [t_[alt] -- bd] [t_[alt] -- bg -- background] [t_[alt] -- bw] [t_[alt] -- display] [t_[alt] -- fg -- foreground] [t_[alt] -- ft -- font] [t_[alt] -- geometry size_pos] [t_[alt] -- resolution value] [t_[alt] -- rv] [t_[alt] -- title string] [t_[alt] -- xrm X_resource]
- groff_options
-
Any combination of (short) options from the
groff(1)
program is accepted; the options that are not explicitly handled by
groffer are transparently passed to groff.
Due to the automatism in groffer, none of these groff options should
be necessary, except for advanced usage.
- Because of the special outputting behavior of the groff options [t_short V,] [t_short X,] and [t_short Z,] groffer was designed to be switched into groff mode by each of these options; in this mode, the groffer viewing features are disabled. The other groff options do not switch the mode, but allow to customize the formatting process. Useful groff formatting options include [t_short m] (to add macro files that cannot be recognized by grog), and [t_short T] (to specify an alternative device for the modes tty and x).
- man_options
-
These options regulate whether and how man pages are searched.
They are compatible with the long options of the
GNU man
program.
- [t_[alt] -- all] [t_[alt] -- ascii] [t_[alt] -- apropos] [t_[alt] -- ditroff] [t_[alt] -- extension suffix] [t_[alt] -- locale language] [t_[alt] -- local-file] [t_[alt] -- man] [t_[alt] -- manpath dir1:dir2:Ellipsis]] [t_[alt] -- no-location] [t_[alt] -- no-man] [t_[alt] -- sections sec1:sec2:Ellipsis]] [t_[alt] -- systems sys1,sys2,Ellipsis]] [t_[alt] -- troff-device device] [t_[alt] -- whatis] The GNU man long options that are not mentioned are recognized, but they are just ignored because of alternative implementations. The full set of long and short options of the GNU man program can be passed via the environment variable see man(1) if your system has GNU man installed.
- filespec
-
is a sequence of file names or templates for searching
man~pages, see
man(1).
A
filespec
can have one of the following forms.
-
- filename
- the path name of an existing file.
- [t_short]
- stands for standard input (can occur several times).
- man:name(section)
- search the man~page name in section~section.
- man:name.section
- search the man~page name in section~section.
- man:name
- search the man~page name in the lowest available section.
- name(section)
- search the man~page name in section~section.
- name.section
- search the man~page name in section~section.
- standard_section
- if this is `1', Ellipsis], `9', `o', or `n' try to retrieve the next argument as a man~page in this section.
- name
- search for the man~page name in the lowest available section. No filespec parameters means standard input.
-
DESCRIPTION
The groffer program is part of groff(7). It can be used to display arbitrary documents written in the roff(7) formatting language in several different ways, in an X window viewer program or in a text terminal. The viewer programs can be chosen as the groff native viewer gxditview(1), a Postcript or dvi display program, or a web browser. A search facility for manual pages ( man~pages) is provided. Almost the whole functionality of the GNU man program was provided or suitably adapted. This makes the groffer program a valuable tool on systems with a poor man system. The program always concatenates all input specified by the non-option parameters of the calling command line or standard input. Compressed standard input or files are decompressed on-the-fly. Normally, the input is run through the groff(1) text processor before being displayed. By using the option [t_short Q] the roff source code is displayed without formatting. The formatting process can be regulated by all options that are available groff. By using the [t_short T] option, groffer can be switched to behave exactly like groff without using its viewer facilities, but additionally with the search and decompression features. All necessary options can be determined automatically. For example, the groffer program internally uses the grog(1) program to determine from the unformatted document which preprocessors should be run and which macro files should be included. But all parts of the program can be controlled manually by suitable options.OPTIONS
The groffer program provides its own parser for command line options that is compatible to both POSIX getopts(1) and GNU getopt(1). The command line behaves as usually. For completeness, the details are provided here.Option Parsing
The following types of options are supported, equally on all systems that are able to run the groffer program: single character options are always preceded by a single minus character, for example, [t_short c] the argument for a single character option is the next command line argument, for example, [t_alt - o~ arg] or can be appended to the option character within the same argument [t_alt - o arg] clusters of such single character options without an argument, eventually terminated by a single character option with an argument; for example, [t_alt - abo arg] is equivalent to [t_short a~][t_short b~][t_short o~]arg . Long options, that means option with names longer than one character are always prededed by a double minus; an option argument can either go to the next command line argument or be appended with an equal sign to the argument; for example, [t_alt -- long= arg] is equivalent to [t_alt -- long~ arg] An argument of [t_--] ends option parsing; all further command line arguments are interpreted as filespec arguments. By default, all command line arguments that are neither options nor option arguments are interpreted as filespec parameters and stored until option parsing has finished. For example, the command lineell_cmd groffer file1 -a -o arg file 2
is, by default, equivalent toell_cmd groffer -a -o arg -- file1 file 2
This behavior can be changed by setting the environment variable to a non-empty value; in this case, option processing is stopped as soon as the first non-option argument is found. For example, in posixly correct mode, the command lineell_cmd groffer file1 -a -o arg file 2
is equivalent toell_cmd groffer -- file1 -a -o arg file 2
As this leads to unwanted behavior in most cases, most people do not want to setCompatibility with Options from other Programs
All short options of groffer are compatible with the short options of groff(1). Some of the groff options were given a special meaning within groffer. All other groff options are supported by groffer, but they are just transparently transferred to groff without any intervention. Therefore these transparent options are not documented here, but in groff(1). All long options of groffer are compatible with the long options of man(1). Most of the man long options were implemented as native options into groffer. These options are documented in the following; the other man options are recognized, but ignored.Native groffer Options
[t_def - h] Print usage message to standard error and exit. [t_def - Q] Output the roff source code of the input files unprocessed. This is the equivalent [t_long mode~source] [t_def - T devname] Switch to [t_long mode~device] thus disabling the groffer viewing. Instead, the input is formatted and postprocessed using plain groff with devname as the output device. The allowed device names are listed in groff(1). Note that this forces all device names that begin with the letter X to be displayed with gxditview(1); all other device names generate output for the specified device; this is printed onto standard output without a pager. [t_def - v] Print version information onto standard error. [t_def - V] Switch into groff mode and format the input with groff option [t_short V] this produces the groff calling pipe without formatting the input. This an advanced option from groff(1), only useful for debugging. [t_def - X] Switch into groff mode and format the input with groff option [t_short X] actually, this formats the input and displays it with gxditview(1). This differs from groffer's mode x because groffer's viewer options are not used, but the viewer is configured like in groff with the groff option [t_short P] This option is inhereted from groff(1). [t_def - Z] Switch into groff mode and format the input with groff option [t_short Z] this produces the groff intermediate output without postprocessing; see groff_out(1). This an advanced option from groff(1), useful for debugging. [t_def -- all] In searching man pages, retrieve all suitable ones instead of only one. [t_def -- apropos] Instead of displaying, start the `apropos' command for searching within man page descriptions; only kept for compatibility with `man'. [t_def -- auto-modes mode1,mode2,Ellipsis]] Set the sequence of modes for default mode to the comma separated list given in the argument. [t_def -- background color] This is equivalent to [t_long bg] [t_def -- bd pixels] Specifies the color of the border surrounding the viewer window. This is an adaption of the X Toolkit option [t_short bd] The argument is an X color name, see (1) for details. [t_def -- bg color] Set the background color of the viewer window. This is an adaption of the X Toolkit option [t_short bg] The argument is an X color name, see (1) for details. [t_def -- bw pixels] Specifies the width in pixels of the border surrounding the viewer window (not available for all viewers). This is an adaption of the X Toolkit option [t_short bw] [t_def -- debug] Print debugging information. Actually, a function call stack is printed if an error occurs. [t_def -- default] Reset all configuration from previously processed command line options to the default values. This is useful to wipe out all effects of former options and restart option processing using only the rest of the command line. [t_def -- device] Eqivalent to [t_short T] [t_def -- display X-display] Set the X display on which the viewer program shall be started, see X(1) for the syntax of the argument. [t_def -- ditroff] Eqivalent to [t_short Z] This is kept for compatibiliy with GNU man(1). [t_def -- dvi] Choose dvi mode; the formatted input is displayed with the by default, the formatted input is displayed with the xdvi(1) program. [t_def -- dvi-viewer prog] Set the viewer program for dvi mode. This can be a file name or a program to be searched in Known dvi viewers inlude xdvi(1) and dvilx(1) In each case, arguments can be provided additionally. [t_def -- extension suffix] Restrict man~page search to file names that have suffix appended to their section element. For example, in the file name /usr/share/man/man3/terminfo.3ncurses.gz the man~page extension is ncurses. Originates from GNU man. [t_def -- foreground color] This is equivalent to [t_short fg] [t_def -- fg color] Set the foreground color of the viewer window. This is an adaption of the X Toolkit option [t_short bg] The argument is an X color name, see (1) for details. [t_def -- font font_name] This is equivalent to [t_short ft] [t_def -- ft font_name] Set the font used by the viewer window. This is an adaption of the X Toolkit option [t_short ft] The argument is an X font name, see (1) for details. [t_def -- geometry size_pos] Set the geometry of the display window, that means its size and its starting position. See X(1) for details on the syntax of the argument. If the actual display mode is not X then this option is ignored. [t_def -- groff] Set groff mode. Switch groffer to process the input like groff(1). This disables the groffer viewing features, all groffer viewing options are ignored. [t_def -- help] Eqivalent to [t_short h] [t_def -- location] Print the location of the retrieved files to standard error. [t_def -- locale language] Set the language for man pages. This option originates from GNU man(1). [t_def -- man] Check the non-option command line arguments (filespecs) first on being man~pages, then whether they represent an existing file. By default, a filespec is first tested if it is an existing file. [t_def -- manpath 'dir1:dir2:Ellipsis]'] Use the specified search path for retrieving man~pages instead of the program defaults. If the argument is set to the empty string "" the search for man~page is disabled. [t_def -- mode value] Set the display mode. The following mode values are recognized:-
- auto
- Display in the default manner; this actually means to try the modes ps, x, and tty in this sequence. Useful for restoring default mode when a different mode was specified with
- dvi
- Display formatted input in a dvi viewer program; equivalent to [t_long dvi]
- Display formatted input in a PDF (Portable Document Format) viewer program; equivalent to [t_long pdf]
- ps
- Display formatted input in a Postscript viewer program; equivalent to [t_long ps]
- tty
- Display formatted input in a text terminal; equivalent to [t_long tty]
- www
- Display formatted input in a internet browser program; equivalent to [t_long www]
- x
- Display formatted input in a native roff viewer such as gxditview(1);equivalentto [t_long x] The following modes do not use the groffer viewing features. They are only interesting for advanced applications.
- groff
- Generate device output with plain groff without using the special viewing features of groffer. If no device was specified by option [t_short T] the groff default ps is assumed.
- source
- Display source code; same as [t_short Q]
- [t_--]
- Signals the end of option processing; all remaining arguments are interpreted as filespec parameters. Besides these, groffer accepts all arguments that are valid for the groff(1) program. All non-groffer options are sent unmodified via grog to groff. Postprocessors, macro packages, compatibility with classical troff, and much more can be manually specified.
OUTPUT MODES
By default, the groffer program formats the input and then automatically chooses a suitable display mode, but the user can also choose between the following modes: graphically display the formatted input with an X window program, including- with X window roff viewers such as gxditview(1) (x mode), in a dvi viewer program (dvi mode), in a Postscript viewer (ps mode), in a PDF viewer (pdf mode), in a web browser (www mode),
Graphical Display Modes
The graphical display modes work only in the X window environment (or similar implementations within other windowing environments). The environment variable or the option [t_long display] are used for specifying the X display to be used; if neither is specified, groffer assumes that no X is running. A certain graphical display mode can be selected by one of the options [t_long dvi] [t_long pdf] [t_long ps] [t_short X] and [t_long www] By default, some graphical modes are tried first. If none succeeds groffer switches to tty mode. The graphical modes can be customized by options that were named according to the resource options in the X(1) Toolkit but using a leading double minus instead of the single minus used by X. These include [t_long background] [t_long foreground] [t_long geometry] [t_long resolution] [t_long title] [t_long xrm] etc. The pdf mode has a major advantage [em] it is the only graphical diplay mode that allows to search for text within the viewer; this can be a really important feature. Unfortunately, it takes a long time to transform the input into the PDF format, so it was not chosen as the major mode. You can change this by the options [t_long pdf] and [t_long auto-modes]Displaying on a tty
If the variable is not set or empty, groffer assumes that it should produce output on a text terminal. This mode can also be forced by option [t_long tty] In the actual implementation, the groff output device latin1 is chosen and the processed output is piped into a pager program. This can be changed by specifying option [t_long tty-device] The pager to be used can be specified by option [t_long pager] by the environment variable If this is not set or empty the less(1) program is used as the default pager.Non-displaying Modes
There are some special modes that do not display the formatted output in a viewer program. These modes are regarded as advanced, they are useful for debugging purposes.- source mode
- Instead of displaying the formatted output, it is also possible to have the roff source code streamed onto the standard output. This mode must be requested by one of the options [t_short Q] or [t_long source]
- groff mode
- This mode disables the groffer viewing facilities. The input is handled as usual with decompression and man~page searching, but then it is passed to groff using only the options provided by groff. This enables the user to save the generated output into a file or pipe it into another program. In this mode, the input is formatted, but not postprocessed; see groff_out(5) for details. This mode is activated automatically by the three groff options [t_short V] (print roff pipe, no formatting), [t_short X] (display with gxditview in groff's native way, using [t_short P] for customization), and [t_short Z] (disable post-processing, thus producing the groff intermediate output).
FILE PARAMETERS
The non-option command line parameters determine which files should be displayed.Filespecs
The default behavior of groffer is to first test whether the file parameter is represents a local file; if not, it is assumed to represent a filespec for searching one or more man~page. This behavior can be modified by options.- [t_long man]
- forces to interpret all file parameters as filespecs for searching man~pages.
- [t_long no-man]
- [t_long local-file]
- disable the man searching; so only local files are displayed. The following parameter formats are recognized to represent a wanted man~page.
- man:name(section)
- the quasi-URL notation used in many Desktop systems to represent the man~page name in section.
- man:name
- search the man~page name in the lowest section. The corresponding command with the man program would be
ell_cmd man~ name
- name.section
- the man~page name in section. The corresponding command with the man program would be
ell_cmd man~ section~name
- name
- if name is not an existing file search for the man~page name in the lowest section just like
ell_cmd man~ name
- section name
- Even this curious construct known from the various man programs is handled. For example,
ell_cmd groffer 7 groff
was modelled according toell_cmd man 7 groff
retrieves the man~page named groff in section 7. Only a few standard section names are accepted, being actually the number sections 1, 2, 3, 4, 5, 6, 7, 8, and 9, and the lower case letters `o' and `n'. If neither a local file nor a man~page was retrieved for some file parameter a warning is issued on standard error, but processing is continued.Man~Page Searching
The groffer program provides a search facility for system manual pages (man~pages). All long options, all environment variables, and most of the functionality of the GNU man(1) program were implemented. Preformatted man~pages (cat~pages) are intentionally excluded from the search because groffer is a roff program that wants to format by its own, not spit out stuff that was digested previously by someone else. With the excellent performance of the actual computers, the preformatted man~pages aren't necessary any longer. Due to their inflexible nature, they tend to provoke some trouble with changing line lengths and different environments in networks. The algorithm for retrieving man~pages uses five search methods. They are successively tried until a method works. The search path can be manually specified by using the option [t_long manpath] An empty argument disables the man~page searching. This overwrites the other methods. If this is not available the environment variable is searched. If this is empty, the program tries to read it from the environment variable If this does not work, the manpath(1) program for determining a path of man directories is tried. If this does not work a reasonable default path is searched for man~pages. After this, the path elements for the language (locale) and operating system specific man~pages are added to the man~path; their sequence is determined automatically. For example, both /usr/share/man/linux/fr and /usr/share/man/fr/linux for french linux man~pages are found. The language and operating system names are determined from both environment variables and command line options. The locale (language) is determined like in GNU man, that is from highest to lowest precedence: [t_long locale] The language locale is usually specified in the POSIX 1003.1 based format: I]<language>][CB]_]I]<territory>][CB].]I]<character-set>][CB],]I]<version>]]]], but the two-letter code in <language> is sufficient for most purposes. If no man~pages for a complicated locale are found the country part consisting of the first two characters (without the `CB]_]', `CB].]', and `CB],]', parts) of the locale is searched as well. If still not found the corresponding man~page in the default language is used instead. As usual, this default can be specified by one of CR]C] or CR]POSIX]. The man~pages in the default language are usually in English. Several operating systems can be given by appending their names, separated by a comma. This is then specified by the environment variable or by the command line option [t_long systems] The precedence is similar to the locale case above from highest to lowest precedence: Topic [t_long systems] When searching for man~pages this man~path with the additional language and system specific directories is used. The search can further be restricted by limiting it to certain sections. A single section can be specified within a filespec, several sections as a colon-separated list in command line option [t_long sections] or environment variable When no section was specified a set of standard sections is searched until a suitable man~page was found. Finally, the search can be restricted to a so-called extension. This is a postfix that acts like a subsection. It can be specified by [t_long extension] or environment variable For further details on man~page searching, see man(1).Decompression
The program has a decompression facility. If standard input or a file that was retrieved from the command line parameters is compressed with a format that is supported by either gzip(1) or bzip2(1) it is decompressed on-the-fly. This includes the GNU .gz, .bz2, and the traditional .Z compression. The program displays the concatenation of all decompressed input in the sequence that was specified on the command line.SEE ALSO
- groff(1)
- troff(1)
- Details on the options and environment variables available in groff; all of them can be used with groffer.
- grog(1)
- Internally, groffer tries to guess the groff command line options from the input using this program.
- groff_out(5)
- Documentation on the groff intermediate output (ditroff output).
- xdvi(1)
- dvilx(1)
- Viewers for groffer's dvi mode.
- gv(1)
- ghostview(1)
- Viewers for groffer's ps mode.
- gs(1)
- Transformer from ps to pdf; and a ps viewer.
- xpdf(1)
- Viewers for pdf files.
- gxditview(1)
- xditview(1x)
- Viewers for groffer's x mode.
- gzip(1)
- bzip2(1)
- The decompression programs supported by groffer.
- man(1)
- The standard program to diplay man~pages. The information there is only useful if it is the man~page for GNU~man. Then it documents the options and environment variables that are supported by groffer.
Important: Use the man command (% man) to see how a command is used on your particular computer.

