файлы макросов в системе набора GNU roff (macro files in the GNU roff typesetting system)
Именование (Naming)
Classical roff systems were designed before the conventions of
the modern C getopt(3) call evolved, and used a naming scheme for
macro packages that looks odd to modern eyes. Macro packages
were always included with the option -m
; when this option was
directly followed by its argument without an intervening space,
this looked like a long option preceded by a single minus — a
sensation in the computer stone age. To make this invocation
form work, classical troff macro packages used names that started
with the letter 'm', which was omitted in the naming of the macro
file.
For example, the macro package for the man pages was called man,
while its macro file tmac.an. So it could be activated by the
argument an to option -m
, or -man
for short.
For similar reasons, macro packages that did not start with an
'm' had a leading 'm' added in the documentation and in speech;
for example, the package corresponding to tmac.doc was called
mdoc in the documentation, although a more suitable name would be
doc. For, when omitting the space between the option and its
argument, the command-line option for activating this package
reads -mdoc
.
To cope with all situations, actual versions of groff(1) are
smart about both naming schemes by providing two macro files for
the inflicted macro packages; one with a leading 'm' the other
one without it. So in groff, the man macro package may be
specified as one of the following four methods:
sh# groff -m man
sh# groff -man
sh# groff -mman
sh# groff -m an
Recent packages that do not start with 'm' do not use an
additional 'm' in the documentation. For example, the www macro
package may be specified only as one of the two methods:
sh# groff -m www
sh# groff -mwww
Obviously, variants like -mmwww would not make much sense.
A second strange feature of classical troff was to name macro
files in the form tmac.name. In modern operating systems, the
type of a file is specified as a postfix, the file name
extension. Again, groff copes with this situation by searching
for both anything.tmac
and tmac.
anything if only anything is
specified.
The easiest way to find out which macro packages are available on
a system is to check the man page groff(1), or the contents of
the tmac directories.
In groff, most macro packages are described in man pages called
groff_name(7), with a leading 'm' for the classical packages.