Initial import of binutils 2.22 on the new vendor branch
[dragonfly.git] / contrib / groff / src / roff / groff / groff.man
1 .ig
2 groff.man
3
4 Copyright (C) 1989, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5 Free Software Foundation, Inc.
6 Rewritten in 2002 by Bernd Warken <bwarken@mayn.de>
7
8 Permission is granted to copy, distribute and/or modify this document
9 under the terms of the GNU Free Documentation License, Version 1.3 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.
13
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.
16 ..
17 .
18 .
19 .\" --------------------------------------------------------------------
20 .\" Environment variable
21 .de EnvVar
22 .  SM
23 .  BR \%\\$1 \\$2
24 ..
25 .\" --------------------------------------------------------------------
26 .\" `char or string'
27 .de Quoted
28 .  ft CR
29 \[oq]\\$*\[cq]
30 .  ft
31 ..
32 .
33 .\" --------------------------------------------------------------------
34 .\" Title
35 .\" --------------------------------------------------------------------
36 .
37 .TH GROFF @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
38 .SH NAME
39 groff \- front-end for the groff document formatting system
40 .
41 .
42 .\" --------------------------------------------------------------------
43 .SH SYNOPSIS
44 .\" --------------------------------------------------------------------
45 .
46 .SY groff
47 .OP \-abcegiklpstzCEGNRSUVXZ
48 .OP \-d cs
49 .OP \-D arg
50 .OP \-f fam
51 .OP \-F dir
52 .OP \-I dir
53 .OP \-K arg
54 .OP \-L arg
55 .OP \-m name
56 .OP \-M dir
57 .OP \-n num
58 .OP \-o list
59 .OP \-P arg
60 .OP \-r cn
61 .OP \-T dev
62 .OP \-w name
63 .OP \-W name
64 .RI [ file\~ .\|.\|.]
65 .
66 .SY groff
67 .B \-h
68 |
69 .B \-\-help
70 .
71 .SY groff
72 .B \-v
73 |
74 .B \-\-version
75 .RI [ option\~ .\|.\|.]
76 .YS
77 .
78 .
79 .\" --------------------------------------------------------------------
80 .SH DESCRIPTION
81 .\" --------------------------------------------------------------------
82 .
83 This document describes the
84 .B groff
85 program, the main front-end for the 
86 .I groff
87 document formatting system.
88 .
89 The
90 .I groff
91 program and macro suite is the implementation of a
92 .BR roff (@MAN7EXT@)
93 system within the free software collection
94 .UR http://\:www.gnu.org
95 GNU
96 .UE .
97 .
98 The
99 .I groff
100 system has all features of the classical
101 .IR roff ,
102 but adds many extensions.
103 .
104 .P
105 The
106 .B groff
107 program allows to control the whole
108 .I groff
109 system by command line options.
110 .
111 This is a great simplification in comparison to the classical case (which
112 uses pipes only).
113 .
114 .
115 .\" --------------------------------------------------------------------
116 .SH OPTIONS
117 .\" --------------------------------------------------------------------
118 .P
119 The command line is parsed according to the usual \f[CR]GNU\f[]
120 convention.
121 .
122 The whitespace between a command line option and its argument is
123 optional.
124 .
125 Options can be grouped behind a single `\-' (minus character).
126 .
127 A filename of
128 .B \-
129 (minus character) denotes the standard input.
130 .
131 .P
132 .
133 As
134 .B groff
135 is a wrapper program for
136 .B @g@troff
137 both programs share a set of options.
138 .
139 But the
140 .B groff
141 program has some additional, native options and gives a new meaning to
142 some
143 .B @g@troff
144 options.
145 .
146 On the other hand, not all
147 .B @g@troff
148 options can be fed into
149 .BR groff .
150 .
151 .
152 .\" --------------------------------------------------------------------
153 .SS Native groff Options
154 .\" --------------------------------------------------------------------
155 .
156 The following options either do not exist for
157 .B @g@troff
158 or are differently interpreted by
159 .BR groff .
160 .
161 .
162 .TP
163 .BI \-D\  arg
164 Set default input encoding used by
165 .B preconv
166 to
167 .IR arg .
168 .
169 Implies
170 .BR \-k .
171 .
172 .
173 .TP
174 .B \-e
175 Preprocess with
176 .BR @g@eqn .
177 .
178 .
179 .TP
180 .B \-g
181 Preprocess with
182 .BR @g@grn .
183 .
184 .
185 .TP
186 .B \-G
187 Preprocess with
188 .BR grap .
189 .
190 .
191 .TP
192 .B \-h
193 .TQ
194 .B \-\-help
195 Print a help message.
196 .
197 .
198 .TP
199 .BI \-I\  dir
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
202 .B .psbb
203 and
204 .B .so
205 requests, and
206 .B \eX'ps: import'
207 and
208 .B \eX'ps: file'
209 escapes).
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
215 .B \-s
216 option.
217 .
218 .
219 .TP
220 .B \-k
221 Preprocess with
222 .BR preconv .
223 This is run before any other preprocessor.
224 .
225 Please refer to
226 .BR preconv 's
227 manual page for its behaviour if no
228 .B \-K
229 (or
230 .BR \-D )
231 option is specified.
232 .
233 .
234 .TP
235 .BI \-K\  arg
236 Set input encoding used by
237 .B preconv
238 to
239 .IR arg .
240 .
241 Implies
242 .BR \-k .
243 .
244 .
245 .TP
246 .B \-l
247 Send the output to a spooler program for printing.
248 .
249 The command that should be used for this is specified by the
250 .B print
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
254 .BR lpr (1)
255 program by default.
256 .
257 See options
258 .B \-L
259 and
260 .BR \-X .
261 .
262 .
263 .TP
264 .BI \-L\  arg
265 Pass
266 .I arg
267 to the spooler program.
268 Several arguments should be passed with a separate
269 -L
270 option each.
271 .
272 Note that
273 .B groff
274 does not prepend
275 `-'
276 (a minus sign) to
277 .I arg
278 before passing it to the spooler program.
279 .
280 .
281 .TP
282 .B \-N
283 Don't allow newlines within
284 .I eqn
285 delimiters.
286 .
287 This is the same as the
288 .B \-N
289 option in
290 .BR @g@eqn .
291 .
292 .
293 .TP
294 .B \-p
295 Preprocess with
296 .BR @g@pic .
297 .
298 .
299 .TP
300 .BI \-P\  \-option
301 .TQ
302 .BI \-P\  \-option \ \-P\  arg
303 Pass
304 .I \-option
305 or
306 .I "\-option\~arg"
307 to the postprocessor.
308 .
309 The option must be specified with the necessary preceding minus
310 sign(s)
311 .Quoted -
312 or
313 .Quoted --
314 because
315 .B groff
316 does not prepend any dashes before passing it to the postprocessor.
317 .
318 For example, to pass a title to the
319 .B \%gxditview
320 postprocessor, the shell command
321 .
322 .RS
323 .IP
324 .EX
325 groff -X -P -title -P 'groff it' \f[I]foo\f[]
326 .EE
327 .RE
328 .
329 .IP
330 is equivalent to
331 .
332 .RS
333 .IP
334 .EX
335 groff -X -Z \f[I]foo\f[] | \
336 gxditview -title 'groff it' -
337 .EE
338 .RE
339 .
340 .
341 .TP
342 .B \-R
343 Preprocess with
344 .BR @g@refer .
345 .
346 No mechanism is provided for passing arguments to 
347 .B @g@refer
348 because most
349 .B @g@refer
350 options have equivalent language elements that can be specified within
351 the document.
352 .
353 See
354 .BR \%@g@refer (@MAN1EXT@)
355 for more details.
356 .
357 .
358 .TP
359 .B \-s
360 Preprocess with
361 .BR @g@soelim .
362 .
363 .
364 .TP
365 .B \-S
366 Safer mode.
367 .
368 Pass the
369 .B \-S
370 option to
371 .B @g@pic
372 and disable the following
373 .B @g@troff
374 requests:
375 .BR .open ,
376 .BR .opena ,
377 .BR .pso ,
378 .BR .sy ,
379 and
380 .BR .pi .
381 For security reasons, safer mode is enabled by default.
382 .
383 .
384 .TP
385 .B \-t
386 Preprocess with
387 .BR @g@tbl .
388 .
389 .
390 .TP
391 .BI \-T\  dev
392 Set output device to
393 .IR dev .
394 For this device,
395 .B @g@troff
396 generates the
397 .I intermediate
398 .IR output ;
399 see
400 .BR \%groff_out (@MAN5EXT@).
401 .
402 Then
403 .B groff
404 calls a postprocessor to convert
405 .BR @g@troff 's
406 .I intermediate output
407 to its final format.
408 .
409 Real devices in
410 .B groff
411 are
412 .
413 .RS
414 .RS
415 .TP
416 dvi
417 TeX DVI format (postprocessor is
418 .BR grodvi ).
419 .
420 .TP
421 html
422 .TQ
423 xhtml
424 HTML and XHTML output (preprocessors are
425 .B @g@soelim
426 and
427 .BR \%pre-grohtml ,
428 postprocessor is
429 .BR \%post-grohtml ).
430 .
431 .TP
432 lbp
433 Canon CAPSL printers (\%LBP-4 and \%LBP-8 series laser printers;
434 postprocessor is
435 .BR grolbp ).
436 .
437 .TP
438 lj4
439 HP LaserJet4 compatible (or other PCL5 compatible) printers (postprocessor
440 is
441 .BR grolj4 ).
442 .
443 .TP
444 ps
445 PostScript output (postprocessor is
446 .BR grops ).
447 .RE
448 .RE
449 .
450 .
451 .IP
452 For the following TTY output devices (postprocessor is always
453 .BR grotty ),
454 .B \-T
455 selects the output encoding:
456 .
457 .RS
458 .RS
459 .TP
460 ascii
461 7bit \f[CR]ASCII\f[].
462 .
463 .TP
464 cp1047
465 \%Latin-1 character set for EBCDIC hosts.
466 .
467 .TP
468 latin1
469 ISO \%8859-1.
470 .
471 .TP
472 utf8
473 Unicode character set in \%UTF-8 encoding.
474 .RE
475 .RE
476 .
477 .
478 .IP
479 The following arguments select
480 .B \%gxditview
481 as the `postprocessor' (it is rather a viewing program):
482 .
483 .RS
484 .RS
485 .TP
486 X75
487 75\|dpi resolution, 10\|pt document base font.
488 .TP
489 X75-12
490 75\|dpi resolution, 12\|pt document base font.
491 .TP
492 X100
493 100\|dpi resolution, 10\|pt document base font.
494 .TP
495 X100-12
496 100\|dpi resolution, 12\|pt document base font.
497 .RE
498 .RE
499 .
500 .IP
501 The default device is
502 .BR @DEVICE@ .
503 .
504 .
505 .TP
506 .B \-U
507 Unsafe mode.
508 .
509 Reverts to the (old) unsafe behaviour; see option
510 .BR \-S .
511 .
512 .
513 .TP
514 .B \-v
515 .TQ
516 .B \-\-version
517 Output version information of
518 .B groff
519 and of all programs that are run by it; that is, the given command line
520 is parsed in the usual way, passing
521 .B \-v
522 to all subprograms.
523 .
524 .
525 .TP
526 .B \-V
527 Output the pipeline that would be run by
528 .BR groff
529 (as a wrapper program) on the standard output, but do not execute it.
530 If given more than once,
531 the commands are both printed on the standard error and run.
532 .
533 .
534 .TP
535 .B \-X
536 Use
537 .B \%gxditview
538 instead of using the usual postprocessor to (pre)view a document.
539 .
540 The printing spooler behavior as outlined with options
541 .B \-l
542 and
543 .B \-L 
544 is carried over to 
545 .BR \%gxditview (@MAN1EXT@)
546 by determining an argument for the
547 .B \-printCommand
548 option of
549 .BR \%gxditview (@MAN1EXT@).
550 .
551 This sets the default
552 .B Print
553 action and the corresponding menu entry to that value.
554 .
555 .B \-X
556 only produces good results with
557 .BR \-Tps ,
558 .BR \-TX75 ,
559 .BR \-TX75-12 ,
560 .BR \-TX100 ,
561 and
562 .BR \-TX100-12 .
563 .
564 The default resolution for previewing
565 .B \-Tps
566 output is 75\|dpi; this can be changed by passing the
567 .B \-resolution
568 option to
569 .BR \%gxditview ,
570 for example
571 .
572 .RS
573 .IP
574 .EX
575 groff -X -P-resolution -P100 -man foo.1
576 .EE
577 .RE
578 .
579 .
580 .TP
581 .B \-z
582 Suppress output generated by
583 .BR @g@troff .
584 Only error messages are printed.
585 .
586 .
587 .TP
588 .B \-Z
589 Do not automatically postprocess
590 .I groff intermediate output
591 in the usual manner.
592 This will cause the
593 .B @g@troff
594 .I output
595 to appear on standard output,
596 replacing the usual postprocessor output; see
597 .BR \%groff_out (@MAN5EXT@).
598 .
599 .
600 .\" --------------------------------------------------------------------
601 .SS Transparent Options
602 .\" --------------------------------------------------------------------
603 .
604 The following options are transparently handed over to the formatter
605 program
606 .B @g@troff
607 that is called by
608 .B groff
609 subsequently.
610 .
611 These options are described in more detail in
612 .BR @g@troff (@MAN1EXT@).
613 .
614 .TP
615 .B \-a
616 \f[CR]ASCII\f[] approximation of output.
617 .
618 .TP
619 .B \-b
620 Backtrace on error or warning.
621 .
622 .TP
623 .B \-c
624 Disable color output.
625 .
626 Please consult the
627 .BR \%grotty (@MAN1EXT@)
628 man page for more details.
629 .
630 .TP
631 .B \-C
632 Enable compatibility mode.
633 .
634 .TP
635 .BI \-d\  cs
636 .TQ
637 .BI \-d\  name = s
638 Define string.
639 .
640 .TP
641 .B \-E
642 Disable
643 .B @g@troff
644 error messages.
645 .
646 .TP
647 .BI \-f\  fam
648 Set default font family.
649 .
650 .TP
651 .BI \-F\  dir
652 Set path for font DESC files.
653 .
654 .TP
655 .B \-i
656 Process standard input after the specified input files.
657 .
658 .TP
659 .BI \-m\  name
660 Include macro file
661 .IB name .tmac
662 (or
663 .BI tmac. name\c
664 ); see also
665 .BR \%groff_tmac (@MAN5EXT@).
666 .
667 .TP
668 .BI \-M\  dir
669 Path for macro files.
670 .
671 .TP
672 .BI \-n\  num
673 Number the first page
674 .IR num .
675 .
676 .TP
677 .BI \-o\  list
678 Output only pages in
679 .IR list .
680 .
681 .TP
682 .BI \-r\  cn
683 .TQ
684 .BI \-r\  name = n
685 Set number register.
686 .
687 .TP
688 .BI \-w\  name
689 Enable warning
690 .IR name .
691 .
692 .TP
693 .BI \-W\  name
694 disable warning
695 .IR name .
696 .
697 .
698 .\" --------------------------------------------------------------------
699 .SH "USING GROFF"
700 .\" --------------------------------------------------------------------
701 .
702 The
703 .I groff system
704 implements the infrastructure of classical roff; see
705 .BR roff (@MAN7EXT@)
706 for a survey on how a
707 .I roff
708 system works in general.
709 .
710 Due to the front-end programs available within the
711 .I groff
712 system, using
713 .I groff
714 is much easier than
715 .IR "classical roff" .
716 .
717 This section gives an overview of the parts that constitute the
718 .I groff
719 system.
720 .
721 It complements
722 .BR roff (@MAN7EXT@)
723 with
724 .IR groff -specific
725 features.
726 .
727 This section can be regarded as a guide to the documentation around
728 the
729 .I groff
730 system.
731 .
732 .
733 .\" --------------------------------------------------------------------
734 .SS Paper Size
735 .\" --------------------------------------------------------------------
736 .
737 The
738 .I virtual
739 paper size used by
740 .B troff
741 to format the input is controlled globally with the requests
742 .BR .po ,
743 .BR .pl ,
744 and
745 .BR .ll .
746 See
747 .BR groff_tmac (@MAN5EXT@)
748 for the `papersize' macro package which provides a convenient interface.
749 .
750 .P
751 The
752 .I physical
753 paper size, giving the actual dimensions of the paper sheets, is
754 controlled by output devices like
755 .BR grops
756 with the command line options
757 .B \-p
758 and
759 .BR \-l .
760 See
761 .BR groff_font (@MAN5EXT@)
762 and the man pages of the output devices for more details.
763 .B groff
764 uses the command line option
765 .B \-P
766 to pass options to output devices; for example, the following selects
767 A4 paper in landscape orientation for the PS device:
768 .
769 .IP
770 .EX
771 groff -Tps -P-pa4 -P-l ...
772 .EE
773 .
774 .
775 .\" --------------------------------------------------------------------
776 .SS Front-ends
777 .\" --------------------------------------------------------------------
778 .
779 The
780 .B groff
781 program is a wrapper around the
782 .BR @g@troff (@MAN1EXT@)
783 program.
784 .
785 It allows to specify the preprocessors by command line options and
786 automatically runs the postprocessor that is appropriate for the
787 selected device.
788 .
789 Doing so, the sometimes tedious piping mechanism of classical
790 .BR roff (@MAN7EXT@)
791 can be avoided.
792 .
793 .P
794 The
795 .BR grog (@MAN1EXT@)
796 program can be used for guessing the correct
797 .I groff
798 command line to format a file.
799 .
800 .P
801 The
802 .BR \%groffer (@MAN1EXT@)
803 program is an allround-viewer for
804 .I groff
805 files and man pages.
806 .
807 .
808 .\" --------------------------------------------------------------------
809 .SS Preprocessors
810 .\" --------------------------------------------------------------------
811 .
812 The
813 .I groff
814 preprocessors are reimplementations of the classical preprocessors
815 with moderate extensions.
816 .
817 The standard preprocessors distributed with the
818 .I groff
819 package are
820 .
821 .TP
822 .BR @g@eqn (@MAN1EXT@)
823 for mathematical formul\(ae,
824 .
825 .TP
826 .BR @g@grn (@MAN1EXT@)
827 for including
828 .BR gremlin (1)
829 pictures,
830 .
831 .TP
832 .BR @g@pic (@MAN1EXT@)
833 for drawing diagrams,
834 .
835 .TP
836 .BR @g@chem (@MAN1EXT@)
837 for chemical structure diagrams,
838 .
839 .TP
840 .BR \%@g@refer (@MAN1EXT@)
841 for bibliographic references,
842 .
843 .TP
844 .BR \%@g@soelim (@MAN1EXT@)
845 for including macro files from standard locations,
846 .
847 .P
848 and
849 .
850 .TP
851 .BR @g@tbl (@MAN1EXT@)
852 for tables.
853 .
854 .P
855 A new preprocessor not available in classical
856 .I troff
857 is
858 .BR \%preconv (@MAN1EXT@)
859 which converts various input encodings to something
860 .B groff
861 can understand.
862 .
863 It is always run first before any other preprocessor.
864 .
865 .P
866 Besides these, there are some internal preprocessors that are
867 automatically run with some devices.
868 .
869 These aren't visible to the user.
870 .
871 .
872 .\" --------------------------------------------------------------------
873 .SS "Macro Packages"
874 .\" --------------------------------------------------------------------
875 .
876 Macro packages can be included by option
877 .BR \-m .
878 .
879 The
880 .I groff
881 system implements and extends all classical macro packages in a
882 compatible way and adds some packages of its own.
883 .
884 Actually, the following macro packages come with
885 .IR groff :
886 .
887 .TP
888 .B man
889 The traditional man page format; see
890 .BR \%groff_man (@MAN7EXT@).
891 It can be specified on the command line as
892 .B \-man
893 or
894 .BR \-m\~man .
895 .
896 .TP
897 .B mandoc
898 The general package for man pages; it automatically recognizes
899 whether the documents uses the
900 .I man
901 or the
902 .I mdoc
903 format and branches to the corresponding macro package.
904 .
905 It can be specified on the command line as
906 .B \%\-mandoc
907 or
908 .BR \-m\~\%mandoc .
909 .
910 .TP
911 .B mdoc
912 The \f[CR]BSD\f[]-style man page format; see
913 .BR \%groff_mdoc (@MAN7EXT@).
914 It can be specified on the command line as
915 .B \-mdoc
916 or
917 .BR \-m\~mdoc .
918 .
919 .TP
920 .B me
921 The classical
922 .I me
923 document format; see
924 .BR \%groff_me (@MAN7EXT@).
925 It can be specified on the command line as
926 .B \-me
927 or
928 .BR \-m\~me .
929 .
930 .TP
931 .B mm
932 The classical
933 .I mm
934 document format; see
935 .BR \%groff_mm (@MAN7EXT@).
936 It can be specified on the command line as
937 .B \-mm
938 or
939 .BR \-m\~mm .
940 .
941 .TP
942 .B ms
943 The classical
944 .I ms
945 document format; see
946 .BR \%groff_ms (@MAN7EXT@).
947 It can be specified on the command line as
948 .B \-ms
949 or
950 .BR \-m\~ms .
951 .
952 .TP
953 .B www
954 HTML-like macros for inclusion in arbitrary
955 .I groff
956 documents; see
957 .BR \%groff_www (@MAN7EXT@).
958 .
959 .P
960 Details on the naming of macro files and their placement can be found
961 in
962 .BR \%groff_tmac (@MAN5EXT@);
963 this man page also documents some other, minor auxiliary macro packages
964 not mentioned here.
965 .
966 .
967 .\" --------------------------------------------------------------------
968 .SS "Programming Language"
969 .\" --------------------------------------------------------------------
970 .
971 General concepts common to all
972 .I roff
973 programming languages are described in
974 .BR roff (@MAN7EXT@).
975 .
976 .P
977 The
978 .I groff
979 extensions to the classical
980 .I troff
981 language are documented in
982 .BR \%groff_diff (@MAN7EXT@).
983 .
984 .P
985 The
986 .I groff
987 language as a whole is described in the (still incomplete)
988 .IR "groff info file" ;
989 a short (but complete) reference can be found in
990 .BR groff (@MAN7EXT@).
991 .
992 .
993 .\" --------------------------------------------------------------------
994 .SS Formatters
995 .\" --------------------------------------------------------------------
996 .
997 The central
998 .I roff
999 formatter within the
1000 .I groff
1001 system is
1002 .BR @g@troff (@MAN1EXT@).
1003 It provides the features of both the classical
1004 .I troff
1005 and
1006 .IR nroff ,
1007 as well as the
1008 .I groff
1009 extensions.
1010 .
1011 The command line option
1012 .B \-C
1013 switches
1014 .B @g@troff
1015 into
1016 .I "compatibility mode"
1017 which tries to emulate classical
1018 .I roff
1019 as much as possible.
1020 .
1021 .P
1022 There is a shell script
1023 .BR @g@nroff (@MAN1EXT@)
1024 that emulates the behavior of classical
1025 .BR nroff .
1026 .
1027 It tries to automatically select the proper output encoding, according to
1028 the current locale.
1029 .
1030 .P
1031 The formatter program generates
1032 .IR "intermediate output" ;
1033 see
1034 .BR \%groff_out (@MAN7EXT@).
1035 .
1036 .
1037 .\" --------------------------------------------------------------------
1038 .SS Devices
1039 .\" --------------------------------------------------------------------
1040 .
1041 In
1042 .IR roff ,
1043 the output targets are called
1044 .IR devices .
1045 A device can be a piece of hardware, e.g., a printer, or a software
1046 file format.
1047 .
1048 A device is specified by the option
1049 .BR \-T .
1050 The
1051 .I groff
1052 devices are as follows.
1053 .
1054 .TP
1055 .B ascii
1056 Text output using the
1057 .BR ascii (7)
1058 character set.
1059 .
1060 .TP
1061 .B cp1047
1062 Text output using the EBCDIC code page IBM cp1047 (e.g., OS/390 Unix).
1063 .
1064 .TP
1065 .B dvi
1066 TeX DVI format.
1067 .
1068 .TP
1069 .B html
1070 HTML output.
1071 .
1072 .TP
1073 .B latin1
1074 Text output using the ISO \%Latin-1 (ISO \%8859-1) character set; see
1075 .BR \%iso_8859_1 (7).
1076 .
1077 .TP
1078 .B lbp
1079 Output for Canon CAPSL printers (\%LBP-4 and \%LBP-8 series laser printers).
1080 .
1081 .TP 
1082 .B lj4
1083 HP LaserJet4-compatible (or other PCL5-compatible) printers.
1084 .
1085 .TP
1086 .B ps
1087 PostScript output; suitable for printers and previewers like
1088 .BR gv (1).
1089 .
1090 .TP
1091 .B utf8
1092 Text output using the Unicode (ISO 10646) character set with \%UTF-8
1093 encoding; see
1094 .BR unicode (7).
1095 .
1096 .TP
1097 .B xhtml
1098 XHTML output.
1099 .
1100 .TP
1101 .B X75
1102 75dpi X Window System output suitable for the previewers
1103 .BR \%xditview (1x)
1104 and
1105 .BR \%gxditview (@MAN1EXT@).
1106 .
1107 A variant for a 12\|pt document base font is
1108 .BR \%X75-12 .
1109 .
1110 .TP
1111 .B X100
1112 100dpi X Window System output suitable for the previewers
1113 .BR \%xditview (1x)
1114 and
1115 .BR \%gxditview (@MAN1EXT@).
1116 .
1117 A variant for a 12\|pt document base font is
1118 .BR \%X100-12 .
1119 .
1120 .P
1121 The postprocessor to be used for a device is specified by the
1122 .B postpro
1123 command in the device description file; see
1124 .BR \%groff_font (@MAN5EXT@).
1125 .
1126 This can be overridden with the
1127 .B -X
1128 option.
1129 .
1130 .P
1131 The default device is
1132 .BR @DEVICE@ .
1133 .
1134 .
1135 .\" --------------------------------------------------------------------
1136 .SS Postprocessors
1137 .\" --------------------------------------------------------------------
1138 .
1139 .I groff
1140 provides 3\~hardware postprocessors:
1141 .
1142 .TP
1143 .BR \%grolbp (@MAN1EXT@)
1144 for some Canon printers,
1145 .
1146 .TP
1147 .BR \%grolj4 (@MAN1EXT@)
1148 for printers compatible to the HP LaserJet\~4 and PCL5,
1149 .
1150 .TP
1151 .BR \%grotty (@MAN1EXT@)
1152 for text output using various encodings, e.g., on text-oriented
1153 terminals or line-printers.
1154 .
1155 .P
1156 Today, most printing or drawing hardware is handled by the operating
1157 system, by device drivers, or by software interfaces, usually accepting
1158 PostScript.
1159 .
1160 Consequently, there isn't an urgent need for more hardware device
1161 postprocessors.
1162 .
1163 .P
1164 The
1165 .I groff
1166 software devices for conversion into other document file formats are
1167 .
1168 .TP
1169 .BR \%grodvi (@MAN1EXT@)
1170 for the DVI format,
1171 .
1172 .TP
1173 .BR \%grohtml (@MAN1EXT@)
1174 for HTML and XHTML formats,
1175 .
1176 .TP
1177 .BR grops (@MAN1EXT@)
1178 for PostScript.
1179 .
1180 .P
1181 Combined with the many existing free conversion tools this should
1182 be sufficient to convert a
1183 .I troff
1184 document into virtually any existing data format.
1185 .
1186 .
1187 .\" --------------------------------------------------------------------
1188 .SS Utilities
1189 .\" --------------------------------------------------------------------
1190 .
1191 The following utility programs around
1192 .I groff
1193 are available.
1194 .
1195 .TP
1196 .BR \%addftinfo (@MAN1EXT@)
1197 Add information to
1198 .I troff
1199 font description files for use with
1200 .IR groff .
1201 .
1202 .TP
1203 .BR \%afmtodit (@MAN1EXT@)
1204 Create font description files for PostScript device.
1205 .
1206 .TP
1207 .BR \%eqn2graph (@MAN1EXT@)
1208 Convert an
1209 .B eqn
1210 image into a cropped image.
1211 .
1212 .TP
1213 .BR \%gdiffmk (@MAN1EXT@)
1214 Mark differences between
1215 .IR groff ,
1216 .IR nroff ,
1217 or
1218 .I troff
1219 files.
1220 .
1221 .TP
1222 .BR \%grap2graph (@MAN1EXT@)
1223 Convert a
1224 .B grap
1225 diagram into a cropped bitmap image.
1226 .
1227 .TP
1228 .BR \%groffer (@MAN1EXT@)
1229 General viewer program for
1230 .I groff
1231 files and man pages.
1232 .
1233 .TP
1234 .BR \%gxditview (@MAN1EXT@)
1235 The
1236 .I groff
1237 X viewer, the \f[CR]GNU\f[] version of
1238 .BR xditview .
1239 .
1240 .TP
1241 .BR \%hpftodit (@MAN1EXT@)
1242 Create font description files for lj4 device.
1243 .
1244 .TP
1245 .BR \%@g@indxbib (@MAN1EXT@)
1246 Make inverted index for bibliographic databases.
1247 .
1248 .TP
1249 .BR lkbib (@MAN1EXT@)
1250 Search bibliographic databases.
1251 .
1252 .TP
1253 .BR \%@g@lookbib (@MAN1EXT@)
1254 Interactively search bibliographic databases.
1255 .
1256 .TP
1257 .BR \%pdfroff (@MAN1EXT@)
1258 Create PDF documents using
1259 .BR groff .
1260 .
1261 .TP
1262 .BR \%pfbtops (@MAN1EXT@)
1263 Translate a PostScript font in .pfb format to \f[CR]ASCII\f[].
1264 .
1265 .TP
1266 .BR \%pic2graph (@MAN1EXT@)
1267 Convert a
1268 .B pic
1269 diagram into a cropped image.
1270 .
1271 .TP
1272 .BR \%tfmtodit (@MAN1EXT@)
1273 Create font description files for TeX DVI device.
1274 .
1275 .TP
1276 .BR \%xditview (1x)
1277 .I roff
1278 viewer distributed with X window.
1279 .
1280 .TP
1281 .BR \%xtotroff (@MAN1EXT@)
1282 Convert X font metrics into \f[CR]GNU\f[]
1283 .I troff
1284 font metrics.
1285 .
1286 .
1287 .\" --------------------------------------------------------------------
1288 .SH ENVIRONMENT
1289 .\" --------------------------------------------------------------------
1290 .
1291 Normally, the path separator in the following environment variables is the
1292 colon; this may vary depending on the operating system.
1293 .
1294 For example, DOS and Windows use a semicolon instead.
1295 .
1296 .
1297 .TP
1298 .EnvVar GROFF_BIN_PATH
1299 This search path, followed by
1300 .EnvVar $PATH ,
1301 is used for commands that are executed by
1302 .BR groff .
1303 .
1304 If it is not set then the directory where the
1305 .I groff
1306 binaries were installed is prepended to
1307 .EnvVar PATH .
1308 .
1309 .
1310 .TP
1311 .EnvVar GROFF_COMMAND_PREFIX
1312 When there is a need to run different
1313 .I roff
1314 implementations at the same time
1315 .I groff
1316 provides the facility to prepend a prefix to most of its programs that
1317 could provoke name clashings at run time (default is to have none).
1318 .
1319 Historically, this prefix was the character
1320 .BR g ,
1321 but it can be anything.
1322 .
1323 For example,
1324 .BR gtroff
1325 stood for
1326 .IR groff 's
1327 .BR troff ,
1328 .BR gtbl
1329 for the
1330 .I groff
1331 version of
1332 .BR tbl .
1333 .
1334 By setting
1335 .EnvVar GROFF_COMMAND_PREFIX
1336 to different values, the different
1337 .I roff
1338 installations can be addressed.
1339 .
1340 More exactly, if it is set to prefix
1341 .I xxx
1342 then
1343 .B groff
1344 as a wrapper program internally calls
1345 .IB xxx troff
1346 instead of
1347 .BR troff .
1348 This also applies to the preprocessors
1349 .BR eqn ,
1350 .BR grn ,
1351 .BR pic ,
1352 .BR \%refer ,
1353 .BR tbl ,
1354 .BR \%soelim ,
1355 and to the utilities
1356 .B \%@g@indxbib
1357 and
1358 .BR \%@g@lookbib .
1359 .
1360 This feature does not apply to any programs different from the ones
1361 above (most notably
1362 .B groff
1363 itself) since they are unique to the
1364 .I groff
1365 package.
1366 .
1367 .
1368 .TP
1369 .EnvVar GROFF_ENCODING
1370 The value of this environment value is passed to the
1371 .B preconv
1372 preprocessor to select the encoding of input files.
1373 .
1374 Setting this option implies
1375 .BR groff 's
1376 command line option
1377 .B \-k
1378 (this is,
1379 .B groff
1380 actually always calls
1381 .BR preconv ).
1382 .
1383 If set without a value,
1384 .B groff
1385 calls
1386 .B preconv
1387 without arguments.
1388 .
1389 An explicit
1390 .B \-K
1391 command line option overrides the value of 
1392 .EnvVar GROFF_ENCODING .
1393 .
1394 See
1395 .BR preconv (@MAN1EXT@)
1396 for details.
1397 .
1398 .
1399 .TP
1400 .EnvVar GROFF_FONT_PATH
1401 A list of directories in which to search for the
1402 .BI dev name
1403 directory in addition to the default ones.
1404 .
1405 See
1406 .BR @g@troff (@MAN1EXT@)
1407 and
1408 .BR \%groff_font (@MAN5EXT@)
1409 for more details.
1410 .
1411 .
1412 .TP
1413 .EnvVar GROFF_TMAC_PATH
1414 A list of directories in which to search for macro files in addition to
1415 the default directories.
1416 .
1417 See
1418 .BR @g@troff (@MAN1EXT@)
1419 and
1420 .BR \%groff_tmac (@MAN5EXT@)
1421 for more details.
1422 .
1423 .
1424 .TP
1425 .EnvVar GROFF_TMPDIR
1426 The directory in which temporary files are created.
1427 .
1428 If this is not set but the environment variable
1429 .EnvVar TMPDIR
1430 instead, temporary files are created in the directory
1431 .EnvVar $TMPDIR .
1432 On MS-DOS and Windows\~32 platforms, the environment variables
1433 .EnvVar TMP
1434 and
1435 .EnvVar TEMP
1436 (in that order) are searched also, after
1437 .EnvVar GROFF_TMPDIR
1438 and
1439 .EnvVar TMPDIR .
1440 .
1441 Otherwise, temporary files are created in
1442 .BR /tmp .
1443 The
1444 .BR \%@g@refer (@MAN1EXT@),
1445 .BR \%groffer (@MAN1EXT@),
1446 .BR \%grohtml (@MAN1EXT@),
1447 and
1448 .BR grops (@MAN1EXT@)
1449 commands use temporary files.
1450 .
1451 .
1452 .TP
1453 .EnvVar GROFF_TYPESETTER
1454 Preset the default device.
1455 .
1456 If this is not set the
1457 .B @DEVICE@
1458 device is used as default.
1459 .
1460 This device name is overwritten by the option
1461 .BR \-T .
1462 .
1463 .
1464 .\" --------------------------------------------------------------------
1465 .SH FILES
1466 .\" --------------------------------------------------------------------
1467 .
1468 There are some directories in which
1469 .I groff
1470 installs all of its data files.
1471 .
1472 Due to different installation habits on different operating systems,
1473 their locations are not absolutely fixed, but their function is
1474 clearly defined and coincides on all systems.
1475 .
1476 .
1477 .\" --------------------------------------------------------------------
1478 .SS "groff Macro Directory"
1479 .\" --------------------------------------------------------------------
1480 .
1481 This contains all information related to macro packages.
1482 .
1483 Note that more than a single directory is searched for those files
1484 as documented in
1485 .BR \%groff_tmac (@MAN5EXT@).
1486 .
1487 For the
1488 .I groff
1489 installation corresponding to this document, it is located at
1490 .IR @MACRODIR@ .
1491 .
1492 The following files contained in the
1493 .I groff macro directory
1494 have a special meaning:
1495 .
1496 .
1497 .TP
1498 .B troffrc
1499 Initialization file for
1500 .IR troff .
1501 .
1502 This is interpreted by
1503 .B @g@troff
1504 before reading the macro sets and any input.
1505 .
1506 .
1507 .TP
1508 .B troffrc-end
1509 Final startup file for
1510 .IR troff .
1511 .
1512 It is parsed after all macro sets have been read.
1513 .
1514 .
1515 .TP
1516 .IB name .tmac
1517 .TQ
1518 .BI tmac. name
1519 Macro file for macro package
1520 .IR name .
1521 .
1522 .
1523 .\" --------------------------------------------------------------------
1524 .SS "groff Font Directory"
1525 .\" --------------------------------------------------------------------
1526 .
1527 This contains all information related to output devices.
1528 .
1529 Note that more than a single directory is searched for those files; see
1530 .BR @g@troff (@MAN1EXT@).
1531 .
1532 For the
1533 .I groff
1534 installation corresponding to this document, it is located at
1535 .IR @FONTDIR@ .
1536 .
1537 The following files contained in the
1538 .I "groff font directory"
1539 have a special meaning:
1540 .
1541 .
1542 .TP
1543 .BI dev name /DESC
1544 Device description file for device
1545 .IR name ,
1546 see
1547 .BR \%groff_font (@MAN5EXT@).
1548 .
1549 .
1550 .TP
1551 .BI dev name / F
1552 Font file for font
1553 .I F
1554 of device
1555 .IR name .
1556 .
1557 .
1558 .\" --------------------------------------------------------------------
1559 .SH EXAMPLES
1560 .\" --------------------------------------------------------------------
1561 .
1562 The following example illustrates the power of the
1563 .B groff
1564 program as a wrapper around
1565 .BR @g@troff .
1566 .
1567 .P
1568 To process a
1569 .I roff
1570 file using the preprocessors
1571 .B tbl
1572 and
1573 .B pic
1574 and the
1575 .B me
1576 macro set, classical
1577 .I troff
1578 had to be called by
1579 .
1580 .IP
1581 .EX
1582 pic foo.me | tbl | troff -me -Tlatin1 | grotty
1583 .EE
1584 .
1585 .P
1586 Using
1587 .BR groff ,
1588 this pipe can be shortened to the equivalent command
1589 .
1590 .IP
1591 .EX
1592 groff -p -t -me -T latin1 foo.me
1593 .EE
1594 .
1595 .P
1596 An even easier way to call this is to use
1597 .BR grog (@MAN1EXT@)
1598 to guess the preprocessor and macro options and execute the generated
1599 command (by using backquotes to specify shell command substitution)
1600 .
1601 .IP
1602 .EX
1603 \`grog -Tlatin1 foo.me\`
1604 .EE
1605 .
1606 .P
1607 The simplest way is to view the contents in an automated way by
1608 calling
1609 .
1610 .IP
1611 .EX
1612 groffer foo.me
1613 .EE
1614 .
1615 .
1616 .\" --------------------------------------------------------------------
1617 .SH BUGS
1618 .\" --------------------------------------------------------------------
1619 .
1620 .P
1621 On \f[CR]EBCDIC\f[] hosts (e.g., \f[CR]OS/390 Unix\f[]), output
1622 devices
1623 .B ascii
1624 and
1625 .B latin1
1626 aren't available.
1627 .
1628 Similarly, output for \f[CR]EBCDIC\f[] code page
1629 .B cp1047
1630 is not available on \f[CR]ASCII\f[] based operating systems.
1631 .
1632 .P
1633 Report bugs to
1634 .MT bug-groff@gnu.org
1635 the groff maling list
1636 .ME .
1637 .
1638 Include a complete, self-contained example that allows the bug to
1639 be reproduced, and say which version of
1640 .I groff
1641 you are using.
1642 .
1643 .
1644 .\" --------------------------------------------------------------------
1645 .SH AVAILABILITY
1646 .\" --------------------------------------------------------------------
1647 .
1648 Information on how to get
1649 .I groff
1650 and related information is available at the
1651 .UR http://\:www.gnu.org/\:software/\:groff
1652 groff GNU website
1653 .UE .
1654 .
1655 The most recent released version of
1656 .I groff
1657 is available at the
1658 .UR http://\:groff.ffii.org/\:groff/\:devel/\:groff-current.tar.gz
1659 groff development site
1660 .UE .
1661 .
1662 .P
1663 Three
1664 .I groff
1665 mailing lists are available:
1666 .IP
1667 .MT bug-groff@gnu.org
1668 for reporting bugs
1669 .ME .
1670 .
1671 .IP
1672 .MT groff@gnu.org
1673 for general discussion of
1674 .IR groff ,
1675 .ME .
1676 .IP
1677 .MT groff-commit@ffii.org
1678 the groff commit list
1679 .ME ,
1680 a read-only list showing logs of commitments to the CVS repository.
1681 .
1682 .P
1683 Details on CVS access and much more can be found in the file
1684 .B README
1685 at the top directory of the
1686 .I groff
1687 source package.
1688 .
1689 .P
1690 There is a free implementation of the
1691 .B grap
1692 preprocessor, written by
1693 .MT faber@lunabase.org
1694 Ted Faber
1695 .ME .
1696 .
1697 The actual version can be found at the
1698 .
1699 .UR http://\:www.lunabase.org/\:~faber/\:Vault/\:software/\:grap/
1700 grap website
1701 .UE .
1702 This is the only grap version supported by
1703 .IR groff .
1704 .
1705 .
1706 .\" --------------------------------------------------------------------
1707 .SH AUTHORS
1708 .\" --------------------------------------------------------------------
1709 .
1710 Copyright \(co 1989, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
1711 Free Software Foundation, Inc.
1712 .
1713 .P
1714 This document is distributed under the terms of the \f[CR]FDL\f[]
1715 (\f[CR]GNU Free Documentation License\f[]) version 1.3 or later.
1716 .
1717 You should have received a copy of the \f[CR]FDL\f[] on your system,
1718 it is also available on-line at the
1719 .UR http://\:www.gnu.org/\:copyleft/\:fdl.html
1720 GNU copyleft site
1721 .UE .
1722 .
1723 .P
1724 This document is based on the original
1725 .I groff
1726 man page written by
1727 .MT jjc@jclark.com
1728 James Clark
1729 .UE .
1730 .
1731 It was rewritten, enhanced, and put under the FDL license by
1732 Bernd Warken.
1733 .
1734 It is maintained by
1735 .MT wl@gnu.org 
1736 Werner Lemberg
1737 .ME .
1738 .
1739 .P
1740 .I groff
1741 is a \f[CR]GNU\f[] free software project.
1742 .
1743 All parts of the
1744 .I groff package
1745 are protected by \f[CR]GNU copyleft licenses\f[].
1746 .
1747 The software files are distributed under the terms of the \f[CR]GNU
1748 General Public License\f[] (\f[CR]GPL\f[]), while the documentation
1749 files mostly use the \f[CR]GNU Free Documentation License\f[]
1750 (\f[CR]FDL\f[]).
1751 .
1752 .
1753 .\" --------------------------------------------------------------------
1754 .SH "SEE ALSO"
1755 .\" --------------------------------------------------------------------
1756 .
1757 The
1758 .I groff info file
1759 contains all information on the
1760 .I groff
1761 system within a single document, providing many examples and
1762 background information.
1763 .
1764 See
1765 .BR info (1)
1766 on how to read it.
1767 .
1768 .P
1769 Due to its complex structure, the
1770 .I groff
1771 system has many man pages.
1772 .
1773 They can be read with
1774 .BR man (1)
1775 or
1776 .BR \%groffer (@MAN1EXT@).
1777 .
1778 .TP
1779 Introduction, history and further readings:
1780 .BR roff (@MAN7EXT@).
1781 .
1782 .TP
1783 Viewer for groff files:
1784 .BR \%groffer (@MAN1EXT@),
1785 .BR \%gxditview (@MAN1EXT@),
1786 .BR \%xditview (1x).
1787 .
1788 .TP
1789 Wrapper programs for formatters:
1790 .BR \%groff (@MAN1EXT@),
1791 .BR \%grog (@MAN1EXT@).
1792 .
1793 .TP
1794 Roff preprocessors:
1795 .BR \%@g@eqn (@MAN1EXT@),
1796 .BR \%@g@grn (@MAN1EXT@),
1797 .BR \%@g@pic (@MAN1EXT@),
1798 .BR \%@g@chem (@MAN1EXT@),
1799 .BR \%preconv (@MAN1EXT@),
1800 .BR \%@g@refer (@MAN1EXT@),
1801 .BR \%@g@soelim (@MAN1EXT@),
1802 .BR \%@g@tbl (@MAN1EXT@),
1803 .BR grap (1).
1804 .
1805 .TP
1806 Roff language with the groff extensions:
1807 .BR \%groff (@MAN7EXT@),
1808 .BR \%groff_char (@MAN7EXT@),
1809 .BR \%groff_diff (@MAN7EXT@),
1810 .BR \%groff_font (@MAN5EXT@).
1811 .
1812 .TP
1813 Roff formatter programs:
1814 .BR \%@g@nroff (@MAN1EXT@),
1815 .BR \%@g@troff (@MAN1EXT@),
1816 .BR ditroff (@MAN7EXT@).
1817 .
1818 .TP
1819 The intermediate output language:
1820 .BR \%groff_out (@MAN7EXT@).
1821 .
1822 .TP
1823 Postprocessors for the output devices:
1824 .BR \%grodvi (@MAN1EXT@),
1825 .BR \%grohtml (@MAN1EXT@),
1826 .BR \%grolbp (@MAN1EXT@),
1827 .BR \%grolj4 (@MAN1EXT@),
1828 .BR \%lj4_font (@MAN5EXT@),
1829 .BR \%grops (@MAN1EXT@),
1830 .BR \%grotty (@MAN1EXT@).
1831 .
1832 .TP
1833 Groff macro packages and macro-specific utilities:
1834 .BR \%groff_tmac (@MAN5EXT@),
1835 .BR \%groff_man (@MAN7EXT@),
1836 .BR \%groff_mdoc (@MAN7EXT@),
1837 .BR \%groff_me (@MAN7EXT@),
1838 .BR \%groff_mm (@MAN7EXT@),
1839 .BR \%groff_mmse (@MAN7EXT@),
1840 .BR \%groff_mom (@MAN7EXT@),
1841 .BR \%groff_ms (@MAN7EXT@),
1842 .BR \%groff_www (@MAN7EXT@),
1843 .BR \%groff_trace (@MAN7EXT@),
1844 .BR \%mmroff (@MAN7EXT@).
1845 .
1846 .TP
1847 The following utilities are available:
1848 .BR \%addftinfo (@MAN1EXT@),
1849 .BR \%afmtodit (@MAN1EXT@),
1850 .BR \%eqn2graph (@MAN1EXT@),
1851 .BR \%gdiffmk (@MAN1EXT@),
1852 .BR \%grap2graph (@MAN1EXT@),
1853 .BR \%groffer (@MAN1EXT@),
1854 .BR \%gxditview (@MAN1EXT@),
1855 .BR \%hpftodit (@MAN1EXT@),
1856 .BR \%@g@indxbib (@MAN1EXT@),
1857 .BR \%lkbib (@MAN1EXT@),
1858 .BR \%@g@lookbib (@MAN1EXT@),
1859 .BR \%pdfroff (@MAN1EXT@),
1860 .BR \%pfbtops (@MAN1EXT@),
1861 .BR \%pic2graph (@MAN1EXT@),
1862 .BR \%tfmtodit (@MAN1EXT@),
1863 .BR \%xtotroff (@MAN1EXT@).
1864 .
1865 .\" --------------------------------------------------------------------
1866 .\" Emacs setup
1867 .\" --------------------------------------------------------------------
1868 .
1869 .\" Local Variables:
1870 .\" mode: nroff
1871 .\" End: