The groffer
program can be preconfigured by two configuration
files.
/etc/groff/groffer.conf
System-wide configuration file for groffer
.
$HOME/.groff/groffer.conf
User-specific configuration file for groffer
, where $HOME
denotes the user's home directory. This file is called
after the system-wide configuration file to enable
overriding by the user.
Both files are handled for the configuration, but the
configuration file in /etc
comes first; it is overwritten by the
configuration file in the home directory; both configuration
files are overwritten by the environment variable GROFFER_OPT;
everything is overwritten by the command-line arguments.
The configuration files contain options that should be called as
default for every groffer
run. These options are written in
lines such that each contains either a long option, a short
option, or a short option cluster; each with or without an
argument. So each line with configuration information starts
with a minus character '-
'; a line with a long option starts with
two minus characters '--
', a line with a short option or short
option cluster starts with a single minus '-
'.
The option names in the configuration files may not be
abbreviated, they must be exact.
The argument for a long option can be separated from the option
name either by an equal sign '=
' or by whitespace, i.e. one or
several space or tab characters. An argument for a short option
or short option cluster can be directly appended to the option
name or separated by whitespace. The end of an argument is the
end of the line. It is not allowed to use a shell environment
variable in an option name or argument.
It is not necessary to use quotes in an option or argument,
except for empty arguments. An empty argument can be provided by
appending a pair of quotes to the separating equal sign or
whitespace; with a short option, the separator can be omitted as
well. For a long option with a separating equal sign '=
', the
pair of quotes can be omitted, thus ending the line with the
separating equal sign. All other quote characters are cancelled
internally.
In the configuration files, arbitrary whitespace is allowed at
the beginning of each line, it is just ignored. Each whitespace
within a line is replaced by a single space character ' '
internally.
All lines of the configuration lines that do not start with a
minus character are ignored, such that comments starting with '#
'
are possible. So there are no shell commands in the
configuration files.
As an example, consider the following configuration file that can
be used either in /etc/groff/groffer.conf
or
~/.groff/groffer.conf .
# groffer configuration file
#
# groffer options that are used in each call of groffer
--foreground=DarkBlue
--resolution=100
--viewer=gxditview -geometry 900x1200
The lines starting with #
are just ignored, so they act as
command lines. This configuration sets four groffer
options (the
lines starting with '-
'). This has the following effects:
* Use a text color of DarkBlue
in all viewers that support this,
such as gxditview
.
* Use a resolution of 100dpi
in all viewers that support this,
such as gxditview
. By this, the default device in x mode is
set to X100
.
* Force gxditview
(1) as the x-mode viewer using the geometry
option for setting the width to 900px
and the height to 1200px
.
This geometry is suitable for a resolution of 100dpi
.
* Use xpdf
(1) as the pdf-mode viewer with the argument -Z 150
.