NAME
groffer - display groff files and man\~pages on X and tty
.
SYNOPSIS
.
.
groffer.1 - man page for groffer (section 1).
Source file position: <groff_source_top>/contrib/groffer/groffer.man
Installed position: $prefix/share/man/man1/groffer.1
Last update : 12 May 2004
Source file position: <groff-source>/contrib/groffer/groffer.man
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
[option...]
[filespec\*[Ellipsis]]
./Synopsis
.
./Synopsis
.
./Synopsis
.
./Synopsis
.
.
DESCRIPTION
.
The
groffer
program is the easiest way to use
groff(1).
It can display arbitrary documents written in the
groff(7)
language or other
roff(7)
languages that are compatible to the original troff language.
.
The
groffer
program also includes many of the features for finding and displaying
the UNIX manual pages
(man\~pages),
such that it can be used as a replacement for a
man(1)
program.
.
Moreover, compressed files that can be handled by
gzip(1)
or
bzip2(1)
are decompressed on-the-fly.
.
.
The normal usage is quite simple by supplying a file name or name of a
man\~page without further options.
.
But the option handling has many possibilities for creating special
behaviors.
.
This can be done in configuration files, with the shell environment
variable
R $GROFFER_OPT ,
or on the command line.
.
.
The output can be generated and viewed in several different ways
available for
R groff .
.
This includes the groff native X viewer
gxditview(1),
each Postcript or dvi display program, a web browser by generating
html in www-mode, or several text modes in text terminals.
.
.
Most of the options that must be named when running
groff
directly are determined automatically for
R groffer ,
due to the internal usage of the
grog(1)
program.
.
But all parts can also be controlled manually by arguments.
.
.
Several file names can be specified on the command line arguments.
.
They are transformed into a single document in the normal way of
R groff .
.
.
OPTION OVERVIEW
.
.
.
.
.
.
.
All further
groff
short options are accepted.
.
.
.
.
Further long options of GNU
man
are accepted as well.
.
.
No
filespec
parameters means standard input.
.
.
stands for standard input (can occur several times).
.
.
filename
the path name of an existing file.
.
.
B name ( section )
search the man\~page
name
in man\~section\~\c
R section .
.
.
B name . s
if
s
is a character in
R [1-9on] ,
search for a man\~page
name
in man\~section
R s .
.
.
I man: name
man\~page in the lowest man\~section that has
R name .
.
.
s name
if
s
is a character in
R [1-9on] ,
search for a man\~page
name
in man\~section
R s .
.
.
name
if
name
is not an existing file search for the man\~page
name
in the lowest man\~section.
.
.
.
OPTION DETAILS
.
The
groffer
program can usually be run with very few options.
.
But for special purposes, it supports many options.
.
These can be classified in 5 option classes.
.
.
All short options of
groffer
are compatible with the short options of
groff(1).
.
All long options of
groffer
are compatible with the long options of
man(1).
.
.
groffer breaking Options
.
As soon as one of these options is found on the command line it is
executed, printed to standard output, and the running
groffer
is terminated thereafter.
.
All other arguments are ignored.
.
.
Start the
apropos(1)
command for searching within man page
descriptions.
.
That slightly differs from the strange behavior of the
program of
man(1),
which has no argument of its own, but takes the file arguments
instead.
.
Practically both concepts are compatible.
.
.
Show only the
apropos(1)
descriptions for data documents, in the
man(7)
sections 4, 5, and 7.
.
.
Show only the
apropos(1)
descriptions for development documents, in the
man(7)
sections 2, 3, and 9.
.
.
Show only the
apropos(1)
descriptions for documents on programs, in the
man(7)
sections 1, 6, and 8.
.
.
Print a helping information with a short explanation of option sto
standard output.
.
.
Print version information to standard output.
.
.
groffer Mode Options
.
The display mode and the viewer programs are determined by these
options.
.
If none of these mode and viewer options is specified
groffer
tries to find a suitable display mode automatically.
.
.
Equivalent to
.
.
Reset all configuration from previously processed command line options
to the default values.
.
This is useful to wipe out all former options of the configuration, in
and restart option processing using only the rest of the command line.
.
.
Set the sequence of modes for
auto mode
to the comma separated list given in the argument.
.
See
for details on modes. Display in the default manner; actually, this
means to try the modes
R x ,
R ps ,
and
tty
in this sequence.
.
.
.
Equivalent to
.
.
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.
.
.
Equivalent to
.
.
Equivalent to
.
.
Equivalent to
.
.
.
Set the display mode.
.
The following mode values are recognized:
.
.
Select the automatic determination of the display mode.
.
The sequence of modes that are tried can be set with the
option.
.
Useful for restoring the default mode when a different mode was
specified before.
.
.
Display formatted input in a
dvi
viewer program.
.
By default, the formatted input is displayed with the
xdvi(1)
program.
.
.
After the file determination, switch
groffer
to process the input like
groff(1)
would do .
.
This disables the
groffer
viewing features.
.
.
Translate the input into html format and display the result in a web
browser program.
.
By default, the existence of a sequence of standard web browsers is
tested, starting with
konqueror(1)
and
mozilla(1).
The text html viewer is
lynx(1).
.
.
Display formatted input in a
PDF
(Portable Document Format) viewer
program.
.
By default, the input is formatted by groff using the Postscript
device, then it is transformed into the PDF file format using
gs(1),
and finally displayed either with the
xpdf(1)
or the
acroread(1)
program.
.
PDF has a big advantage because the text is displayed graphically and
is searchable as well.
.
But as the transformation takes a considerable amount of time, this
mode is not suitable as a default device for the auto mode.
.
.
Display formatted input in a Postscript viewer program.
.
By default, the formatted input is displayed with the
ghostview(1)
program.
.
.
Format in a
groff
text mode and write the result to standard output without a pager or
viewer program.
.
The text device,
latin1
by default, can be chosen with option
.
.
Format in a
groff
text mode and write the result to standard output using a text pager
program, even when in X Window.
.
.
Display formatted input in a native roff viewer.
.
By default, the formatted input is displayed with the
gxditview(1)
program, being distributed together with groff, or with
xditview(1),
which is distributed as a standard X tool.
.
.
The following modes do not use the
groffer
viewing features.
.
They are only interesting for advanced applications.
.
.
Generate device output with plain
groff
without using the special viewing features of
R groffer .
If no device was specified by option
the
groff
default
ps
is assumed.
.
.
Display the source code of the input without formatting; equivalent to
.
.
.
.
Equivalent to
.
.
Set the viewer program for
pdf
mode.
.
This can be a file name or a program to be searched in
.
In each case, arguments can be provided additionally.
.
.
Equivalent to
.
.
Set the viewer program for
ps
mode.
.
This can be a file name or a program to be searched in
.
Common Postscript viewers inlude
gv(1),
ghostview(1),
and
gs(1),
.
In each case, arguments can be provided additionally.
.
.
Equivalent to
.
.
Equivalent to
.
.
Choose tty display mode, that means displaying in a text pager even
when in X; eqivalent to
.
.
Equivalent to
.
.
Set the web browser program for viewing in
www
mode.
.
Each program that accepts html input and allows the
I file://localhost/ dir / file
syntax on the command line is suitable as viewer program; it can be
the path name of an executable file or a program in
.
In each case, arguments can be provided additionally.
.
.
Equivalent to
.
.
Set the viewer program for
x
mode.
.
Suitable viewer programs are
gxditview(1)
and
xditview(1).
.
But the argument can be any executable file or a program in
.
In each case, arguments can be provided additionally.
.
.
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
R groff .
.
Postprocessors, macro packages, compatibility with classical
R troff ,
and much more can be manually specified.
.
.
Options for Development
.
Print debugging information for development only.
.
Actually, a function call stack is printed if an error occurs.
.
.
Specify the shell under which the groffer script should be run.
.
The script first tests whether this option is set (either by
configuration, within
or as a command line option); if so, the script is rerun under the
shell program specified with the option argument.
.
.
Output the roff source code of the input files without further
processing.
.
This is the equivalent
.
.
Other useful debugging options are the
groff
options
and
and option
.
.
Options related to groff
.
All short options of
groffer
are compatible with the short options of
groff(1).
.
The following of
groff
options have either an additional special meaning within
groffer
or make sense for normal usage.
.
.
Because of the special outputting behavior of the
groff
options
and
groffer
was designed to be switched into
groff
mode by these; the
groffer
viewing features are disabled there.
.
The other
groff
options do not switch the mode, but allow to customize the formatting
process.
.
.
This generates an ascii approximation of output in text modes.
.
That could be important when the text pager has problems with control
sequences.
.
.
Add
file
as a
groff
macro file.
.
This is useful in case it cannot be recognized automatically.
.
.
Send the argument
opt_or_arg
as an option or option argument to the actual
groff
postprocessor.
.
.
.
This option determines
R groff 's
output device.
.
The most important devices are the text output devices for referring
to the different character sets, such as
R ascii ,
R utf8 ,
R latin1 ,
and others.
.
Each of these arguments switches
groffer
into a text mode using this device, to
mode tty
if the actual mode is not a text mode.
.
The following
devname
arguments are mapped to the corresponding
groffer
option:
R dvi ,
R html ,
and
R ps .
All
X*
arguments are mapped to mode
R X .
Each other
devname
argument switches to
mode groff
using this device.
.
.
Switch into
groff
mode and show only the
groff
calling pipe without formatting the input.
.
This an advanced option from
groff(1) ,
only useful for debugging.
.
.
was made equivalent to
this slightly enhances the facility of
R groff 's
option.
.
.
Switch into
groff
mode and format the input with
groff
intermediate output without postprocessing; see
groff_out(1).
This is equivalent to option
of
R man ,
which can be used as well.
.
.
All other
groff
options are supported by
R groffer ,
but they are just transparently transferred to
groff
without any intervention.
.
The options that are not explicitly handled by
groffer
are transparently passed to
R groff .
.
Therefore these transparent options are not documented here, but in
groff(1).
Due to the automatism in
R groffer ,
none of these
groff
options should be needed, except for advanced usage.
.
.
X Window toolkit Options
.
The following long options were adapted from the corresponding X
Toolkit options.
.
groffer
will pass them to the actual viewer program if it is an X Window
program.
.
Otherwise these options are ignored.
.
.
Unfortunately these options use the old style of a single minus for
long options.
.
For
groffer
that was changed to the standard with using a double minus for long
options, for example,
groffer
uses the option
for the
X
option
.
.
See
X(1),
X(7),
and the documentation on the X toolkit options for more details on
these options and their arguments.
.
.
Set the background color of the viewer window.
.
.
Specifies the color of the border surrounding the viewer window.
.
.
This is equivalent to
.
.
Specifies the width in pixels of the border surrounding the viewer
window.
.
.
Set the X display on which the viewer program shall be started, see the
X Window
documentation for the syntax of the argument.
.
.
Set the foreground color of the viewer window.
.
.
This is equivalent to
.
.
Set the font used by the viewer window.
.
The argument is an X font name.
.
.
This is equivalent to
.
.
Set the geometry of the display window, that means its size and its
starting position.
.
See
X(7)
for the syntax of the argument.
.
.
Set X resolution in dpi (dots per inch) in some viewer programs.
.
The only supported dpi values are
75
and
R 100 .
.
Actually, the default resolution for
groffer
is set to
R 75 .
.
.
Reverse foreground and background color of the viewer window.
.
.
Set the title for the viewer window.
.
.
Set X resource.
.
.
Options from man
.
The long options of
groffer
were synchronized with the long options of
R GNU man .
.
All long options of
GNU man
are recognized, but not all of these options are important to
R groffer ,
so most of them are just ignored.
.
.
The following two options were added by
groffer
for choosing whether the file name arguments are interpreted as names
for local files or as a search pattern for man pages.
.
The default is looking up for local files.
.
.
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 whether it is an existing file.
.
.
Do not check for man\~pages.
.
is the corresponding
man
option.
.
.
In the following, the
man
options that have a special meaning for
groffer
are documented.
.
.
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.
.
.
In searching man\~pages, retrieve all suitable documents instead of
only one.
.
.
In text modes, display ASCII translation of special characters.
.
.
Eqivalent to
groffer
.
.
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
R ncurses .
.
.
.
Set the language for man pages.
.
This has the same effect, but overwrites
.
.
Print the location of the retrieved files to standard error.
.
.
Do not display the location of retrieved files; this resets a former
call to
.
This was added by
R groffer .
.
.
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.
.
.
Set the pager program in tty mode; default is
R less .
This is equivalent to
.
.
Restrict searching for man\~pages to the given
R sections ,
a colon-separated list.
.
.
Search for man pages for the given operating systems; the argument
systems
is a comma-separated list.
.
.
Instead of displaying the content, get the one-liner description from
the retrieved man\~page files \[em] or say that it is not a man\~page.
.
.
Eqivalent to
.
.
Additionally, the following short option of
man
is supported as well.
.
.
Filespec Arguments
.
A
filespec
parameter is an argument meaning an input source, such as a file name
or template for searching man\~pages.
.
These input sources are collected and composed into a single output
file such as
groff
does.
.
.
The strange POSIX behavior that maps all arguments behind the first
non-option argument into
filespec
arguments is ignored.
.
The GNU behavior to recognize options even when mixed with
filespec
arguments is used througout.
.
But, as usual, the double minus argument
still takes all following arguments as
R filespecs .
.
.
Each
filespec
parameters can have one of the following forms.
.
.
No
filespec
parameters means that
groffer
waits for standard input.
.
The minus option
stands for standard input, too, but can occur several times.
.
Next
filespec
is tested whether it is the path name of an existing file.
.
Otherwise it is assumed as a searching pattern for a man\~page.
.
.
On each system, the man pages are sorted according to their content
into several sections.
.
The
classical man sections
have a single-character name, either are a digit from
1
to
9
or one of the characters
n
or
R o .
.
In the following, a stand-alone character
s
means this scheme.
.
.
The internal precedence of
man
for searching man pages with the same name within several sections
goes according to the classical single-character sequence.
.
On some systems, this single character can be extended by a following
string.
.
But the special
groffer
man page facility is based on the classical single character sections.
.
.
I man: name ( section )
and
B name ( section )
search the man\~page
name
in man\~section\~\c
R section ,
where
section
can be any string, but it must exist in the
man
system.
.
.
Next some patterns based on the
classical man sections
were constructed.
.
I man: name . s
and
B name . s
search for a man\~page
name
in man\~section
s
if
s
is a
classical man section
mentioned above.
.
Otherwise search for a man\~page named
R name.s
in the lowest
man
section.
.
.
Now
I man: name
searches for a man\~page in the lowest man\~section that has a
document called
R name .
.
.
The pattern
s name
originates from a strange argument parsing of the
man
program.
.
If
s
is a
classical man section
interpret it as a search for a man\~page called
name
in man\~section
R s ,
otherwise interpret
s
as a file argument and
name
as another
filespec
argument.
.
.
We are left with the argument
name
which is not an existing file.
.
So this searches for the man\~page called
name
in the lowest man\~section that has a document for this name.
.
.
Several file name arguments can be supplied.
.
They are mixed by
groff
into a single document.
.
Note that the set of option arguments must fit to all of these file
arguments.
.
So they should have at least the same style of the
groff
language.
.
.
OUTPUT MODES
.
By default, the
groffer
program collects all input into a single file, formats it with the
groff
program for a certain device, and then chooses a suitable viewer
program.
.
The device and viewer process in
groffer
is called a
R mode .
.
The mode and viewer of a running
groffer
program is selected automatically, but the user can also choose it
with options.
.
.
The modes are selected by option the arguments of
Additionally, each of this argument can be specified as an option of
its own, such as
Most of these modes have a viewer program, which can be chosen by an
option that is constructed like
.
.
Several different modes are offered, graphical X modes, text modes,
and some direct
groff
modes for debugging and development.
.
.
By default,
groffer
first tries whether
x
mode is possible, then
ps
mode, and finally
tty
mode.
.
This mode testing sequence for
auto
mode can be changed by specifying a comma separated list of modes
with the option
.
.
The searching for man\~pages and the decompression of the input are
active in every 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
and the option
are used for specifying the X display to be used.
.
If neither is given,
groffer
assumes that no X and changes to one text mode.
.
You can change this automatic behavior by the option
.
.
Known viewers for the graphical display modes and their standard X
Window viewer progams are
.
X Window roff viewers such as
gxditview(1)
or
xditview(1)
(in
x
or
X
mode),
.
in a Postscript viewer
(ps
mode),
.
in a dvi viewer program
(dvi
mode),
.
in a PDF viewer
(pdf
mode),
.
in a web browser
(html
or
www
mode),
.
.
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 some time to transform the input into the PDF
format, so it was not chosen as the major mode.
.
.
These graphical viewers can be customized by options of the X Window
Toolkit.
.
But the
groffer
options use a leading double minus instead of the single minus used by
the X Window Toolkit.
.
.
Text mode
.
There are to modes for text output, mode
text
for plain output without a pager and mode
tty
for a text output on a text terminal using some pager program.
.
.
If the variable
is not set or empty, groffer assumes that it should use
tty
mode.
.
.
In the actual implementation, the groff output device
latin1
is chosen for text modes.
.
This can be changed by specifying option
or
.
.
The pager to be used can be specified by one of the options
and
or by the environment variable
If all of this is not used the
less(1)
program with the option
for correctly displaying control sequences is used as the default
pager.
.
.
Special Modes for Debugging and Development
.
These modes use the
groffer
file determination and decompression.
.
This is combined into a single input file that is fed directly into
groff
with different strategy without the
groffer
viewing facilities.
.
These modes are regarded as advanced, they are useful for debugging
and development purposes.
.
.
The
source
mode with just displays the generated input.
.
The
groff
mode passes the input to
groff
using only some suitable options provided to
R groffer .
.
This enables the user to save the generated output into a file or pipe
it into another program.
.
.
In
groff
mode, the option
disables post-processing, thus producing the
groff intermediate
R output .
.
In this mode, the input is formatted, but not postprocessed; see
groff_out(5)
for details.
.
.
All
groff
short options are supported by
R groffer .
.
.
MAN\~PAGE\~SEARCHING
.
The default behavior of groffer is to first test whether a file
parameter represents a local file; if it is not an existing file name,
it is assumed to represent a name of a man\~page.
.
This behavior can be modified by the following options.
.
.
forces to interpret all file parameters as filespecs for searching
man\~pages.
.
disable the man searching; so only local files are displayed.
.
.
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.
.
.
The groffer program provides a search facility for man\~pages.
.
All long options, all environment variables, and most of the
functionality of the GNU
man(1)
program were implemented.
.
This inludes the extended file names of man\~pages, for example,
the man\~page of
groff
in man\~section 7 may be stored under
where
is part of the man\~path, the subdirectory
man7
and the file extension
.7
refer to the man\~section 7;
.gz
shows the compression of the file.
.
.
The
cat\~pages
(preformatted man\~pages) are intentionally excluded from the search
because groffer is a roff program that wants to format by its own.
.
With the excellent performance of the actual computers, the
preformatted man\~pages aren't necessary any longer.
.
.
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
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 a reasonable default path from
is searched for man\~pages.
.
.
If this does not work, the
manpath(1)
program for determining a path of man directories is tried.
.
.
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:
.
.
.
.
.
.
.
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
The precedence is similar to the locale case above from highest to
lowest precedence:
.
Topic
.
.
.
.
.
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 each filespec argument,
several sections as a colon-separated list in command line option
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
R extension .
This is a postfix that acts like a subsection.
.
It can be specified by
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
R .gz ,
R .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.
.
.
ENVIRONMENT
.
The groffer programs supports many system variables, most of them by
courtesy of other programs.
.
All environment variables of
groff(1)
and GNU
man(1)
and some standard system variables are honored.
.
.
Native groffer Variables
.
Store options for a run of groffer.
.
The options specified in this variable are overridden by the options
given on the command line.
.
The content of this variable is run through the shell builtin `eval';
so arguments containing white-space or special shell characters should
be quoted.
.
.
System Variables
.
The groffer program is a shell script that is run through
R /bin/sh ,
which can be internally linked to programs like
bash(1).
The corresponding system environment is automatically effective.
.
The following variables have a special meaning for groffer.
.
.
If this variable is set this indicates that the X Window system is
running.
.
Testing this variable decides on whether graphical or text output is
generated.
.
This variable should not be changed by the user carelessly, but it can
be used to start the graphical groffer on a remote X terminal.
.
For example, depending on your system, groffer can be started on the
second monitor by the command
ell_cmd DISPLAY=:0.1\~groffer\~ what.ever &
.
.
If one of these variables is set (in the above sequence), its content
is interpreted as the locale, the language to be used, especially when
retrieving man\~pages.
.
A locale name is typically of the form
R language [\c
_\c
R territory [\c
.\c
R codeset [\c
@\c
R modifier ]]],
where
language
is an ISO 639 language code,
territory
is an ISO 3166 country code, and
codeset
is a character set or encoding identifier like ISO-8859-1 or UTF-8;
see
setlocale(3).
.
The locale values\~\c
C
and
POSIX
stand for the default, i.e. the man\~page directories without a
language prefix.
.
This is the same behavior as when all 3\~variables are unset.
.
.
This variable can be used to set the pager for the tty output.
.
For example, to disable the use of a pager completely set this
variable to the
cat(1)
program
ell_cmd PAGER=cat\~groffer\~ anything
.
.
All programs within the groffer shell script are called without a
fixed path.
.
Thus this environment variable determines the set of programs used
within the run of groffer.
.
.
If set to a non-empty value this chooses the POSIX mode.
.
This is done internally by some shells.
.
groffer
ignores the bad POSIX behavior for option processing, that means that
option processing will be finished as soon as a non-option argument is
found.
.
Instead the GNU behavior of freely mixing options and
filespec
arguments is used in any case.
.
Usually, you do not want to set this environment variable externally.
.
.
Groff Variables
.
The groffer program internally calls groff, so all environment
variables documented in
groff(1)
are internally used within groffer as well.
.
The following variables have a direct meaning for the groffer program.
.
If the value of this variable is an existing, writable directory,
groffer uses it for storing its temporary files, just as groff does.
.
.
Man Variables
.
Parts of the functionality of the man\~program were implemented in
groffer; support for all environment variables documented in
man(1)
was added to groffer, but the meaning was slightly modified due to the
different approach in groffer; but the user interface is the same.
.
The man environment variables can be overwritten by options provided
with
which in turn is overwritten by the command line.
.
.
Restrict the search for man\~pages to files having this extension.
.
This is overridden by option
see there for details.
.
.
This variable contains options as a preset for
man(1).
As not all of these are relevant for groffer only the essential parts
of its value are extracted.
.
The options specified in this variable overwrite the values of the
other environment variables taht are specific to man.
.
All options specified in this variable are overridden by the options
given on the command line.
.
.
If set, this variable contains the directories in which the man\~page
trees are stored.
.
This is overridden by option
.
.
If this is a colon separated list of section names, the search for
man\~pages is restricted to those manual sections in that order.
.
This is overridden by option
.
.
If this is set to a comma separated list of names these are interpreted
as man\~page trees for different operating systems.
.
This variable can be overwritten by option
see there for details.
.
.
The environment variable
is ignored by groffer because the necessary preprocessors are
determined automatically.
.
.
CONFIGURATION FILES
.
The
groffer
program can be preconfigured by two configuration files.
.
This configuration can be overridden at each program start by command
line options or by the environment variable
.
.
System-wide configuration file for groffer.
.
.
User-specific configuration file for groffer, where
denotes the user's home directory.
.
This script is called after the system-wide configuration file to
enable overriding by the user.
.
.
Their lines either start with a minus character or are shell commands.
.
Arbitrary spaces are allowed at the beginning, they are just ignored.
.
The lines with the beginning minus are appended to the existing value
of $GROFFER_OPT.
.
This easily allows to set general
groffer
options that are used with any call of
R groffer .
.
.
After the transformation of the minus lines the emerging shell scripts
that are called by
groffer
using the `\c
R filename '
syntax.
.
.
The only option that needs a minus line in the configuration files is
The reason is that its argument must be called at a very early stage
before the whole syntax of the configuration can be transformed.
.
.
It makes sense to use these configuration files for the following
tasks:
.
Preset command line options by writing them into lines starting with a
minus sign.
.
Preset environment variables recognized by groffer.
.
Write a function for calling a viewer program for a special
mode
and feed this name into its corresponding
option.
.
Note that the name of such a function must coincide with some existing
program in the system path
in order to be recognized by groffer.
.
.
As an example, consider the following configuration file in
~/.groff/groffer.conf, say.
.
# groffer configuration file
#
# groffer options that are used in each call of groffer
--shell=/bin/bash
--resolution=100
--foreground=DarkBlue
--x-viewer='gxditview -geometry 850x800'
#
# some shell commands
if test "$DISPLAY" = ""; then
DISPLAY='localhost:0.0'
fi
date >>~/mygroffer.log
.
.
This configuration sets four
groffer
options and runs two shell commands.
.
This has the following effects:
.
.
Lines starting with a
#
character
are
.
.
Use
/bin/bash
as the shell to run the
groffer
script.
.
.
Take a resolution of
100 dpi
and a text color of
DarkBlue
in all viewers that support this.
.
.
Force
gxditview(1)
as the X-mode viewer using the geometry option for setting the width
to
850 dpi
and the height to
800
R dpi .
.
.
The variable
is set to
R localhost:0.0
which allows to start
groffer
in the standard X display, even when the program is called from a text
console.
.
.
Just for fun, the date of each
groffer
start is written to the file
mygroffer.log
in the home directory.
.
.
EXAMPLES
.
The usage of groffer is very easy.
.
Usually, it is just called with a file name or man\~page.
.
The following examples, however, show that groffer has much more fancy
capabilities.
.
.
Decompress, format and display the compressed file
meintro.ms.gz
in the directory
R /usr/local/share/doc/groff ,
using
gxditview
as graphical viewer when in X Window, or the
less(1)
pager program when not in X.
.
.
If the file
./groff
exists use it as input.
.
Otherwise interpret the argument as a search for the man\~page named
groff
in the smallest possible man\~section, being secion 1 in this case.
.
.
search for the man\~page of
groff
even when the file
./groff
exists.
.
.
search the man\~page of
groff
in man\~section
R 7 .
This section search works only for a digit or a single character from
a small set.
.
.
If the file
./fb.modes
does not exist interpret this as a search for the man\~page of
R fb.modes .
As the extension
modes
is not a single character in classical section style the argument is
not split to a search for
R fb .
.
.
.
The arguments that are not existing files are looked-up as the
following man\~pages:
groff
(automatic search, should be found in man\~section\~1),
troff
(in section\~1),
and
roff
(in the section with the lowest number, being\~7 in this case).
.
The quotes around
\[cq]troff(1)\[cq]
are necessary because the paranthesis are special shell characters;
escaping them with a backslash character
\[rs](
and
\[rs])
would be possible, too.
.
The formatted files are concatenated and displayed in one piece.
.
.
.
Retrieve the German man\~page (language
R de )
for the
ls
program, decompress it, format it to
html
format
(www
mode) and view the result in the web browser
galeon .
The option
guarantees that the man\~page is retrieved, even when a local file
ls
exists in the actual directory.
.
.
.
Get the man\~page called
roff
in man\~section 7, decompress it, and print its unformatted content,
its source code.
.
.
.
Decompress the standard input, send this to
groff
intermediate mode without post-processing (groff option
using macro package by
foo
(groff option
.
.
.
Display the word CB]WOW!] in a small window in constant-width
bold font, using color yellow on red background.
.
.
COMPATIBILITY
.
The
groffer
shell script is compatible with both GNU and POSIX.
.
POSIX compatibility refers to
IEEE P1003.2/D11.2
of September 1991, a very early version of the POSIX standard that is
still freely available in the internet.
.
Unfortunately, this version of the standard has `local' for shell
function variables removed.
.
As `local' is needed for serious programming this temporary POSIX
deprecation was ignored.
.
.
Most GNU shells are compatible with this interpretation of POSIX, but
provide much more facilities.
.
Nevertheless this script uses only a restricted set of shell language
elements and shell builtins.
.
The groffer script should work on most actual free and commercial
operating systems.
.
.
The groffer program provides its own parser for command line options;
it can handle option arguments and file names containing white space
and a large set of special characters.
.
.
The groffer shell script was tested with the following common
implementations of the GNU shells:
POSIX
sh(1),
bash(1),
and others.
.
Free POSIX compatible shells and shell utilities for most operating
systems are available at the
.
.
The shell can be chosen by the option
This option can also be given to the environment variable
If you want to write it to one of the
groffer
configuration files you must use the single option style, a line
starting with
.
.
The groffer program provides its own parser for command line arguments
that is compatible to both POSIX
getopts(1)
and GNU
getopt(1)
except for shortcuts of long options.
.
The following standard types of options are supported.
.
.
A single minus always refers to single character option or a
combination thereof, for example, the
groffer
short option combination
is equivalent to
.
.
Long options are options with names longer than one character; they
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,
is equivalent to
.
.
An argument of
ends option parsing; all further command line arguments are
interpreted as file name 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 line
is, by default, equivalent to
.
.
This behavior can be changed by setting the environment variable
to a non-empty value.
.
Then the strange POSIX non-option behavior is adopted, i. e. option
processing is stopped as soon as the first non-option argument is
found and each following argument is taken as a file name.
.
For example, in posixly correct mode, the command line
is equivalent to
As this leads to unwanted behavior in most cases, most people do not
want to set
.
.
SEE ALSO
.
troff(1)
Details on the options and environment variables available in
R groff ;
all of them can be used with groffer.
.
.
man(1)
The standard program to diplay man\~pages.
.
The information there is only useful if it is the man\~page for
R GNU\~man .
Then it documents the options and environment variables that are
supported by groffer.
.
.
R xditview (1x)
Viewers for groffer's
x
mode.
.
.
ghostview(1)
Viewers for groffer's
ps
mode.
.
.
gs(1)
Transformer from
ps
to
R pdf ;
and a
ps
viewer.
.
.
xpdf(1)
Viewers for
pdf
files.
.
.
dvilx(1)
Viewers for groffer's
dvi
mode.
.
.
less(1)
Standard pager program for the
tty
R mode .
.
.
bzip2(1)
The decompression programs supported by groffer.
.
.
groff(7)
Documentation of the
groff
language.
.
.
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).
.
.
AUTHOR
.
.
COPYING
.
.
\" --------------------------------------------------------------------
.