1groff(1) General Commands Manual groff(1)
2
3
4
6 groff - front end to the GNU roff document formatting system
7
9 groff [-abcCeEgGijklNpRsStUVXzZ] [-d ctext] [-d string=text]
10 [-D fallback-encoding] [-f font-family] [-F font-directory]
11 [-I inclusion-directory] [-K input-encoding] [-L spooler-
12 argument] [-m macro-package] [-M macro-directory] [-n page-
13 number] [-o page-list] [-P postprocessor-argument] [-r cnumeric-
14 expression] [-r register=numeric-expression] [-T output-device]
15 [-w warning-category] [-W warning-category] [file ...]
16
17 groff -h
18 groff --help
19
20 groff -v [option ...] [file ...]
21 groff --version [option ...] [file ...]
22
24 groff is the primary front end to the GNU roff document formatting sys‐
25 tem. GNU roff is a typesetting system that reads plain text input
26 files that include formatting commands to produce output in PostScript,
27 PDF, HTML, DVI, or other formats, or for display to a terminal. For‐
28 matting commands can be low-level typesetting primitives, macros from a
29 supplied package, or user-defined macros. All three approaches can be
30 combined. If no file operands are specified, or if file is “-”, groff
31 reads the standard input stream.
32
33 A reimplementation and extension of the typesetter from AT&T Unix,
34 groff is present on most POSIX systems owing to its long association
35 with Unix manuals (including man pages). It and its predecessor are
36 notable for their production of several best-selling software engineer‐
37 ing texts. groff is capable of producing typographically sophisticated
38 documents while consuming minimal system resources.
39
40 The groff command orchestrates the execution of preprocessors, the
41 transformation of input documents into a device-independent page de‐
42 scription language, and the production of output from that language.
43
45 -h and --help display a usage message and exit.
46
47 Because groff is intended to subsume most users' direct invocations of
48 the troff(1) formatter, the two programs share a set of options. How‐
49 ever, groff has some options that troff does not share, and others
50 which groff interprets differently. At the same time, not all valid
51 troff options can be given to groff.
52
53 groff-specific options
54 The following options either do not exist in GNU troff or are inter‐
55 preted differently by groff.
56
57 -D enc Set fallback input encoding used by preconv(1) to enc; implies
58 -k.
59
60 -e Run eqn(1) preprocessor.
61
62 -g Run grn(1) preprocessor.
63
64 -G Run grap(1) preprocessor; implies -p.
65
66 -I dir Works as troff's option (see below), but also implies -g and -s.
67 It is passed to soelim(1) and the output driver, and grn is
68 passed an -M option with dir as its argument.
69
70 -j Run chem(1) preprocessor; implies -p.
71
72 -k Run preconv(1) preprocessor. Refer to its man page for its be‐
73 havior if neither of groff's -K or -D options is also specified.
74
75 -K enc Set input encoding used by preconv(1) to enc; implies -k.
76
77 -l Send the output to a spooler program for printing. The “print”
78 directive in the device description file specifies the default
79 command to be used; see groff_font(5). If no such directive is
80 present for the output device, this option is ignored. See op‐
81 tions -L and -X.
82
83 -L arg Pass arg to the print spooler program. If multiple args are re‐
84 quired, pass each with a separate -L option. groff does not
85 prefix an option dash to arg before passing it to the spooler
86 program.
87
88 -M Works as troff's option (see below), but is also passed to
89 eqn(1), grap(1), and grn(1).
90
91 -N Prohibit newlines between eqn delimiters: pass -N to eqn(1).
92
93 -p Run pic(1) preprocessor.
94
95 -P arg Pass arg to the postprocessor. If multiple args are required,
96 pass each with a separate -P option. groff does not prefix an
97 option dash to arg before passing it to the postprocessor.
98
99 -R Run refer(1) preprocessor. No mechanism is provided for passing
100 arguments to refer because most refer options have equivalent
101 language elements that can be specified within the document.
102
103 -s Run soelim(1) preprocessor.
104
105 -S Operate in “safer” mode; see -U below for its opposite. For se‐
106 curity reasons, safer mode is enabled by default.
107
108 -t Run tbl(1) preprocessor.
109
110 -T dev Direct troff to format the input for the output device dev.
111 groff then calls an output driver to convert troff's output to a
112 form appropriate for dev; see subsection “Output devices” below.
113
114 -U Operate in unsafe mode: pass the -U option to pic and troff.
115
116 -v
117 --version
118 Write version information for groff and all programs run by it
119 to the standard output stream; that is, the given command line
120 is processed in the usual way, passing -v to the formatter and
121 any pre- or postprocessors invoked.
122
123 -V Output the pipeline that groff would run to the standard output
124 stream, but do not execute it. If given more than once, groff
125 both writes and runs the pipeline.
126
127 -X Use gxditview(1) instead of the usual postprocessor to (pre)view
128 a document on an X11 display. Combining this option with -Tps
129 uses the font metrics of the PostScript device, whereas the
130 -TX75 and -TX100 options use the metrics of X11 fonts.
131
132 -Z Disable postprocessing. troff output will appear on the stan‐
133 dard output stream (unless suppressed with -z); see groff_out(5)
134 for a description of this format.
135
136 Transparent options
137 The following options are passed as-is to the formatter program
138 troff(1) and described in more detail in its man page.
139
140 -a Generate a plain text approximation of the typeset output.
141
142 -b Write a backtrace to the standard error stream on each error or
143 warning.
144
145 -c Start with color output disabled.
146
147 -C Enable AT&T troff compatibility mode; implies -c.
148
149 -d cs
150 -d name=string
151 Define string.
152
153 -E Inhibit troff error messages; implies -Ww.
154
155 -f fam Set default font family.
156
157 -F dir Search in directory dir for the selected output device's direc‐
158 tory of device and font description files.
159
160 -i Process standard input after the specified input files.
161
162 -I dir Search dir for input files.
163
164 -m name
165 Process name.tmac before input files.
166
167 -M dir Search directory dir for macro files.
168
169 -n num Number the first page num.
170
171 -o list
172 Output only pages in list.
173
174 -r cnumeric-expression
175 -r register=numeric-expression
176 Define register.
177
178 -w name
179 -W name
180 Enable (-w) or inhibit (-W) emission of warnings in category
181 name.
182
183 -z Suppress formatted device-independent output of troff.
184
186 The architecture of the GNU roff system follows that of other device-
187 independent roff implementations, comprising preprocessors, macro pack‐
188 ages, output drivers (or “postprocessors”), a suite of utilities, and
189 the formatter troff at its heart. See roff(7) for a survey of how a
190 roff system works.
191
192 The front end programs available in the GNU roff system make it easier
193 to use than traditional roffs that required the construction of pipe‐
194 lines or use of temporary files to carry a source document from main‐
195 tainable form to device-ready output. The discussion below summarizes
196 the constituent parts of the GNU roff system. It complements roff(7)
197 with groff-specific information.
198
199 Getting started
200 Those who prefer to learn by experimenting or are desirous of rapid
201 feedback from the system may wish to start with a “Hello, world!” docu‐
202 ment.
203
204 $ echo "Hello, world!" | groff -Tascii | sed '/^$/d'
205 Hello, world!
206
207 We used a sed command only to eliminate the 65 blank lines that would
208 otherwise flood the terminal screen. (roff systems were developed in
209 the days of paper-based terminals with 66 lines to a page.)
210
211 Today's users may prefer output to a UTF-8-capable terminal.
212
213 $ echo "Hello, world!" | groff -Tutf8 | sed '/^$/d'
214
215 Producing PDF, HTML, or TeX's DVI is also straightforward. The hard
216 part may be selecting a viewer program for the output.
217
218 $ echo "Hello, world!" | groff -Tpdf > hello.pdf
219 $ evince hello.pdf
220 $ echo "Hello, world!" | groff -Thtml > hello.html
221 $ firefox hello.html
222 $ echo "Hello, world!" | groff -Tdvi > hello.dvi
223 $ xdvi hello.html
224
225 Using groff as a REPL
226 Those with a programmer's bent may be pleased to know that they can use
227 groff in a read-evaluate-print loop (REPL). Doing so can be handy to
228 verify one's understanding of the formatter's behavior and/or the syn‐
229 tax it accepts. Turning on all warnings with -ww can aid this goal.
230
231 $ groff -ww -Tutf8
232 \# This is a comment. Let's define a register.
233 .nr a 1
234 \# Do integer arithmetic with operators evaluated left-to-right.
235 .nr b \n[a]+5/2
236 \# Let's get the result on the standard error stream.
237 .tm \n[b]
238 3
239 \# Now we'll define a string.
240 .ds name Leslie\" This is another form of comment.
241 .nr b (\n[a] + (7/2))
242 \# Center the next two text input lines.
243 .ce 2
244 Hi, \*[name].
245 Your secret number is \n[b].
246 \# We will see that the division rounded toward zero.
247 It is
248 \# Here's an if-else control structure.
249 .ie (\n[b] % 2) odd.
250 .el even.
251 \# This trick sets the page length to the current vertical
252 \# position, so that blank lines don't spew when we're done.
253 .pl \n[nl]u
254 <Control-D>
255 Hi, Leslie.
256 Your secret number is 4.
257 It is even.
258
259 Paper format
260 In GNU roff, the page dimensions for the formatter troff and for output
261 devices are handled separately. In the formatter, requests are used to
262 set the page length (.pl), page offset (or left margin, .po), and line
263 length (.ll). The right margin is not explicitly configured; the com‐
264 bination of page offset and line length provides the information neces‐
265 sary to derive it. The papersize macro package, automatically loaded
266 by troff, provides an interface for configuring page dimensions by con‐
267 venient names, like “letter” or “A4”; see groff_tmac(5). The format‐
268 ter's default in this installation is “letter”.
269
270 It is up to each macro package to respect the page dimensions config‐
271 ured in this way. Some offer alternative mechanisms.
272
273 For each output device, the size of the output medium can be set in its
274 DESC file. Most output drivers also recognize a command-line option -p
275 to override the default dimensions and an option -l to use landscape
276 orientation. See groff_font(5) for a description of the papersize di‐
277 rective, which takes an argument of the same form as -p. The output
278 driver's man page, such as grops(1), may also be helpful. groff uses
279 the command-line option -P to pass options to output devices; for exam‐
280 ple, use the following for PostScript output on A4 paper in landscape
281 orientation.
282
283 groff -Tps -dpaper=a4l -P-pa4 -P-l -ms foo.ms > foo.ps
284
285 Front end
286 The groff program is a wrapper around the troff(1) program. It allows
287 one to specify preprocessors via command-line options and automatically
288 runs the appropriate postprocessor for the selected output device. Do‐
289 ing so, the manual construction of pipelines or management of temporary
290 files required of users of traditional roff(7) systems can be avoided.
291 Use the grog(1) program to infer an appropriate groff command line to
292 format a document.
293
294 Language
295 Input to a roff system is in plain text interleaved with control lines
296 and escape sequences. The combination constitutes a document in one of
297 a family of languages we also call roff; see roff(7) for background.
298 An overview of GNU roff language syntax and features, including lists
299 of all supported escape sequences, requests, and predefined registers,
300 can be found in groff(7). GNU roff extensions to the AT&T troff lan‐
301 guage, a common subset of roff dialects extant today, are detailed in
302 groff_diff(7).
303
304 Preprocessors
305 A preprocessor interprets a domain-specific language that produces roff
306 language output. Frequently, such input is confined to sections or re‐
307 gions of a roff input file (bracketed with macro calls specific to each
308 preprocessor), which it replaces. Preprocessors therefore often inter‐
309 pret a subset of roff syntax along with their own language. GNU roff
310 provides reimplementations of most preprocessors familiar to users of
311 AT&T troff; these routinely have extended features and/or require GNU
312 troff to format their output.
313
314 tbl lays out tables;
315 eqn typesets mathematics;
316 pic draws diagrams;
317 refer processes bibliographic references;
318 soelim preprocesses “sourced” input files;
319 grn renders gremlin(1) diagrams;
320 chem draws chemical structural formulæ using pic;
321 gperl populates groff registers and strings using perl(1);
322 glilypond embeds LilyPond sheet music; and
323 gpinyin eases Mandarin Chinese input using Hanyu Pinyin.
324
325 A preprocessor unique to GNU roff is preconv(1), which converts various
326 input encodings to something GNU troff can understand. When used, it
327 is run before any other preprocessors.
328
329 Most preprocessors enclose content between a pair of characteristic to‐
330 kens. Such a token must occur at the beginning of an input line and
331 use the dot control character. Spaces and tabs must not follow the
332 control character or precede the end of the input line. Deviating from
333 these rules defeats a token's recognition by the preprocessor. Tokens
334 are generally preserved in preprocessor output and interpreted as macro
335 calls subsequently by troff. The ideal preprocessor is not yet avail‐
336 able in groff.
337
338 ┌─────────────┬─────────────────┬────────────────┐
339 │preprocessor │ starting token │ ending token │
340 ├─────────────┼─────────────────┼────────────────┤
341 │ chem │ .cstart │ .cend │
342 │ eqn │ .EQ │ .EN │
343 │ grap │ .G1 │ .G2 │
344 │ grn │ .GS │ .GE │
345 │ ideal │ .IS │ .IE │
346 │ │ │ .IF │
347 │ pic │ .PS │ .PE │
348 │ │ │ .PF │
349 │ │ │ .PY │
350 │ refer │ .R1 │ .R2 │
351 │ tbl │ .TS │ .TE │
352 ├─────────────┼─────────────────┼────────────────┤
353 │ glilypond │ .lilypond start │ .lilypond stop │
354 │ gperl │ .Perl start │ .Perl stop │
355 │ gpinyin │ .pinyin start │ .pinyin stop │
356 └─────────────┴─────────────────┴────────────────┘
357 Macro packages
358 Macro files are roff input files designed to produce no output them‐
359 selves but instead ease the preparation of other roff documents. When
360 a macro file is installed at a standard location and suitable for use
361 by a general audience, it is termed a macro package.
362
363 Macro packages can be loaded prior to any roff input documents with the
364 -m option. The GNU roff system implements most well-known macro pack‐
365 ages for AT&T troff in a compatible way and extends them. These have
366 one- or two-letter names arising from intense practices of naming econ‐
367 omy in early Unix culture, a laconic approach that led to many of the
368 packages being identified in general usage with the nroff and troff op‐
369 tion letter used to invoke them, sometimes to punning effect, as with
370 “man” (short for “manual”), and even with the option dash, as in the
371 case of the s package, much better known as ms or even -ms.
372
373 Macro packages serve a variety of purposes. Some are “full-service”
374 packages, adopting responsibility for page layout among other fundamen‐
375 tal tasks, and defining their own lexicon of macros for document compo‐
376 sition; each such package stands alone and a given document can use at
377 most one.
378
379 an is used to compose man pages in the format originating in Ver‐
380 sion 7 Unix (1979); see groff_man(7). It can be specified on
381 the command line as -man.
382
383 doc is used to compose man pages in the format originating in
384 4.3BSD-Reno (1990); see groff_mdoc(7). It can be specified on
385 the command line as -mdoc.
386
387 e is the Berkeley general-purpose macro suite, developed as an al‐
388 ternative to AT&T's s; see groff_me(7). It can be specified on
389 the command line as -me.
390
391 m implements the format used by the second-generation AT&T macro
392 suite for general documents, a successor to s; see groff_mm(7).
393 It can be specified on the command line as -mm.
394
395 om (invariably called “mom”) is a modern package written by Peter
396 Schaffter specifically for GNU roff. Consult the mom HTML
397 manual ⟨file:///usr/share/doc/groff/html/mom/toc.html⟩ for ex‐
398 tensive documentation. She—for mom takes the female pronoun—can
399 be specified on the command line as -mom.
400
401 s is the original AT&T general-purpose document format; see
402 groff_ms(7). It can be specified on the command line as -ms.
403
404 Others are supplemental. For instance, andoc is a wrapper package spe‐
405 cific to GNU roff that recognizes whether a document uses man or mdoc
406 format and loads the corresponding macro package. It can be specified
407 on the command line as -mandoc. A man(1) librarian program may use
408 this macro file to delegate loading of the correct macro package; it is
409 thus unnecessary for man itself to scan the contents of a document to
410 decide the issue.
411
412 Many macro files augment the function of the full-service packages, or
413 of roff documents that do not employ such a package—the latter are
414 sometimes characterized as “raw”. These auxiliary packages are de‐
415 scribed, along with details of macro file naming and placement, in
416 groff_tmac(5).
417
418 Formatters
419 The formatter, the program that interprets roff language input, is
420 troff(1). It provides the features of the AT&T troff and nroff pro‐
421 grams as well as many extensions. The command-line option -C switches
422 troff into compatibility mode, which tries to emulate AT&T troff as
423 closely as is practical to enable the formatting of documents written
424 for the older system.
425
426 A shell script, nroff(1), emulates the behavior of AT&T nroff. It at‐
427 tempts to correctly encode the output based on the locale, relieving
428 the user of the need to specify an output device with the -T option and
429 is therefore convenient for use with terminal output devices, described
430 in the next subsection.
431
432 GNU troff generates output in a device-independent, but not device-ag‐
433 nostic, page description language detailed in groff_out(5).
434
435 Output devices
436 troff output is formatted for a particular output device, typically
437 specified by the -T option to the formatter or a front end. If neither
438 this option nor the GROFF_TYPESETTER environment variable is used, the
439 default output device is ps. An output device may be any of the fol‐
440 lowing.
441
442 ascii for terminals using the ISO 646 1991:IRV character set and en‐
443 coding, also known as US-ASCII.
444
445 cp1047 for terminals using the IBM code page 1047 character set and
446 encoding.
447
448 dvi for TeX DVI format.
449
450 html
451 xhtml for HTML and XHTML output, respectively.
452
453 latin1 for terminals using the ISO Latin-1 (ISO 8859-1) character set
454 and encoding.
455
456 lbp for Canon CaPSL printers (LBP-4 and LBP-8 series laser print‐
457 ers).
458
459 lj4 for HP LaserJet4-compatible (or other PCL5-compatible) print‐
460 ers.
461
462 pdf for PDF output.
463
464 ps for PostScript output.
465
466 utf8 for terminals using the ISO 10646 (“Unicode”) character set in
467 UTF-8 encoding.
468
469 X75 for previewing with gxditview using 75 dpi resolution and a
470 10-point base type size.
471
472 X75-12 for previewing with gxditview using 75 dpi resolution and a
473 12-point base type size.
474
475 X100 for previewing with gxditview using 100 dpi resolution and a
476 10-point base type size.
477
478 X100-12 for previewing with gxditview using 100 dpi resolution and a
479 12-point base type size.
480
481 Postprocessors
482 Any program that interprets the output of GNU troff is a postprocessor.
483 The postprocessors provided by GNU roff are output drivers, which pre‐
484 pare a document for viewing or printing. Postprocessors for other pur‐
485 poses, such as page resequencing or statistical measurement of a docu‐
486 ment, are conceivable.
487
488 An output driver supports one or more output devices, each with its own
489 device description file. A device determines its postprocessor with
490 the postpro directive in its device description file; see
491 groff_font(5). The -X option overrides this selection, causing
492 gxditview to serve as the output driver.
493
494 grodvi(1)
495 provides dvi.
496
497 grohtml(1)
498 provides html and xhtml.
499
500 grolbp(1)
501 provides lbp.
502
503 grolj4(1)
504 provides lj4.
505
506 gropdf(1)
507 provides pdf.
508
509 grops(1)
510 provides ps.
511
512 grotty(1)
513 provides ascii, cp1047, latin1, and utf8.
514
515 gxditview(1)
516 provides X75, X75-12, X100, and X100-12, and additionally can
517 preview ps.
518
519 Utilities
520 GNU roff includes a suite of utilities.
521
522 gdiffmk(1)
523 marks differences between a pair of roff input files.
524
525 grog(1)
526 infers the groff command a document requires.
527
528 Several utilities prepare descriptions of fonts, enabling the formatter
529 to use them when producing output for a given device.
530
531 addftinfo(1)
532 adds information to AT&T troff font description files to enable
533 their use with GNU troff.
534
535 afmtodit(1)
536 creates font description files for PostScript Type 1 fonts.
537
538 pfbtops(1)
539 translates a PostScript Type 1 font in PFB (Printer Font Binary)
540 format to PFA (Printer Font ASCII), which can then be inter‐
541 preted by afmtodit.
542
543 hpftodit(1)
544 creates font description files for the HP LaserJet 4 family of
545 printers.
546
547 tfmtodit(1)
548 creates font description files for the TeX DVI device.
549
550 xtotroff(1)
551 creates font description files for X Window System core fonts.
552
553 A trio of tools transform material constructed using roff preprocessor
554 languages into graphical image files.
555
556 eqn2graph(1)
557 converts an eqn equation into a cropped image.
558
559 grap2graph(1)
560 converts a grap diagram into a cropped image.
561
562 pic2graph(1)
563 converts a pic diagram into a cropped image.
564
565 Another set of programs works with the bibliographic data files used by
566 the refer(1) preprocessor.
567
568 indxbib(1)
569 makes inverted indices for bibliographic databases, speeding
570 lookup operations on them.
571
572 lkbib(1)
573 searches the databases.
574
575 lookbib(1)
576 interactively searches the databases.
577
579 groff exits with a failure status if there was a problem parsing its
580 arguments and a successful status if either of the options -h or --help
581 was specified. Otherwise, groff runs a pipeline to process its input;
582 if all commands within the pipeline exit successfully, groff does like‐
583 wise. If not, groff's exit status encodes a summary of problems en‐
584 countered, setting bit 0 if a command exited with a failure status,
585 bit 1 if a command was terminated with a signal, and bit 2 if a command
586 could not be executed. (Thus, if all three misfortunes befell one's
587 pipeline, groff would exit with status 2^0 + 2^1 + 2^2 = 1+2+4 = 7.)
588 To troubleshoot pipeline problems, you may wish to re-run the groff
589 command with the -V option and break the reported pipeline down into
590 separate stages, inspecting the exit status of and diagnostic messages
591 emitted by each command.
592
594 Normally, the path separator in environment variables ending with PATH
595 is the colon; this may vary depending on the operating system. For ex‐
596 ample, Windows uses a semicolon instead.
597
598 GROFF_BIN_PATH
599 This search path, followed by PATH, is used to locate commands
600 executed by groff. If it is not set, the installation directory
601 of the GNU roff executables, /usr/bin, is searched before PATH.
602
603 GROFF_COMMAND_PREFIX
604 GNU roff can be configured at compile time to apply a prefix to
605 the names of the programs it provides that had a counterpart in
606 AT&T troff, so that name collisions are avoided at run time.
607 The default prefix is empty.
608
609 When used, this prefix is conventionally the letter “g”. For
610 example, GNU troff would be installed as gtroff. Besides troff,
611 the prefix applies to the formatter nroff; the preprocessors
612 eqn, grn, pic, refer, tbl, and soelim; and the utilities indxbib
613 and lookbib.
614
615 GROFF_ENCODING
616 The value of this variable is passed to the preconv(1) pre‐
617 processor's -e option to select the character encoding of input
618 files. This variable's existence implies the groff option -k.
619 If set but empty, groff calls preconv without an -e option.
620 groff's -K option overrides GROFF_ENCODING.
621
622 GROFF_FONT_PATH
623 Seek the selected output device's directory of device and font
624 description files in this list of directories. See troff(1) and
625 groff_font(5).
626
627 GROFF_TMAC_PATH
628 Seek macro files in this list of directories. See troff(1) and
629 groff_tmac(5).
630
631 GROFF_TMPDIR
632 Create temporary files in this directory. If not set, but the
633 environment variable TMPDIR is set, temporary files are created
634 there instead. On Windows systems, if neither of the foregoing
635 are set, the environment variables TMP and TEMP (in that order)
636 are checked also. Otherwise, temporary files are created in
637 /tmp. The refer(1), grohtml(1), and grops(1) commands use tem‐
638 porary files.
639
640 GROFF_TYPESETTER
641 Set the default output device. If empty or not set, ps is used.
642 The -T option overrides GROFF_TYPESETTER.
643
644 SOURCE_DATE_EPOCH
645 A time stamp (expressed as seconds since the Unix epoch) to use
646 as the output creation time stamp in place of the current time.
647 The time is converted to human-readable form using localtime(3)
648 when the formatter starts up and stored in registers usable by
649 documents and macro packages.
650
651 TZ The time zone to use when converting the current time (or value
652 of SOURCE_DATE_EPOCH) to human-readable form; see tzset(3).
653
655 roff systems are best known for formatting man pages. Once a man(1)
656 librarian program has located a man page, it may execute a groff com‐
657 mand much like the following.
658 groff -t -man -Tutf8 /usr/share/man/man1/groff.1
659 The librarian will also pipe the output through a pager, which might
660 not interpret the SGR terminal escape sequences groff emits for bold‐
661 face, underlining, or italics; see section “Limitations” below.
662
663 To process a roff input file using the preprocessors tbl and pic and
664 the me macro package in the way to which AT&T troff users were accus‐
665 tomed, one would type (or script) a pipeline.
666
667 pic foo.me | tbl | troff -me -Tutf8 | grotty
668
669 Using groff, this pipe can be shortened to an equivalent command.
670
671 groff -p -t -me -T utf8 foo.me
672
673 An even easier way to do this is to use grog(1) to guess the preproces‐
674 sor and macro options and execute the result by using the command sub‐
675 stitution feature of the shell.
676
677 $(grog -Tutf8 foo.me)
678
679 Each command-line option to a postprocessor must be specified with any
680 required leading dashes “-” because groff passes the arguments as-is to
681 the postprocessor; this permits arbitrary arguments to be transmitted.
682 For example, to pass a title to the gxditview postprocessor, the shell
683 commands
684 groff -X -P -title -P 'trial run' mydoc.t
685 and
686 groff -X -Z mydoc.t | gxditview -title 'trial run' -
687 are equivalent.
688
690 When paging output for the ascii, cp1047, latin1, and utf8 devices,
691 programs like more(1) and less(1) may require command-line options to
692 correctly handle some terminal escape sequences; see grotty(1).
693
694 On EBCDIC hosts such as OS/390 Unix, the output devices ascii and
695 latin1 aren't available. Conversely, the output device cp1047 is not
696 available on systems based on the ISO 646 or ISO 8859 character encod‐
697 ing standards.
698
700 GNU roff installs files in varying locations depending on its compile-
701 time configuration. On this installation, the following locations are
702 used.
703
704 /usr/share/X11/app-defaults
705 Application defaults directory for gxditview(1).
706
707 /usr/bin
708 Directory containing groff's executable commands.
709
710 /usr/share/groff/1.23.0/eign
711 List of common words for indxbib(1).
712
713 /usr/share/groff/1.23.0
714 Directory for data files.
715
716 /usr/dict/papers/Ind
717 Default index for lkbib(1) and refer(1).
718
719 /usr/share/doc/groff
720 Documentation directory.
721
722 /usr/share/doc/groff/examples
723 Example directory.
724
725 /usr/share/groff/1.23.0/font
726 Font directory.
727
728 /usr/share/doc/groff/html
729 HTML documentation directory.
730
731 /usr/lib/font
732 Legacy font directory.
733
734 /etc/groff/site-font
735 Local font directory.
736
737 /etc/groff/site-tmac
738 Local macro package (tmac file) directory.
739
740 /usr/share/groff/1.23.0/tmac
741 Macro package (tmac file) directory.
742
743 /usr/share/groff/1.23.0/oldfont
744 Font directory for compatibility with old versions of groff; see
745 grops(1).
746
747 /usr/share/doc/groff/pdf
748 PDF documentation directory.
749
750 groff macro directory
751 Most macro files supplied with GNU roff are stored in /usr/share/groff/
752 1.23.0/tmac for the installation corresponding to this document. As a
753 rule, multiple directories are searched for macro files; see troff(1).
754 For a catalog of macro files GNU roff provides, see groff_tmac(5).
755
756 groff device and font description directory
757 Device and font description files supplied with GNU roff are stored in
758 /usr/share/groff/1.23.0/font for the installation corresponding to this
759 document. As a rule, multiple directories are searched for device and
760 font description files; see troff(1). For the formats of these files,
761 see groff_font(5).
762
764 Obtain links to groff releases for download, its source repository,
765 discussion mailing lists, a support ticket tracker, and further infor‐
766 mation from the groff page of the GNU website ⟨http://www.gnu.org/
767 software/groff⟩.
768
769 A free implementation of the grap preprocessor, written by Ted Faber
770 ⟨faber@lunabase.org⟩, can be found at the grap website ⟨http://www
771 .lunabase.org/~faber/Vault/software/grap/⟩. groff supports only this
772 grap.
773
775 groff (both the front-end command and the overall system) was primarily
776 written by James Clark ⟨jjc@jclark.com⟩. Contributors to this document
777 include Clark, Trent A. Fisher, Werner Lemberg ⟨wl@gnu.org⟩, Bernd
778 Warken ⟨groff-bernd.warken-72@web.de⟩, and G. Branden Robinson
779 ⟨g.branden.robinson@gmail.com⟩.
780
782 Groff: The GNU Implementation of troff, by Trent A. Fisher and Werner
783 Lemberg, is the primary groff manual. You can browse it interactively
784 with “info groff”.
785
786 Introduction, history, and further reading:
787 roff(7)
788
789 Viewer for groff (and AT&T device-independent troff) documents:
790 gxditview(1)
791
792 Preprocessors:
793 chem(1), eqn(1), neqn(1), glilypond(1), grn(1), preconv(1),
794 gperl(1), pic(1), gpinyin(1), refer(1), soelim(1), tbl(1)
795
796 Macro packages and package-specific utilities:
797 groff_hdtbl(7), groff_man(7), groff_man_style(7), groff_mdoc(7),
798 groff_me(7), groff_mm(7), groff_mmse(7), mmroff(1),
799 groff_mom(7), pdfmom(1), groff_ms(7), groff_rfc1345(7),
800 groff_trace(7), groff_www(7)
801
802 Bibliographic database management tools:
803 indxbib(1), lkbib(1), lookbib(1)
804
805 Language, conventions, and GNU extensions:
806 groff(7), groff_char(7), groff_diff(7), groff_font(5),
807 groff_tmac(5)
808
809 Intermediate output language:
810 groff_out(5)
811
812 Formatter program:
813 troff(1)
814
815 Formatter wrappers:
816 nroff(1), pdfroff(1)
817
818 Postprocessors for output devices:
819 grodvi(1), grohtml(1), grolbp(1), grolj4(1), gropdf(1),
820 grops(1), grotty(1)
821
822 Font support utilities:
823 addftinfo(1), afmtodit(1), hpftodit(1), pfbtops(1), tfmtodit(1),
824 xtotroff(1)
825
826 Graphics conversion utilities:
827 eqn2graph(1), grap2graph(1), pic2graph(1)
828
829 Difference-marking utility:
830 gdiffmk(1)
831
832 “groff guess” utility:
833 grog(1)
834
835
836
837groff 1.23.0 2 November 2023 groff(1)