Debian Codegraph @

upstream/fedora-rawhide/man1/groff.1

raw
1 .TH groff 1 "2026-03-03" "groff 1.24.0"
2 .SH Name
3 groff \- front end to the GNU
4 .I roff
5 document formatting system
6 .
7 .
8 .\" ====================================================================
9 .\" Legal Terms
10 .\" ====================================================================
11 .\"
12 .\" Copyright 1989-2024 Free Software Foundation, Inc.
13 .\" 2018-2025 G. Branden Robinson
14 .\"
15 .\" This file is part of groff, the GNU roff typesetting system.
16 .\"
17 .\" Permission is granted to copy, distribute and/or modify this
18 .\" document under the terms of the GNU Free Documentation License,
19 .\" Version 1.3 or any later version published by the Free Software
20 .\" Foundation; with no Invariant Sections, with no Front-Cover Texts,
21 .\" and with no Back-Cover Texts.
22 .\"
23 .\" A copy of the Free Documentation License is included as a file
24 .\" called FDL in the main directory of the groff source package.
25 .
26 .
27 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
28 .do nr *groff_groff_1_man_C \n[.cp]
29 .cp 0
30 .
31 .\" Define fallback for groff 1.23's MR macro if the system lacks it.
32 .nr do-fallback 0
33 .if !\n(.f .nr do-fallback 1 \" mandoc
34 .if \n(.g .if !d MR .nr do-fallback 1 \" older groff
35 .if !\n(.g .nr do-fallback 1 \" non-groff *roff
36 .if \n[do-fallback] \{\
37 . de MR
38 . ie \\n(.$=1 \
39 . I \%\\$1
40 . el \
41 . IR \%\\$1 (\\$2)\\$3
42 . .
43 .\}
44 .rr do-fallback
45 .
46 .\" Define a string for the TeX logo.
47 .ie t .ds TeX T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
48 .el .ds TeX TeX
49 .
50 .\" ====================================================================
51 .SH Synopsis
52 .\" ====================================================================
53 .
54 .SY groff
55 .RB [ \-abcCeEgGijklNpRsStUVXzZ ]
56 .RB [ \-d\~\c
57 .IR ctext ]
58 .RB [ \-d\~\c
59 .IB string =\c
60 .IR text ]
61 .RB [ \-D\~\c
62 .IR fallback-encoding ]
63 .RB [ \-f\~\c
64 .IR font-family ]
65 .RB [ \-F\~\c
66 .IR font-directory ]
67 .RB [ \-I\~\c
68 .IR inclusion-directory ]
69 .RB [ \-K\~\c
70 .IR input-encoding ]
71 .RB [ \-L\~\c
72 .IR spooler-argument ]
73 .RB [ \-m\~\c
74 .IR macro-package ]
75 .RB [ \-M\~\c
76 .IR macro-directory ]
77 .RB [ \-n\~\c
78 .IR page-number ]
79 .RB [ \-o\~\c
80 .IR page-list ]
81 .RB [ \-P\~\c
82 .IR postprocessor-argument ]
83 .RB [ \-r\~\c
84 .IR cnumeric-expression ]
85 .RB [ \-r\~\c
86 .IB register =\c
87 .IR numeric-expression ]
88 .RB [ \-T\~\c
89 .IR output-device ]
90 .RB [ \-w\~\c
91 .IR warning-category ]
92 .RB [ \-W\~\c
93 .IR warning-category ]
94 .RI [ file\~ .\|.\|.]
95 .YS
96 .
97 .
98 .P
99 .SY groff
100 .B \-h
101 .YS
102 .
103 .SY groff
104 .B \-\-help
105 .YS
106 .
107 .
108 .P
109 .SY groff
110 .B \-v
111 .RI [ option\~ .\|.\|.\&]
112 .RI [ file\~ .\|.\|.]
113 .YS
114 .
115 .SY groff
116 .B \%\-\-version
117 .RI [ option\~ .\|.\|.\&]
118 .RI [ file\~ .\|.\|.]
119 .YS
120 .
121 .
122 .\" ====================================================================
123 .SH Description
124 .\" ====================================================================
125 .
126 .I groff
127 is the primary front end to the GNU
128 .I roff
129 document formatting system.
130 .
131 .\" BEGIN Keep parallel with groff.texi node "What Is groff?".
132 .\" This language is slightly expanded from that in the "ANNOUNCE" file
133 .\" and on the groff home page.
134 GNU
135 .I roff
136 is a typesetting system that reads plain text input that includes
137 formatting commands to produce output in PostScript,
138 PDF,
139 HTML,
140 or other formats,
141 or for display to a terminal.
142 .
143 Formatting commands can be low-level typesetting primitives,
144 macros from a supplied package,
145 or user-defined macros.
146 .
147 All three approaches can be combined.
148 .
149 If no
150 .I file
151 operands are specified,
152 or if
153 .I file
154 is
155 .RB \[lq] \- \[rq],
156 .I groff
157 reads the standard input stream.
158 .
159 .
160 .P
161 A reimplementation and extension of
162 .I troff \" AT&T
163 and other programs from AT&T Unix,
164 .I groff
165 is widely available on POSIX and other systems
166 owing to its long association with Unix manuals,
167 including man pages.
168 .
169 It and its predecessor have produced
170 several best-selling software engineering texts.
171 .I groff
172 can create typographically sophisticated documents
173 while consuming minimal system resources.
174 .
175 .
176 .P
177 Like its predecessor \[lq]troff\[rq],
178 the term \[lq]groff\[rq] affords two popular pronunciations:
179 as one syllable
180 (like the surname),
181 rhyming with \[lq]trough\[rq],
182 or as \[lq]jee-roff\[rq],
183 in analogy to the Bell Labs pronunciation \[lq]tee-roff\[rq].
184 .
185 Little risk of confusion exists;
186 use whichever suits you.
187 .\" END Keep parallel with groff.texi node "What Is groff?".
188 .
189 .
190 .P
191 The
192 .I groff
193 command orchestrates the execution of preprocessors,
194 the transformation of input documents into a device-independent page
195 description language,
196 and the production of output from that language.
197 .
198 .
199 .\" ====================================================================
200 .SH Options
201 .\" ====================================================================
202 .
203 .B \-h
204 and
205 .B \-\-help
206 display a usage message and exit.
207 .
208 .
209 .P
210 Because
211 .I groff
212 is intended to subsume most users' direct invocations of the
213 .MR \%troff 1
214 formatter,
215 the two programs share a set of options.
216 .
217 However,
218 .I groff
219 has some options that
220 .I \%troff
221 does not share,
222 and others which
223 .I groff
224 interprets differently.
225 .
226 At the same time,
227 not all valid
228 .I \%troff
229 options can be given to
230 .IR groff .
231 .
232 .
233 .\" ====================================================================
234 .SS "\f[I]groff\f[]-specific options"
235 .\" ====================================================================
236 .
237 The following options either do not exist in
238 GNU
239 .I troff \" GNU
240 or are interpreted differently by
241 .IR groff .
242 .
243 .
244 .TP 9n \" "-m name" + 2n
245 .BI \-D\~ enc
246 Use
247 .I enc
248 as
249 .MR preconv 1 's
250 fallback input encoding;
251 implies
252 .BR \-k .
253 .
254 .
255 .TP
256 .B \-e
257 Run
258 .MR \%eqn 1
259 preprocessor.
260 .
261 .
262 .TP
263 .B \-g
264 Run
265 .MR \%grn 1
266 preprocessor.
267 .
268 .
269 .TP
270 .B \-G
271 Run
272 .MR grap 1
273 preprocessor;
274 implies
275 .BR \-p .
276 .
277 .
278 .TP
279 .BI \-I\~ dir
280 Works as
281 .IR \%troff 's
282 option
283 (see below),
284 but also implies
285 .B \-g
286 and
287 .BR \-s .
288 .
289 .I groff
290 passes
291 .B \-I
292 options and their arguments to
293 .MR \%soelim 1 ,
294 .MR \%troff 1 ,
295 and output drivers;
296 with the option letter changed to
297 .BR \-M ,
298 it passes the same arguments to
299 .MR \%grn 1 .
300 .
301 .
302 .TP
303 .B \-j
304 Run
305 .MR \%chem 1
306 preprocessor;
307 implies
308 .BR \-p .
309 .
310 .
311 .TP
312 .B \-k
313 Run
314 .MR preconv 1
315 preprocessor.
316 .
317 Refer to its man page for its behavior if neither of
318 .IR groff 's
319 .B \-K
320 or
321 .B \-D
322 options is also specified.
323 .
324 .
325 .TP
326 .BI \-K\~ enc
327 Set input encoding used by
328 .MR preconv 1
329 to
330 .IR enc ;
331 implies
332 .BR \-k .
333 .
334 .
335 .TP
336 .B \-l
337 Send the output to a spooler program for printing.
338 .
339 The
340 .RB \[lq] print \[rq]
341 directive in the device description file
342 specifies the default command to be used;
343 see
344 .MR groff_font 5 .
345 .
346 If no such directive is present for the output device,
347 .ie ''' \{\
348 this option is ignored.
349 .\}
350 .el \{\
351 output is piped to
352 .MR 1 .
353 .\}
354 .
355 See options
356 .B \-L
357 and
358 .BR \-X .
359 .
360 .
361 .TP
362 .BI \-L\~ arg
363 Pass
364 .I arg
365 to the print spooler.
366 .
367 If multiple
368 .IR arg s
369 are required,
370 pass each with a separate
371 .B \-L
372 option.
373 .
374 .I groff
375 does not prefix an option dash to
376 .I arg
377 before passing it to the spooler.
378 .
379 .
380 .TP
381 .B \-M
382 Works as
383 .IR \%troff 's
384 option
385 (see below),
386 but is also passed to
387 .MR \%eqn 1 ,
388 .MR grap 1 ,
389 and
390 .MR \%grn 1 .
391 .
392 .
393 .TP
394 .B \-N
395 Prohibit newlines between
396 .I eqn \" language
397 delimiters:
398 pass
399 .B \-N
400 to
401 .MR \%eqn 1 .
402 .
403 .
404 .TP
405 .B \-p
406 Run
407 .MR \%pic 1
408 preprocessor.
409 .
410 .
411 .TP
412 .BI \-P\~ arg
413 Pass
414 .I arg
415 to the postprocessor.
416 .
417 If multiple
418 .IR arg s
419 are required,
420 pass each with a separate
421 .B \-P
422 option.
423 .
424 .I groff
425 does not prefix an option dash to
426 .I arg
427 before passing it to the postprocessor.
428 .
429 .
430 .TP
431 .B \-R
432 Run
433 .MR \%refer 1
434 preprocessor.
435 .
436 No mechanism is provided for passing arguments to it;
437 most
438 .I \%refer
439 options have equivalent language elements that can be specified within
440 the document.
441 .
442 .
443 .TP
444 .B \-s
445 Run
446 .MR \%soelim 1
447 preprocessor.
448 .
449 .
450 .TP
451 .B \-S
452 Enable safer mode and ignore any subsequent
453 .B \-U
454 option.
455 .
456 .I groff
457 passes the
458 .B \-S
459 option to
460 .MR \%pic 1
461 and
462 .MR \%troff 1 .
463 .
464 .
465 .TP
466 .B \-t
467 Run
468 .MR \%tbl 1
469 preprocessor.
470 .
471 .
472 .TP
473 .BI \-T\~ dev
474 Prepare output for device
475 .I dev.
476 .
477 .I groff
478 passes the
479 .B \-T
480 option and its argument to
481 .IR \%troff ,
482 then
483 (unless the
484 .B \-Z
485 option is used)
486 runs an output driver to convert
487 .IR \%troff 's
488 output to a form appropriate for
489 .IR dev ;
490 see subsection \[lq]Output devices\[rq] below.
491 .
492 .
493 .TP
494 .B \-U
495 Operate in unsafe mode.
496 .
497 .I groff
498 passes the
499 .B \-U
500 option to
501 .MR \%pic 1
502 and
503 .MR \%troff 1 .
504 .
505 .
506 .TP
507 .B \%\-\-version
508 .TQ
509 .B \-v
510 Write version information for
511 .I groff
512 and all programs run by it to the standard output stream;
513 that is,
514 the given command line is processed in the usual way,
515 passing
516 .B \-v
517 to the formatter and any pre- or postprocessors invoked.
518 .
519 .
520 .TP
521 .B \-V
522 Output the pipeline that
523 .I groff
524 would run to the standard output stream and exit.
525 .
526 If given more than once,
527 .I groff
528 both writes the pipeline to the standard error stream and runs it.
529 .
530 .
531 .TP
532 .B \-X
533 Use
534 .MR gxditview 1
535 instead of the usual postprocessor to (pre)view a document on an X11
536 display.
537 .
538 Combining this option with
539 .RB \[lq] "\-T ps" \[rq]
540 uses the font metrics of the PostScript device,
541 whereas the
542 .RB \[lq] "\-T X75" \[rq],
543 .RB \[lq] "\-T X75\-12" \[rq]
544 .RB \[lq] "\-T X100" \[rq],
545 and
546 .RB \[lq] "\-T X100\-12" \[rq]
547 options use the metrics of X11 fonts.
548 .
549 .
550 .TP
551 .B \-Z
552 Disable postprocessing.
553 .
554 .I \%troff
555 output appears on the standard output stream
556 (unless suppressed with
557 .BR \-z );
558 see
559 .MR groff_out 5
560 for a description of this format.
561 .
562 .
563 .\" ====================================================================
564 .SS "Transparent options"
565 .\" ====================================================================
566 .
567 The following options are passed as-is to the formatter program
568 .MR \%troff 1
569 and described in more detail in its man page.
570 .
571 .
572 .TP 9n \" "-m mac" + 2n + hand-tuned for PDF
573 .B \-a
574 Generate a plain text approximation of the typeset output.
575 .
576 .
577 .TP
578 .B \-b
579 Write a backtrace to the standard error stream on each error or warning.
580 .
581 .
582 .TP
583 .B \-c
584 Start with color output disabled.
585 .
586 .
587 .TP
588 .B \-C
589 Enable AT&T
590 .I troff \" AT&T
591 compatibility mode;
592 implies
593 .BR \-c .
594 .
595 .
596 .TP
597 .BI \-d\~ ctext
598 .TQ
599 .BI \-d\~ string = text
600 Define string.
601 .
602 .
603 .TP
604 .B \-E
605 Inhibit
606 .I \%troff
607 error messages;
608 implies
609 .BR \-Ww .
610 .
611 .
612 .TP
613 .BI \-f\~ fam
614 Set default font family.
615 .
616 .
617 .TP
618 .BI \-F\~ dir
619 Search in directory
620 .I dir
621 for the selected output device's directory of device and font
622 description files.
623 .
624 .
625 .TP
626 .B \-i
627 Process standard input after the specified input files.
628 .
629 .
630 .TP
631 .BI \-I\~ dir
632 Search
633 .I dir
634 for input files.
635 .
636 .
637 .TP
638 .BI \-m\~ mac
639 Read macro package
640 .I mac
641 before input.
642 .
643 .I groff
644 passes
645 .B \-m
646 options and their arguments to
647 .MR \%eqn 1 ,
648 .MR grap 1 ,
649 and
650 .MR \%grn 1 .
651 .
652 .
653 .TP
654 .BI \-M\~ dir
655 Search directory
656 .I dir
657 for macro files.
658 .
659 .I groff
660 passes
661 .B \-M
662 options and their arguments to
663 .MR \%eqn 1 ,
664 .MR grap 1 ,
665 and
666 .MR \%grn 1 .
667 .
668 .
669 .TP
670 .BI \-n\~ num
671 Begin numbering pages at
672 .I num.
673 .
674 .
675 .TP
676 .BI \-o\~ list
677 Output only pages in
678 .IR list .
679 .
680 .
681 .TP
682 .BI \-r\~ cnumeric-expression
683 .TQ
684 .BI \-r\~ register = numeric-expression
685 Define register.
686 .
687 .
688 .TP
689 .B \-S
690 Enable safer mode and ignore any subsequent
691 .B \-U
692 option.
693 .
694 .
695 .TP
696 .B \-U
697 Operate in unsafe mode.
698 .
699 .
700 .TP
701 .BI \-w\~ cat
702 .TQ
703 .BI \-W\~ cat
704 Enable and inhibit,
705 respectively,
706 warnings in category
707 .I cat.
708 .
709 .
710 .TP
711 .B \-z
712 Suppress formatted device-independent output of
713 .IR \%troff .
714 .
715 .
716 .\" ====================================================================
717 .SH Usage
718 .\" ====================================================================
719 .
720 The architecture of the GNU
721 .I roff
722 system
723 follows that of other device-independent
724 .I roff
725 implementations,
726 comprising preprocessors,
727 macro packages,
728 output drivers
729 (or \[lq]postprocessors\[rq]),
730 and a suite of utilities,
731 with the formatter program
732 .MR \%troff 1
733 at its heart.
734 .
735 See
736 .MR roff 7
737 for a survey of how a
738 .I roff
739 system works.
740 .
741 .
742 .P
743 The front end programs available in the
744 GNU
745 .I roff
746 system make it easier to use than traditional
747 .IR roff s
748 that required the construction of pipelines
749 or use of temporary files to carry a source document
750 from maintainable form to device-ready output.
751 .
752 The discussion below summarizes the constituent parts of the GNU
753 .I roff
754 system.
755 .
756 It complements
757 .MR roff 7
758 with
759 .IR groff -specific
760 information.
761 .
762 .
763 .\" ====================================================================
764 .SS "Getting started"
765 .\" ====================================================================
766 .
767 Those who prefer to learn by experimenting or are desirous of rapid
768 feedback from the system may wish to start with a \[lq]Hello,
769 world!\&\[rq] document.
770 .
771 .
772 .P
773 .EX
774 $ \c
775 .B echo \[dq]Hello, world!\[dq] | groff \-Tascii \
776 | sed \[aq]/\[ha]$/d\[aq]
777 Hello, world!
778 .EE
779 .
780 .
781 .P
782 We used a
783 .MR sed 1
784 command only to eliminate the 65 blank lines that would otherwise flood
785 the terminal screen.
786 .
787 .RI ( roff
788 systems were developed in the days of paper-based terminals with 66
789 lines to a page.)
790 .
791 .
792 .P
793 Today's users may prefer output to a UTF-8-capable terminal.
794 .
795 .
796 .P
797 .EX
798 $ \c
799 .B echo \[dq]Hello, world!\[dq] | groff \-Tutf8 \
800 | sed \[aq]/\[ha]$/d\[aq]
801 .EE
802 .
803 .
804 .P
805 Producing PDF,
806 HTML,
807 or \*[TeX]'s DVI is also straightforward.
808 .
809 The hard part may be selecting a viewer program for the output.
810 .
811 .
812 .P
813 .EX
814 $ \c
815 .B echo \[dq]Hello, world!\[dq] | groff \-Tpdf > hello.pdf
816 $ \c
817 .B evince hello.pdf
818 $ \c
819 .B echo \[dq]Hello, world!\[dq] | groff \-Thtml > hello.html
820 $ \c
821 .B firefox hello.html
822 $ \c
823 .B echo \[dq]Hello, world!\[dq] | groff \-Tdvi > hello.dvi
824 $ \c
825 .B xdvi hello.dvi
826 .EE
827 .
828 .
829 .\" ====================================================================
830 .SS "Using \f[I]groff\f[] as a REPL"
831 .\" ====================================================================
832 .
833 Those with a programmer's bent may be pleased to know that they can use
834 .I groff
835 in a read-evaluate-print loop (REPL).
836 .
837 Doing so can be handy to verify one's understanding of the formatter's
838 behavior and/or the syntax it accepts.
839 .
840 Turning on all warnings with
841 .B \-ww
842 can aid this goal.
843 .
844 .
845 .P
846 .EX
847 $ \c
848 .B groff \-ww \-Tutf8
849 .B \[rs]# This is a comment. Let\[aq]s define a register.
850 .B .nr a 1
851 .B \[rs]# Do integer arithmetic with operators evaluated left-to-right.
852 .B .nr b \[rs]n[a]+5/2
853 .ne 2v
854 .B \[rs]# Let\[aq]s get the result on the standard error stream.
855 .B .tm \[rs]n[b]
856 3
857 .B \[rs]# Now we\[aq]ll define a string.
858 .B .ds name Leslie\[rs]" This is another form of comment.
859 .B .nr b (\[rs]n[a] + (7/2))
860 .B \[rs]# Center the next two text input lines.
861 .B .ce 2
862 .B Hi, \[rs]*[name].
863 .B Your secret number is \[rs]n[b].
864 .B \[rs]# We will see that the division rounded toward zero.
865 .B It is
866 .B \[rs]# Here\[aq]s an if-else control structure.
867 .B .ie (\[rs]n[b] % 2) odd.
868 .B .el even.
869 .B \[rs]# This trick sets the page length to the current vertical
870 .B \[rs]# position, so that blank lines don\[aq]t spew when we\[aq]re \
871 done.
872 .B .pl \[rs]n[nl]u
873 .I <Control-D>
874 Hi, Leslie.
875 Your secret number is 4.
876 It is even.
877 .EE
878 .
879 .
880 .\" ====================================================================
881 .SS "Paper format"
882 .\" ====================================================================
883 .
884 .\" BEGIN Keep parallel with groff.texi node "Paper Format".
885 The formatter reads the device description file
886 .I DESC
887 for the selected output device when it starts;
888 page dimensions declared there are used if present.
889 .
890 .IR groff 's
891 build process configures a default page format
892 and writes it to typesetters'
893 .I DESC
894 files.
895 .
896 This installation defaults to
897 .RB \[lq] \%letter \[rq].
898 .
899 If the
900 .I DESC
901 file lacks this information,
902 the formatter and output driver use a page length of
903 .BR \[lq] 11i \[rq]
904 (eleven inches)
905 for compatibility with AT&T
906 .IR troff . \" AT&T
907 .
908 See
909 .MR groff_font 5 .
910 .
911 .
912 .P
913 In the formatter,
914 the
915 .B pl
916 request changes the page length,
917 but macro packages often do not support alteration of the paper format
918 within a document.
919 .
920 One might,
921 for instance,
922 want to switch between portrait and landscape orientations.
923 .
924 Macro packages lack a consistent approach to configuration of parameters
925 dependent on the paper format;
926 some,
927 like
928 .IR ms ,
929 benefit from a preamble in the document prior to the first macro call,
930 while others,
931 like
932 .IR mm ,
933 instead require the specification of registers on the command line,
934 or otherwise before its macro file is interpreted,
935 to configure page dimensions.
936 .
937 .
938 .P
939 Output drivers for typesetters also recognize command-line options
940 .B \-p
941 to override the default page dimensions and
942 .B \-l
943 to use landscape orientation.
944 .
945 The output driver's man page,
946 such as
947 .MR grops 1 ,
948 may be helpful.
949 .
950 .
951 .P
952 .IR groff 's
953 .RB \[lq] "\-d \%paper" \[rq]
954 command-line option is a convenient means of setting the paper format;
955 see
956 .MR groff_tmac 5 .
957 .
958 Combine it with appropriate
959 .B \-P
960 options for the output driver,
961 overriding its defaults.
962 .
963 The following command formats for PostScript on A4 paper in landscape
964 orientation.
965 .
966 .
967 .P
968 .RS
969 .EX
970 $ \c
971 .B "groff \-T ps \-d paper=a4l \-P \-pa4 \-P \-l \-ms my.ms >my.ps"
972 .EE
973 .RE
974 .\" END Keep parallel with groff.texi node "Paper Format".
975 .
976 .
977 .\" ====================================================================
978 .SS "Front end"
979 .\" ====================================================================
980 .
981 The
982 .I groff
983 program wraps
984 .MR \%troff 1 ,
985 allowing one to specify preprocessors via command-line options and
986 running the appropriate output driver for the selected output device.
987 .
988 This convenience avoids
989 the manual construction of pipelines or management of temporary files
990 required of users of traditional
991 .MR roff 7
992 systems.
993 .
994 Use
995 .MR grog 1
996 to infer an appropriate
997 .I groff
998 command line to format a document.
999 .
1000 .
1001 .\" ====================================================================
1002 .SS Language
1003 .\" ====================================================================
1004 .
1005 Input to a
1006 .I roff
1007 system is in plain text interleaved with control lines and escape
1008 sequences.
1009 .
1010 The combination constitutes a document in one of a family of languages
1011 we also call
1012 .IR roff ;
1013 see
1014 .MR roff 7
1015 for background.
1016 .
1017 An overview of GNU
1018 .I roff
1019 language syntax and features,
1020 including lists of all supported escape sequences,
1021 requests,
1022 and predefined registers,
1023 can be found in
1024 .MR groff 7 .
1025 .
1026 GNU
1027 .I roff
1028 extensions to the AT&T
1029 .I troff \" AT&T
1030 language,
1031 a common subset of
1032 .I roff
1033 dialects extant today,
1034 are detailed in
1035 .MR groff_diff 7 .
1036 .
1037 .
1038 .\" ====================================================================
1039 .SS Preprocessors
1040 .\" ====================================================================
1041 .
1042 A preprocessor interprets a domain-specific language that produces
1043 .I roff
1044 language output.
1045 .
1046 Frequently,
1047 such input is confined to sections or regions of
1048 .I roff
1049 input
1050 (bracketed with macro calls specific to each preprocessor),
1051 which it replaces.
1052 .
1053 Preprocessors therefore often interpret a subset of
1054 .I roff
1055 syntax along with their own language.
1056 .
1057 GNU
1058 .I roff
1059 provides reimplementations of most preprocessors familiar to users of
1060 AT&T
1061 .IR troff ; \" AT&T
1062 these routinely have extended features and/or require GNU
1063 .I troff \" GNU
1064 to format their output.
1065 .
1066 .
1067 .br
1068 .ne 10v
1069 .P
1070 .RS
1071 .TS
1072 tab($);
1073 Li Lx.
1074 \%tbl$lays out tables;
1075 \%eqn$typesets mathematics;
1076 \%pic$draws diagrams;
1077 \%refer$processes bibliographic references;
1078 \%soelim$preprocesses \[lq]sourced\[rq] input files;
1079 \%grn$T{
1080 renders
1081 .MR gremlin 1
1082 diagrams;
1083 T}
1084 \%chem$T{
1085 draws chemical structural formul\[ae]
1086 using
1087 .IR pic ; \" generic
1088 T}
1089 gperl$T{
1090 populates
1091 .I groff
1092 registers and strings using
1093 .MR perl 1 ;
1094 T}
1095 glilypond$T{
1096 embeds
1097 .I LilyPond
1098 sheet music;
1099 and
1100 T}
1101 gpinyin$T{
1102 eases Mandarin Chinese input using Hanyu Pinyin.
1103 T}
1104 .TE
1105 .RE
1106 .
1107 .
1108 .P
1109 A preprocessor unique to GNU
1110 .I roff
1111 is
1112 .MR preconv 1 ,
1113 which converts various input encodings to something GNU
1114 .I troff \" GNU
1115 can understand.
1116 .
1117 When used,
1118 it is run before any other preprocessors.
1119 .
1120 .
1121 .P
1122 Most preprocessors enclose content between a pair of characteristic
1123 tokens.
1124 .
1125 Such a token must occur at the beginning of an input line and use the
1126 dot control character.
1127 .
1128 Spaces and tabs must not follow the control character or precede the
1129 end of the input line.
1130 .
1131 Deviating from these rules defeats a token's recognition by the
1132 preprocessor.
1133 .
1134 Tokens are generally preserved in preprocessor output and interpreted as
1135 macro calls subsequently by
1136 .IR \%troff .
1137 .
1138 The
1139 .I \%ideal
1140 preprocessor is not yet available in
1141 .IR groff .
1142 .
1143 .
1144 .P
1145 .TS
1146 box center tab(^);
1147 C | C | C
1148 CfI | Cf(CR) | Cf(CR).
1149 preprocessor^starting token^ending token
1150 =
1151 \%chem^.cstart^.cend
1152 \%eqn^.EQ^.EN
1153 grap^.G1^.G2
1154 \%grn^.GS^.GE
1155 .\" Keep the .IF line below the \%ideal line.
1156 \%ideal^.IS^.IE
1157 ^^.IF
1158 .\" Keep the .PF line below the \%pic line.
1159 \%pic^.PS^.PE
1160 ^^.PF
1161 ^^.PY
1162 \%refer^.R1^.R2
1163 \%tbl^.TS^.TE
1164 _
1165 glilypond^.lilypond start^.lilypond stop
1166 gperl^.Perl start^.Perl stop
1167 gpinyin^.pinyin start^.pinyin stop
1168 .TE
1169 .
1170 .
1171 .\" ====================================================================
1172 .SS "Macro packages"
1173 .\" ====================================================================
1174 .
1175 Macro files are
1176 .I roff
1177 input files designed to produce no output themselves but instead ease
1178 the preparation of other
1179 .I roff
1180 documents.
1181 .
1182 When a macro file is installed at a standard location and suitable for
1183 use by a general audience,
1184 it is termed a
1185 .IR "macro package" .
1186 .
1187 .
1188 .br
1189 .ne 2v
1190 .P
1191 The
1192 .BR \-m \~option
1193 loads a macro package
1194 prior to any
1195 .I roff
1196 input documents,
1197 and after performing any string and register assignments
1198 directed by
1199 .B \-d
1200 and
1201 .B \-r
1202 options.
1203 .
1204 The GNU
1205 .I roff
1206 system implements most well-known macro packages for AT&T
1207 .I troff \" AT&T
1208 .\" exceptions: mpm, mv
1209 in a compatible way and extends them.
1210 .
1211 These have one- or two-letter names arising from intense practices of
1212 naming economy in early Unix culture,
1213 a laconic approach that led to many of the packages being identified in
1214 general usage with the
1215 .I nroff
1216 and
1217 .I troff
1218 option letter used to invoke them,
1219 sometimes to punning effect,
1220 as with \[lq]man\[rq]
1221 (short for \[lq]manual\[rq]),
1222 and even with the option dash,
1223 as in the case of the
1224 .I s
1225 package,
1226 much better known as
1227 .I ms
1228 or even
1229 .IR \-ms .
1230 .
1231 .
1232 .P
1233 Macro packages serve a variety of purposes.
1234 .
1235 Some are \[lq]full-service\[rq] packages,
1236 adopting responsibility for page layout among other fundamental tasks,
1237 and defining their own lexicon of macros for document composition;
1238 each such package stands alone and a given document can use at most one.
1239 .
1240 .
1241 .TP
1242 .I an
1243 is used to compose man pages in the format originating in Version\~7
1244 Unix (1979);
1245 see
1246 .MR groff_man 7 .
1247 .
1248 It can be specified on the command line as
1249 .BR \-man .
1250 .
1251 .
1252 .TP
1253 .I doc
1254 is used to compose man pages in the format originating in 4.3BSD-Reno
1255 (1990);
1256 see
1257 .MR groff_mdoc 7 .
1258 .
1259 It can be specified on the command line as
1260 .BR \-mdoc .
1261 .
1262 .
1263 .TP
1264 .I e
1265 is the Berkeley general-purpose macro suite,
1266 developed as an alternative to AT&T's
1267 .IR s ;
1268 see
1269 .MR groff_me 7 .
1270 .
1271 It can be specified on the command line as
1272 .BR \-me .
1273 .
1274 .
1275 .TP
1276 .I m
1277 implements the format used by the
1278 second-generation AT&T macro suite for general documents,
1279 a successor to
1280 .IR s ;
1281 see
1282 .MR groff_mm 7 .
1283 .
1284 It can be specified on the command line as
1285 .BR \-mm .
1286 .
1287 .
1288 .TP
1289 .I om
1290 (invariably called \[lq]mom\[rq])
1291 is a modern package written by Peter Schaffter specifically for GNU
1292 .IR roff .
1293 .
1294 Consult the
1295 .UR file://\:/usr/\:\%share/\:\%doc/\:\%groff/\:\%html/\:mom/\:toc\:.html
1296 .I mom
1297 HTML manual
1298 .UE
1299 for extensive documentation.
1300 .
1301 She\[em]for
1302 .I mom
1303 takes the female pronoun\[em]can be specified on the command line as
1304 .BR \-mom .
1305 .
1306 .
1307 .TP
1308 .I s
1309 is the original AT&T general-purpose document format;
1310 see
1311 .MR groff_ms 7 .
1312 .
1313 It can be specified on the command line as
1314 .BR \-ms .
1315 .
1316 .
1317 .P
1318 Others are supplemental.
1319 .
1320 For instance,
1321 .
1322 .I \%andoc
1323 is a wrapper package specific to GNU
1324 .I roff
1325 that recognizes whether a document uses
1326 .I man
1327 or
1328 .I mdoc
1329 format and loads the corresponding macro package.
1330 .
1331 It can be specified on the command line as
1332 .BR \%\-mandoc .
1333 .
1334 A
1335 .MR man 1
1336 librarian \" such as man-db, since 2001
1337 may use this macro file to delegate loading of the correct macro
1338 package;
1339 it is thus unnecessary for
1340 .I man
1341 itself to scan the contents of a document to decide the issue.
1342 .
1343 .
1344 .P
1345 Many macro files augment the function of the full-service packages,
1346 or of
1347 .I roff
1348 documents that do not employ such a package\[em]the latter are sometimes
1349 characterized as \[lq]raw\[rq].
1350 .
1351 These auxiliary packages are described,
1352 along with
1353 details of macro file naming and placement,
1354 in
1355 .MR groff_tmac 5 .
1356 .
1357 .
1358 .\" ====================================================================
1359 .SS Formatters
1360 .\" ====================================================================
1361 .
1362 The formatter,
1363 the program that interprets
1364 .I roff
1365 language input,
1366 is
1367 .MR \%troff 1 .
1368 .
1369 It provides the features of the AT&T
1370 .I troff \" AT&T
1371 and
1372 .I nroff \" AT&T
1373 programs as well as many extensions.
1374 .
1375 The command-line option
1376 .B \-C
1377 switches
1378 .I \%troff
1379 into
1380 .IR "compatibility mode" ,
1381 which tries to emulate AT&T
1382 .I troff \" AT&T
1383 as closely as is practical to enable the formatting of documents written
1384 for the older system.
1385 .
1386 .
1387 .P
1388 A shell script,
1389 .MR \%nroff 1 ,
1390 emulates the behavior of AT&T
1391 .IR nroff . \" AT&T
1392 .
1393 It attempts to correctly encode the output based on the locale,
1394 relieving the user of the need to specify an output device with the
1395 .B \-T
1396 option and is therefore convenient for use with terminal output devices,
1397 described in the next subsection.
1398 .
1399 .
1400 .P
1401 GNU
1402 .I troff \" GNU
1403 generates output in a device-independent,
1404 but not device-agnostic,
1405 page description language detailed in
1406 .MR groff_out 5 .
1407 .
1408 .
1409 .\" ====================================================================
1410 .SS "Output devices"
1411 .\" ====================================================================
1412 .
1413 .I \%troff
1414 output is formatted for a particular
1415 .IR "output device" ,
1416 typically specified by the
1417 .B \-T
1418 option to the formatter or a front end.
1419 .
1420 If neither this option nor the
1421 .I \%GROFF_TYPESETTER
1422 environment variable is used,
1423 the default output device is
1424 .BR \%ps .
1425 .
1426 An output device may be any of the following.
1427 .
1428 .
1429 .TP 10n \" "X100\-12" + 2n + hand-tuned for PDF
1430 .B ascii
1431 for terminals using the ISO 646 1991:IRV character set and encoding,
1432 also known as US-ASCII.
1433 .
1434 .
1435 .TP
1436 .B dvi
1437 for TeX DVI format.
1438 .
1439 .
1440 .TP
1441 .B html
1442 .TQ
1443 .B xhtml
1444 for HTML and XHTML output,
1445 respectively.
1446 .
1447 .
1448 .TP
1449 .B latin1
1450 for terminals using the ISO\~Latin-1
1451 (8859-1)
1452 character set and encoding.
1453 .
1454 .
1455 .TP
1456 .B lbp
1457 for Canon CaPSL printers
1458 (LBP-4 and LBP-8 series laser printers).
1459 .
1460 .
1461 .TP
1462 .B lj4
1463 for HP LaserJet4-compatible
1464 (or other PCL5-compatible)
1465 printers.
1466 .
1467 .
1468 .TP
1469 .B pdf
1470 for PDF output.
1471 .
1472 .
1473 .TP
1474 .B ps
1475 for PostScript output.
1476 .
1477 .
1478 .TP
1479 .B utf8
1480 for terminals using the ISO 10646 (\[lq]Unicode\[rq]) character set in
1481 UTF-8 encoding.
1482 .
1483 .
1484 .TP
1485 .B X75
1486 for previewing with
1487 .I \%gxditview
1488 using
1489 75 dpi resolution and a
1490 10-point base type size.
1491 .
1492 .
1493 .TP
1494 .B X75\-12
1495 for previewing with
1496 .I \%gxditview
1497 using
1498 75 dpi resolution and a
1499 12-point base type size.
1500 .
1501 .
1502 .TP
1503 .B X100
1504 for previewing with
1505 .I \%gxditview
1506 using
1507 100 dpi resolution and a
1508 10-point base type size.
1509 .
1510 .
1511 .TP
1512 .B X100\-12
1513 for previewing with
1514 .I \%gxditview
1515 using
1516 100 dpi resolution
1517 and a
1518 12-point base type size.
1519 .
1520 .
1521 .\" ====================================================================
1522 .SS Postprocessors
1523 .\" ====================================================================
1524 .
1525 Any program that interprets the output of
1526 GNU
1527 .I troff \" GNU
1528 is a
1529 postprocessor.
1530 .
1531 The postprocessors provided by GNU
1532 .I roff
1533 are
1534 .IR "output drivers" ,
1535 which prepare a document for viewing or printing.
1536 .
1537 Postprocessors for other purposes,
1538 such as page resequencing or statistical measurement of a document,
1539 are conceivable.
1540 .
1541 .
1542 .P
1543 An output driver supports one or more output devices,
1544 each with its own device description file.
1545 .
1546 A device determines its postprocessor with the
1547 .B postpro
1548 directive in its device description file;
1549 see
1550 .MR groff_font 5 .
1551 .
1552 The
1553 .B \-X
1554 option overrides this selection,
1555 causing
1556 .I \%gxditview
1557 to serve as the output driver.
1558 .
1559 .
1560 .TP
1561 .MR grodvi 1
1562 provides
1563 .BR dvi .
1564 .
1565 .
1566 .TP
1567 .MR grohtml 1
1568 provides
1569 .B html
1570 and
1571 .BR xhtml .
1572 .
1573 .
1574 .TP
1575 .MR grolbp 1
1576 provides
1577 .BR lbp .
1578 .
1579 .
1580 .TP
1581 .MR grolj4 1
1582 provides
1583 .BR lj4 .
1584 .
1585 .
1586 .TP
1587 .MR gropdf 1
1588 provides
1589 .BR pdf .
1590 .
1591 .
1592 .TP
1593 .MR grops 1
1594 provides
1595 .BR ps .
1596 .
1597 .
1598 .TP
1599 .MR grotty 1
1600 provides
1601 .BR ascii ,
1602 .BR latin1 ,
1603 and
1604 .BR utf8 .
1605 .
1606 .
1607 .TP
1608 .MR gxditview 1
1609 provides
1610 .BR X75 ,
1611 .BR X75\-12 ,
1612 .BR X100 ,
1613 and
1614 .BR X100\-12 ,
1615 and additionally can preview
1616 .BR ps .
1617 .
1618 .
1619 .\" ====================================================================
1620 .SS Utilities
1621 .\" ====================================================================
1622 .
1623 GNU
1624 .I roff
1625 includes a suite of utilities.
1626 .
1627 .
1628 .TP
1629 .MR gdiffmk 1
1630 marks differences between a pair of
1631 .I roff
1632 input files.
1633 .
1634 .
1635 .TP
1636 .MR grog 1
1637 infers the
1638 .I groff
1639 command a document requires.
1640 .
1641 .
1642 .P
1643 Several utilities prepare descriptions of fonts,
1644 enabling the formatter to use them when producing output for a given
1645 device.
1646 .
1647 .
1648 .TP
1649 .MR addftinfo 1
1650 adds information to AT&T
1651 .I troff \" AT&T
1652 font description files to enable their use with
1653 GNU
1654 .IR troff .\" GNU
1655 .
1656 .
1657 .TP
1658 .MR afmtodit 1
1659 creates font description files for PostScript Type\~1 fonts.
1660 .
1661 .
1662 .TP
1663 .MR pfbtops 1
1664 translates a PostScript Type\~1 font in PFB
1665 (Printer Font Binary)
1666 format to PFA
1667 (Printer Font ASCII),
1668 which can then be interpreted by
1669 .IR \%afmtodit .
1670 .
1671 .
1672 .TP
1673 .MR hpftodit 1
1674 creates font description files for the HP LaserJet\~4 family of
1675 printers.
1676 .
1677 .
1678 .TP
1679 .MR tfmtodit 1
1680 creates font description files for the TeX DVI device.
1681 .
1682 .
1683 .TP
1684 .MR xtotroff 1
1685 creates font description files for X Window System core fonts.
1686 .
1687 .
1688 .P
1689 A trio of tools transform material constructed using
1690 .I roff
1691 preprocessor languages into graphical image files.
1692 .
1693 .
1694 .TP
1695 .MR eqn2graph 1
1696 converts an
1697 .I eqn
1698 equation into a cropped image.
1699 .
1700 .
1701 .TP
1702 .MR grap2graph 1
1703 converts a
1704 .I grap
1705 diagram into a cropped image.
1706 .
1707 .
1708 .TP
1709 .MR pic2graph 1
1710 converts a
1711 .I pic
1712 diagram into a cropped image.
1713 .
1714 .
1715 .P
1716 Another set of programs works with the bibliographic data files used
1717 by the
1718 .MR \%refer 1
1719 preprocessor.
1720 .
1721 .
1722 .TP
1723 .MR \%indxbib 1
1724 makes inverted indices for bibliographic databases,
1725 speeding lookup operations on them.
1726 .
1727 .
1728 .TP
1729 .MR lkbib 1
1730 searches the databases.
1731 .
1732 .
1733 .TP
1734 .MR \%lookbib 1
1735 interactively searches
1736 the databases.
1737 .
1738 .
1739 .\" ====================================================================
1740 .SH "Exit status"
1741 .\" ====================================================================
1742 .
1743 .I groff
1744 exits successfully (with
1745 .RB status\~ 0 )
1746 if either of the options
1747 .B \-h
1748 or
1749 .B \-\-help
1750 is specified,
1751 .RB status\~ 2
1752 if the program cannot interpret its command-line arguments,
1753 and
1754 .RB status\~ 1
1755 if it encounters an error during operation.
1756 .
1757 Otherwise,
1758 .I groff
1759 runs a pipeline to process its input;
1760 if all commands within the pipeline exit successfully,
1761 .I groff
1762 does likewise.
1763 .
1764 If not,
1765 .IR groff 's
1766 exit status encodes a summary of problems encountered,
1767 setting bit\~2 if a command exited with a failure status,
1768 bit\~3 if a command was terminated with a signal,
1769 and bit\~4 if a command could not be executed.
1770 .
1771 (Thus,
1772 if all three misfortunes befall one's pipeline,
1773 .I groff
1774 exits with status 2\[ha]2 + 2\[ha]3 + 2\[ha]4 = 4+8+16 = 28.)
1775 .
1776 To troubleshoot pipeline problems,
1777 re-run the
1778 .I groff
1779 command with the
1780 .B \-V
1781 option and break the reported pipeline down into separate stages,
1782 inspecting the exit status of,
1783 and diagnostic messages emitted by,
1784 each command.
1785 .
1786 .
1787 .\" ====================================================================
1788 .SH Environment
1789 .\" ====================================================================
1790 .
1791 Environment variables in the host system affect the behavior of programs
1792 supplied by
1793 .I groff
1794 as follows.
1795 .
1796 Normally,
1797 the path separator in environment variables ending with
1798 .I PATH
1799 is the colon;
1800 this may vary depending on the operating system.
1801 .
1802 For example,
1803 Windows uses a semicolon instead.
1804 .
1805 .
1806 .TP
1807 .I GROFF_BIN_PATH
1808 Locate
1809 .I groff \" system
1810 commands
1811 in these directories,
1812 followed by those in
1813 .IR PATH .
1814 .
1815 If not set,
1816 the installation directory of GNU
1817 .I roff
1818 executables,
1819 .IR /usr/\:\%bin ,
1820 is searched before
1821 .IR PATH .
1822 .
1823 .
1824 .TP
1825 .I GROFF_COMMAND_PREFIX
1826 Apply a prefix to certain GNU
1827 .I roff
1828 commands.
1829 .
1830 .I groff
1831 can be configured at compile time to apply a prefix to the names of
1832 programs it provides that had counterparts in AT&T
1833 .IR troff , \" AT&T
1834 so that name collisions are avoided at run time.
1835 .
1836 The default prefix is empty.
1837 .
1838 .
1839 .IP
1840 When used,
1841 this prefix is conventionally the letter \[lq]g\[rq].
1842 .
1843 For example,
1844 GNU
1845 .I troff \" GNU
1846 would be installed as
1847 .IR gtroff .
1848 .
1849 Besides
1850 .IR troff , \" generic
1851 the prefix applies to
1852 the formatter wrapper
1853 .IR nroff ; \" generic (but not a wrapper in AT&T troff)
1854 the preprocessors
1855 .IR eqn , \" generic
1856 .IR grn , \" generic
1857 .IR pic , \" generic
1858 .IR \%refer , \" generic
1859 .IR tbl , \" generic
1860 and
1861 .IR \%soelim ; \" generic
1862 and the utilities
1863 .I \%indxbib \" generic
1864 and
1865 .IR \%lookbib . \" generic
1866 .
1867 .
1868 .TP
1869 .I GROFF_ENCODING
1870 Specify the assumed character encoding of the input.
1871 .
1872 .I groff
1873 passes its value as an argument to
1874 .IR preconv (1)
1875 preprocessor's
1876 .B \-e
1877 option.
1878 .
1879 This variable's existence implies
1880 the
1881 .I groff
1882 option
1883 .BR \-k .
1884 .
1885 If set but empty,
1886 .I groff
1887 runs
1888 .I preconv
1889 without an
1890 .B \-e
1891 option.
1892 .
1893 .IR groff 's
1894 .B \-K
1895 option overrides
1896 .IR \%GROFF_ENCODING .
1897 .
1898 .
1899 .TP
1900 .I GROFF_FONT_PATH
1901 Seek the selected output device's directory of device and font
1902 description files in this list of directories.
1903 .
1904 See
1905 .MR \%troff 1
1906 and
1907 .MR groff_font 5 .
1908 .
1909 .
1910 .TP
1911 .I GROFF_TMAC_PATH
1912 Seek macro packages in this list of directories.
1913 .
1914 See
1915 .MR \%troff 1
1916 and
1917 .MR groff_tmac 5 .
1918 .
1919 .
1920 .TP
1921 .I GROFF_TMPDIR
1922 Create temporary files in this directory.
1923 .
1924 If not set,
1925 but
1926 .I \%TMPDIR
1927 is,
1928 the latter is used instead.
1929 .
1930 On Windows systems,
1931 if neither of the foregoing are set,
1932 the environment variables
1933 .I TMP
1934 and
1935 .I TEMP
1936 (in that order)
1937 are checked also.
1938 .
1939 Otherwise,
1940 temporary files are created in
1941 .IR /tmp .
1942 .
1943 The
1944 .MR \%refer 1 ,
1945 .MR grohtml 1 ,
1946 and
1947 .MR grops 1
1948 commands use temporary files.
1949 .
1950 .
1951 .TP
1952 .I GROFF_TYPESETTER
1953 Set the default output device.
1954 .
1955 If empty or not set,
1956 .B \%ps
1957 is used.
1958 .
1959 The
1960 .B \-T
1961 option overrides
1962 .IR \%GROFF_TYPESETTER .
1963 .
1964 .
1965 .TP
1966 .I SOURCE_DATE_EPOCH
1967 Declare a time stamp
1968 (expressed as seconds since the Unix epoch)
1969 to use as the output creation time stamp in place of the current time.
1970 .
1971 The time is converted to human-readable form using
1972 .MR gmtime 3
1973 and
1974 .MR asctime 3
1975 when the formatter starts up and stored in registers usable by documents
1976 and macro packages.
1977 .
1978 .
1979 .TP
1980 .I TZ
1981 Declare the time zone to use when converting the current time to
1982 human-readable form;
1983 see
1984 .MR tzset 3 .
1985 .
1986 If
1987 .I SOURCE_DATE_EPOCH
1988 is used,
1989 it is always converted to human-readable form using UTC.
1990 .
1991 .
1992 .\" ====================================================================
1993 .SH Examples
1994 .\" ====================================================================
1995 .
1996 .\" BEGIN Keep parallel with groff.texi node "Invocation Examples".
1997 .I roff
1998 systems are best known for formatting man pages.
1999 .
2000 A
2001 .MR man 1
2002 librarian program,
2003 having located a page,
2004 might render it with a
2005 .I groff
2006 command.
2007 .
2008 .RS
2009 .EX
2010 groff \-t \-man \-Tutf8 /usr/share/man/man1/groff.1
2011 .EE
2012 .RE
2013 .
2014 The librarian will also pipe the output through a pager,
2015 which might not interpret terminal escape sequences
2016 .I groff
2017 emits for boldface,
2018 underlining,
2019 italics,
2020 or hyperlinking;
2021 see section \[lq]Limitations\[rq] below.
2022 .
2023 .
2024 .P
2025 To process a
2026 .I roff
2027 input file using the preprocessors
2028 .I \%tbl
2029 and
2030 .I \%pic
2031 and the
2032 .I me
2033 macro package in the way to which AT&T
2034 .I troff \" AT&T
2035 users were accustomed,
2036 one would type
2037 (or script)
2038 a pipeline.
2039 .
2040 .
2041 .IP
2042 .EX
2043 \%pic foo.me | \%tbl | \%troff \-me \-Tutf8 | grotty
2044 .EE
2045 .
2046 .
2047 .P
2048 Shorten this pipeline to an equivalent command using
2049 .IR groff .
2050 .
2051 .
2052 .IP
2053 .EX
2054 groff \-p \-t \-me \-T utf8 foo.me
2055 .EE
2056 .
2057 .
2058 .P
2059 An even easier way to do this is to use
2060 .MR grog 1
2061 to guess the preprocessor and macro options and execute the result by
2062 using the command substitution feature of the shell.
2063 .
2064 .IP
2065 .EX
2066 $(grog \-Tutf8 foo.me)
2067 .EE
2068 .
2069 .
2070 .P
2071 Each command-line option to a postprocessor must be specified with any
2072 required leading dashes
2073 .RB \[lq] \- \[rq]
2074 .\" No GNU roff postprocessor uses long options for anything except
2075 .\" --help or --version.
2076 .\"or
2077 .\".RB \[lq] \-\- \[rq]
2078 .\" XXX: grolbp does.
2079 because
2080 .I groff
2081 passes the arguments as-is to the postprocessor;
2082 this permits arbitrary arguments to be transmitted.
2083 .
2084 For example,
2085 to pass a title to the
2086 .I gxditview
2087 postprocessor,
2088 the shell commands
2089 .
2090 .RS
2091 .EX
2092 groff \-X \-P \-title \-P \[aq]trial run\[aq] mydoc.t
2093 .EE
2094 .RE
2095 .
2096 and
2097 .
2098 .RS
2099 .EX
2100 groff \-X \-Z mydoc.t | gxditview \-title \[aq]trial run\[aq] \-
2101 .EE
2102 .RE
2103 .
2104 are equivalent.
2105 .\" END Keep parallel with groff.texi node "Invocation Examples".
2106 .
2107 .
2108 .\" ====================================================================
2109 .SH Limitations
2110 .\" ====================================================================
2111 .
2112 When paging output for the
2113 .BR ascii ,
2114 .BR latin1 ,
2115 and
2116 .B utf8
2117 devices,
2118 programs like
2119 .MR more 1
2120 and
2121 .MR less 1
2122 may require command-line options to correctly handle some terminal
2123 escape sequences;
2124 see
2125 .MR grotty 1 .
2126 .
2127 .
2128 .\" ====================================================================
2129 .SH "Installation directories"
2130 .\" ====================================================================
2131 .
2132 GNU
2133 .I roff
2134 installs files in varying locations depending on its compile-time
2135 configuration.
2136 .
2137 On this installation,
2138 the following locations are used.
2139 .
2140 .
2141 .if !'/usr/\:\%share/\:\%X11/\:\%app\-defaults'' \{\
2142 .TP
2143 .I /usr/\:\%share/\:\%X11/\:\%app\-defaults
2144 Application defaults directory for
2145 .MR gxditview 1 .
2146 .\}
2147 .
2148 .
2149 .TP
2150 .I /usr/\:\%bin
2151 Directory containing
2152 .IR groff 's
2153 executable commands.
2154 .
2155 .
2156 .TP
2157 .I /usr/\:\%share/\:\%groff/\:\%1.24.0/\:\%eign
2158 List of common words for
2159 .MR \%indxbib 1 .
2160 .
2161 .
2162 .TP
2163 .I /usr/\:\%share/\:\%groff/\:\%1.24.0
2164 Directory for data files.
2165 .
2166 .
2167 .TP
2168 .I /usr/\:\%dict/\:\%papers/\:\%Ind
2169 Default index for
2170 .MR lkbib 1
2171 and
2172 .MR \%refer 1 .
2173 .
2174 .
2175 .TP
2176 .I /usr/\:\%share/\:\%doc/\:\%groff
2177 Documentation directory.
2178 .
2179 .
2180 .TP
2181 .I /usr/\:\%share/\:\%doc/\:\%groff/\:\%examples
2182 Example directory.
2183 .
2184 .
2185 .TP
2186 .I /usr/\:\%share/\:\%groff/\:\%1.24.0/\:\%font
2187 Font directory.
2188 .
2189 .
2190 .TP
2191 .I /usr/\:\%share/\:\%doc/\:\%groff/\:\%html
2192 HTML documentation directory.
2193 .
2194 .
2195 .TP
2196 .I /usr/\:\%lib/\:\%font
2197 Legacy font directory.
2198 .
2199 .
2200 .TP
2201 .I /etc/\:\%groff/\:\%site\-font
2202 Local font directory.
2203 .
2204 .
2205 .TP
2206 .I /etc/\:\%groff/\:\%site\-tmac
2207 Local macro package
2208 .RI ( tmac
2209 file) directory.
2210 .
2211 .
2212 .TP
2213 .I /usr/\:\%share/\:\%groff/\:\%1.24.0/\:\%tmac
2214 Macro package
2215 .RI ( tmac
2216 file) directory.
2217 .
2218 .
2219 .TP
2220 .I /usr/\:\%share/\:\%groff/\:\%1.24.0/\:\%oldfont
2221 Font directory for compatibility with old versions of
2222 .IR groff ;
2223 see
2224 .MR grops 1 .
2225 .
2226 .
2227 .TP
2228 .I /usr/\:\%share/\:\%doc/\:\%groff/\:\%pdf
2229 PDF documentation directory.
2230 .
2231 .
2232 .if !'no'no' \{\
2233 .TP
2234 .I /etc/\:\%groff/\:\%site\-tmac
2235 System macro package
2236 .RI ( tmac
2237 file) directory.
2238 .\}
2239 .
2240 .
2241 .\" ====================================================================
2242 .SS "\f[I]groff\f[] macro directory"
2243 .\" ====================================================================
2244 .
2245 Most macro files supplied with GNU
2246 .I roff
2247 are stored in
2248 .I /usr/\:\%share/\:\%groff/\:\%1.24.0/\:\%tmac
2249 for the installation corresponding to this document.
2250 .
2251 As a rule,
2252 multiple directories are searched for macro files;
2253 see
2254 .MR \%troff 1 .
2255 .
2256 For a catalog of macro files GNU
2257 .I roff
2258 provides,
2259 see
2260 .MR groff_tmac 5 .
2261 .
2262 .
2263 .\" ====================================================================
2264 .SS "\f[I]groff\f[] device and font description directory"
2265 .\" ====================================================================
2266 .
2267 Device and font description files supplied with GNU
2268 .I roff
2269 are stored in
2270 .I /usr/\:\%share/\:\%groff/\:\%1.24.0/\:\%font
2271 for the installation corresponding to this document.
2272 .
2273 As a rule,
2274 multiple directories are searched for device and font description files;
2275 see
2276 .MR \%troff 1 .
2277 .
2278 For the formats of these files,
2279 see
2280 .MR groff_font 5 .
2281 .
2282 .
2283 .\" ====================================================================
2284 .SH Availability
2285 .\" ====================================================================
2286 .
2287 Obtain links to
2288 .I groff
2289 releases for download,
2290 its source repository,
2291 discussion mailing lists,
2292 a support ticket tracker,
2293 and further information from the
2294 .UR http://\:www\:.gnu\:.org/\:software/\:groff
2295 .I groff
2296 page of the GNU website
2297 .UE .
2298 .
2299 .
2300 .P
2301 A free implementation of the
2302 .I grap
2303 preprocessor,
2304 written by
2305 .MT faber@\:lunabase\:.org
2306 Ted Faber
2307 .ME ,
2308 can be found at the
2309 .UR http://\:www\:.lunabase\:.org/\:\[ti]faber/\:Vault/\:software/\
2310 \:grap/
2311 .I grap
2312 website
2313 .UE .
2314 .
2315 .I groff
2316 supports only this
2317 .IR grap .
2318 .
2319 .
2320 .\" ====================================================================
2321 .SH Authors
2322 .\" ====================================================================
2323 .
2324 .I groff
2325 (both the front-end command and the overall system)
2326 was primarily written by
2327 .MT jjc@\:jclark\:.com
2328 James Clark
2329 .ME .
2330 .
2331 Contributors to this document include Clark,
2332 Trent A.\& Fisher,
2333 .MT [email protected]
2334 Werner Lemberg
2335 .ME ,
2336 .MT groff\-bernd.warken\-72@\:web\:.de
2337 Bernd Warken
2338 .ME ,
2339 and
2340 .MT g.branden\:.robinson@\:gmail\:.com
2341 G.\& Branden Robinson
2342 .ME .
2343 .
2344 .
2345 .\" ====================================================================
2346 .SH "See also"
2347 .\" ====================================================================
2348 .
2349 .IR "Groff: The GNU Implementation of troff" ,
2350 by Trent A.\& Fisher and Werner Lemberg,
2351 is the primary
2352 .I groff
2353 manual.
2354 .
2355 You can browse it interactively with \[lq]info groff\[rq].
2356 .
2357 .
2358 .P
2359 A list of all
2360 .I groff
2361 man pages follows.
2362 .
2363 A few
2364 .RI ( \%grohtml ,
2365 .IR gropdf ,
2366 .IR gxditview ,
2367 and
2368 .IR xtotroff )
2369 will be unavailable if their corresponding programs were disabled during
2370 compilation.
2371 .
2372 .
2373 .\" groff ships 59 man pages generated from 58 source files. The
2374 .\" numbered comments refer to their sorting order in the source tree,
2375 .\" so that it is easier to tell that we've enumerated all of them.
2376 .TP
2377 Introduction, \c
2378 history, \c
2379 and further reading:
2380 .MR roff 7 \" #23
2381 .
2382 .
2383 .TP
2384 .RI "Viewer for\~" groff "\~(and AT&T device-independent\~" troff \
2385 )\~documents:
2386 .MR gxditview 1 \" #33
2387 .
2388 .
2389 .TP
2390 Preprocessors:
2391 .MR \%chem 1 , \" #1
2392 .MR \%eqn 1 , \" #34
2393 .MR \%neqn 1 , \" #35
2394 .MR glilypond 1 , \" #4
2395 .MR \%grn 1 , \" #36
2396 .MR preconv 1 , \" #38
2397 .MR gperl 1 , \" #5
2398 .MR \%pic 1 , \" #37
2399 .MR gpinyin 1 , \" #6
2400 .MR \%refer 1 , \" #39
2401 .MR \%soelim 1 , \" #40
2402 .MR \%tbl 1 \" #41
2403 .
2404 .
2405 .TP
2406 Macro packages:
2407 .MR groff_hdtbl 7 , \" #9
2408 .MR groff_man 7 , \" #55a
2409 .MR groff_man_style 7 , \" #55b
2410 .MR groff_mdoc 7 , \" #56
2411 .MR groff_me 7 , \" #57
2412 .MR groff_mm 7 , \" # 10
2413 .MR groff_mmse 7 , \" # 11
2414 .MR groff_mom 7 , \" #13
2415 .MR groff_ms 7 , \" #58
2416 .MR groff_rfc1345 7 , \" 16
2417 .MR groff_trace 7 , \" #59
2418 .MR groff_www 7 \" #60
2419 .
2420 .
2421 .TP
2422 Bibliographic database management tools:
2423 .MR \%indxbib 1 , \" #49
2424 .MR lkbib 1 , \" #50
2425 .MR \%lookbib 1 \" #51
2426 .
2427 .
2428 .TP
2429 Language, \c
2430 conventions, \c
2431 and GNU extensions:
2432 .MR groff 7 , \" #17
2433 .MR groff_char 7 , \" #18
2434 .MR groff_diff 7 , \" #19
2435 .MR groff_font 5 , \" #20
2436 .MR groff_tmac 5 \" #22
2437 .
2438 .
2439 .TP
2440 Device-independent page description language:
2441 .MR groff_out 5 \" #21
2442 .
2443 .
2444 .TP
2445 Formatter program:
2446 .MR \%troff 1 \" #45
2447 .
2448 .
2449 .TP
2450 Formatter wrappers:
2451 .\".MR groff 1 , \" 42 -- this page
2452 .MR \%nroff 1 , \" #44
2453 .MR mmroff 1 , \" #12
2454 .MR pdfmom 1 \" #30
2455 .\" MR pdfroff 1 \" formerly #14
2456 .
2457 .
2458 .TP
2459 Postprocessors for output devices:
2460 .MR grodvi 1 , \" #24
2461 .MR grohtml 1 , \" #25
2462 .MR grolbp 1 , \" #26
2463 .MR grolj4 1 , \" #27
2464 .MR gropdf 1 , \" #29
2465 .MR grops 1 , \" #31
2466 .MR grotty 1 \" #32
2467 .
2468 .
2469 .TP
2470 Font support utilities:
2471 .MR addftinfo 1 , \" #46
2472 .MR afmtodit 1 , \" #47
2473 .MR hpftodit 1 , \" #48
2474 .MR pfbtops 1 , \" #52
2475 .MR tfmtodit 1 , \" #53
2476 .MR xtotroff 1 \" #54
2477 .
2478 .
2479 .TP
2480 Graphics conversion utilities:
2481 .MR eqn2graph 1 , \" #2
2482 .MR grap2graph 1 , \" #7
2483 .MR pic2graph 1 \" #15
2484 .
2485 .
2486 .TP
2487 Difference-marking utility:
2488 .MR gdiffmk 1 \" #3
2489 .
2490 .
2491 .TP
2492 \[lq]groff guess\[rq] utility:
2493 .MR grog 1 \" #43
2494 .
2495 .
2496 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
2497 .cp \n[*groff_groff_1_man_C]
2498 .do rr *groff_groff_1_man_C
2499 .
2500 .
2501 .\" Local Variables:
2502 .\" fill-column: 72
2503 .\" mode: nroff
2504 .\" End:
2505 .\" vim: set filetype=groff textwidth=72: