Imported Upstream version 1.22.3
[platform/upstream/groff.git] / contrib / groffer / groffer.1.man
1 .TH GROFFER @MAN1EXT@ "@MDATE@" "groff @VERSION@"
2 .SH NAME
3 groffer \- display groff files and man pages on X and tty
4 .
5 .
6 .\"*********************************************************************
7 .\"
8 .\" This man page doesn't use extended groff syntax!
9 .\" XXX: Yes, it does--"\~" is ubiquitous.  "\/" and "\," also occur.
10 .\" Formatting it with and without groff's option '-C' should always
11 .\" give the same result.
12 .\"
13 .\"*********************************************************************
14 .
15 .
16 .\" ====================================================================
17 .\" Legal Terms
18 .\" ====================================================================
19 .\"
20 .\" Copyright (C) 2001-2018 Free Software Foundation, Inc.
21 .\"
22 .\" This file is part of groffer, which is part of groff, a free
23 .\" software project.
24 .\"
25 .\" You can redistribute it and/or modify it under the terms of the GNU
26 .\" General Public License version 2 as published by the Free Software
27 .\" Foundation.
28 .\"
29 .\" The license text is available in the internet at
30 .\" <http://www.gnu.org/licenses/gpl-2.0.html>.
31 .
32 .
33 .\" ====================================================================
34 .\" Characters
35 .\" ====================================================================
36 .
37 .\" Ellipsis ...
38 .ie t .ds EL \fS\N'188'\fP\"
39 .el .ds EL \&.\|.\|.\&\"
40 .\" called with \*(EL
41 .
42 .\" Bullet
43 .ie t .ds BU \(bu
44 .el .ds BU *
45 .\" used in '.IP \*(BU 2m' (former .Topic)
46 .
47 .
48 .\" ====================================================================
49 .SH "SYNOPSIS"
50 .\" ====================================================================
51 .
52 .SY groffer
53 .RI [ mode-option
54 \*(EL]
55 .RI [ groff-option
56 \*(EL]
57 .RI [ man-option
58 \*(EL]
59 .RI [ X-option
60 \*(EL]
61 .OP \-\-
62 .RI [ filespec
63 \*(EL]
64 .YS
65 .
66 .SY groffer
67 .B \-h
68 .SY groffer
69 .B \-\-help
70 .YS
71 .
72 .SY groffer
73 .B \-v
74 .SY groffer
75 .B \-\-version
76 .YS
77 .
78 .
79 .\" ====================================================================
80 .SH DESCRIPTION
81 .\" ====================================================================
82 .
83 The
84 .B \%groffer
85 program is the easiest way to use
86 .BR \%groff (@MAN1EXT@).
87 It can display arbitrary documents written in the
88 .I \%groff
89 language, see
90 .BR \%groff (@MAN7EXT@),
91 or other
92 .I \%roff
93 languages, see
94 .BR \%roff (@MAN7EXT@),
95 that are compatible to the original
96 .I \%troff
97 language.
98 .
99 It finds and runs all necessary
100 .I groff
101 preprocessors, such as
102 .BR @g@chem .
103 .
104 .
105 .P
106 The
107 .B \%groffer
108 program also includes many of the features for finding and displaying
109 the \%\f(CRUnix\fP manual pages
110 .nh
111 .RI ( man\~pages ),
112 .hy
113 such that it can be used as a replacement for a
114 .BR \%man (1)
115 program.
116 .
117 Moreover, compressed files that can be handled by
118 .BR \%gzip (1)
119 or
120 .BR \%bzip2 (1)
121 are decompressed on-the-fly.
122 .
123 .
124 .P
125 The normal usage is quite simple by supplying a file name or name of a
126 .I \%man\~page
127 without further options.
128 .
129 But the option handling has many possibilities for creating special
130 behaviors.
131 .
132 This can be done either in configuration files, with the shell
133 environment variable
134 .IR \%GROFFER_OPT ,
135 or on the command line.
136 .
137 .
138 .P
139 The output can be generated and viewed in several different ways
140 available for
141 .IR \%groff .
142 .
143 This includes the
144 X Window System-based
145 .I \%groff
146 program
147 .BR \%gxditview (@MAN1EXT@),
148 each
149 .IR \%PostScript ,
150 .IR \%PDF ,
151 or
152 .I \%DVI
153 display program, a web browser by generating
154 .I \%HTML
155 or
156 .I \%XHTML
157 in
158 .IR \%www\~mode ,
159 or several
160 .I \%text\~modes
161 in text terminals.
162 .
163 .
164 .P
165 Most of the options that must be named when running
166 .B \%groff
167 directly are determined automatically for
168 .BR \%groffer ,
169 due to the internal usage of the
170 .BR \%grog (@MAN1EXT@)
171 program.
172 .
173 But all parts can also be controlled manually by arguments.
174 .
175 .
176 .P
177 Several file names can be specified on the command-line arguments.
178 .
179 They are transformed into a single document in the normal way of
180 .BR \%groff .
181 .
182 .
183 .P
184 Option handling is done in \f(CRGNU\fP style.
185 .
186 Options and file names can be mixed freely.
187 .
188 The option
189 .RB \[lq] \-\- \[rq]
190 closes the option handling, all following arguments are treated as
191 file names.
192 .
193 Long options can be abbreviated in several ways.
194 .
195 .
196 .\" ====================================================================
197 .SH "OPTION OVERVIEW"
198 .\" ====================================================================
199 .
200 .TP
201 .I breaking options
202 .RS
203 .P
204 .SY
205 .OP \-h\~\fR|\fB\~\-\-help
206 .OP \-v\~\fR|\fB\~\-\-version
207 .YS
208 .RE
209 .
210 .
211 .TP
212 .I \%groffer mode options
213 .RS
214 .P
215 .SY
216 .OP \-\-auto
217 .OP \-\-default
218 .OP \-\-default\-modes mode1,mode2,\*(EL
219 .OP \-\-dvi
220 .OP \-\-groff
221 .OP \-\-html
222 .OP \-\-latin1
223 .OP \-\-mode display_mode
224 .OP \-\-pdf
225 .OP \-\-pdf2
226 .OP \-\-ps
227 .OP \-\-source
228 .OP \-\-text
229 .OP \-\-to\-stdout
230 .OP \-\-tty
231 .OP \-\-utf8
232 .OP \-\-viewer prog
233 .OP \-\-www
234 .OP \-\-xhtml
235 .OP \-\-x\~\fR|\fB\~\-\-X\fP
236 .YS
237 .RE
238 .
239 .
240 .TP
241 .I options related to \%groff
242 .RS
243 .P
244 .SY
245 .OP \-T\~\fR|\fB\~\-\-device device
246 .OP \-Z\~\fR|\fB\~\-\-intermediate\-output\~\fR|\fB\~\-\-ditroff
247 .YS
248 .P
249 All further
250 .B \%groff
251 short options are accepted.
252 .RE
253 .
254 .
255 .TP
256 .I options for man\~pages
257 .RS
258 .P
259 .SY
260 .OP \-\-apropos
261 .OP \-\-apropos\-data
262 .OP \-\-apropos\-devel
263 .OP \-\-apropos\-progs
264 .OP \-\-man
265 .OP \-\-no\-man
266 .OP \-\-no\-special
267 .OP \-\-whatis
268 .YS
269 .RE
270 .
271 .
272 .TP
273 .I long options taken over from GNU man
274 .RS
275 .P
276 .SY
277 .OP \-\-all
278 .OP \-\-ascii
279 .OP \-\-ditroff
280 .OP \-\-extension suffix
281 .OP \-\-locale language
282 .OP \-\-local\-file
283 .OP \-\-location\~\fR|\fB\~\-\-where
284 .OP \-\-manpath dir1:dir2:\*(EL
285 .OP \-\-no\-location
286 .OP \-\-pager program
287 .OP \-\-sections sec1:sec2:\*(EL
288 .OP \-\-systems sys1,sys2,\*(EL
289 .OP \-\-troff\-device device
290 .YS
291 .P
292 Further long options of \f(CRGNU\fP
293 .B man
294 are accepted as well.
295 .RE
296 .
297 .
298 .TP
299 .I options mapped to X Window System Toolkit Intrinsics options
300 .RS
301 .P
302 .SY
303 .OP \-\-bd\~\fR|\fB\~\-\-bordercolor pixels
304 .OP \-\-bg\~\fR|\fB\~\-\-background color
305 .OP \-\-bw\~\fR|\fB\~\-\-borderwidth pixels
306 .OP \-\-display X-display
307 .OP \-\-fg\~\fR|\fB\~\-\-foreground color
308 .OP \-\-fn\~\fR|\fB\~\-\-ft\~\fR|\fB\~\-\-font font_name
309 .OP \-\-geometry size_pos
310 .OP \-\-resolution value
311 .OP \-\-rv
312 .OP \-\-title string
313 .OP \-\-xrm X\-resource
314 .YS
315 .RE
316 .
317 .
318 .TP
319 .I options for development
320 .RS
321 .P
322 .SY
323 .OP \-\-debug
324 .OP \-\-debug\-filenames
325 .OP \-\-debug\-grog
326 .OP \-\-debug\-keep
327 .OP \-\-debug\-params
328 .OP \-\-debug\-tmpdir
329 .OP \-\-do\-nothing
330 .OP \-\-print text
331 .OP \-V
332 .YS
333 .RE
334 .
335 .
336 .TP
337 .I \%filespec arguments
338 .RS
339 .P
340 The
341 .I \%filespec
342 parameters are all arguments that are neither an option nor an option
343 argument.
344 .
345 They usually mean a file name or a
346 .I man page
347 searching scheme.
348 .
349 .
350 .P
351 In the following, the term
352 .I section_extension
353 is used.
354 .
355 It means a word that consists of a
356 .I man section
357 that is optionally followed by an
358 .IR extension .
359 .
360 The name of a
361 .I man section
362 is a single character from
363 .BR \%[1\(en9on] ,
364 the
365 .I extension
366 is some word.
367 .
368 The
369 .I extension
370 is mostly lacking.
371 .
372 .
373 .P
374 No
375 .I \%filespec
376 parameters means standard input.
377 .
378 .
379 .TP 10m
380 .B \-
381 stands for standard input (can occur several times).
382 .
383 .
384 .TP
385 .I filename
386 the path name of an existing file.
387 .
388 .
389 .TP
390 .BI man: name ( section_extension )
391 .TQ
392 .BI man: name . section_extension
393 .TQ
394 .IB name ( section_extension )
395 .TQ
396 .IB name . section_extension
397 .TQ
398 .I "section_extension name"
399 search the \%man\~page
400 .I \%name
401 in the section with optional extension
402 .IR section_extension .
403 .
404 .
405 .TP
406 .BI man: name
407 \%man\~page in the lowest
408 .I \%man\~section
409 that has
410 .IR \%name .
411 .
412 .
413 .TP
414 .I name
415 if
416 .I \%name
417 is not an existing file search for the man\~page
418 .I \%name
419 in the lowest man\~section.
420 .
421 .RE
422 .
423 .
424 .\" ====================================================================
425 .SH "OPTION DETAILS"
426 .\" ====================================================================
427 .
428 The
429 .B \%groffer
430 program can usually be run with very few options.
431 .
432 But for special purposes, it supports many options.
433 .
434 These can be classified in 5 option classes.
435 .
436 .
437 .P
438 All short options of
439 .B \%groffer
440 are compatible with the short options of
441 .BR \%groff (@MAN1EXT@).
442 .
443 All long options of
444 .B \%groffer
445 are compatible with the long options of
446 .BR \%man (1).
447 .
448 .
449 .P
450 Arguments for long option names can be abbreviated in several ways.
451 .
452 First, the argument is checked whether it can be prolonged as is.
453 .
454 Furthermore, each minus sign
455 .B \-
456 is considered as a starting point for a new abbreviation.
457 .
458 This leads to a set of multiple abbreviations for a single argument.
459 .
460 For example,
461 .B \-\-de\-n\-f
462 can be used as an abbreviation for
463 .BR \-\-debug\-not\-func ,
464 but
465 .B \-\-de\-n
466 works as well.
467 .
468 If the abbreviation of the argument leads to several resulting options
469 an error is raised.
470 .
471 .
472 .P
473 These abbreviations are only allowed in the environment variable
474 .IR \%GROFFER_OPT ,
475 but not in the configuration files.
476 .
477 In configuration, all long options must be exact.
478 .
479 .
480 .\" ====================================================================
481 .SS "groffer breaking Options"
482 .\" ====================================================================
483 .
484 As soon as one of these options is found on the command line it is
485 executed, printed to standard output, and the running
486 .B \%groffer
487 is terminated thereafter.
488 .
489 All other arguments are ignored.
490 .
491 .
492 .TP
493 .B \-h\~\fR|\fB\~\-\-help
494 Print help information with a short explanation of options to
495 standard output.
496 .
497 .
498 .TP
499 .B \-v\~\fR|\fB\~\-\-version
500 Print version information to standard output.
501 .
502 .
503 .\" ====================================================================
504 .SS "groffer Mode Options"
505 .\" ====================================================================
506 .
507 The display mode and the viewer programs are determined by these
508 options.
509 .
510 If none of these mode and viewer options is specified
511 .B \%groffer
512 tries to find a suitable display mode automatically.
513 .
514 The default modes are
515 .IR "mode pdf" ,
516 .IR "mode ps" ,
517 .IR "mode html" ,
518 .IR "mode xhtml" ,
519 .IR "mode x" ,
520 and
521 .I "mode dvi"
522 in the X Window System with different viewers and
523 .I mode tty
524 with device
525 .I utf8
526 under
527 .B less
528 on a terminal; other modes are tested if the programs for the main
529 default mode do not exist.
530 .
531 .
532 .P
533 In the X Window System, many programs create their own window when
534 called.
535 .
536 .B \%groffer
537 can run these viewers as an independent program in the background.
538 .
539 As this does not work in text mode on a terminal (tty) there must be a
540 way to know which viewers are X Window System-based graphical
541 programs.
542 .
543 The
544 .B \%groffer
545 script has a small amount of information on some viewer names.
546 .
547 If a viewer argument of the command\-line chooses an element that is
548 recognized as an X Window System-based program in this list, it is
549 treated as a viewer that can run in the background.
550 .
551 Unrecognized viewers are not run in the background.
552 .
553 .
554 .P
555 For each mode, you are free to choose whatever viewer you want.
556 .
557 That need not be some graphical viewer suitable for this mode.
558 .
559 There is a chance to view the output source; for example, the
560 combination of the options
561 .B \-\-mode=ps
562 and
563 .B \-\-viewer=less
564 shows the content of the
565 .I PostScript
566 output, the source code, with the pager
567 .BR less .
568 .
569 .
570 .TP
571 .B \-\-auto
572 Equivalent to
573 .BR \-\-mode=auto .
574 .
575 .
576 .TP
577 .B \-\-default
578 Reset all configuration from previously processed command-line options
579 to the default values.
580 .
581 This is useful to wipe out all former options of the configuration, in
582 .IR \%GROFFER_OPT ,
583 and restart option processing using only the rest of the command line.
584 .
585 .
586 .TP
587 .BI \-\-default\-modes \ mode1,mode2,\*(EL
588 Set the sequence of modes for
589 .I \%auto\~mode
590 to the comma separated list given in the argument.
591 .
592 See
593 .B \-\-mode
594 for details on modes.
595 Display in the default manner; actually, this means to try the modes
596 .IR x ,
597 .IR ps ,
598 and
599 .I \%tty
600 in this sequence.
601 .
602 .
603 .
604 .TP
605 .B \-\-dvi
606 Equivalent to
607 .BR \-\-mode=\%dvi .
608 .
609 Known
610 .I \%DVI
611 viewers for the X Window System include
612 .BR \%xdvi (1)
613 and
614 .BR \%dvilx (1).
615 .
616 .
617 .TP
618 .B \-\-groff
619 Equivalent to
620 .BR \-\-mode=groff .
621 .
622 .
623 .TP
624 .B \-\-html
625 Equivalent to
626 .BR \-\-mode=html .
627 .
628 .
629 .TP
630 .BI \-\-mode \ value
631 .
632 Set the display mode.
633 .
634 The following mode values are recognized:
635 .
636 .RS
637 .
638 .TP
639 .B auto
640 Select the automatic determination of the display mode.
641 .
642 The sequence of modes that are tried can be set with the
643 .B \-\-default\-modes
644 option.
645 .
646 Useful for restoring the
647 .I \%default\~mode
648 when a different mode was specified before.
649 .
650 .
651 .TP
652 .B dvi
653 Display formatted input in a
654 .I \%DVI
655 viewer program.
656 .
657 By default, the formatted input is displayed with the
658 .BR \%xdvi (1)
659 program.
660 .
661 .
662 .TP
663 .B groff
664 After the file determination, switch
665 .B \%groffer
666 to process the input like
667 .BR \%groff (@MAN1EXT@)
668 would do.
669 .
670 This disables the
671 .I \%groffer
672 viewing features.
673 .
674 .
675 .TP
676 .B html
677 Translate the input into HTML format and display the result in a web
678 browser program.
679 .
680 By default, the existence of a sequence of standard web browsers is
681 tested, starting with
682 .BR \%konqueror (1)
683 and
684 .BR \%mozilla (1).
685 The text HTML viewer is
686 .BR \%lynx (1).
687 .
688 By default, the existence of a sequence of standard web browsers is
689 tested, starting with
690 .BR \%konqueror (1)
691 and
692 .BR \%mozilla (1).
693 The text HTML viewer is
694 .BR \%lynx (1).
695 .
696 .
697 .TP
698 .B pdf
699 Transform
700 .I roff input files
701 into a
702 .I PDF file
703 by using the
704 .B groff (@MAN1EXT@)
705 device
706 .BR -Tpdf .
707 .
708 This is the default
709 .B PDF
710 generator.
711 .
712 The generated
713 .I PDF file
714 is displayed with suitable viewer programs, such as
715 .BR okular (1).
716 .
717 .
718 .TP
719 .B pdf2
720 This is the traditional
721 .IR "pdf mode" .
722 .
723 Sometimes this mode produces more correct output than the default
724 .BR "PDF mode" .
725 .
726 By default, the input is formatted by
727 .B \%groff
728 using the PostScript device, then it is transformed into the PDF file
729 format using
730 .BR \%gs (1),
731 or
732 .BR ps2pdf (1).
733 .
734 If that's not possible, the
735 .I PostScript mode (ps)
736 is used instead.
737 .
738 Finally it is displayed using different viewer programs.
739 .
740 .
741 .TP
742 .B ps
743 Display formatted input in a PostScript viewer program.
744 .
745 By default, the formatted input is displayed in one of many viewer
746 programs.
747 .
748 .
749 .TP
750 .B text
751 Format in a
752 .I \%groff\~text\~mode
753 and write the result to standard output without a pager or viewer
754 program.
755 .
756 The text device,
757 .I \%latin1
758 by default, can be chosen with option
759 .BR \-T .
760 .
761 .
762 .TP
763 .B tty
764 Format in a
765 .I \%groff\~text\~mode
766 and write the result to standard output using a text pager program,
767 even when in the X Window System.
768 .
769 .
770 .TP
771 .B www
772 Equivalent to
773 .BR \-\-mode=html .
774 .
775 .
776 .TP
777 .B x
778 Display the formatted input in a native
779 .I roff
780 viewer.
781 .
782 By default, the formatted input is displayed with the
783 .BR \%gxditview (@MAN1EXT@)
784 program being distributed together with
785 .BR \%groff .
786 But the legacy X Window System application
787 .BR \%xditview (1)
788 can also be chosen with the option
789 .BR \-\-viewer .
790 The default resolution is
791 .BR 75dpi ,
792 but
793 .B 100dpi
794 are also possible.
795 .
796 The default
797 .I groff
798 device
799 for the resolution of
800 .B 75dpi
801 is
802 .BR X75\-12 ,
803 for
804 .B 100dpi
805 it is
806 .BR X100 .
807 .
808 The corresponding
809 .I "groff intermediate output"
810 for the actual device is generated and the result is displayed.
811 .
812 For a resolution of
813 .BR 100dpi ,
814 the default width of the geometry of the display program is chosen to
815 .BR 850dpi .
816 .
817 .
818 .TP
819 .B X
820 Equivalent to
821 .BR \-\-mode=x .
822 .
823 .
824 .TP
825 .B xhtml
826 Translate the input into
827 .I XHTML
828 format, which is an
829 .I XML
830 version of
831 .IR HTML .
832 .
833 Then display the result in a web browser program, mostly the known
834 .IR "HTML viewers" .
835 .
836 .
837 .P
838 The following modes do not use the
839 .I \%groffer
840 viewing features.
841 .
842 They are only interesting for advanced applications.
843 .
844 .
845 .TP
846 .B groff
847 Generate device output with plain
848 .I \%groff
849 without using the special viewing features of
850 .IR \%groffer .
851 If no device was specified by option
852 .B \-T
853 the
854 .I \%groff
855 default
856 .B \%ps
857 is assumed.
858 .
859 .
860 .TP
861 .B source
862 Output the roff source code of the input files without further
863 processing.
864 .
865 .
866 .RE
867 .
868 .
869 .TP
870 .B \-\-pdf
871 Equivalent to
872 .BR \-\-mode=pdf .
873 .TQ
874 .B \-\-pdf2
875 Equivalent to
876 .BR \-\-mode=pdf2 .
877 .
878 .
879 .TP
880 .B \-\-ps
881 Equivalent to
882 .BR \-\-mode=ps .
883 .
884 Common PostScript viewers include
885 .BR \%okular (1),
886 .BR \%evince (1),
887 .BR \%gv (1),
888 .BR \%ghostview (1),
889 and
890 .BR \%gs (1),
891 .
892 In each case, arguments can be provided additionally.
893 .
894 .
895 .TP
896 .B \-\-source
897 Equivalent to
898 .BR \-\-mode=source .
899 .
900 .
901 .TP
902 .B \-\-text
903 Equivalent to
904 .BR \-\-mode=text .
905 .
906 .
907 .TP
908 .B \-\-to\-stdout
909 The file for the chosen mode is generated and its content is printed
910 to standard output.
911 .
912 It will not be displayed in graphical mode.
913 .
914 .
915 .TP
916 .B \-\-tty
917 Equivalent to
918 .BR \-\-mode=tty .
919 The standard pager is
920 .BR less (1).
921 This option is equivalent to
922 .I man
923 option
924 .BR \-\-pager=\,\fIprog\fP .
925 The option argument can be a file name or a program to be searched in
926 .IR $PATH ;
927 arguments can be provided additionally.
928 .
929 .
930 .TP
931 .BI \-\-viewer \ prog
932 Choose a viewer program for actual device or mode.
933 .
934 This can be a file name or a program to be searched in
935 .IR $PATH ;
936 arguments can be provided additionally.
937 .
938 .
939 .TP
940 .B \-\-www
941 Equivalent to
942 .BR \-\-mode=html .
943 .
944 .
945 .TP
946 .B \-\-X\~\fR|\fB\~\-\-x
947 Equivalent to
948 .BR \-\-mode=x .
949 Suitable viewer programs are
950 .BR \%gxditview (@MAN1EXT@)
951 which is the default and
952 .BR \%xditview (1).
953 .
954 .
955 .TP
956 .B \-\-
957 Signals the end of option processing; all remaining arguments are
958 interpreted as
959 .I \%filespec
960 parameters.
961 .
962 .
963 .P
964 Besides these,
965 .B \%groffer
966 accepts all short options that are valid for the
967 .BR \%groff (@MAN1EXT@)
968 program.
969 .
970 All
971 .RB \%non- groffer
972 options are sent unmodified via
973 .B \%grog
974 to
975 .BR \%groff .
976 .
977 So postprocessors, macro packages, compatibility with
978 .I classical
979 .IR \%troff ,
980 and much more can be manually specified.
981 .
982 .
983 .\" ====================================================================
984 .SS "Options related to groff"
985 .\" ====================================================================
986 .
987 All short options of
988 .B \%groffer
989 are compatible with the short options of
990 .BR \%groff (@MAN1EXT@).
991 .
992 The following of
993 .B \%groff
994 options have either an additional special meaning within
995 .B \%groffer
996 or make sense for normal usage.
997 .
998 .
999 .P
1000 Because of the special outputting behavior of the
1001 .B \%groff
1002 option
1003 .B \-Z
1004 .B \%groffer
1005 was designed to be switched into
1006 .IR \%groff\~mode ;
1007 the
1008 .I \%groffer
1009 viewing features are disabled there.
1010 .
1011 The other
1012 .B \%groff
1013 options do not switch the mode, but allow to customize the formatting
1014 process.
1015 .
1016 .
1017 .TP
1018 .B \-\-a
1019 This generates an ASCII approximation of output in the
1020 .IR \%text\~modes .
1021 .
1022 That could be important when the text pager has problems with control
1023 sequences in
1024 .IR "tty mode" .
1025 .
1026 .
1027 .TP
1028 .BI \-\-m \ file
1029 Add
1030 .I \%file
1031 as a
1032 .I \%groff
1033 macro file.
1034 .
1035 This is useful in case it cannot be recognized automatically.
1036 .
1037 .
1038 .TP
1039 .BI \-\-P \ opt_or_arg
1040 Send the argument
1041 .I \%opt_or_arg
1042 as an option or option argument to the actual
1043 .B \%groff
1044 postprocessor.
1045 .
1046 .
1047 .TP
1048 .B \-\-T \fIdevname\fR\~\fR|\fB\~\-\-device \fIdevname\fR
1049 .
1050 This option determines
1051 .BR \%groff 's
1052 output device.
1053 .
1054 The most important devices are the text output devices for referring
1055 to the different character sets, such as
1056 .BR \%ascii ,
1057 .BR \%utf8 ,
1058 .BR \%latin1 ,
1059 .BR \%utf8 ,
1060 and others.
1061 .
1062 Each of these arguments switches
1063 .B \%groffer
1064 into a
1065 .I \%text\~mode
1066 using this device, to
1067 .I \%mode\~tty
1068 if the actual mode is not a
1069 .IR \%text\~mode .
1070 .
1071 The following
1072 .I \%devname
1073 arguments are mapped to the corresponding
1074 .B \%groffer
1075 .B \-\-mode=\,\fIdevname\fR
1076 option:
1077 .BR \%dvi ,
1078 .BR \%html ,
1079 .BR \%xhtml ,
1080 and
1081 .BR \%ps .
1082 All
1083 .B \%X*
1084 arguments are mapped to
1085 .IR \%mode\~x .
1086 Each other
1087 .I \%devname
1088 argument switches to
1089 .I \%mode\~groff
1090 using this device.
1091 .
1092 .
1093 .TP
1094 .B \-\-X
1095 is equivalent to
1096 .BR "groff \-X" .
1097 It displays the
1098 .I groff intermediate output
1099 with
1100 .BR gxditview .
1101 As the quality is relatively bad this option is deprecated; use
1102 .B \-\-X
1103 instead because the
1104 .I \%x\~mode
1105 uses an
1106 .IR X *
1107 device for a better display.
1108 .
1109 .
1110 .TP
1111 .B \-Z\~\fR|\fB\~\-\-intermediate-output\~\fR|\fB\~\-\-ditroff
1112 Switch into
1113 .I \%groff\~mode
1114 and format the input with the
1115 .I \%groff intermediate output
1116 without postprocessing; see
1117 .BR \%groff_out (@MAN5EXT@).
1118 This is equivalent to option
1119 .B \-\-ditroff
1120 of
1121 .IR \%man ,
1122 which can be used as well.
1123 .
1124 .
1125 .P
1126 All other
1127 .B \%groff
1128 options are supported by
1129 .BR \%groffer ,
1130 but they are just transparently transferred to
1131 .B \%groff
1132 without any intervention.
1133 .
1134 The options that are not explicitly handled by
1135 .B \%groffer
1136 are transparently passed to
1137 .BR \%groff .
1138 .
1139 Therefore these transparent options are not documented here, but in
1140 .BR \%groff (@MAN1EXT@).
1141 Due to the automatism in
1142 .BR \%groffer ,
1143 none of these
1144 .B \%groff
1145 options should be needed, except for advanced usage.
1146 .
1147 .
1148 .\" ====================================================================
1149 .SS "Options for man\~pages"
1150 .\" ====================================================================
1151 .
1152 .TP
1153 .B \-\-apropos
1154 Start the
1155 .BR \%apropos (1)
1156 command or facility of
1157 .BR \%man (1)
1158 for searching the
1159 .I \%filespec
1160 arguments within all
1161 .I \%man\~page
1162 descriptions.
1163 .
1164 Each
1165 .I \%filespec
1166 argument is taken for search as it is;
1167 .I section
1168 specific parts are not handled, such that
1169 .B 7 groff
1170 searches for the two arguments
1171 .B 7
1172 and
1173 .BR groff ,
1174 with a large result; for the
1175 .I \%filespec
1176 .B groff.7
1177 nothing will be found.
1178 .
1179 The
1180 .I language
1181 locale is handled only when the called programs do support this; the
1182 GNU
1183 .B apropos
1184 and
1185 .B man \-k
1186 do not.
1187 .
1188 The display differs from the
1189 .B \%apropos
1190 program by the following concepts:
1191 .RS
1192 .IP \*(BU 2m
1193 Construct a
1194 .I \%groff
1195 frame similar to a
1196 .I \%man\~page
1197 to the output of
1198 .BR \%apropos ,
1199 .IP \*(BU 2m
1200 each
1201 .I \%filespec
1202 argument is searched on its own.
1203 .IP \*(BU 2m
1204 The restriction by
1205 .B \-\-sections
1206 is handled as well,
1207 .IP \*(BU 2m
1208 wildcard characters are allowed and handled without a further option.
1209 .RE
1210 .
1211 .
1212 .TP
1213 .B \-\-apropos\-data
1214 Show only the
1215 .B \%apropos
1216 descriptions for data documents, these are the
1217 .BR \%man (7)
1218 .IR sections\~4 ", " 5 ", and " 7 .
1219 .
1220 Direct
1221 .I section
1222 declarations are ignored, wildcards are accepted.
1223 .
1224 .
1225 .TP
1226 .B \-\-apropos\-devel
1227 Show only the
1228 .B \%apropos
1229 descriptions for development documents, these are the
1230 .BR man (7)
1231 .IR sections\~2 ", " 3 ", and " 9 .
1232 .
1233 Direct
1234 .I section
1235 declarations are ignored, wildcards are accepted.
1236 .
1237 .
1238 .TP
1239 .B \-\-apropos\-progs
1240 Show only the
1241 .B \%apropos
1242 descriptions for documents on programs, these are the
1243 .BR \%man (7)
1244 .IR sections\~1 ", " 6 ", and " 8 .
1245 .
1246 Direct
1247 .I section
1248 declarations are ignored, wildcards are accepted.
1249 .
1250 .
1251 .TP
1252 .B \-\-whatis
1253 For each
1254 .I \%filespec
1255 argument search all
1256 .I \%man\~pages
1257 and display their description \(em or say that it is not a
1258 .IR \%man\~page .
1259 This is written from anew, so it differs from
1260 .IR man 's
1261 .B whatis
1262 output by the following concepts
1263 .RS
1264 .IP \*(BU 2m
1265 each retrieved file name is added,
1266 .IP \*(BU 2m
1267 local files are handled as well,
1268 .IP \*(BU 2m
1269 the \fIlanguage\fP and \fIsystem\fP locale is supported,
1270 .IP \*(BU 2m
1271 the display is framed by a
1272 .I groff
1273 output format similar to a
1274 .IR \%man\~page ,
1275 .IP \*(BU 2m
1276 wildcard characters are allowed without a further option.
1277 .RE
1278 .
1279 .
1280 .P
1281 The following options were added to
1282 .B \%groffer
1283 for choosing whether the file name arguments are interpreted as names
1284 for local files or as a search pattern for
1285 .IR \%man\~pages .
1286 .
1287 The default is looking up for local files.
1288 .
1289 .
1290 .TP
1291 .B \-\-man
1292 Check the non-option command-line arguments
1293 .nh
1294 .RI ( filespecs )
1295 .hy
1296 first on being
1297 .IR \%man\~pages ,
1298 then whether they represent an existing file.
1299 .
1300 By default, a
1301 .I \%filespec
1302 is first tested whether it is an existing file.
1303 .
1304 .
1305 .TP
1306 .B \-\-no-man\~\fR|\fB\~\-\-local-file
1307 Do not check for
1308 .IR \%man\~pages .
1309 .
1310 .B \-\-local-file
1311 is the corresponding
1312 .B man
1313 option.
1314 .
1315 .
1316 .TP
1317 .B \-\-no-special
1318 Disable former calls of
1319 .BR \-\-all ,
1320 .BR \-\-apropos* ,
1321 and
1322 .BR \-\-whatis .
1323 .
1324 .
1325 .\" ====================================================================
1326 .SS "Long options taken over from GNU man"
1327 .\" ====================================================================
1328 .
1329 The long options of
1330 .B \%groffer
1331 were synchronized with the long options of \f(CRGNU\fP
1332 .BR man .
1333 .
1334 All long options of \f(CRGNU\fP
1335 .B man
1336 are recognized, but not all of these options are important to
1337 .BR \%groffer ,
1338 so most of them are just ignored.
1339 .
1340 These ignored
1341 .B man
1342 options are
1343 .BR \-\-catman ,
1344 .BR \-\-troff ,
1345 and
1346 .BR \-\-update .
1347 .
1348 .
1349 .P
1350 In the following, the
1351 .B man
1352 options that have a special meaning for
1353 .B \%groffer
1354 are documented.
1355 .
1356 .
1357 .P
1358 If your system has \f(CRGNU\fP
1359 .B man
1360 installed the full set of long and short options of the \f(CRGNU\fP
1361 .B man
1362 program can be passed via the environment variable
1363 .IR MANOPT ;
1364 see
1365 .BR \%man (1).
1366 .
1367 .
1368 .TP
1369 .B \-\-all
1370 In searching
1371 .IR \%man\~pages ,
1372 retrieve all suitable documents instead of only one.
1373 .
1374 .
1375 .TP
1376 .B \-7\~\fR|\fB\~\-\-ascii
1377 In
1378 .IR \%text\~modes ,
1379 display ASCII translation of special characters for critical environment.
1380 .
1381 This is equivalent to
1382 .BR "groff \%\-mtty_char" ;
1383 see
1384 .BR groff_tmac (@MAN5EXT@).
1385 .
1386 .
1387 .TP
1388 .B \-\-ditroff
1389 Produce
1390 .IR "groff intermediate output" .
1391 This is equivalent to
1392 .B \%groffer
1393 .BR \-Z .
1394 .
1395 .
1396 .TP
1397 .BI \-\-extension \ suffix
1398 Restrict
1399 .I \%man\~page
1400 search to file names that have
1401 .I \%suffix
1402 appended to their section element.
1403 .
1404 For example, in the file name
1405 .I \%/usr/share/man/man3/terminfo.3ncurses.gz
1406 the
1407 .I \%man\~page
1408 extension is
1409 .IR \%ncurses .
1410 .
1411 .
1412 .TP
1413 .BI \-\-locale \ language
1414 .
1415 Set the language for
1416 .IR \%man\~pages .
1417 .
1418 This has the same effect, but overwrites
1419 .IR $LANG .
1420 .
1421 .
1422 .TP
1423 .B \-\-location
1424 Print the location of the retrieved files to standard error.
1425 .
1426 .
1427 .TP
1428 .B \-\-no-location
1429 Do not display the location of retrieved files; this resets a former
1430 call to
1431 .BR \-\-location .
1432 .
1433 This was added by
1434 .BR \%groffer .
1435 .
1436 .
1437 .TP
1438 .BI \-\-manpath \ 'dir1:dir2:\*(EL'
1439 Use the specified search path for retrieving
1440 .I \%man\~pages
1441 instead of the program defaults.
1442 .
1443 If the argument is set to the empty string "" the search for
1444 .I \%man\~page
1445 is disabled.
1446 .
1447 .
1448 .TP
1449 .B \-\-pager
1450 Set the pager program in
1451 .IR \%tty\~mode ;
1452 default is
1453 .BR \%less .
1454 .
1455 This can be set with
1456 .BR \-\-viewer .
1457 .
1458 .
1459 .TP
1460 .BI \-\-sections \ sec1:sec2:\*(EL
1461 Restrict searching for
1462 .I \%man\~pages
1463 to the given
1464 .IR sections ,
1465 a colon-separated list.
1466 .
1467 .
1468 .TP
1469 .BI \-\-systems \ sys1,sys2,\*(EL
1470 Search for
1471 .I \%man\~pages
1472 for the given operating systems; the argument
1473 .I \%systems
1474 is a comma-separated list.
1475 .
1476 .
1477 .TP
1478 .B \-\-where
1479 Equivalent to
1480 .BR \-\-location .
1481 .
1482 .
1483 .\" ====================================================================
1484 .SS "X Window System Toolkit Intrinsics Options"
1485 .\" ====================================================================
1486 .
1487 The following long options were adapted from the corresponding
1488 X Window System Toolkit Intrinsics options.
1489 .
1490 .B \%groffer
1491 will pass them to the actual viewer program if it is an
1492 X Window System program.
1493 .
1494 Otherwise these options are ignored.
1495 .
1496 .
1497 .P
1498 Unfortunately these options use the old style of a single minus for
1499 long options.
1500 .
1501 For
1502 .B \%groffer
1503 that was changed to the standard with using a double minus for long
1504 options, for example,
1505 .B \%groffer
1506 uses the option
1507 .B \-\-font
1508 for the X Window System Toolkit Intrinsics option
1509 .BR \-font .
1510 .
1511 .
1512 .P
1513 See
1514 .BR X (7)
1515 and the manual
1516 .I "X Toolkit Intrinsics \(en C Language Interface"
1517 for more details on these options and their arguments.
1518 .
1519 .
1520 .TP
1521 .BI \-\-background \ color
1522 Set the background color of the viewer window.
1523 .
1524 .
1525 .TP
1526 .BI \-\-bd \ pixels
1527 This is equivalent to
1528 .BR \-\-bordercolor .
1529 .
1530 .
1531 .TP
1532 .BI \-\-bg \ color
1533 This is equivalent to
1534 .BR \-\-background .
1535 .
1536 .
1537 .TP
1538 .BI \-\-bw \ pixels
1539 This is equivalent to
1540 .BR \-\-borderwidth .
1541 .
1542 .
1543 .TP
1544 .BI \-\-bordercolor \ pixels
1545 Specifies the color of the border surrounding the viewer window.
1546 .
1547 .
1548 .TP
1549 .BI \-\-borderwidth \ pixels
1550 Specifies the width in pixels of the border surrounding the viewer
1551 window.
1552 .
1553 .
1554 .TP
1555 .BI \-\-display \ X-display
1556 Set the X Window System display on which the viewer program
1557 shall be started.
1558 .
1559 See section \(lqDisplay Names\(rq in
1560 .BR X (7)
1561 for the syntax of the argument.
1562 .
1563 .
1564 .TP
1565 .BI \-\-foreground \ color
1566 Set the foreground color of the viewer window.
1567 .
1568 .
1569 .TP
1570 .BI \-\-fg \ color
1571 This is equivalent to
1572 .BR \-\-foreground .
1573 .
1574 .
1575 .TP
1576 .BI \-\-fn \ font_name
1577 This is equivalent to
1578 .BR \-\-font .
1579 .
1580 .
1581 .TP
1582 .BI \-\-font \ font_name
1583 Set the font used by the viewer window.
1584 .
1585 The argument is an X Window System font name.
1586 .
1587 .
1588 .TP
1589 .BI \-\-ft \ font_name
1590 This is equivalent to
1591 .BR \-\-font .
1592 .
1593 .
1594 .TP
1595 .BI \-\-geometry \ size_pos
1596 Set the geometry of the display window, that means its size and its
1597 starting position.
1598 .
1599 See section \(lqGeometry Specifications\(rq in
1600 .BR X (7)
1601 for the syntax of the argument.
1602 .
1603 .
1604 .TP
1605 .BI \-\-resolution \ value
1606 Set X Window System resolution in dpi (dots per inch) in some
1607 viewer programs.
1608 .
1609 The only supported dpi values are
1610 .B 75
1611 and
1612 .BR 100 .
1613 .
1614 Actually, the default resolution for
1615 .B \%groffer
1616 is set to
1617 .BR 75dpi .
1618 The resolution also sets the default device in
1619 .IR "mode x" .
1620 .
1621 .
1622 .TP
1623 .B \-\-rv
1624 Reverse foreground and background color of the viewer window.
1625 .
1626 .
1627 .TP
1628 .BI \-\-title "\ 'some text'"
1629 Set the title for the viewer window.
1630 .
1631 .
1632 .TP
1633 .BI \-\-xrm \ 'resource'
1634 Set the X Window System server resource to the given value.
1635 .
1636 .
1637 .\" ====================================================================
1638 .SS "Options for Development"
1639 .\" ====================================================================
1640 .
1641 .TP
1642 .B \-\-debug
1643 Enable all debugging options
1644 .BR \-\-debug\-\,\fItype\fP .
1645 .
1646 The temporary files are kept and not deleted, the
1647 .B grog
1648 output is printed, the name of the temporary directory is printed, the
1649 displayed file names are printed, and the parameters are printed.
1650 .
1651 .
1652 .TP
1653 .B \-\-debug\-filenames
1654 Print the names of the files and
1655 .I \%man\~pages
1656 that are displayed by
1657 .BR \&groffer .
1658 .
1659 .
1660 .TP
1661 .B \-\-debug\-grog
1662 Print the output of all
1663 .B grog
1664 commands.
1665 .
1666 .
1667 .TP
1668 .B \-\-debug\-keep
1669 Enable two debugging informations.
1670 .
1671 Print the name of the temporary directory and keep the temporary
1672 files, do not delete them during the run of
1673 .BR \%groffer .
1674 .
1675 .
1676 .TP
1677 .B \-\-debug\-params
1678 Print the parameters, as obtained from the configuration files, from
1679 .IR \%GROFFER_OPT ,
1680 and the command-line arguments.
1681 .
1682 .
1683 .TP
1684 .B \-\-debug\-tmpdir
1685 Print the name of the temporary directory.
1686 .
1687 .
1688 .TP
1689 .B \-\-do-nothing
1690 This is like
1691 .BR \-\-version ,
1692 but without the output; no viewer is started.
1693 .
1694 This makes only sense in development.
1695 .
1696 .
1697 .TP
1698 .B \-\-print=\,\fItext\fR
1699 Just print the argument to standard error.
1700 .
1701 This is good for parameter check.
1702 .
1703 .
1704 .TP
1705 .B \-V
1706 This is an advanced option for debugging only.
1707 .
1708 Instead of displaying the formatted input, a lot of
1709 .I \%groffer
1710 specific information is printed to standard output:
1711 .
1712 .RS
1713 .IP \*(BU 2m
1714 the output file name in the temporary directory,
1715 .
1716 .IP \*(BU 2m
1717 the display mode of the actual
1718 .B \%groffer
1719 run,
1720 .
1721 .IP \*(BU 2m
1722 the display program for viewing the output with its arguments,
1723 .
1724 .IP \*(BU 2m
1725 the active parameters from the config files, the arguments in
1726 .IR \%GROFFER_OPT ,
1727 and the arguments of the command line,
1728 .
1729 .IP \*(BU 2m
1730 the pipeline that would be run by the
1731 .B \%groff
1732 program, but without executing it.
1733 .RE
1734 .
1735 .
1736 .P
1737 Other useful debugging options are the
1738 .B \%groff
1739 option
1740 .B \-Z
1741 and
1742 .BR \-\-mode=groff .
1743 .
1744 .
1745 .\" ====================================================================
1746 .SS "Filespec Arguments"
1747 .\" ====================================================================
1748 .
1749 A
1750 .I \%filespec
1751 parameter is an argument that is not an option or option argument.
1752 .
1753 In
1754 .BR \%groffer ,
1755 .I \%filespec
1756 parameters are a file name or a template for searching
1757 .IR \%man\~pages .
1758 .
1759 These input sources are collected and composed into a single output
1760 file such as
1761 .B \%groff
1762 does.
1763 .
1764 .
1765 .P
1766 The strange \%\f(CRPOSIX\fP behavior to regard all arguments behind
1767 the first non-option argument as
1768 .I \%filespec
1769 arguments is ignored.
1770 .
1771 The \f(CRGNU\fP behavior to recognize options even when mixed with
1772 .I \%filespec
1773 arguments is used throughout.
1774 .
1775 But, as usual, the double minus argument
1776 .B \-\-
1777 ends the option handling and interprets all following arguments as
1778 .I \%filespec
1779 arguments; so the \%\f(CRPOSIX\fP behavior can be easily adopted.
1780 .
1781 .
1782 .P
1783 The options
1784 .B \-\-apropos*
1785 have a special handling of
1786 .I filespec
1787 arguments.
1788 .
1789 Each argument is taken as a search scheme of its own.
1790 .
1791 Also a regexp (regular expression) can be used in the filespec.
1792 .
1793 For example,
1794 .B groffer \-\-apropos '^gro.f$'
1795 searches
1796 .B groff
1797 in the
1798 .I man\~page
1799 name, while
1800 .B groffer \-\-apropos groff
1801 searches
1802 .B groff
1803 somewhere in the name or description of the
1804 .IR man\~pages .
1805 .
1806 .
1807 .P
1808 All other parts of
1809 .IR groffer ,
1810 such as the normal display or the output with
1811 .B \-\-whatis
1812 have a different scheme for
1813 .IR filespecs .
1814 No regular expressions are used for the arguments.
1815 .
1816 The
1817 .I filespec
1818 arguments are handled by the following scheme.
1819 .
1820 .
1821 .P
1822 It is necessary to know that on each system the
1823 .I \%man\~pages
1824 are sorted according to their content into several sections.
1825 .
1826 The
1827 .I classical man sections
1828 have a single-character name, either a digit from
1829 .B 1
1830 to
1831 .B 9
1832 or one of the characters
1833 .B n
1834 or
1835 .BR o .
1836 .
1837 .
1838 .P
1839 This can optionally be followed by a string, the so-called
1840 .IR extension .
1841 The
1842 .I extension
1843 allows the storage of several
1844 .I man\~pages
1845 with the same name in the same
1846 .IR section .
1847 But the
1848 .I extension
1849 is only rarely used; usually it is omitted.
1850 .
1851 Then the
1852 .I extensions
1853 are searched automatically by alphabet.
1854 .
1855 .
1856 .P
1857 In the following, we use the name
1858 .I section_extension
1859 for a word that consists of a single character
1860 .I section
1861 name or a
1862 .I section
1863 character that is followed by an
1864 .IR extension .
1865 .
1866 Each
1867 .I \%filespec
1868 parameter can have one of the following forms in decreasing sequence.
1869 .
1870 .
1871 .IP \*(BU 2m
1872 No
1873 .I \%filespec
1874 parameters means that
1875 .B \%groffer
1876 waits for standard input.
1877 .
1878 The minus option
1879 .B \-
1880 always stands for standard input; it can occur several times.
1881 .
1882 If you want to look up a
1883 .I \%man\~page
1884 called
1885 .B \-
1886 use the argument
1887 .BR man:\- .
1888 .
1889 .
1890 .IP \*(BU 2m
1891 Next a
1892 .I \%filespec
1893 is tested whether it is the path name of an existing file.
1894 .
1895 Otherwise it is assumed to be a searching pattern for a
1896 .IR \%man\~page .
1897 .
1898 .
1899 .IP \*(BU 2m
1900 .BI \%man: name ( section_extension ) ,
1901 .BI \%man: name . section_extension,
1902 .IB \%name ( section_extension ) ,
1903 or
1904 .IB \%name . section_extension
1905 search the \%man\~page
1906 .I \%name
1907 in \%man\~section and possibly extension of
1908 .IR \%section_extension .
1909 .
1910 .
1911 .IP \*(BU 2m
1912 Now
1913 .BI \%man: name
1914 searches for a
1915 .I \%man\~page
1916 in the lowest
1917 .I \%man\~section
1918 that has a document called
1919 .IR \%name .
1920 .
1921 .
1922 .IP \*(BU 2m
1923 .I \%section_extension\~name
1924 is a pattern of 2 arguments that originates from a strange argument
1925 parsing of the
1926 .B man
1927 program.
1928 .
1929 Again, this searches the man page
1930 .I name
1931 with
1932 .IR \%section_extension ,
1933 a combination of a
1934 .I section
1935 character optionally followed by an
1936 .IR extension .
1937 .
1938 .
1939 .IP \*(BU 2m
1940 We are left with the argument
1941 .I \%name
1942 which is not an existing file.
1943 .
1944 So this searches for the
1945 .I \%man\~page
1946 called
1947 .I \%name
1948 in the lowest
1949 .I \%man\~section
1950 that has a document for this name.
1951 .
1952 .
1953 .P
1954 Several file name arguments can be supplied.
1955 .
1956 They are mixed by
1957 .B \%groff
1958 into a single document.
1959 .
1960 Note that the set of option arguments must fit to all of these file
1961 arguments.
1962 .
1963 So they should have at least the same style of the
1964 .I \%groff
1965 language.
1966 .
1967 .
1968 .\" ====================================================================
1969 .SH "OUTPUT MODES"
1970 .\" ====================================================================
1971 .
1972 By default, the
1973 .B \%groffer
1974 program collects all input into a single file, formats it with the
1975 .B \%groff
1976 program for a certain device, and then chooses a suitable viewer
1977 program.
1978 .
1979 The device and viewer process in
1980 .B \%groffer
1981 is called a
1982 .IR \%mode .
1983 .
1984 The mode and viewer of a running
1985 .B \%groffer
1986 program is selected automatically, but the user can also choose it
1987 with options.
1988 .
1989 .
1990 The modes are selected by option the arguments of
1991 .BR \-\-mode=\,\fIanymode .
1992 Additionally, each of this argument can be specified as an option of
1993 its own, such as
1994 .BR anymode .
1995 Most of these modes have a viewer program, which can be chosen by the
1996 option
1997 .BR \-\-viewer .
1998 .
1999 .
2000 .P
2001 Several different modes are offered: graphical modes for
2002 the X Window System,
2003 .IR \%text\~modes ,
2004 and some direct
2005 .I \%groff\~modes
2006 for debugging and development.
2007 .
2008 .
2009 .P
2010 By default,
2011 .B \%groffer
2012 first tries whether
2013 .I \%x\~mode
2014 is possible, then
2015 .IR \%ps\~mode ,
2016 and finally
2017 .IR \%tty\~mode .
2018 .
2019 This mode testing sequence for
2020 .I \%auto\~mode
2021 can be changed by specifying a comma separated list of modes with the
2022 option
2023 .B \-\-default\-modes.
2024 .
2025 .
2026 .P
2027 The searching for
2028 .I \%man\~pages
2029 and the decompression of the input are active in every mode.
2030 .
2031 .
2032 .\" ====================================================================
2033 .SS "Graphical Display Modes"
2034 .\" ====================================================================
2035 .
2036 The graphical display modes work mostly in the X Window System
2037 environment (or similar implementations within other windowing
2038 environments).
2039 .
2040 The environment variable
2041 .I \%DISPLAY
2042 and the option
2043 .B \-\-display
2044 are used for specifying the X Window System display to be used.
2045 .
2046 If this environment variable is empty,
2047 .B \%groffer
2048 assumes that the X Window System is not running and changes to a
2049 .IR \%text\~mode .
2050 .
2051 You can change this automatic behavior by the option
2052 .BR \-\-default\-modes .
2053 .
2054 .
2055 .P
2056 Known viewers for the graphical display modes and their standard
2057 X Window System viewer programs are
2058 .
2059 .IP \*(BU 2m
2060 in a PDF viewer
2061 .nh
2062 .RI ( \%pdf\~mode )
2063 .hy
2064 .
2065 .IP \*(BU 2m
2066 in a web browser
2067 .nh
2068 .RI ( html ,
2069 .RI ( xhtml ,
2070 or
2071 .IR \%www\~mode )
2072 .hy
2073 .RE
2074 .
2075 .IP \*(BU 2m
2076 in a PostScript viewer
2077 .nh
2078 .RI ( \%ps\~mode )
2079 .hy
2080 .
2081 .IP \*(BU 2m
2082 X Window System
2083 .I roff
2084 viewers such as
2085 .BR \%gxditview (@MAN1EXT@)
2086 or
2087 .BR \%xditview (1)
2088 (in
2089 .IR \%x\~mode )
2090 .
2091 .IP \*(BU 2m
2092 in a DVI viewer program
2093 .nh
2094 .RI ( \%dvi\~mode )
2095 .hy
2096 .
2097 .
2098 .P
2099 The
2100 .I \%pdf\~mode
2101 has a major advantage \(em it is the only graphical display mode that
2102 allows searching for text within the viewer; this can be a really
2103 important feature.
2104 .
2105 Unfortunately, it takes some time to transform the input into the PDF
2106 format, so it was not chosen as the major mode.
2107 .
2108 .
2109 .P
2110 These graphical viewers can be customized by options of the
2111 X Window System Toolkit Intrinsics.
2112 .
2113 But the
2114 .B \%groffer
2115 options use a leading double minus instead of the single minus used by
2116 the X Window System Toolkit Intrinsics.
2117 .
2118 .
2119 .\" ====================================================================
2120 .SS "Text modes"
2121 .\" ====================================================================
2122 .
2123 There are two modes for text output,
2124 .I \%mode\~text
2125 for plain output without a pager and
2126 .I \%mode\~tty
2127 for a text output on a text terminal using some pager program.
2128 .
2129 .
2130 .P
2131 If the variable
2132 .I \%DISPLAY
2133 is not set or empty,
2134 .B \%groffer
2135 assumes that it should use
2136 .IR \%tty\~\%mode .
2137 .
2138 .
2139 .P
2140 In the actual implementation, the
2141 .I groff
2142 output device
2143 .I \%latin1
2144 is chosen for
2145 .IR \%text\~modes .
2146 .
2147 This can be changed by specifying option
2148 .B \-T
2149 or
2150 .BR \%\-\-device .
2151 .
2152 .
2153 .P
2154 The pager to be used can be specified by one of the options
2155 .B \-\-pager
2156 and
2157 .BR \-\-viewer ,
2158 or by the environment variable
2159 .IR PAGER .
2160 If all of this is not used the
2161 .BR \%less (1)
2162 program with the option
2163 .B \-r
2164 for correctly displaying control sequences is used as the default
2165 pager.
2166 .
2167 .
2168 .\" ====================================================================
2169 .SS "Special Modes for Debugging and Development"
2170 .\" ====================================================================
2171 .
2172 These modes use the
2173 .I \%groffer
2174 file determination and decompression.
2175 .
2176 This is combined into a single input file that is fed directly into
2177 .B \%groff
2178 with different strategy without the
2179 .I \%groffer
2180 viewing facilities.
2181 .
2182 These modes are regarded as advanced, they are useful for debugging
2183 and development purposes.
2184 .
2185 .
2186 .P
2187 The
2188 .I \%source\~mode
2189 with option
2190 .B \-\-source
2191 just displays the decompressed input.
2192 .
2193 .
2194 .P
2195 Option
2196 .B \-\-to\-stdout
2197 does not display in a graphical mode.
2198 .
2199 It just generates the file for the chosen mode and then prints its
2200 content to standard output.
2201 .
2202 .
2203 .P
2204 The
2205 .I \%groff\~mode
2206 passes the input to
2207 .B \%groff
2208 using only some suitable options provided to
2209 .BR \%groffer .
2210 .
2211 This enables the user to save the generated output into a file or pipe
2212 it into another program.
2213 .
2214 .
2215 .P
2216 In
2217 .IR \%groff\~\%mode ,
2218 the option
2219 .B \-Z
2220 disables post-processing, thus producing the
2221 .nh
2222 .I groff intermediate
2223 .IR output .
2224 .hy
2225 .
2226 In this mode, the input is formatted, but not postprocessed; see
2227 .BR \%groff_out (@MAN5EXT@)
2228 for details.
2229 .
2230 .
2231 .P
2232 All
2233 .B \%groff
2234 short options are supported by
2235 .BR \%groffer .
2236 .
2237 .
2238 .\" ====================================================================
2239 .SH "MAN PAGE SEARCHING"
2240 .\" ====================================================================
2241 .
2242 The default behavior of
2243 .B \%groffer
2244 is to first test whether a file parameter represents a local file; if
2245 it is not an existing file name, it is assumed to represent the name
2246 of a
2247 .IR \%man\~page .
2248 The following options can be used to determine whether the arguments
2249 should be handled as file name or
2250 .I \%man\~page
2251 arguments.
2252 .
2253 .TP
2254 .B \-\-man
2255 forces to interpret all file parameters as
2256 .I \%filespecs
2257 for searching
2258 .IR \%man\~pages .
2259 .
2260 .TP
2261 .B \-\-no\-man
2262 .TQ
2263 .B \-\-local\-file
2264 disable the
2265 .I man
2266 searching; so only local files are displayed.
2267 .
2268 .
2269 .P
2270 If neither a local file nor a
2271 .I \%man\~page
2272 was retrieved for some file parameter a warning is issued on standard
2273 error, but processing is continued.
2274 .
2275 .
2276 .\" ====================================================================
2277 .SS "Search Algorithm"
2278 .\" ====================================================================
2279 .
2280 Let us now assume that a
2281 .I \%man\~page
2282 should be searched.
2283 .
2284 The
2285 .B \%groffer
2286 program provides a search facility for
2287 .IR \%man\~pages .
2288 .
2289 All long options, all environment variables, and most of the
2290 functionality of the \f(CRGNU\fP
2291 .BR \%man (1)
2292 program were implemented.
2293 .
2294 The search algorithm shall determine which file is displayed for a given
2295 .IR \%man\~page .
2296 The process can be modified by options and environment variables.
2297 .
2298 .
2299 .P
2300 The only
2301 .I man
2302 action that is omitted in
2303 .B \%groffer
2304 are the preformatted
2305 .IR \%man\~pages ,
2306 also called
2307 .IR cat\~pages .
2308 .
2309 With the excellent performance of the actual computers, the
2310 preformatted
2311 .I \%man\~pages
2312 aren't necessary any longer.
2313 .
2314 Additionally,
2315 .B \%groffer
2316 is a
2317 .I roff
2318 program; it wants to read
2319 .I roff
2320 source files and format them itself.
2321 .
2322 .
2323 .P
2324 The algorithm for retrieving the file for a
2325 .I \%man\~page
2326 needs first a set of directories.
2327 .
2328 This set starts with the so-called
2329 .I man\~path
2330 that is modified later on by adding names of
2331 .I operating system
2332 and
2333 .IR language .
2334 .
2335 This arising set is used for adding the section directories which
2336 contain the
2337 .I \%man\~page
2338 files.
2339 .
2340 .
2341 .P
2342 The
2343 .I man\~path
2344 is a list of directories that are separated by colon.
2345 .
2346 It is generated by the following methods.
2347 .
2348 .IP \*(BU 2m
2349 The environment variable
2350 .I \%MANPATH
2351 can be set.
2352 .
2353 .IP \*(BU 2m
2354 It can be read from the arguments of the environment variable
2355 .IR MANOPT .
2356 .
2357 .IP \*(BU 2m
2358 The
2359 .I man\~path
2360 can be manually specified by using the option
2361 .BR \-\-manpath .
2362 An empty argument disables the
2363 .I \%man\~page
2364 searching.
2365 .
2366 .IP \*(BU 2m
2367 When no
2368 .I man\~path
2369 was set the
2370 .BR \%manpath (1)
2371 program is tried to determine one.
2372 .
2373 .IP \*(BU 2m
2374 If this does not work a reasonable default path from
2375 .I $PATH
2376 is determined.
2377 .
2378 .
2379 .P
2380 We now have a starting set of directories.
2381 .
2382 The first way to change this set is by adding names of
2383 .I operating
2384 .IR systems .
2385 .
2386 This assumes that
2387 .I \%man\~pages
2388 for several
2389 .I operating systems
2390 are installed.
2391 .
2392 This is not always true.
2393 .
2394 The names of such
2395 .I operating systems
2396 can be provided by 3 methods.
2397 .
2398 .IP \*(BU 2m
2399 The environment variable
2400 .I \%SYSTEM
2401 has the lowest precedence.
2402 .
2403 .IP \*(BU 2m
2404 This can be overridden by an option in
2405 .IR MANOPT .
2406 .
2407 .IP \*(BU 2m
2408 This again is overridden by the command-line option
2409 .BR \-\-systems .
2410 .
2411 .
2412 .P
2413 Several names of
2414 .I operating systems
2415 can be given by appending their names, separated by a comma.
2416 .
2417 .
2418 .P
2419 The
2420 .I man\~path
2421 is changed by appending each
2422 .I system
2423 name as subdirectory at the end of each directory of the set.
2424 .
2425 No directory of the
2426 .I man\~path
2427 set is kept.
2428 .
2429 But if no
2430 .I system
2431 name is specified the
2432 .I man\~path
2433 is left unchanged.
2434 .
2435 .
2436 .P
2437 After this, the actual set of directories can be changed by
2438 .I language
2439 information.
2440 .
2441 This assumes that there exist
2442 .I man\~pages
2443 in different languages.
2444 .
2445 The wanted
2446 .I language
2447 can be chosen by several methods.
2448 .
2449 .IP \*(BU 2m
2450 Environment variable
2451 .IR LANG .
2452 .
2453 .IP \*(BU 2m
2454 This is overridden by
2455 .IR \%LC_MESSAGES .
2456 .
2457 .IP \*(BU 2m
2458 This is overridden by
2459 .IR LC_ALL .
2460 .
2461 .IP \*(BU 2m
2462 This can be overridden by providing an option in
2463 .IR MANOPT .
2464 .
2465 .IP \*(BU 2m
2466 All these environment variables are overridden by the command-line
2467 option
2468 .BR \-\-locale .
2469 .
2470 .
2471 .P
2472 The
2473 .I default language
2474 can be specified by specifying one of the pseudo-language parameters
2475 \f(CRC\fP or \f(CR\%POSIX\fP.
2476 .
2477 This is like deleting a formerly given
2478 .I language
2479 information.
2480 .
2481 The
2482 .I \%man\~pages
2483 in the
2484 .I default language
2485 are usually in English.
2486 .
2487 .
2488 .P
2489 Of course, the
2490 .I language
2491 name is determined by
2492 .BR man .
2493 In \f(CRGNU\fP
2494 .BR man ,
2495 it is specified in the \%\f(CRPOSIX\~1003.1\fP based format:
2496 .P
2497 .nh
2498 \fI<language>\/\fP[\f(CB_\fP\,\fI<territory>\/\fP[\f(CB.\fP\
2499 \fI<character-set>\/\fP[\f(CB,\fP\,\fI<version>\/\fP]]],
2500 .hy
2501 .P
2502 but the two-letter code in
2503 .nh
2504 .I <language>
2505 .hy
2506 is sufficient for most purposes.
2507 .
2508 If for a complicated
2509 .I language
2510 formulation no
2511 .I \%man\~pages
2512 are found
2513 .B \%groffer
2514 searches the country part consisting of these first two characters as
2515 well.
2516 .
2517 .
2518 .P
2519 The actual directory set is copied thrice.
2520 .
2521 The
2522 .I language
2523 name is appended as subdirectory to each directory in the first copy
2524 of the actual directory set (this is only done when a language
2525 information is given).
2526 .
2527 Then the 2-letter abbreviation of the
2528 .I language
2529 name is appended as subdirectories to the second copy of the directory
2530 set (this is only done when the given language name has more than 2
2531 letters).
2532 .
2533 The third copy of the directory set is kept unchanged (if no
2534 .I language
2535 information is given this is the kept directory set).
2536 .
2537 These maximally 3 copies are appended to get the new directory set.
2538 .
2539 .
2540 .P
2541 We now have a complete set of directories to work with.
2542 .
2543 In each of these directories, the
2544 .I man
2545 files are separated in
2546 .IR sections .
2547 .
2548 The name of a
2549 .I section
2550 is represented by a single character, a digit between
2551 .I 1
2552 and
2553 .IR 9 ,
2554 or the character
2555 .I o
2556 or
2557 .IR n ,
2558 in this order.
2559 .
2560 .
2561 .P
2562 For each available
2563 .IR section ,
2564 a subdirectory
2565 .BI man <section>
2566 exists containing all
2567 .I man
2568 files for this
2569 .IR section ,
2570 where
2571 .I <section>
2572 is a single character as described before.
2573 .
2574 Each
2575 .I man
2576 file in a
2577 .I section
2578 directory has the form
2579 .IR \%\f(CBman\fP<section>\f(CB/\fP<name>\f(CB.\fP<section>\
2580 [<extension>][\f(CB.\fP<compression>] ,
2581 where
2582 .I \%<extension>
2583 and
2584 .I \%<compression>
2585 are optional.
2586 .
2587 .I \%<name>
2588 is the name of the
2589 .I \%man\~page
2590 that is also specified as filespec argument on the command line.
2591 .
2592 .
2593 .P
2594 The
2595 .I extension
2596 is an addition to the section.
2597 .
2598 This postfix acts like a subsection.
2599 .
2600 An
2601 .I extension
2602 occurs only in the file name, not in name of the
2603 .I section
2604 subdirectory.
2605 .
2606 It can be specified on the command line.
2607 .
2608 .
2609 .P
2610 On the other hand, the
2611 .I compression
2612 is just an information on how the file is compressed.
2613 .
2614 This is not important for the user, such that it cannot be specified
2615 on the command line.
2616 .
2617 .
2618 .P
2619 There are 4 methods to specify a
2620 .I section
2621 on the command line:
2622 .
2623 .IP \*(BU 2m
2624 Environment variable
2625 .I \%MANSECT
2626 .
2627 .IP \*(BU 2m
2628 Command line option
2629 .B \-\-sections
2630 .
2631 .IP \*(BU 2m
2632 Appendix to the
2633 .I name
2634 argument in the form
2635 .I <name>.<section>
2636 .
2637 .IP \*(BU 2m
2638 Preargument before the
2639 .I name
2640 argument in the form
2641 .I <section> <name>
2642 .
2643 .
2644 .P
2645 It is also possible to specify several
2646 .I sections
2647 by appending the single characters separated by colons.
2648 .
2649 One can imagine that this means to restrict the
2650 .I \%man\~page
2651 search to only some
2652 .IR sections .
2653 .
2654 The multiple
2655 .I sections
2656 are only possible for
2657 .I \%MANSECT
2658 and
2659 .BR \-\-sections .
2660 .
2661 .
2662 .P
2663 If no
2664 .I section
2665 is specified all
2666 .I sections
2667 are searched one after the other in the given order, starting with
2668 .IR section\~1 ,
2669 until a suitable file is found.
2670 .
2671 .
2672 .P
2673 There are 4 methods to specify an
2674 .I extension
2675 on the command line.
2676 .
2677 But it is not necessary to provide the whole extension name, some
2678 abbreviation is good enough in most cases.
2679 .
2680 .IP \*(BU 2m
2681 Environment variable
2682 .I \%EXTENSION
2683 .
2684 .IP \*(BU 2m
2685 Command line option
2686 .B \-\-extension
2687 .
2688 .IP \*(BU 2m
2689 Appendix to the
2690 .I <name>.<section>
2691 argument in the form
2692 .I <name>.<section><extension>
2693 .
2694 .IP \*(BU 2m
2695 Preargument before the
2696 .I name
2697 argument in the form
2698 .I <section><extension> <name>
2699 .
2700 .
2701 .P
2702 For further details on
2703 .I \%man\~page
2704 searching, see
2705 .BR \%man (1).
2706 .
2707 .
2708 .\" ====================================================================
2709 .SS "Examples of man files"
2710 .\" ====================================================================
2711 .
2712 .TP
2713 .B /usr/share/man/man1/groff.1
2714 This is an uncompressed file for the
2715 .I \%man\~page
2716 \f(CRgroff\fP in
2717 .IR section\~1 .
2718 .
2719 It can be called by
2720 .EX
2721 \fIsh#\fR groffer\~groff
2722 .EE
2723 No
2724 .I section
2725 is specified here, so all
2726 .I sections
2727 should be searched, but as
2728 .I section\~1
2729 is searched first this file will be found first.
2730 .
2731 The file name is composed of the following components.
2732 .B /usr/share/man/
2733 must be part of the
2734 .IR \%man\~path ;
2735 the subdirectory
2736 .B man1/
2737 and the part
2738 .B .1
2739 stand for the
2740 .IR section ;
2741 .B groff
2742 is the name of the
2743 .IR \%man\~page .
2744 .
2745 .
2746 .TP
2747 .B /usr/local/share/man/man7/groff.7.gz
2748 The file name is composed of the following components.
2749 .B /usr/local/share/man
2750 must be part of the
2751 .IR \%man\~path ;
2752 the subdirectory
2753 .B man7/
2754 and the part
2755 .B .7
2756 stand for the
2757 .IR section ;
2758 .B groff
2759 is the name of the
2760 .IR \%man\~page ;
2761 the final part
2762 .B .gz
2763 stands for a compression with
2764 .BR gzip (1).
2765 As the
2766 .I section
2767 is not the first one it must be specified as well.
2768 .
2769 This can be done by one of the following commands.
2770 .EX
2771 \fIsh#\fR\~groffer\~groff.7
2772 \fIsh#\fR\~groffer\~7\~groff
2773 \fIsh#\fR\~groffer\~\-\-sections=7\~groff
2774 .EE
2775 .
2776 .TP
2777 .B /usr/local/man/man1/ctags.1emacs21.bz2
2778 Here
2779 .B /usr/local/man
2780 must be in
2781 .IR \%man\~path ;
2782 the subdirectory
2783 .B man1/
2784 and the file name part
2785 .B .1
2786 stand for
2787 .IR section\~1 ;
2788 the name of the
2789 .I \%man\~page
2790 is
2791 .BR ctags ;
2792 the section has an extension
2793 .BR emacs21 ;
2794 and the file is compressed as
2795 .B .bz2
2796 with
2797 .BR bzip2 (1).
2798 The file can be viewed with one of the following commands
2799 .EX
2800 \fIsh#\fR\~groffer\~ctags.1e
2801 \fIsh#\fR\~groffer\~1e\~ctags
2802 \fIsh#\fR\~groffer\~\-\-extension=e\~\-\-sections=1\~ctags
2803 .EE
2804 where \f(CRe\fP works as an abbreviation for the extension
2805 \f(CRemacs21\fP.
2806 .
2807 .
2808 .TP
2809 .B /usr/man/linux/de/man7/man.7.Z
2810 The directory
2811 .B /usr/man
2812 is now part of the
2813 .IR \%man\~path ;
2814 then there is a subdirectory for an
2815 .I operating system
2816 name
2817 .BR linux/ ;
2818 next comes a subdirectory
2819 .B de/
2820 for the German
2821 .IR language ;
2822 the
2823 .I section
2824 names
2825 .B man7
2826 and
2827 .B .7
2828 are known so far;
2829 .B man
2830 is the name of the
2831 .IR \%man\~page ;
2832 and
2833 .B .Z
2834 signifies the compression that can be handled by
2835 .BR gzip (1).
2836 We want now show how to provide several values for some options.
2837 .
2838 That is possible for
2839 .I sections
2840 and
2841 .I operating system
2842 names.
2843 .
2844 So we use as
2845 .I sections\~5
2846 and
2847 .I 7
2848 and as
2849 .I system
2850 names
2851 .I linux
2852 and
2853 .IR aix .
2854 The command is then
2855 .sp
2856 .EX
2857 \fIsh#\fR groffer\~\-\-locale=de\~\-\-sections=5:7\~\-\-systems=linux,aix\~man
2858 \fIsh#\fR LANG=de\~MANSECT=5:7\~SYSTEM=linux,aix\~groffer\~man
2859 .EE
2860 .
2861 .
2862 .\" ====================================================================
2863 .SH DECOMPRESSION
2864 .\" ====================================================================
2865 .
2866 The program has a decompression facility.
2867 .
2868 If standard input or a file that was retrieved from the command line
2869 parameters is compressed with a format that is supported by either
2870 .BR \%gzip (1)
2871 or
2872 .BR \%bzip2 (1)
2873 it is decompressed on-the-fly.
2874 .
2875 This includes the \f(CRGNU\fP
2876 .BR \%.gz ,
2877 .BR \%.bz2 ,
2878 and the traditional
2879 .B \%.Z
2880 compression.
2881 .
2882 The program displays the concatenation of all decompressed input in
2883 the sequence that was specified on the command line.
2884 .
2885 .
2886 .\" ====================================================================
2887 .SH "ENVIRONMENT"
2888 .\" ====================================================================
2889 .
2890 The
2891 .B \%groffer
2892 program supports many system variables, most of them by courtesy of
2893 other programs.
2894 .
2895 All environment variables of
2896 .BR \%groff (@MAN1EXT@)
2897 and \f(CRGNU\fP
2898 .BR \%man (1)
2899 and some standard system variables are honored.
2900 .
2901 .
2902 .\" ====================================================================
2903 .SS "Native groffer Variables"
2904 .\" ====================================================================
2905 .
2906 .TP
2907 .I \%GROFFER_OPT
2908 Store options for a run of
2909 .BR \%groffer .
2910 .
2911 The options specified in this variable are overridden by the options
2912 given on the command line.
2913 .
2914 The content of this variable is run through the shell builtin
2915 \[lq]eval\[rq],
2916 so arguments containing whitespace or special shell characters should
2917 be quoted.
2918 .
2919 Do not forget to export this variable, otherwise it does not exist
2920 during the run of
2921 .BR groffer .
2922 .
2923 .
2924 .\" ====================================================================
2925 .SS "System Variables"
2926 .\" ====================================================================
2927 .
2928 The following variables have a special meaning for
2929 .BR \%groffer .
2930 .
2931 .
2932 .TP
2933 .I \%DISPLAY
2934 If set, this variable indicates that the X Window System is running.
2935 .
2936 Testing this variable decides on whether graphical or text output is
2937 generated.
2938 .
2939 This variable should not be changed by the user carelessly, but it can
2940 be used to start the graphical
2941 .B \%groffer
2942 on a remote X Window System terminal.
2943 .
2944 For example, depending on your system,
2945 .B \%groffer
2946 can be started on the second monitor by the command
2947 .sp
2948 .EX
2949 \fIsh#\fR DISPLAY=:0.1\~groffer\~what.ever &
2950 .EE
2951 .
2952 .
2953 .TP
2954 .I \%LC_ALL
2955 .TQ
2956 .I \%LC_MESSAGES
2957 .TQ
2958 .I LANG
2959 If one of these variables is set (in the above sequence), its content
2960 is interpreted as the locale, the language to be used, especially when
2961 retrieving
2962 .IR \%man\~pages .
2963 .
2964 A locale name is typically of the form
2965 .nh
2966 .IR language [\c
2967 .B _\c
2968 .IR territory [\c
2969 .B .\c
2970 .IR codeset [\c
2971 .B @\c
2972 .IR modifier ]]],
2973 .hy
2974 where
2975 .I \%language
2976 is an ISO 639 language code,
2977 .I \%territory
2978 is an ISO 3166 country code, and
2979 .I \%codeset
2980 is a character set or encoding identifier like ISO-8859-1 or UTF-8;
2981 see
2982 .BR \%setlocale (3).
2983 .
2984 The locale values \f(CRC\fP and \%\f(CRPOSIX\fP
2985 stand for the default, i.e.\& the
2986 .I \%man\~page
2987 directories without a language prefix.
2988 .
2989 This is the same behavior as when all 3\~variables are unset.
2990 .
2991 .
2992 .TP
2993 .I \%PAGER
2994 This variable can be used to set the pager for the tty output.
2995 .
2996 For example, to disable the use of a pager completely set this
2997 variable to the
2998 .BR \%cat (1)
2999 program
3000 .sp
3001 .EX
3002 \fIsh#\fR PAGER=cat\~groffer\~anything
3003 .EE
3004 .sp
3005 .
3006 .TP
3007 .I PATH
3008 All programs within the
3009 .B \%groffer
3010 script are called without a fixed path.
3011 .
3012 Thus this environment variable determines the set of programs used
3013 within the run of
3014 .BR \%groffer .
3015 .
3016 .
3017 .\" ====================================================================
3018 .SS "Groff Variables"
3019 .\" ====================================================================
3020 .
3021 The
3022 .B \%groffer
3023 program internally calls
3024 .BR \%groff ,
3025 so all environment variables documented in
3026 .BR \%groff (@MAN1EXT@)
3027 are internally used within
3028 .B \%groffer
3029 as well.
3030 .
3031 The following variable has a direct meaning for the
3032 .B \%groffer
3033 program.
3034 .
3035 .TP
3036 .I \%GROFF_TMPDIR
3037 If the value of this variable is an existing, writable directory,
3038 .B \%groffer
3039 uses it for storing its temporary files, just as
3040 .B groff
3041 does.
3042 .
3043 See the
3044 .BR \%groff (@MAN1EXT@)
3045 man page for more details on the location of temporary files.
3046 .
3047 .
3048 .\" ====================================================================
3049 .SS "Man Variables"
3050 .\" ====================================================================
3051 .
3052 Parts of the functionality of the
3053 .B man
3054 program were implemented in
3055 .BR \%groffer ;
3056 support for all environment variables documented in
3057 .BR \%man (1)
3058 was added to
3059 .BR \%groffer ,
3060 but the meaning was slightly modified due to the different approach in
3061 .BR \%groffer ;
3062 but the user interface is the same.
3063 .
3064 The
3065 .B man
3066 environment variables can be overwritten by options provided with
3067 .IR MANOPT ,
3068 which in turn is overwritten by the command line.
3069 .
3070 .
3071 .TP
3072 .I \%EXTENSION
3073 Restrict the search for
3074 .I \%man\~pages
3075 to files having this extension.
3076 .
3077 This is overridden by option
3078 .BR \-\-extension ;
3079 see there for details.
3080 .
3081 .
3082 .TP
3083 .I MANOPT
3084 This variable contains options as a preset for
3085 .BR \%man (1).
3086 As not all of these are relevant for
3087 .B \%groffer
3088 only the essential parts of its value are extracted.
3089 .
3090 The options specified in this variable overwrite the values of the
3091 other environment variables that are specific to
3092 .IR man .
3093 .
3094 All options specified in this variable are overridden by the options
3095 given on the command line.
3096 .
3097 .
3098 .TP
3099 .I \%MANPATH
3100 If set, this variable contains the directories in which the
3101 .I \%man\~page
3102 trees are stored.
3103 .
3104 This is overridden by option
3105 .BR \%\-\-manpath .
3106 .
3107 .
3108 .TP
3109 .I \%MANSECT
3110 If this is a colon separated list of section names, the search for
3111 .I \%man\~pages
3112 is restricted to those manual sections in that order.
3113 .
3114 This is overridden by option
3115 .BR \-\-sections .
3116 .
3117 .
3118 .TP
3119 .I \%SYSTEM
3120 If this is set to a comma separated list of names these are interpreted
3121 as
3122 .I \%man\~page
3123 trees for different operating systems.
3124 .
3125 This variable can be overwritten by option
3126 .BR \-\-systems ;
3127 see there for details.
3128 .
3129 .
3130 .P
3131 The environment variable
3132 .I \%MANROFFSEQ
3133 is ignored by
3134 .B \%groffer
3135 because the necessary preprocessors are determined automatically.
3136 .
3137 .
3138 .\" ====================================================================
3139 .SH "CONFIGURATION FILES"
3140 .\" ====================================================================
3141 .
3142 The
3143 .B \%groffer
3144 program can be preconfigured by two configuration files.
3145 .
3146 .
3147 .TP
3148 .B \%/etc/groff/groffer.conf
3149 System-wide configuration file for
3150 .BR \%groffer .
3151 .
3152 .
3153 .TP
3154 .B \%$HOME/.groff/groffer.conf
3155 User-specific configuration file for
3156 .BR \%groffer ,
3157 where
3158 .I \%$HOME
3159 denotes the user's home directory.
3160 .
3161 This file is called after the system-wide configuration file to enable
3162 overriding by the user.
3163 .
3164 .
3165 .P
3166 Both files are handled for the configuration, but the configuration
3167 file in
3168 .B /etc
3169 comes first; it is overwritten by the configuration file in the home
3170 directory; both configuration files are overwritten by the environment
3171 variable
3172 .IR \%GROFFER_OPT ;
3173 everything is overwritten by the command line arguments.
3174 .
3175 .
3176 .P
3177 The configuration files contain options that should be called as
3178 default for every
3179 .B \%groffer
3180 run.
3181 .
3182 These options are written in lines such that each contains either a
3183 long option, a short option, or a short option cluster; each with or
3184 without an argument.
3185 .
3186 So each line with configuration information starts with a minus
3187 character
3188 .RB \[lq] \- \[rq];
3189 a line with a long option starts with two minus characters
3190 .RB \[lq] \-\- \[rq],
3191 a line with a short option or short option cluster starts with a
3192 single minus
3193 .RB \[lq] \- \[rq].
3194 .
3195 .
3196 .P
3197 The option names in the configuration files may not be abbreviated,
3198 they must be exact.
3199 .
3200 .
3201 .P
3202 The argument for a long option can be separated from the option name
3203 either by an equal sign
3204 .RB \[lq] = \[rq]
3205 or by whitespace, i.e.\& one or several space or tab characters.
3206 .
3207 An argument for a short option or short option cluster can be directly
3208 appended to the option name or separated by whitespace.
3209 .
3210 The end of an argument is the end of the line.
3211 .
3212 It is not allowed to use a shell environment variable in an option
3213 name or argument.
3214 .
3215 .
3216 .P
3217 It is not necessary to use quotes in an option or argument, except for
3218 empty arguments.
3219 .
3220 An empty argument can be provided by appending a pair of quotes to the
3221 separating equal sign or whitespace; with a short option, the
3222 separator can be omitted as well.
3223 .
3224 For a long option with a separating equal sign
3225 .RB \[lq] = \[rq],
3226 the pair of quotes can be omitted, thus ending the line with the
3227 separating equal sign.
3228 .
3229 All other quote characters are cancelled internally.
3230 .
3231 .
3232 .P
3233 In the configuration files, arbitrary whitespace is allowed at the
3234 beginning of each line, it is just ignored.
3235 .
3236 Each whitespace within a line is replaced by a single space character
3237 \[lq] \[rq] internally.
3238 .
3239 .
3240 .P
3241 All lines of the configuration lines that do not start
3242 with a minus character are ignored, such that comments starting with
3243 .RB \[lq] # \[rq]
3244 are possible.
3245 .
3246 So there are no shell commands in the configuration files.
3247 .
3248 .
3249 .P
3250 As an example, consider the following configuration file that can be
3251 used either in
3252 .B \%/etc/groff/groffer.conf
3253 or
3254 .B \%\s+2~\s0/.groff/groffer.conf .
3255 .
3256 .
3257 .P
3258 .ft CR
3259 .nh
3260 .nf
3261 # groffer configuration file
3262 #
3263 # groffer options that are used in each call of groffer
3264 \-\-foreground=DarkBlue
3265 \-\-resolution=100
3266 \-\-viewer=gxditview \-geometry 900x1200
3267 .fi
3268 .hy
3269 .ft
3270 .
3271 .
3272 .P
3273 The lines starting with
3274 .B #
3275 are just ignored, so they act as command lines.
3276 .
3277 This configuration sets four
3278 .B \%groffer
3279 options (the lines starting with
3280 .RB \[lq] \- \[rq]).
3281 This has the following effects:
3282 .
3283 .
3284 .IP \*(BU 2m
3285 Use a text color of
3286 .B \%DarkBlue
3287 in all viewers that support this, such as
3288 .BR \%gxditview .
3289 .
3290 .
3291 .IP \*(BU 2m
3292 Use a resolution of
3293 .B 100dpi
3294 in all viewers that support this, such as
3295 .BR \%gxditview .
3296 .
3297 By this, the default device in
3298 .I x mode
3299 is set to
3300 .BR X100 .
3301 .
3302 .
3303 .IP \*(BU 2m
3304 Force
3305 .BR \%gxditview (@MAN1EXT@)
3306 as the
3307 .I \%x-mode
3308 viewer using the geometry option for setting the width to
3309 .B 900px
3310 and the height to
3311 .BR 1200px .
3312 This geometry is suitable for a resolution of
3313 .BR 100dpi .
3314 .
3315 .
3316 .IP \*(BU 2m
3317 Use
3318 .BR \%xpdf (1)
3319 as the
3320 .I \%pdf-mode
3321 viewer with the argument
3322 .B \-Z
3323 .BR 150 .
3324 .
3325 .
3326 .\" ====================================================================
3327 .SH "EXAMPLES"
3328 .\" ====================================================================
3329 .
3330 The usage of
3331 .B \%groffer
3332 is very easy.
3333 .
3334 Usually, it is just called with a file name or
3335 .IR \%man\~page .
3336 .
3337 The following examples, however, show that
3338 .B \%groffer
3339 has much more fancy capabilities.
3340 .
3341 .sp
3342 .EX
3343 \fIsh#\fR\~groffer\~/usr/local/share/doc/groff/meintro.ms.gz
3344 .EE
3345 .sp
3346 Decompress, format and display the compressed file
3347 .B meintro.ms.gz
3348 in the directory
3349 .BR /usr/local/share/doc/groff ,
3350 using the standard viewer
3351 .B \%gxditview
3352 as graphical viewer when in the X Window System, or the
3353 .BR \%less (1)
3354 pager program otherwise.
3355 .
3356 .sp
3357 .EX
3358 \fIsh#\fR\~groffer\~groff
3359 .EE
3360 .sp
3361 If the file
3362 .B \%./groff
3363 exists use it as input.
3364 .
3365 Otherwise interpret the argument as a search for the
3366 .I \%man\~page
3367 named
3368 .B \%groff
3369 in the smallest possible
3370 .IR \%man\~section ,
3371 being section 1 in this case.
3372 .
3373 .sp
3374 .EX
3375 \fIsh#\fR\~groffer\~man:groff
3376 .EE
3377 .sp
3378 search for the
3379 .I \%man\~page
3380 of
3381 .B \%groff
3382 even when the file
3383 .B ./groff
3384 exists.
3385 .
3386 .sp
3387 .EX
3388 \fIsh#\fR\~groffer\~groff.7
3389 \fIsh#\fR\~groffer\~7\~groff
3390 .EE
3391 .sp
3392 search the
3393 .I \%man\~page
3394 of
3395 .B \%groff
3396 in
3397 .I \%man\~section
3398 .BR 7 .
3399 This section search works only for a digit or a single character from
3400 a small set.
3401 .
3402 .sp
3403 .EX
3404 \fIsh#\fR\~groffer\~fb.modes
3405 .EE
3406 .sp
3407 If the file
3408 .B ./fb.modes
3409 does not exist interpret this as a search for the
3410 .I \%man\~page
3411 of
3412 .BR fb.modes .
3413 As the extension
3414 .I \%modes
3415 is not a single character in classical section style the argument is
3416 not split to a search for
3417 .BR fb .
3418 .
3419 .sp
3420 .EX
3421 \fIsh#\fR\~groffer\~groff\~\(cqtroff(1)\(cq\~man:roff
3422 .EE
3423 .sp
3424 The arguments that are not existing files are looked-up as the
3425 following
3426 .IR \%man\~pages :
3427 .B \%groff
3428 (automatic search, should be found in \fIman\fP\~section\~1),
3429 .B \%troff
3430 (in section\~1),
3431 and
3432 .B \%roff
3433 (in the section with the lowest number, being\~7 in this case).
3434 .
3435 The quotes around
3436 .nh
3437 .I \(cqtroff(1)\(cq
3438 .hy
3439 are necessary because the parentheses are special shell characters;
3440 escaping them with a backslash character
3441 .I \(rs(
3442 and
3443 .I \(rs)
3444 would be possible, too.
3445 .
3446 The formatted files are concatenated and displayed in one piece.
3447 .
3448 .sp
3449 .EX
3450 \fIsh#\fR\~LANG=de\~groffer\~\-\-man\~\-\-viewer=galeon\~ls
3451 .EE
3452 .sp
3453 Retrieve the German
3454 .I \%man\~page
3455 (language
3456 .IR de )
3457 for the
3458 .B ls
3459 program, decompress it, format it to
3460 .I \%html
3461 or
3462 .I \%xhtml
3463 format
3464 .nh
3465 .RI ( \%www\~mode )
3466 .hy
3467 and view the result in the web browser
3468 .BR \%galeon .
3469 The option
3470 .B \-\-man
3471 guarantees that the
3472 .I \%man\~page
3473 is retrieved, even when a local file
3474 .B \%ls
3475 exists in the actual directory.
3476 .
3477 .
3478 .sp
3479 .EX
3480 \fIsh#\fR\~groffer\~\-\-source\~'man:roff(7)'
3481 .EE
3482 .sp
3483 Get the
3484 .I \%man\~page
3485 called
3486 .I \%roff
3487 in \fIman\fP\~section 7, decompress it, and print its unformatted
3488 content, its source code.
3489 .
3490 .
3491 .sp
3492 .EX
3493 \fIsh#\fR\~groffer\~\-\-de-p\~\-\-in\~\-\-ap
3494 .EE
3495 .sp
3496 This is a set of abbreviated arguments, it is determined as
3497 .br
3498 .sp
3499 .EX
3500 \fIsh#\fR\~groffer\~\-\-debug-params\~\-\-intermediate-output\~\-\-apropos
3501 .EE
3502 .sp
3503 .
3504 .sp
3505 .EX
3506 \fIsh#\fR\~cat\~file.gz\~|\~groffer\~-Z\~-mfoo
3507 .EE
3508 .sp
3509 .
3510 The file
3511 .B file.gz
3512 is sent to standard input, this is decompressed, and then this is
3513 transported to the
3514 .I \%groff intermediate output mode
3515 without post-processing
3516 .RB ( groff
3517 option
3518 .BR \-Z ),
3519 using macro package
3520 .I \%foo
3521 .RB ( groff
3522 option
3523 .BR \-m ).
3524 .
3525 .
3526 .sp
3527 .EX
3528 \fIsh#\fR\~echo\~'\(rsf(CBWOW!'\~|
3529 > groffer \-\-x \-\-bg red \-\-fg yellow \-\-geometry 200x100 \-
3530 .EE
3531 .sp
3532 .
3533 Display the word \f(CBWOW!\fP in a small window in constant-width
3534 bold font, using color yellow on red background.
3535 .
3536 .
3537 .\" ====================================================================
3538 .SH "COMPATIBILITY"
3539 .\" ====================================================================
3540 .
3541 The
3542 .B \%groffer
3543 program is written in Perl, the Perl version during writing was v5.8.8.
3544 .
3545 .
3546 .P
3547 .B \%groffer
3548 provides its own parser for command-line arguments that is compatible
3549 to both \%\f(CRPOSIX\fP
3550 .BR \%getopts (1)
3551 and \%\f(CRGNU\fP
3552 .BR \%getopt (1).
3553 It can handle option arguments and file names containing white space
3554 and a large set of special characters.
3555 .
3556 The following standard types of options are supported.
3557 .
3558 .
3559 .IP \*(BU 2m
3560 The option consisting of a single minus
3561 .B \-
3562 refers to standard input.
3563 .
3564 .
3565 .IP \*(BU 2m
3566 A single minus followed by characters refers to a single character
3567 option or a combination thereof; for example, the
3568 .B \%groffer
3569 short option combination
3570 .B \-Qmfoo
3571 is equivalent to
3572 .BR \-Q\~\-m\~foo .
3573 .
3574 .
3575 .IP \*(BU 2m
3576 Long options are options with names longer than one character; they
3577 are always preceded by a double minus.
3578 .
3579 An option argument can either go to the next command-line argument or
3580 be appended with an equal sign to the argument; for example,
3581 .B \-\-long=arg
3582 is equivalent to
3583 .BR \-\-long\~arg .
3584 .
3585 .
3586 .IP \*(BU 2m
3587 An argument of
3588 .B \-\-
3589 ends option parsing; all further command-line arguments are
3590 interpreted as
3591 .I \%filespec
3592 parameters, i.e.\& file names or constructs for searching
3593 .IR \%man\~pages ).
3594 .
3595 .
3596 .IP \*(BU 2m
3597 All command-line arguments that are neither options nor option
3598 arguments are interpreted as
3599 .I \%filespec
3600 parameters and stored until option parsing has finished.
3601 .
3602 For example, the command line
3603 .sp
3604 .EX
3605 \fIsh#\fR\~groffer file1 \-a \-o arg file2
3606 .EE
3607 .sp
3608 is equivalent to
3609 .sp
3610 .EX
3611 \fIsh#\fR\~groffer \-a \-o arg \-\- file1 file2
3612 .EE
3613 .sp
3614 .
3615 .P
3616 The free mixing of options and
3617 .I \%filespec
3618 parameters follows the GNU principle.
3619 .
3620 That does not fulfill the strange option behavior of \%\f(CRPOSIX\fP
3621 that ends option processing as soon as the first non-option argument
3622 has been reached.
3623 .
3624 The end of option processing can be forced by the option
3625 .RB \[lq] \-\- \[rq]
3626 anyway.
3627 .
3628 .
3629 .\" ====================================================================
3630 .SH AUTHORS
3631 .\" ====================================================================
3632 .B groffer
3633 was written by
3634 .MT groff\-bernd.warken\-72@\:web.de
3635 Bernd Warken
3636 .ME .
3637 .
3638 .
3639 .\" ====================================================================
3640 .SH "SEE ALSO"
3641 .\" ====================================================================
3642 .
3643 .P
3644 .BR \%groff (@MAN1EXT@),
3645 .BR \%@g@troff (@MAN1EXT@)
3646 .RS
3647 Details on the options and environment variables available in
3648 .BR \%groff ;
3649 all of them can be used with
3650 .BR \%groffer .
3651 .RE
3652 .
3653 .
3654 .TP
3655 .BR \%grog (@MAN1EXT@)
3656 This program tries to guess the necessary
3657 .B \%groff
3658 command-line options from the input and the
3659 .B groffer
3660 options.
3661 .
3662 .
3663 .TP
3664 .BR \%groff (@MAN7EXT@)
3665 Documentation of the
3666 .I \%groff
3667 language.
3668 .
3669 .
3670 .TP
3671 .BR groff_char (@MAN7EXT@)
3672 Documentation on the
3673 .I \%groff
3674 characters, special characters, and glyphs..
3675 .
3676 .
3677 .TP
3678 .BR groff_tmac (@MAN5EXT@)
3679 Documentation on the
3680 .I \%groff
3681 macro files.
3682 .
3683 .
3684 .TP
3685 .BR groff_out (@MAN5EXT@)
3686 Documentation on the
3687 .I \%groff intermediate output
3688 before the run of a
3689 .IR postprocessor .
3690 .nh
3691 .RI ( ditroff
3692 output).
3693 .hy
3694 .
3695 This can be run by the
3696 .B groff
3697 or
3698 .B groffer
3699 option
3700 .BR -Z .
3701 .
3702 .
3703 .TP
3704 .BR \%man (1)
3705 The standard program to display
3706 .IR \%man\~pages .
3707 .
3708 The information there is only useful if it is the
3709 .I \%man\~page
3710 for GNU
3711 .BR man .
3712 Then it documents the options and environment variables that are
3713 supported by
3714 .BR \%groffer .
3715 .
3716 .
3717 .TP
3718 .BR \%gxditview (@MAN1EXT@)
3719 .TQ
3720 .BR \%xditview (1x)
3721 .RS
3722 Viewers for
3723 .BR \%groffer 's
3724 .IR \%x\~mode .
3725 .RE
3726 .
3727 .
3728 .TP
3729 .BR \%kpdf (1)
3730 .TQ
3731 .BR \%kghostview (1)
3732 .TQ
3733 .BR \%evince (1)
3734 .TQ
3735 .BR \%ggv (1)
3736 .TQ
3737 .BR \%gv (1)
3738 .TQ
3739 .BR \%ghostview (1)
3740 .TQ
3741 .BR \%gs (1)
3742 Viewers for
3743 .BR \%groffer 's
3744 .IR \%ps\~mode .
3745 .
3746 .
3747 .TP
3748 .BR \%kpdf (1)
3749 .TQ
3750 .BR \%acroread (1)
3751 .TQ
3752 .BR \%evince (1)
3753 .TQ
3754 .BR \%xpdf (1)
3755 .TQ
3756 .BR \%gpdf (1)
3757 .TQ
3758 .BR \%kghostview (1)
3759 .TQ
3760 .BR \%ggv (1)
3761 Viewers for
3762 .BR \%groffer 's
3763 .IR \%pdf\~mode .
3764 .
3765 .
3766 .P
3767 .BR \%kdvi (1),
3768 .BR \%xdvi (1),
3769 .BR \%dvilx (1)
3770 .RS
3771 Viewers for
3772 .BR \%groffer 's
3773 .IR \%dvi\~mode .
3774 .RE
3775 .
3776 .
3777 .TP
3778 .BR \%konqueror (1)
3779 .TQ
3780 .BR \%epiphany (1)
3781 .TQ
3782 .BR \%firefox (1)
3783 .TQ
3784 .BR \%mozilla (1)
3785 .TQ
3786 .BR \%netscape (1)
3787 .TQ
3788 .BR \%lynx (1)
3789 Web-browsers for
3790 .BR \%groffer 's
3791 .IR \%html ,
3792 .IR \%xhtml ,
3793 or
3794 .IR \%www\~mode .
3795 .
3796 .
3797 .TP
3798 .BR \%less (1)
3799 .TQ
3800 .BR more (1)
3801 Standard pager program for the
3802 .IR \%tty\~mode .
3803 .
3804 .
3805 .TP
3806 .BR \%gzip (1)
3807 .TQ
3808 .BR \%bzip2 (1)
3809 .TQ
3810 .BR \%xz (1)
3811 The decompression programs supported by
3812 .BR \%groffer .
3813 .
3814 .
3815 .\" ====================================================================
3816 .\" Emacs settings
3817 .\" ====================================================================
3818 .
3819 .\" Local Variables:
3820 .\" mode: nroff
3821 .\" End:
3822 .\" vim: set filetype=groff: