4 Copyright (C) 1989, 2002, 2003, 2004, 2005, 2006, 2007, 2008
5 Free Software Foundation, Inc.
6 Rewritten in 2002 by Bernd Warken <bwarken@mayn.de>
8 Permission is granted to copy, distribute and/or modify this document
9 under the terms of the GNU Free Documentation License, Version 1.1 or
10 any later version published by the Free Software Foundation; with the
11 Invariant Sections being this .ig-section and AUTHOR, with no
12 Front-Cover Texts, and with no Back-Cover Texts.
14 A copy of the Free Documentation License is included as a file called
15 FDL in the main directory of the groff source package.
19 .\" --------------------------------------------------------------------
20 .\" Environment variable
25 .\" --------------------------------------------------------------------
33 .\" --------------------------------------------------------------------
35 .\" --------------------------------------------------------------------
37 .TH GROFF @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
39 groff \- front-end for the groff document formatting system
42 .\" --------------------------------------------------------------------
44 .\" --------------------------------------------------------------------
47 .OP \-abcegiklpstzCEGNRSUVXZ
75 .RI [ option\~ .\|.\|.]
79 .\" --------------------------------------------------------------------
81 .\" --------------------------------------------------------------------
83 This document describes the
85 program, the main front-end for the
87 document formatting system.
91 program and macro suite is the implementation of a
93 system within the free software collection
94 .UR http://\:www.gnu.org
100 system has all features of the classical
102 but adds many extensions.
107 program allows to control the whole
109 system by command line options.
111 This is a great simplification in comparison to the classical case (which
115 .\" --------------------------------------------------------------------
117 .\" --------------------------------------------------------------------
119 The command line is parsed according to the usual \f[CR]GNU\f[]
122 The whitespace between a command line option and its argument is
125 Options can be grouped behind a single `\-' (minus character).
129 (minus character) denotes the standard input.
135 is a wrapper program for
137 both programs share a set of options.
141 program has some additional, native options and gives a new meaning to
146 On the other hand, not all
148 options can be fed into
152 .\" --------------------------------------------------------------------
153 .SS Native groff Options
154 .\" --------------------------------------------------------------------
156 The following options either do not exist for
158 or are differently interpreted by
164 Set default input encoding used by
195 Print a help message.
200 This option may be used to specify a directory to search for
201 files (both those on the command line and those named in
210 The current directory is always searched first.
211 This option may be specified more than once;
212 the directories are searched in the order specified.
213 No directory search is performed for files specified using an absolute path.
214 This option implies the
223 This is run before any other preprocessor.
227 manual page for its behaviour if no
236 Set input encoding used by
247 Send the output to a spooler program for printing.
249 The command that should be used for this is specified by the
251 command in the device description file, see
252 .BR \%groff_font (@MAN5EXT@).
253 If this command is not present, the output is piped into the
267 to the spooler program.
268 Several arguments should be passed with a separate
278 before passing it to the spooler program.
283 Don't allow newlines within
287 This is the same as the
302 .BI \-P\ \-option \ \-P\ arg
307 to the postprocessor.
309 The option must be specified with the necessary preceding minus
316 does not prepend any dashes before passing it to the postprocessor.
324 No mechanism is provided for passing arguments to
328 options have equivalent language elements that can be specified within
332 .BR \%@g@refer (@MAN1EXT@)
350 and disable the following
359 For security reasons, safer mode is enabled by default.
378 .BR \%groff_out (@MAN5EXT@).
382 calls a postprocessor to convert
384 .I intermediate output
395 TeX DVI format (postprocessor is
402 HTML and XHTML output (preprocessors are
407 .BR \%post-grohtml ).
411 PostScript output (postprocessor is
418 For the following TTY output devices (postprocessor is always
421 selects the output encoding:
427 7bit \f[CR]ASCII\f[].
431 \%Latin-1 character set for EBCDIC hosts.
439 Unicode character set in \%UTF-8 encoding.
445 The default device is
453 Reverts to the (old) unsafe behaviour; see option
461 Output version information of
463 and of all programs that are run by it; that is, the given command line
464 is parsed in the usual way, passing
471 Output the pipeline that would be run by
473 (as a wrapper program) on the standard output, but do not execute it.
474 If given more than once,
475 the commands are both printed on the standard error and run.
480 Suppress output generated by
482 Only error messages are printed.
487 Do not automatically postprocess
488 .I groff intermediate output
493 to appear on standard output,
494 replacing the usual postprocessor output; see
495 .BR \%groff_out (@MAN5EXT@).
498 .\" --------------------------------------------------------------------
499 .SS Transparent Options
500 .\" --------------------------------------------------------------------
502 The following options are transparently handed over to the formatter
509 These options are described in more detail in
510 .BR @g@troff (@MAN1EXT@).
514 \f[CR]ASCII\f[] approximation of output.
518 Backtrace on error or warning.
522 Disable color output.
525 .BR \%grotty (@MAN1EXT@)
526 man page for more details.
530 Enable compatibility mode.
546 Set default font family.
550 Set path for font DESC files.
554 Process standard input after the specified input files.
563 .BR \%groff_tmac (@MAN5EXT@).
567 Path for macro files.
571 Number the first page
596 .\" --------------------------------------------------------------------
598 .\" --------------------------------------------------------------------
602 implements the infrastructure of classical roff; see
604 for a survey on how a
606 system works in general.
608 Due to the front-end programs available within the
613 .IR "classical roff" .
615 This section gives an overview of the parts that constitute the
625 This section can be regarded as a guide to the documentation around
631 .\" --------------------------------------------------------------------
633 .\" --------------------------------------------------------------------
639 to format the input is controlled globally with the requests
645 .BR groff_tmac (@MAN5EXT@)
646 for the `papersize' macro package which provides a convenient interface.
651 paper size, giving the actual dimensions of the paper sheets, is
652 controlled by output devices like
654 with the command line options
659 .BR groff_font (@MAN5EXT@)
660 and the man pages of the output devices for more details.
662 uses the command line option
664 to pass options to output devices; for example, the following selects
665 A4 paper in landscape orientation for the PS device:
669 groff -Tps -P-pa4 -P-l ...
673 .\" --------------------------------------------------------------------
675 .\" --------------------------------------------------------------------
679 program is a wrapper around the
680 .BR @g@troff (@MAN1EXT@)
683 It allows to specify the preprocessors by command line options and
684 automatically runs the postprocessor that is appropriate for the
687 Doing so, the sometimes tedious piping mechanism of classical
694 program can be used for guessing the correct
696 command line to format a file.
700 .BR \%groffer (@MAN1EXT@)
701 program is an allround-viewer for
706 .\" --------------------------------------------------------------------
708 .\" --------------------------------------------------------------------
712 preprocessors are reimplementations of the classical preprocessors
713 with moderate extensions.
715 The standard preprocessors distributed with the
720 .BR @g@eqn (@MAN1EXT@)
721 for mathematical formul\(ae,
724 .BR @g@grn (@MAN1EXT@)
730 .BR @g@pic (@MAN1EXT@)
731 for drawing diagrams,
734 .BR @g@chem (@MAN1EXT@)
735 for chemical structure diagrams,
738 .BR \%@g@refer (@MAN1EXT@)
739 for bibliographic references,
742 .BR \%@g@soelim (@MAN1EXT@)
743 for including macro files from standard locations,
749 .BR @g@tbl (@MAN1EXT@)
753 A new preprocessor not available in classical
756 .BR \%preconv (@MAN1EXT@)
757 which converts various input encodings to something
761 It is always run first before any other preprocessor.
764 Besides these, there are some internal preprocessors that are
765 automatically run with some devices.
767 These aren't visible to the user.
770 .\" --------------------------------------------------------------------
772 .\" --------------------------------------------------------------------
774 Macro packages can be included by option
779 system implements and extends all classical macro packages in a
780 compatible way and adds some packages of its own.
782 Actually, the following macro packages come with
787 The traditional man page format; see
788 .BR \%groff_man (@MAN7EXT@).
789 It can be specified on the command line as
796 The general package for man pages; it automatically recognizes
797 whether the documents uses the
801 format and branches to the corresponding macro package.
803 It can be specified on the command line as
810 The \f[CR]BSD\f[]-style man page format; see
811 .BR \%groff_mdoc (@MAN7EXT@).
812 It can be specified on the command line as
822 .BR \%groff_me (@MAN7EXT@).
823 It can be specified on the command line as
833 .BR \%groff_mm (@MAN7EXT@).
834 It can be specified on the command line as
844 .BR \%groff_ms (@MAN7EXT@).
845 It can be specified on the command line as
852 HTML-like macros for inclusion in arbitrary
855 .BR \%groff_www (@MAN7EXT@).
858 Details on the naming of macro files and their placement can be found
860 .BR \%groff_tmac (@MAN5EXT@);
861 this man page also documents some other, minor auxiliary macro packages
865 .\" --------------------------------------------------------------------
866 .SS "Programming Language"
867 .\" --------------------------------------------------------------------
869 General concepts common to all
871 programming languages are described in
872 .BR roff (@MAN7EXT@).
877 extensions to the classical
879 language are documented in
880 .BR \%groff_diff (@MAN7EXT@).
885 language as a whole is described in the (still incomplete)
886 .IR "groff info file" ;
887 a short (but complete) reference can be found in
888 .BR groff (@MAN7EXT@).
891 .\" --------------------------------------------------------------------
893 .\" --------------------------------------------------------------------
900 .BR @g@troff (@MAN1EXT@).
901 It provides the features of both the classical
909 The command line option
914 .I "compatibility mode"
915 which tries to emulate classical
920 There is a shell script
921 .BR @g@nroff (@MAN1EXT@)
922 that emulates the behavior of classical
925 It tries to automatically select the proper output encoding, according to
929 The formatter program generates
930 .IR "intermediate output" ;
932 .BR \%groff_out (@MAN7EXT@).
935 .\" --------------------------------------------------------------------
937 .\" --------------------------------------------------------------------
941 the output targets are called
943 A device can be a piece of hardware, e.g., a printer, or a software
946 A device is specified by the option
950 devices are as follows.
954 Text output using the
960 Text output using the EBCDIC code page IBM cp1047 (e.g., OS/390 Unix).
972 Text output using the ISO \%Latin-1 (ISO \%8859-1) character set; see
973 .BR \%iso_8859_1 (7).
977 PostScript output; suitable for printers and previewers like
982 Text output using the Unicode (ISO 10646) character set with \%UTF-8
991 The postprocessor to be used for a device is specified by the
993 command in the device description file; see
994 .BR \%groff_font (@MAN5EXT@).
997 The default device is
1001 .\" --------------------------------------------------------------------
1003 .\" --------------------------------------------------------------------
1006 provides 3\~hardware postprocessors:
1009 .BR \%grotty (@MAN1EXT@)
1010 for text output using various encodings, e.g., on text-oriented
1011 terminals or line-printers.
1014 Today, most printing or drawing hardware is handled by the operating
1015 system, by device drivers, or by software interfaces, usually accepting
1018 Consequently, there isn't an urgent need for more hardware device
1024 software devices for conversion into other document file formats are
1027 .BR \%grodvi (@MAN1EXT@)
1031 .BR \%grohtml (@MAN1EXT@)
1032 for HTML and XHTML formats,
1035 .BR grops (@MAN1EXT@)
1039 Combined with the many existing free conversion tools this should
1040 be sufficient to convert a
1042 document into virtually any existing data format.
1045 .\" --------------------------------------------------------------------
1047 .\" --------------------------------------------------------------------
1049 The following utility programs around
1054 .BR \%addftinfo (@MAN1EXT@)
1057 font description files for use with
1061 .BR \%afmtodit (@MAN1EXT@)
1062 Create font description files for PostScript device.
1065 .BR \%@g@indxbib (@MAN1EXT@)
1066 Make inverted index for bibliographic databases.
1069 .BR lkbib (@MAN1EXT@)
1070 Search bibliographic databases.
1073 .BR \%@g@lookbib (@MAN1EXT@)
1074 Interactively search bibliographic databases.
1077 .BR \%pdfroff (@MAN1EXT@)
1078 Create PDF documents using
1082 .BR \%pfbtops (@MAN1EXT@)
1083 Translate a PostScript font in .pfb format to \f[CR]ASCII\f[].
1086 .BR \%tfmtodit (@MAN1EXT@)
1087 Create font description files for TeX DVI device.
1090 .\" --------------------------------------------------------------------
1092 .\" --------------------------------------------------------------------
1094 Normally, the path separator in the following environment variables is the
1095 colon; this may vary depending on the operating system.
1097 For example, DOS and Windows use a semicolon instead.
1101 .EnvVar GROFF_BIN_PATH
1102 This search path, followed by
1104 is used for commands that are executed by
1107 If it is not set then the directory where the
1109 binaries were installed is prepended to
1114 .EnvVar GROFF_COMMAND_PREFIX
1115 When there is a need to run different
1117 implementations at the same time
1119 provides the facility to prepend a prefix to most of its programs that
1120 could provoke name clashings at run time (default is to have none).
1122 Historically, this prefix was the character
1124 but it can be anything.
1138 .EnvVar GROFF_COMMAND_PREFIX
1139 to different values, the different
1141 installations can be addressed.
1143 More exactly, if it is set to prefix
1147 as a wrapper program internally calls
1151 This also applies to the preprocessors
1158 and to the utilities
1163 This feature does not apply to any programs different from the ones
1166 itself) since they are unique to the
1172 .EnvVar GROFF_ENCODING
1173 The value of this environment value is passed to the
1175 preprocessor to select the encoding of input files.
1177 Setting this option implies
1183 actually always calls
1186 If set without a value,
1194 command line option overrides the value of
1195 .EnvVar GROFF_ENCODING .
1198 .BR preconv (@MAN1EXT@)
1203 .EnvVar GROFF_FONT_PATH
1204 A list of directories in which to search for the
1206 directory in addition to the default ones.
1209 .BR @g@troff (@MAN1EXT@)
1211 .BR \%groff_font (@MAN5EXT@)
1216 .EnvVar GROFF_TMAC_PATH
1217 A list of directories in which to search for macro files in addition to
1218 the default directories.
1221 .BR @g@troff (@MAN1EXT@)
1223 .BR \%groff_tmac (@MAN5EXT@)
1228 .EnvVar GROFF_TMPDIR
1229 The directory in which temporary files are created.
1231 If this is not set but the environment variable
1233 instead, temporary files are created in the directory
1235 On MS-DOS and Windows\~32 platforms, the environment variables
1239 (in that order) are searched also, after
1240 .EnvVar GROFF_TMPDIR
1244 Otherwise, temporary files are created in
1247 .BR \%@g@refer (@MAN1EXT@),
1248 .BR \%groffer (@MAN1EXT@),
1249 .BR \%grohtml (@MAN1EXT@),
1251 .BR grops (@MAN1EXT@)
1252 commands use temporary files.
1256 .EnvVar GROFF_TYPESETTER
1257 Preset the default device.
1259 If this is not set the
1261 device is used as default.
1263 This device name is overwritten by the option
1267 .\" --------------------------------------------------------------------
1269 .\" --------------------------------------------------------------------
1271 There are some directories in which
1273 installs all of its data files.
1275 Due to different installation habits on different operating systems,
1276 their locations are not absolutely fixed, but their function is
1277 clearly defined and coincides on all systems.
1280 .\" --------------------------------------------------------------------
1281 .SS "groff Macro Directory"
1282 .\" --------------------------------------------------------------------
1284 This contains all information related to macro packages.
1286 Note that more than a single directory is searched for those files
1288 .BR \%groff_tmac (@MAN5EXT@).
1292 installation corresponding to this document, it is located at
1295 The following files contained in the
1296 .I groff macro directory
1297 have a special meaning:
1302 Initialization file for
1305 This is interpreted by
1307 before reading the macro sets and any input.
1312 Final startup file for
1315 It is parsed after all macro sets have been read.
1322 Macro file for macro package
1326 .\" --------------------------------------------------------------------
1327 .SS "groff Font Directory"
1328 .\" --------------------------------------------------------------------
1330 This contains all information related to output devices.
1332 Note that more than a single directory is searched for those files; see
1333 .BR @g@troff (@MAN1EXT@).
1337 installation corresponding to this document, it is located at
1340 The following files contained in the
1341 .I "groff font directory"
1342 have a special meaning:
1347 Device description file for device
1350 .BR \%groff_font (@MAN5EXT@).
1361 .\" --------------------------------------------------------------------
1363 .\" --------------------------------------------------------------------
1365 The following example illustrates the power of the
1367 program as a wrapper around
1373 file using the preprocessors
1379 macro set, classical
1385 pic foo.me | tbl | troff -me -Tlatin1 | grotty
1391 this pipe can be shortened to the equivalent command
1395 groff -p -t -me -T latin1 foo.me
1399 An even easier way to call this is to use
1400 .BR grog (@MAN1EXT@)
1401 to guess the preprocessor and macro options and execute the generated
1402 command (by using backquotes to specify shell command substitution)
1406 \`grog -Tlatin1 foo.me\`
1410 The simplest way is to view the contents in an automated way by
1419 .\" --------------------------------------------------------------------
1421 .\" --------------------------------------------------------------------
1424 On \f[CR]EBCDIC\f[] hosts (e.g., \f[CR]OS/390 Unix\f[]), output
1431 Similarly, output for \f[CR]EBCDIC\f[] code page
1433 is not available on \f[CR]ASCII\f[] based operating systems.
1437 .MT bug-groff@gnu.org
1438 the groff maling list
1441 Include a complete, self-contained example that allows the bug to
1442 be reproduced, and say which version of
1447 .\" --------------------------------------------------------------------
1449 .\" --------------------------------------------------------------------
1451 Information on how to get
1453 and related information is available at the
1454 .UR http://\:www.gnu.org/\:software/\:groff
1458 The most recent released version of
1461 .UR http://\:groff.ffii.org/\:groff/\:devel/\:groff-current.tar.gz
1462 groff development site
1468 mailing lists are available:
1470 .MT bug-groff@gnu.org
1476 for general discussion of
1480 .MT groff-commit@ffii.org
1481 the groff commit list
1483 a read-only list showing logs of commitments to the CVS repository.
1486 Details on CVS access and much more can be found in the file
1488 at the top directory of the
1493 There is a free implementation of the
1495 preprocessor, written by
1496 .MT faber@lunabase.org
1500 The actual version can be found at the
1502 .UR http://\:www.lunabase.org/\:~faber/\:Vault/\:software/\:grap/
1505 This is the only grap version supported by
1509 .\" --------------------------------------------------------------------
1511 .\" --------------------------------------------------------------------
1513 Copyright \(co 1989, 2002, 2003, 2004, 2005, 2006, 2007, 2008
1514 Free Software Foundation, Inc.
1517 This document is distributed under the terms of the \f[CR]FDL\f[]
1518 (\f[CR]GNU Free Documentation License\f[]) version 1.1 or later.
1520 You should have received a copy of the \f[CR]FDL\f[] on your system,
1521 it is also available on-line at the
1522 .UR http://\:www.gnu.org/\:copyleft/\:fdl.html
1527 This document is based on the original
1534 It was rewritten, enhanced, and put under the FDL license by
1544 is a \f[CR]GNU\f[] free software project.
1548 are protected by \f[CR]GNU copyleft licenses\f[].
1550 The software files are distributed under the terms of the \f[CR]GNU
1551 General Public License\f[] (\f[CR]GPL\f[]), while the documentation
1552 files mostly use the \f[CR]GNU Free Documentation License\f[]
1556 .\" --------------------------------------------------------------------
1558 .\" --------------------------------------------------------------------
1562 contains all information on the
1564 system within a single document, providing many examples and
1565 background information.
1572 Due to its complex structure, the
1574 system has many man pages.
1576 They can be read with
1579 .BR \%groffer (@MAN1EXT@).
1582 Introduction, history and further readings:
1583 .BR roff (@MAN7EXT@).
1586 Wrapper programs for formatters:
1587 .BR \%groff (@MAN1EXT@),
1588 .BR \%grog (@MAN1EXT@).
1592 .BR \%@g@eqn (@MAN1EXT@),
1593 .BR \%@g@grn (@MAN1EXT@),
1594 .BR \%@g@pic (@MAN1EXT@),
1595 .BR \%@g@chem (@MAN1EXT@),
1596 .BR \%preconv (@MAN1EXT@),
1597 .BR \%@g@refer (@MAN1EXT@),
1598 .BR \%@g@soelim (@MAN1EXT@),
1599 .BR \%@g@tbl (@MAN1EXT@),
1603 Roff language with the groff extensions:
1604 .BR \%groff (@MAN7EXT@),
1605 .BR \%groff_char (@MAN7EXT@),
1606 .BR \%groff_diff (@MAN7EXT@),
1607 .BR \%groff_font (@MAN5EXT@).
1610 Roff formatter programs:
1611 .BR \%@g@nroff (@MAN1EXT@),
1612 .BR \%@g@troff (@MAN1EXT@),
1613 .BR ditroff (@MAN7EXT@).
1616 The intermediate output language:
1617 .BR \%groff_out (@MAN7EXT@).
1620 Postprocessors for the output devices:
1621 .BR \%grodvi (@MAN1EXT@),
1622 .BR \%grohtml (@MAN1EXT@),
1623 .BR \%grops (@MAN1EXT@),
1624 .BR \%grotty (@MAN1EXT@).
1627 Groff macro packages and macro-specific utilities:
1628 .BR \%groff_tmac (@MAN5EXT@),
1629 .BR \%groff_man (@MAN7EXT@),
1630 .BR \%groff_mdoc (@MAN7EXT@),
1631 .BR \%groff_me (@MAN7EXT@),
1632 .BR \%groff_mm (@MAN7EXT@),
1633 .BR \%groff_mmse (@MAN7EXT@),
1634 .BR \%groff_mom (@MAN7EXT@),
1635 .BR \%groff_ms (@MAN7EXT@),
1636 .BR \%groff_www (@MAN7EXT@),
1637 .BR \%groff_trace (@MAN7EXT@),
1638 .BR \%mmroff (@MAN7EXT@).
1641 The following utilities are available:
1642 .BR \%addftinfo (@MAN1EXT@),
1643 .BR \%afmtodit (@MAN1EXT@),
1644 .BR \%eqn2graph (@MAN1EXT@),
1645 .BR \%grap2graph (@MAN1EXT@),
1646 .BR \%groffer (@MAN1EXT@),
1647 .BR \%@g@indxbib (@MAN1EXT@),
1648 .BR \%lkbib (@MAN1EXT@),
1649 .BR \%@g@lookbib (@MAN1EXT@),
1650 .BR \%pdfroff (@MAN1EXT@),
1651 .BR \%pfbtops (@MAN1EXT@),
1652 .BR \%pic2graph (@MAN1EXT@),
1653 .BR \%tfmtodit (@MAN1EXT@),
1655 .\" --------------------------------------------------------------------
1657 .\" --------------------------------------------------------------------
1659 .\" Local Variables: