* Makefile.comm (install_dev, uninstall_dev): Protect `for' loops
[s-roff.git] / contrib / groffer / groffer.man
blob6d76db41ba8cad92a4e5e914dfab3bdd89604a44
1 .TH GROFFER @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
2 .SH NAME
3 groffer \- display groff files and man\~pages on X and tty
5 .SH "SYNOPSIS"
6 .\" The .SH was moved to this place in order to appease `apropos'.
8 .\" --------------------------------------------------------------------
9 .\" Legalize
10 .\" --------------------------------------------------------------------
12 .ig
13 groffer.1 - man page for groffer (section 1).
15 Source file position:  <groff_source_top>/contrib/groffer/groffer.man
16 Installed position:    $prefix/share/man/man1/groffer.1
18 Version     : groffer 0.9.2
19 Last update : 17 Jul 2003
21 This file is part of groff, the GNU roff type-setting system.
23 Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
24 Written by Bernd Warken <bwarken@mayn.de>
26 Permission is granted to copy, distribute and/or modify this document
27 under the terms of the GNU Free Documentation License, Version 1.1 or
28 any later version published by the Free Software Foundation; with the
29 Invariant Sections being this .ig-section and AUTHORS, with no
30 Front-Cover Texts, and with no Back-Cover Texts.
32 A copy of the Free Documentation License is included as a file called
33 FDL in the main directory of the groff source package.
36 .\" --------------------------------------------------------------------
37 .\" Setup
38 .\" --------------------------------------------------------------------
40 .do nr groffer_C \n[.C]
41 .cp 0
43 .mso www.tmac
45 .if n \{\
46 .  mso tty-char.tmac
47 .  ftr CR R
48 .  ftr CI I
49 .  ftr CB B
50 .\}
52 .if '\*[.T]'dvi' \{\
53 .  ftr CB CW
54 .\}
56 .ds @- "\-\""
57 .ds @-- "\-\^\-\""
59 .ds @b- "\f[CB]-\f[]\""
60 .ds @b-- "\f[CB]--\f[]\""
62 .ds @i- "\f[CI]-\f[]\""
63 .ds @i-- "\f[CI]--\f[]\""
65 .ds Ellipsis ".\|.\|.\""
67 .\" --------------------------------------------------------------------
68 .\" setup for the macro definitions below
69 .\"
70 .\" naming:  namespace:cathegory_macro.variable_name  (experimental)
72 .\" --------------------------------------------------------------------
73 .\" configuration of prompt for `.Shell_cmd'* macros
74 .ds groffer:Shell_cmd.prompt_text sh#\"    prompt for shell commands
75 .ds groffer:Shell_cmd+.prompt_text >\"     prompt on continuation lines
76 .ds groffer:Shell_cmd_base.prompt_font I\" font for prompts
78 .\" automatically determine setup from the configuration above
79 .als @f groffer:Shell_cmd_base.prompt_font\"
80 .als @t groffer:Shell_cmd.prompt_text\"
81 .als @t+ groffer:Shell_cmd+.prompt_text\"
82 .ds groffer:Shell_cmd.prompt \f[\*[@f]]\*[@t]\f[]\"            needed
83 .ds groffer:Shell_cmd+.prompt \f[\*[@f]]\*[@t+]\f[]\"          needed
84 .nr @w \w'\*[groffer:Shell_cmd.prompt]'\"
85 .nr @w+ \w'\*[groffer:Shell_cmd+.prompt]'\"
86 .ft \*[@f]
87 .\" Full prompt width is maximum of texts plus 1m
88 .nr groffer:Shell_cmd_base.prompt_width (\n[@w]>?\n[@w+]+1m)\" needed
89 .ft
90 .rm @f
91 .rm @f+
92 .rm @t
93 .rm @t+
94 .rr @w
95 .rr @w+
97 .\" --------------------------------------------------------------------
98 .\" static register for inter-macro communication in `.Synopsis'*
99 .nr groffer:Synopsis.level 0
101 .\" --------------------------------------------------------------------
102 .\" static registers for inter-macro communication in `.TP'*
103 .nr groffer:TP.level 0
104 .rr groffer:TP_header.flag
105 .rr groffer:TP_body.flag
106 .rr groffer:TP.indent
109 .\" --------------------------------------------------------------------
110 .\" Macro definitions
112 .\" Ignore all arguments like a comment, even after a .eo call.
113 .de c
115 .c --------------------------------------------------------------------
116 .c .CB  (<text>...)
118 .c Print in constant-width bold font.
120 .de CB
121 .  ft CB
122 .  Text \\$*
123 .  ft
125 .c --------------------------------------------------------------------
126 .c .CI  (<text>...)
128 .c Print in constant-width italic font.
130 .de CI
131 .  ft CI
132 .  Text \\$*
133 .  ft
135 .c --------------------------------------------------------------------
136 .c .CR  (<text>...)
138 .c Print in constant-width roman font.
140 .de CR
141 .  ft CR
142 .  Text \\$*
143 .  ft
145 .c --------------------------------------------------------------------
146 .c .Error  (<text>...)
148 .c Print error message to terminal and abort.
150 .de Error
151 .  tm \\$*
152 .  ab
154 .c --------------------------------------------------------------------
155 .c .Env_var  (<env_var_name> [<punct>])
157 .c Display an environment variable, with optional punctuation.
159 .de Env_var
160 .  nh
161 .  SM
162 .  Text \f[CB]\\$1\f[]\\$2
163 .  hy
165 .c --------------------------------------------------------------------
166 .c .File_name  (<path_name>)
168 .c Display a file or directory name in CB font.
170 .de File_name
171 .  Header_CB \\$@
173 .c --------------------------------------------------------------------
174 .c .Header_CB  (<path_name>)
176 .c Display a line in CB font, for example after .TP
178 .de Header_CB
179 .  nh
180 .  Text \f[CB]\\$1\f[]\\$2
181 .  hy
183 .c --------------------------------------------------------------------
184 .c .Opt_-  ([<punct>])
186 .c Print `-' (minus sign); optional punctuation. 
188 .de Opt_-
189 .  ie (\\n[.$] == 0) \
190 .    Opt_alt - ""
191 .  el \
192 .    Opt_alt - "" "\\$1"
194 .c --------------------------------------------------------------------
195 .c .Opt_[-]  ([<punct>])
197 .c Print `Opt_[-]' (minus sign in brackets); optional punctuation. 
199 .de Opt_[-]
200 .  ie (\\n[.$] == 0) \
201 .    Opt_[alt] - ""
202 .  el \
203 .    Opt_[alt] - "" "\\$1"
205 .c --------------------------------------------------------------------
206 .c .Opt_--  ([<punct>])
208 .c Print `--' (double minus); optional punctuation. 
210 .de Opt_--
211 .  ie (\\n[.$] == 0) \
212 .    Opt_alt -- ""
213 .  el \
214 .    Opt_alt -- "" "\\$1"
216 .c --------------------------------------------------------------------
217 .c .Opt_[--]  ([<punct>])
219 .c Print `Opt_[--]' (double minus in brackets); optional punctuation. 
221 .de Opt_[--]
222 .  ie (\\n[.$] == 0) \
223 .    Opt_[alt] -- ""
224 .  el \
225 .    Opt_[alt] -- "" "\\$1"
227 .c --------------------------------------------------------------------
228 .c .Opt_alt  ([<minus> <opt>]... [<arg> [<punct>]])
230 .c Alternate options separated by a vertical bar.
232 .c Arguments:
233 .c   minus: either `-' or `--' (font CB).
234 .c   opt: a name for an option, empty allowed (font CB).
235 .c   arg: optionally, the argument to the option (font I).
236 .c   punct: optional punctuation (in the starting font).
237 .c Result:
238 .c   The minus/opt argument pairs, each
239 .c   separated by a vertical bar `|', optionally add 'arg', separated
240 .c   a space character ` '.
242 .c Example:
243 .c  .Opt_alt - T -- device -- device-troff device .
244 .c  results in
245 .c  -T|--device|--device-troff device.
247 .de Opt_alt
248 .  Opt_alt_base "" | "" \\$@
250 .c --------------------------------------------------------------------
251 .c .Opt_[alt]  ([<minus> <opt>]... [<arg> [<punct>]])
253 .c Alternate options in brackets for section SYNOPSIS.
255 .c Arguments:
256 .c   minus: either `-' or `--' (font CB).
257 .c   opt: a name for an option, empty allowed (font CB).
258 .c   arg: optionally, the argument to the option (font I).
259 .c   punct: optional punctuation (in the starting font).
260 .c Global strings written to:
261 .c   `@oa_prefix': left enclosing character (`[')
262 .c   `@oa_sep': separator (`|')
263 .c   `@oa_postfix': right enclosing character (`]')
264 .c Result:
265 .c   The minus/opt argument pairs, each separated by a vertical
266 .c   bar `|', optionally add 'arg', separated by a space character ` '.
268 .c Example:
269 .c  .Opt_[alt] - T -- device -- device-troff device .
270 .c  results in
271 .c  [-T|--device|--device-troff device].
273 .de Opt_[alt]
274 .  Opt_alt_base [ | ] \\$@
276 .c --------------------------------------------------------------------
277 .c .Opt_alt_base  (<pre> <sep> <post> [<minus> <opt>]... [arg [punct]])
279 .c Alternating options; base macro for many others; do not use directly.
281 .c Arguments:
282 .c   <pre>: prefix, resulted is preceded by this.
283 .c   <sep>: separator between minux/opt pairs.
284 .c   <post>: postfix, is appended to the result.
285 .c   <minus>: either `-' or `--' (font CB).
286 .c   <opt>: a name for an option, empty allowed (font CB).
287 .c   <arg>: optionally, the argument to the option (font I).
288 .c   <punct>: optional punctuation (in the starting font).
289 .c Result:
290 .c   String `<pre>' followed by the <minus>/<opt> argument pairs, each
291 .c   separated by string `<sep>', optionally add '<arg>', separated by
292 .c   a single space ` ', followed by the string `<post>'.
294 .de Opt_alt_base
295 .  nr @font \\n[.f]\"
296 .  if (\\n[.$] < 3) \
297 .    Error .\\0: not enough arguments.
298 .  ds @pre \)\\$1\)\"                   prefix
299 .  ds @sep \)\\$2\)\"                   separator
300 .  ds @post \)\\$3\)\"                  postfix
301 .  shift 3
302 .  nr @count 0
303 .  ds @res \f[CR]\\*[@pre]\"
304 .  while (\\n[.$] >= 2) \{\
305 .    c                                  do the pairs, break on no `-'
306 .    if !'\\$1'-' \{\
307 .      if !'\\$1'--' \
308 .        break
309 .    \}
310 .    c                                  separator
311 .    if (\\n[@count] > 0) \
312 .      as @res \f[CR]\\*[@sep]\"
313 .    nr @count +1
314 .    as @res \f[CB]\\$1\\$2\:\"           combine minus with option name
315 .    shift 2
316 .  \}
317 .  if (\\n[.$] >= 3) \
318 .    Error .\\0: wrong arguments: \\$@
319 .  c                                     all pairs are done
320 .  ie (\\n[.$] == 0) \
321 .    as @res \f[CR]\\*[@post]\"
322 .  el \{\
323 .    c                                   optional option argument
324 .    if !'\\$1'' \
325 .      as @res \f[CR] \,\f[I]\\$1\"
326 .    shift
327 .    as @res \\f[CR]\\*[@post]\"         postfix
328 .    if (\\n[.$] >= 1) \{\
329 .      c                                 add punctuation
330 .      as @res \f[\\n[@font]]\\$1\"
331 .    \}
332 .  \}
333 .  nh
334 .  Text \\*[@res]
335 .  hy
336 .  ft \\n[@font]
337 .  rr @count
338 .  rr @font
339 .  rm @pre
340 .  rm @post
341 .  rm @sep
342 .  rm @res
344 .c --------------------------------------------------------------------
345 .c .Opt_def  ([<minus> <opt>]... [<arg> [<punct>]])
347 .c Definitions of options in section OPTIONS.
349 .c Arguments:
350 .c   minus: either `-' or `--' (font CB).
351 .c   opt: a name for an option, empty allowed (font CB).
352 .c   arg: optionally, the argument to the option (font I).
353 .c   punct: optional punctuation (in the starting font).
354 .c Result:
355 .c   The header for an indented paragraph, consisting of
356 .c   minus/opt argument pairs, each, separated by a space
357 .c   character ` ', optionally add 'arg', separated a space
358 .c   character ` '.
360 .c Example:
361 .c  .Opt_def - T -- device -- device-troff device .
362 .c  results in
363 .c  -T --device --device-troff device.
364 .c  as the header of for indented paragraph.
366 .de Opt_def
367 .  TP
368 .    Opt_alt_base "" "\~|\~" "" \\$@
370 .c --------------------------------------------------------------------
371 .c .Opt_element  ([<minus> <opt>]... [<arg> [<punct>]])
373 .c Definitions of options in section OPTIONS.
375 .c Arguments:
376 .c   minus: either `-' or `--' (font CB).
377 .c   opt: a name for an option, empty allowed (font CB).
378 .c   arg: optionally, the argument to the option (font I).
379 .c   punct: optional punctuation (in the starting font).
380 .c Result:
381 .c   The minus/opt argument pairs, each, separated by a space
382 .c   character ` ', optionally add 'arg', separated a space
383 .c   character ` '.
385 .c Example:
386 .c  .Opt_element - T -- device -- device-troff device .
387 .c  results in
388 .c  -T --device --device-troff device.
390 .de Opt_element
391 .  Opt_alt_base "" "\~" "" \\$@
393 .c --------------------------------------------------------------------
394 .als Opt_list Opt_element
396 .c --------------------------------------------------------------------
397 .c .Opt_long  ([<name> [<punct>]])
399 .c Print `--name' somewhere in the text; optional punctuation.
401 .de Opt_long
402 .  Opt_alt -- "\\$1" "" "\\$2"
404 .c --------------------------------------------------------------------
405 .c .Opt_[long]  ([<name> [<punct>]])
407 .c Print `--name' somewhere in the text; optional punctuation.
409 .de Opt_[long]
410 .  Opt_[alt] -- "\\$1" "" "\\$2"
412 .c --------------------------------------------------------------------
413 .c .Opt_short  ([<name> [<punct>]])
415 .c Print `-name' somewhere in the Text; optional punctuation.
417 .de Opt_short
418 .  Opt_alt - "\\$1" "" "\\$2"
420 .c --------------------------------------------------------------------
421 .c .Opt_[short]  ([name [punct]])
423 .c Print `[-name]' somewhere in the Text; optional punctuation.
425 .de Opt_[short]
426 .  Opt_[alt] - "\\$1" "" "\\$2"
428 .c --------------------------------------------------------------------
429 .c .Shell_cmd  (<CR> [<CI>] ...)
431 .c A shell command line; display args alternating in fonts CR and CI.
433 .c Examples:
434 .c   .Shell_cmd "groffer --dpi 100 file"
435 .c     result: `sh#  groffer --dpi 100 file'
436 .c             with 'sh#' in font I, the rest in CR
438 .c   .Shell_cmd groffer\~--dpi\~100\~file
439 .c     result: the same as above
441 .c   .Shell_cmd "groffer --dpi=" value " file"
442 .c     result: sh#  groffer --dpi=value file
443 .c             with `groffer --dpi=' and `file' in CR; `value' in CI
445 .c   .Shell_cmd groffer\~--dpi= value \~file
446 .c     result: the same as the previous example
448 .de Shell_cmd
449 .  groffer:Shell_cmd_base "\*[groffer:Shell_cmd.prompt]" \\$@
451 .c --------------------------------------------------------------------
452 .c .Shell_cmd+  (<CR> [<CI>] ...)
454 .c A continuation line for .Shell_cmd.
456 .de Shell_cmd+
457 .  groffer:Shell_cmd_base "\*[groffer:Shell_cmd+.prompt]" \\$@
459 .c --------------------------------------------------------------------
460 .c .Shell_cmd_base  (<prompt> [<CR> [<CI>] ...])
462 .c A shell command line; display args alternating in fonts CR and CI.
463 .c Internal, do not use directly.
465 .c Globals: read-only register @.Shell_cmd_width
467 .de groffer:Shell_cmd_base
468 .  if (\\n[.$] <= 0) \
469 .    return
470 .  nr @+font \\n[.f]\"
471 .  ds @prompt \\$1\"
472 .  ft CR
473 .  c gap between prompt and command
474 .  nr @+gap \\n[groffer:Shell_cmd_base.prompt_width]-\\w'\\*[@prompt]'\"
475 .  ds @res \\*[@prompt]\h'\\n[@+gap]u'\"
476 .  shift
477 .  ds @cf CR\"
478 .  while (\\n[.$] > 0) \{\
479 .    as @res \\f[\\*[@cf]]\\$1\"
480 .    shift
481 .    ie '\\*[@cf]'CR' \
482 .      ds @cf I\"
483 .    el \
484 .      ds @cf CR\"
485 .  \}
486 .  br
487 .  ad l
488 .  nh
489 .  nf
490 .  Text \\*[@res]\"
491 .  fi
492 .  hy
493 .  ad
494 .  br
495 .  ft \\n[@+font]
496 .  rr @+font
497 .  rr @+gap
498 .  rm @cf
499 .  rm @res
501 .c --------------------------------------------------------------------
502 .c .Synopsis  ()
504 .c Begin a synopsis section, to be ended by a ./Synopsis macro.
506 .de Synopsis
507 .  if (\\n[groffer:Synopsis.level] > 0) \
508 .    Error .\\$0: previous .Synopsis was not closed by ./Synopsis.
509 .  nh
510 .  ds @1 \\$1\"
511 .  nr @old_indent \\n(.i
512 .  ad l
513 .  in +\w'\fB\\*[@1]\0'u
514 .  ti \\n[@old_indent]u
515 .  B \\*[@1]\0\c
516 .  rr @old_indent
517 .  rm @1
518 .  nr groffer:Synopsis.level +1\"        marker for ./Synopsis
520 .c  --------------------------------------------------------------------
521 .c ./Synopsis  ()
523 .c Close a synopsis section opened by the previous .Synopsis macro.
525 .de /Synopsis
526 .  if (\\n[groffer:Synopsis.level] <= 0) \
527 .    Error .\\$0: no previous call of .Synopsis
528 .  br
529 .  ad
530 .  in
531 .  hy
532 .  nr groffer:Synopsis.level -1
534 .c  --------------------------------------------------------------------
535 .c .Text  (<text>...)
537 .c Treat the arguments as text, no matter how they look.
539 .de Text
540 .  if (\\n[.$] == 0) \
541 .    return
542 .  nop \)\\$*\)
544 .c --------------------------------------------------------------------
545 .c .Topic  ([<indent>])
547 .c A bulleted paragraph
549 .de Topic
550 .  ie (\\n[.$] = 0) \
551 .    ds @indent 2m\"
552 .  el \
553 .    ds @indent \\$1\"
554 .  TP \\*[@indent]
555 .  Text \[bu]
556 .  rm @indent
558 .c --------------------------------------------------------------------
559 .c .TP+  ()
561 .c Continuation line for .TP header.
563 .de TP+
564 .  br
565 .  ns
566 .  TP \\$1
568 .c --------------------------------------------------------------------
569 .c .TP_header  ([<indent>])
571 .c Start a multi-line header for a .TP-like paragraph
573 .de TP_header
574 .  if (\\n[groffer:TP.level] < 0) \
575 .    Error .\\$0: wrong level.
576 .  nr groffer:TP.level +1
577 .  P
578 .  ie (\\n[.$] == 0) \
579 .    rr groffer:TP.indent
580 .  el \
581 .    nr groffer:TP.indent \\$1
582 .  nr groffer:TP_header.flag 1
584 .c --------------------------------------------------------------------
585 .c .TP_body  ([<indent>])
587 .c End a previous .TP-header and beging the body of the paragraph.
589 .de TP_body
590 .  if !rgroffer:TP_header.flag \
591 .    Error .\\$0: no previous call of .TP_header
592 .  if (\\n[groffer:TP.level] <= 0) \
593 .    Error .\\$0: wrong level.
594 .  br
595 .  ie (\\n[.$] == 0) \{\
596 .    ie rgroffer:TP.indent \{\
597 .      RS \\n[groffer:TP.indent]u
598 .    \}
599 .    el \
600 .      RS
601 .  \}
602 .  el \
603 .    RS \\$1u
604 .  rr groffer:TP.indent
605 .  rr groffer:TP_header.flag
606 .  nr groffer:TP_body.flag 1
608 .c --------------------------------------------------------------------
609 .c TP_end  ()
611 .c End of former .TP_body paragraph.
613 .de TP_end
614 .  if !rgroffer:TP_body.flag \
615 .    Error .\\$0: no previous .TP_body.
616 .  if (\\n[groffer:TP.level] <= 0) \
617 .    Error TP_end: wrong level.
618 .  nr groffer:TP.level -1
619 .  rr grogger:TP.indent
620 .  rr groffer:TP_header.flag
621 .  rr groffer:TP_body.flag
622 .  br
623 .  RE
626 .\" End of macro definitions
629 .\" --------------------------------------------------------------------
630 .\" SH "SYNOPSIS"
631 .\" --------------------------------------------------------------------
633 .ad l
634 .Synopsis groffer
635 .RI [ groffer_options ]
636 .RI [ groff_options ]
637 .Opt_[--]
638 .RI [ "filespec" "\*[Ellipsis]]"
639 ./Synopsis
641 .Synopsis groffer
642 .Opt_alt - h -- help
643 ./Synopsis
645 .Synopsis groffer
646 .Opt_alt - v -- version
647 ./Synopsis
650 .\" --------------------------------------------------------------------
651 .SH DESCRIPTION
652 .\" --------------------------------------------------------------------
655 .I groffer
656 program is the easiest way to use
657 .BR groff (@MAN1EXT@).
658 It can display arbitrary documents written in the
659 .BR groff (@MAN7EXT@)
660 language or other
661 .BR roff (@MAN7EXT@)
662 languages that are compatible to the original troff language.
665 .I groffer
666 program also includes many of the features for finding and displaying
667 the UNIX manual pages
668 .RI ( man\~pages ),
669 such that it can be used as a replacement for a
670 .BR man (1)
671 program.
673 Moreover, compressed files that can be handled by
674 .BR gzip (1)
676 .BR bzip2 (1)
677 are decompressed on-the-fly.
681 The normal usage is quite simple by supplying a file name or name of a
682 man\~page without further options.
684 But the option handling has many possibilities for creating special
685 behaviors.
687 These can be stored in a configuration file.
691 The output can be generated and viewed in several different ways
692 available for
693 .IR groff .
695 This includes the groff native X viewer
696 .BR gxditview (@MAN1EXT@),
697 each Postcript or dvi display program, a web browser by generating
698 html in www-mode, or several text modes in text terminals.
702 Most options that must be named when running
703 .I groff
704 are determined automatically because
705 .I groffer
706 internally calls the
707 .BR grog (@MAN1EXT@)
708 program.
710 But all parts can be controlled manually by supplying options.
713 .\" --------------------------------------------------------------------
714 .SH "OPTION OVERVIEW"
715 .\" --------------------------------------------------------------------
718 .I groffer_options
719 The following options determine and configure the display mode.
721 They were synchronized with the options of both
722 .BR groff (@MAN1EXT@)
723 and GNU
724 .BR man (1).
726 If none of these options is used groffer tries to find a suitable
727 display mode automatically.
733 .Opt_[alt] - Q -- source
734 .Opt_[alt] - T -- device device
735 .Opt_[alt] -- auto-modes mode1,mode2,\*[Ellipsis]
736 .Opt_[alt] -- debug
737 .Opt_[alt] -- default
738 .Opt_[alt] -- dvi
739 .Opt_[alt] -- dvi-viewer prog
740 .Opt_[alt] -- groff
741 .Opt_[alt] -- location
742 .Opt_[alt] -- mode display_mode
743 .Opt_[alt] -- pager program
744 .Opt_[alt] -- pdf
745 .Opt_[alt] -- pdf-viewer prog
746 .Opt_[alt] -- ps
747 .Opt_[alt] -- ps-viewer prog
748 .Opt_[alt] -- shell
749 .Opt_[alt] -- tty
750 .Opt_[alt] -- www
751 .Opt_[alt] -- www-viewer prog
752 .Opt_[alt] -- x
753 .Opt_[alt] -- x-viewer prog
757 The following long options were adapted from the corresponding X
758 Toolkit options.
760 Their single leading minus in X Toolkit was changed to a double minus
761 for long options; see
762 .BR X (1).
766 .Opt_[alt] -- bd
767 .Opt_[alt] -- bg -- background
768 .Opt_[alt] -- bw
769 .Opt_[alt] -- display
770 .Opt_[alt] -- fg -- foreground
771 .Opt_[alt] -- ft -- font
772 .Opt_[alt] -- geometry size_pos
773 .Opt_[alt] -- resolution value
774 .Opt_[alt] -- rv
775 .Opt_[alt] -- title string
776 .Opt_[alt] -- xrm X_resource
780 The following long options regulate whether and how
781 .I man\~pages
782 (UNIX manual pages) are searched.
784 They were constructed for
785 .IR groffer ,
786 but they are compatible with the long options of the
787 .I GNU man
788 program.
792 .Opt_[alt] -- all
793 .Opt_[alt] -- ascii
794 .Opt_[alt] -- apropos
795 .Opt_[alt] -- ditroff
796 .Opt_[alt] -- extension suffix
797 .Opt_[alt] -- locale language
798 .Opt_[alt] -- local-file
799 .Opt_[alt] -- man
800 .Opt_[alt] -- manpath dir1:dir2:\*[Ellipsis]
801 .Opt_[alt] -- no-location
802 .Opt_[alt] -- no-man
803 .Opt_[alt] -- sections sec1:sec2:\*[Ellipsis]
804 .Opt_[alt] -- systems sys1,sys2,\*[Ellipsis]
805 .Opt_[alt] -- troff-device device
806 .Opt_[alt] -- whatis
810 The GNU
811 .I man
812 long options that are not mentioned are recognized, but they are just
813 ignored because of alternative implementations.
815 The full set of long and short options of the GNU man program can be
816 passed via the environment variable
817 .Env_var $MANOPT ;
819 .BR man (1)
820 if your system has GNU man installed.
826 .I groff_options
827 Any combination of (short) options from the
828 .BR groff (@MAN1EXT@)
829 program is accepted; the options that are not explicitly handled by
830 groffer are transparently passed to groff.
832 Due to the automatism in groffer, none of these groff options should
833 be necessary, except for advanced usage.
839 Because of the special outputting behavior of the groff options
840 .Opt_short V,
841 .Opt_short X,
843 .Opt_short Z,
844 groffer was designed to be switched into
845 .I groff
846 mode by each of these options; in this mode, the groffer viewing
847 features are disabled.
850 The other groff options do not switch the mode, but allow to customize
851 the formatting process.
853 Useful groff formatting options include
854 .Opt_short m
855 (to add macro files that cannot be recognized by grog), and
856 .Opt_short T
857 (to specify an alternative device for the modes
858 .I tty
860 .IR x ).
866 .I filespec
867 is one or more file names or templates for searching
868 man\~pages, see
869 .BR man (1).
870 Each
871 .I filespec
872 can have one of the following forms.
879 .I filespec
880 parameters means standard input.
883 .TP 10m
884 .Opt_short
885 stands for standard input (can occur several times).
889 .I filename
890 the path name of an existing file.
894 .I name
895 if 
896 .I name
897 is not an existing file search for the man\~page called in the lowest
898 man\~section that has a document for this name.
902 .BI man: name
903 search for a man\~page in the lowest man\~section that has a document
904 called
905 .IR name .
909 .BI man: name . section
910 .TP+
911 .BI man: name ( section )
912 .TP+
913 .IB name ( section )
914 .TP+
915 .IB name . section
916 each of these search the man\~page
917 .I name
918 in man\~section\~\c
919 .IR section .
923 .I "std_section name"
924 two arguments like in the
925 .BR man (1)
926 program to find man\~page
927 .I name
928 in man\~section
929 .IR std_section .
932 .IR groffer ,
933 the argument
934 .I std_section
935 is a standard section name for man\~pages; these are a digit `1',
936 \&\*[Ellipsis], `9', or the single letters `o' or `n'.
938 This should be used only with care.
943 .\" --------------------------------------------------------------------
944 .SH "GROFFER OPTIONS"
945 .\" --------------------------------------------------------------------
947 All short options of
948 .I groffer
949 are compatible with the short options of
950 .BR groff (@MAN1EXT@).
952 Some of the
953 .I groff
954 options were given a special meaning within
955 .IR groffer .
957 All other
958 .I groff
959 options are supported by
960 .IR groffer ,
961 but they are just transparently transferred to
962 .I groff
963 without any intervention.
965 Therefore these transparent options are not documented here, but in
966 .BR groff (@MAN1EXT@).
970 All long options of
971 .I groffer
972 are compatible with the long options of
973 .BR man (1).
975 Most of the
976 .I man
977 long options were implemented as native options into
978 .IR groffer .
980 These options are documented in the following; the other
981 .I man
982 options are recognized, but ignored.
985 .Opt_def - h
986 Print usage message to standard error and exit.
989 .Opt_def - Q
990 Output the roff source code of the input files unprocessed.
992 This is the equivalent
993 .Opt_long mode\~source .
996 .Opt_def - T devname
997 Switch to
998 .Opt_long mode
999 .IR devname .
1001 The input is formatted and postprocessed using plain
1002 .I groff
1003 with
1004 .I devname
1005 as the output device.
1007 The allowed device names are listed in
1008 .BR groff (@MAN1EXT@).
1010 Note that this forces all device names that begin with the letter
1011 .I X
1012 to be displayed with
1013 .BR gxditview (@MAN1EXT@);
1014 all other device names generate output for the specified device; this
1015 is printed onto standard output without a pager.
1018 .Opt_def - v
1019 Print version information onto standard error.
1022 .Opt_def - V
1023 Switch into
1024 .I groff
1025 mode and format the input with groff option
1026 .Opt_short V ;
1027 this produces the groff calling pipe without formatting the input.
1029 This an advanced option from
1030 .BR groff (@MAN1EXT@) ,
1031 only useful for debugging.
1034 .Opt_def - X
1035 Switch into
1036 .I groff
1037 mode and format the input with groff option
1038 .Opt_short X ;
1039 actually, this formats the input and displays it with
1040 .BR gxditview (@MAN1EXT@) .
1042 This differs from groffer's mode
1043 .I x
1044 because groffer's viewer options are not used, but the viewer is
1045 configured like in groff with the groff option
1046 .Opt_short P .
1047 This option is inhereted from
1048 .BR groff (@MAN1EXT@) .
1051 .Opt_def - Z
1052 Switch into
1053 .I groff
1054 mode and format the input with groff option
1055 .Opt_short Z ;
1056 this produces the groff intermediate output without postprocessing; see
1057 .BR groff_out (@MAN1EXT@) .
1058 This an advanced option from
1059 .BR groff (@MAN1EXT@) ,
1060 useful for debugging.
1063 .Opt_def -- all
1064 In searching man pages, retrieve all suitable ones instead of only one.
1067 .Opt_def -- apropos
1068 Instead of displaying, start the `apropos' command for searching
1069 within man page descriptions; only kept for compatibility with `man'.
1072 .Opt_def -- auto-modes mode1,mode2,\*[Ellipsis]
1073 Set the sequence of modes for default mode to the comma separated list
1074 given in the argument.
1077 .Opt_def -- background color
1078 This is equivalent to
1079 .Opt_long bg .
1082 .Opt_def -- bd pixels
1083 Specifies the color of the border surrounding the viewer
1084 window.
1086 This is an adaption of the X Toolkit option
1087 .Opt_short bd .
1089 The argument is an X color name, see
1090 .BR (1)
1091 for details.
1094 .Opt_def -- bg color
1095 Set the background color of the viewer window.
1097 This is an adaption of the X Toolkit option
1098 .Opt_short bg .
1100 The argument is an X color name, see
1101 .BR (1)
1102 for details.
1105 .Opt_def -- bw pixels
1106 Specifies the width in pixels of the border surrounding the viewer
1107 window (not available for all viewers).
1109 This is an adaption of the X Toolkit option
1110 .Opt_short bw .
1113 .Opt_def -- debug
1114 Print debugging information.
1116 Actually, a function call stack is printed if an error occurs.
1119 .Opt_def -- default
1120 Reset all configuration from previously processed command line options
1121 to the default values.
1123 This is useful to wipe out all effects of former options and restart
1124 option processing using only the rest of the command line.
1127 .Opt_def -- device
1128 Eqivalent to
1129 .Opt_short T .
1132 .Opt_def -- display X-display
1133 Set the X display on which the viewer program shall be started, see
1134 .BR X (1)
1135 for the syntax of the argument.
1138 .Opt_def -- ditroff
1139 Eqivalent to
1140 .Opt_short Z .
1141 This is kept for compatibiliy with GNU
1142 .BR man (1).
1145 .Opt_def -- dvi
1146 Choose dvi mode; the formatted input is displayed with the  
1147 by default, the formatted input is displayed with the
1148 .BR xdvi (1)
1149 program.
1152 .Opt_def -- dvi-viewer prog
1153 Set the viewer program for dvi mode.
1155 This can be a file name or a program to be searched in
1156 .Env_var $PATH .
1158 Known dvi viewers inlude
1159 .BR xdvi (1)
1161 .BR dvilx (1)
1163 In each case, arguments can be provided additionally.
1166 .Opt_def -- extension suffix
1167 Restrict man\~page search to file names that have
1168 .I suffix
1169 appended to their section element.
1171 For example, in the file name
1172 .I /usr/share/man/man3/terminfo.3ncurses.gz
1173 the man\~page extension is
1174 .IR ncurses .
1176 Originates from GNU
1177 .IR man .
1180 .Opt_def -- foreground color
1181 This is equivalent to
1182 .Opt_long fg .
1185 .Opt_def -- fg color
1186 Set the foreground color of the viewer window.
1188 This is an adaption of the X Toolkit option
1189 .Opt_long bg .
1191 The argument is an X color name, see
1192 .BR (1)
1193 for details.
1196 .Opt_def -- font font_name
1197 This is equivalent to
1198 .Opt_long ft .
1201 .Opt_def -- ft font_name
1202 Set the font used by the viewer window.
1204 This is an adaption of the X Toolkit option
1205 .Opt_short ft .
1207 The argument is an X font name, see
1208 .BR (1)
1209 for details.
1212 .Opt_def -- geometry size_pos
1213 Set the geometry of the display window, that means its size and its
1214 starting position.
1217 .BR X (1)
1218 for details on the syntax of the argument.
1220 If the actual display mode is not X then this option is ignored.
1223 .Opt_def -- groff
1225 .I groff
1226 mode.
1228 Switch groffer to process the input like
1229 .BR groff (@MAN1EXT@).
1231 This disables the groffer viewing features, all groffer viewing
1232 options are ignored.
1235 .Opt_def -- help
1236 Eqivalent to
1237 .Opt_short h .
1240 .Opt_def -- location
1241 Print the location of the retrieved files to standard error.
1244 .Opt_def -- locale language
1246 Set the language for man pages.
1248 This option originates from GNU
1249 .BR man (1).
1252 .Opt_def -- man
1253 Check the non-option command line arguments (filespecs) first on being
1254 man\~pages, then whether they represent an existing file.
1256 By default, a filespec is first tested if it is an existing file.
1259 .Opt_def -- manpath "'dir1:dir2:\*[Ellipsis]'"
1260 Use the specified search path for retrieving man\~pages instead of the
1261 program defaults.
1263 If the argument is set to the empty string "" the search for man\~page
1264 is disabled.
1267 .Opt_def -- mode value
1269 Set the display mode.
1271 The following mode values are recognized:
1278 .Header_CB auto
1279 Display in the default manner; this actually means to try the modes
1280 .IR ps ,
1281 .IR x ,
1283 .I tty
1284 in this sequence.
1286 Useful for restoring default mode when a different mode was specified
1287 with
1288 .Env_var $GROFFER_OPT .
1292 .Header_CB dvi
1293 Display formatted input in a dvi viewer program; equivalent to
1294 .Opt_long dvi .
1298 .Header_CB pdf
1299 Display formatted input in a PDF (Portable Document Format) viewer
1300 program; equivalent to
1301 .Opt_long pdf .
1305 .Header_CB ps
1306 Display formatted input in a Postscript viewer program; equivalent to
1307 .Opt_long ps .
1311 .Header_CB tty
1312 Display formatted input in a text terminal; equivalent to
1313 .Opt_long tty .
1317 .Header_CB www
1318 Display formatted input in a internet browser program; equivalent to
1319 .Opt_long www .
1323 .Header_CB x
1324 Display formatted input in a native roff viewer such as
1325 .BR gxditview (@MAN1EXT@);
1326 equivalent to
1327 .Opt_long x .
1331 The following modes do not use the
1332 .I groffer
1333 viewing features.
1335 They are only interesting for advanced applications.
1339 .Header_CB groff
1340 Generate device output with plain
1341 .I groff
1342 without using the special viewing features of
1343 .IR groffer .
1344 If no device was specified by option
1345 .Opt_short T
1347 .I groff
1348 default
1349 .B ps
1350 is assumed.
1354 .Header_CB source
1355 Display source code; same as
1356 .Opt_short Q .
1362 .Opt_def -- no-location
1363 Do not display the location of retireved files; this resets a former
1364 call to
1365 .Opt_long location .
1368 .Opt_def -- no-man
1369 Do not check for man\~pages.
1372 .Opt_def -- pager
1373 Set the pager program in tty mode; default is
1374 .IR less .
1377 .Opt_def -- pdf
1378 Choose pdf mode (Portable Document Format).
1380 By default, the input is formatted by groff using the Postscript
1381 device, then it is transformed into the PDF file format using
1382 .BR gs (1)
1383 (this is quite slow), and finally displayed either with the
1384 .BR xpdf (1)
1385 or the
1386 .BR acroread (1)
1387 program; this can be configured with option
1388 .Opt_long viewer-pdf .
1390 PDF has a big advantage because the text is displayed graphically and
1391 is searchable nevertheless; but as thtransformation into pdf takes a
1392 considerable amount of time, the pdf mode is not suitable as a default
1393 device for the auto mode.
1395 The only device that is compatible to this mode is
1396 .IR ps ,
1397 which is also the default when no device is specified.
1400 .Opt_def -- pdf-viewer prog
1401 Set the viewer program for
1402 .I pdf
1403 mode.
1405 This can be a file name or a program to be searched in
1406 .Env_var $PATH .
1408 In each case, arguments can be provided additionally.
1411 .Opt_def -- ps
1412 Choose ps mode (Postscript).
1414 By default, the formatted input is displayed with the
1415 .BR ghostview (@MAN1EXT@)
1416 program; this can be configured with option
1417 .Opt_long viewer-ps .
1419 The only device that is compatible to this mode is
1420 .IR ps ,
1421 which is also the default when no device is specified.
1424 .Opt_def -- ps-viewer prog
1425 Set the viewer program for
1426 .I ps
1427 mode.
1429 This can be a file name or a program to be searched in
1430 .Env_var $PATH .
1432 Common Postscript viewers inlude
1433 .BR gv (1),
1434 .BR ghostview (1),
1436 .BR gs (1),
1438 In each case, arguments can be provided additionally.
1441 .Opt_def -- resolution value
1442 Set X resolution in dpi (dots per inch) in some viewer programs.
1444 The only supported dpi values are
1445 .B 75
1447 .BR 100 .
1448 This is an adaption of the X Toolkit option
1449 .Opt_short resolution .
1452 .Opt_def -- rv
1453 Reverse foreground and background color of the viewer window.
1455 This is an adaption of the X Toolkit option
1456 .Opt_short rv .
1457 This feature is not available in all viewer programs.
1460 .Opt_def -- sections
1461 Restrict searching for man pages to the given
1462 .IR sections ,
1463 a colon-separated list.
1466 .Opt_def -- shell "shell_program"
1467 Specify the shell under which the groffer script should be run.
1469 The script first tests whether this option is set (either within
1470 .Env_var $GROFF_OPT
1471 or as a command line option); if so, the script is rerun under the
1472 shell program specified with the option argument.
1475 .Opt_def -- source
1476 Equivalent to
1477 .Opt_short Q .
1480 .Opt_def -- systems
1481 Search for man pages for the given operating systems; the argument
1482 .I systems
1483 is a comma-separated list.
1486 .Opt_def -- title "'some text'"
1487 Set the title for the viewer window.
1489 This feature is not available in all viewer programs.
1492 .Opt_def -- to-postproc opt_or_arg
1493 Eqivalent to
1494 .Opt_short P .
1497 .Opt_def -- troff-device
1498 Eqivalent to
1499 .Opt_short T .
1500 This option is only kept for compatibility with GNU
1501 .BR man (1).
1504 .Opt_def -- tty
1505 Choose tty display mode, that means displaying in a text pager even
1506 when in X; eqivalent to
1507 .Opt_long mode\~tty .
1510 .Opt_def -- version
1511 Eqivalent to
1512 .Opt_short v .
1515 .Opt_def -- whatis
1516 Instead of displaying the content, get the one-liner description from
1517 the retrieved man page files \[em] or say that it is not a man page.
1520 .Opt_def -- where
1521 Eqivalent to
1522 .Opt_long location .
1525 .Opt_def -- www
1526 Choose www mode (html), display in a web browser program, which can be
1527 specified with option
1528 .Opt_long www-viewer .
1529 By default, the existence of a sequence of standard web browsers is
1530 tested, starting with
1531 .BR mozilla (1)
1533 .BR netscape (1)
1536 .Opt_def -- www-viewer prog
1537 Set the web browser program for viewing in
1538 .I www
1539 mode.
1541 Each program that accepts html input and allows the
1542 .BI file://localhost/ dir / file
1543 syntax on the command line is suitable; it can be the path name of an
1544 executable file or a program in
1545 .Env_var $PATH .
1547 In each case, arguments can be provided additionally.
1550 .Opt_def -- x
1551 Choose
1552 .I x
1553 mode (view in X roff viewer).
1555 By default, the formatted input is displayed with the
1556 .BR gxditview (@MAN1EXT@)
1557 program, being distributed together with groff, or with
1558 .BR xditview (1),
1559 which is distributed as a standard X tool.
1561 This can be configured with option
1562 .Opt_long x-viewer .
1564 The only devices (option
1565 .Opt_short T )
1566 that are compatible with this mode are
1567 .IR X75 ,
1568 .IR X100 ,
1569 .IR X75-12 ,
1570 .IR X100-12 ,
1572 .I ps
1573 (the default device).
1576 .Opt_def -- x-viewer prog
1577 Set the viewer program for
1578 .I x
1579 mode.
1581 Suitable viewer programs are
1582 .BR gxditview (@MAN1EXT@)
1584 .BR xditview (1).
1586 But the argument can be any executable file or a program in
1587 .Env_var $PATH .
1589 In each case, arguments can be provided additionally.
1593 .Opt_--
1594 Signals the end of option processing; all remaining arguments are
1595 interpreted as
1596 .I filespec
1597 parameters.
1601 Besides these, groffer accepts all arguments that are valid for the
1602 .BR groff (@MAN1EXT@)
1603 program.
1605 All non-groffer options are sent unmodified via grog to groff.
1607 Postprocessors, macro packages, compatibility with classical troff,
1608 and much more can be manually specified.
1611 .\" --------------------------------------------------------------------
1612 .SH "OUTPUT MODES"
1613 .\" --------------------------------------------------------------------
1615 By default, the groffer program formats the input and then
1616 automatically chooses a suitable display mode, but the user can also
1617 choose between the following modes:
1619 .Topic
1620 graphically display the formatted input with an X window program,
1621 including
1624 .Topic
1625 with X window roff viewers such as
1626 .BR gxditview (@MAN1EXT@)
1627 .RI ( x
1628 mode),
1630 .Topic
1631 in a dvi viewer program
1632 .RI ( dvi
1633 mode),
1635 .Topic
1636 in a Postscript viewer
1637 .RI ( ps
1638 mode),
1640 .Topic
1641 in a PDF viewer
1642 .RI ( pdf
1643 mode),
1645 .Topic
1646 in a web browser
1647 .RI ( www
1648 mode),
1651 .Topic
1652 display formatted input in a pager on the text terminal
1653 .RI ( tty
1654 mode),
1656 .Topic
1657 run groffer like groff, but with decompression and man\~page searching
1658 .RI ( groff
1659 mode); this includes things like generating the groff intermediate
1660 output.
1662 .Topic
1663 stream the unformatted source code of the input onto standard output
1664 .RI ( source
1665 mode),
1670 .IR default ,
1671 .I groffer
1672 first tries whether
1673 .B x
1674 mode is possible, then
1675 .B ps
1676 mode, and finally
1677 .B tty
1678 mode.
1680 This mode testing sequence for
1681 .B default
1682 mode can be changed by specifying a comma separated list of modes
1683 with the option
1684 .Opt_long default\-modes.
1688 The searching for man\~pages and the decompression of the input are
1689 active in every mode.
1692 .\" --------------------------------------------------------------------
1693 .SS "Graphical Display Modes"
1694 .\" --------------------------------------------------------------------
1696 The graphical display modes work only in the X window environment (or
1697 similar implementations within other windowing environments).
1699 The environment variable
1700 .Env_var $DISPLAY
1701 or the option
1702 .Opt_long display
1703 are used for specifying the X display to be used; if neither is
1704 specified, groffer assumes that no X is running.
1708 A certain graphical display mode can be selected by one of the options
1709 .Opt_long dvi ,
1710 .Opt_long pdf ,
1711 .Opt_long ps ,
1712 .Opt_short X ,
1714 .Opt_long www .
1716 By default, some graphical modes are tried first.  If none succeeds
1717 groffer switches to
1718 .B tty
1719 mode.
1723 The graphical modes can be customized by options that were named
1724 according to the resource options in the
1725 .BR X (1)
1726 Toolkit but using a leading double minus instead of the single minus
1727 used by X.
1729 These include
1730 .Opt_long background ,
1731 .Opt_long foreground ,
1732 .Opt_long geometry ,
1733 .Opt_long resolution ,
1734 .Opt_long title ,
1735 .Opt_long xrm ,
1736 etc.
1741 .I pdf
1742 mode has a major advantage \[em] it is the only graphical diplay mode
1743 that allows to search for text within the viewer; this can be a really
1744 important feature.
1746 Unfortunately, it takes a long time to transform the input into the
1747 PDF format, so it was not chosen as the major mode.
1749 You can change this by the options
1750 .Opt_long pdf
1752 .Opt_long auto\-modes .
1755 .\" --------------------------------------------------------------------
1756 .SS "Text mode"
1757 .\" --------------------------------------------------------------------
1759 If the variable
1760 .Env_var $DISPLAY
1761 is not set or empty, groffer assumes that it should produce output on
1762 a text terminal.
1764 This mode can also be forced by option
1765 .Opt_long tty .
1769 In the actual implementation, the groff output device
1770 .I latin1
1771 is chosen and the processed output is piped into a pager program.
1773 This can be changed by specifying option
1774 .Opt_long tty-device .
1778 The pager to be used can be specified by option
1779 .Opt_long pager
1780 or by the environment variable
1781 .Env_var $PAGER .
1782 If this is not set or empty the
1783 .BR less (1)
1784 program is used as the default pager.
1787 .\" --------------------------------------------------------------------
1788 .SS "Non-displaying Modes"
1789 .\" --------------------------------------------------------------------
1791 There are some special modes that do not display the formatted output
1792 in a viewer program.
1794 These modes are regarded as advanced, they are useful for debugging
1795 purposes.
1799 .I source mode
1800 Instead of displaying the formatted output, it is also possible to
1801 have the roff source code streamed onto the standard output.
1803 This mode must be requested by one of the options
1804 .Opt_short Q
1806 .Opt_long source .
1810 .I groff mode
1811 This mode disables the groffer viewing facilities.
1813 The input is handled as usual with decompression and man\~page
1814 searching, but then it is passed to groff using only the options
1815 provided by groff.
1817 This enables the user to save the generated output into a file or pipe
1818 it into another program.
1820 In this mode, the input is formatted, but not postprocessed; see
1821 .BR groff_out (@MAN5EXT@)
1822 for details.
1824 This mode is activated automatically by the three groff options
1825 .Opt_short V
1826 (print roff pipe, no formatting),
1827 .Opt_short X
1828 (display with gxditview in groff's native way, using
1829 .Opt_short P
1830 for customization), and
1831 .Opt_short Z
1832 (disable post-processing, thus producing the groff intermediate output).
1835 .\" --------------------------------------------------------------------
1836 .SH "MAN\~PAGE\~SEARCHING"
1837 .\" --------------------------------------------------------------------
1839 The default behavior of groffer is to first test whether a file
1840 parameter represents a local file; if it is not an existing file name,
1841 it is assumed to represent a name of a man\~page.
1843 This behavior can be modified by the following options.
1847 .Opt_long man
1848 forces to interpret all file parameters as filespecs for searching
1849 man\~pages.
1852 .Opt_long no\-man
1853 .TP+
1854 .Opt_long local\-file
1855 disable the man searching; so only local files are displayed.
1859 If neither a local file nor a man\~page was retrieved for some file
1860 parameter a warning is issued on standard error, but processing is
1861 continued.
1865 The groffer program provides a search facility for man\~pages.
1867 All long options, all environment variables, and most of the
1868 functionality of the GNU
1869 .BR man (1)
1870 program were implemented.
1872 This inludes the extended file names of man\~pages, for example,
1873 the man\~page of
1874 .I groff
1875 in man\~section 7 may be stored under
1876 .File_name /usr/share/man/man7/groff.7.gz ,
1877 where
1878 .File_name /usr/share/man/
1879 is part of the man\~path, the subdirectory
1880 .I man7
1881 and the file extension
1882 .I .7
1883 refer to the man\~section 7;
1884 .I .gz
1885 shows the compression of the file.
1890 .I cat\~pages
1891 (preformatted man\~pages) are intentionally excluded from the search
1892 because groffer is a roff program that wants to format by its own.
1894 With the excellent performance of the actual computers, the
1895 preformatted man\~pages aren't necessary any longer.
1899 The algorithm for retrieving man\~pages uses five search methods.
1901 They are successively tried until a method works.
1904 .Topic
1905 The search path can be manually specified by using the option
1906 .Opt_long manpath .
1907 An empty argument disables the man\~page searching.
1909 This overwrites the other methods.
1912 .Topic
1913 If this is not available the environment variable
1914 .Env_var $MANPATH
1915 is searched.
1918 .Topic
1919 If this is empty, the program tries to read it from the environment
1920 variable
1921 .Env_var $MANOPT .
1923 .Topic
1924 If this does not work, the
1925 .BR manpath (1)
1926 program for determining a path of man directories is tried.
1929 .Topic
1930 If this does not work a reasonable default path is searched for
1931 man\~pages.
1935 After this, the path elements for the language (locale) and operating
1936 system specific man\~pages are added to the man\~path; their sequence
1937 is determined automatically.
1939 For example, both
1940 .I /usr/share/man/linux/fr
1942 .I /usr/share/man/fr/linux
1943 for french linux man\~pages are found.
1945 The language and operating system names are determined from both
1946 environment variables and command line options.
1950 The locale (language) is determined like in GNU man, that is from
1951 highest to lowest precedence:
1952 .Topic
1953 .Opt_long locale
1955 .Topic
1956 .Env_var $GROFFER_OPT
1958 .Topic
1959 .Env_var $MANOPT
1961 .Topic
1962 .Env_var $LCALL
1964 .Topic
1965 .Env_var $LC_MESSAGES
1967 .Topic
1968 .Env_var $LANG .
1972 The language locale is usually specified in the POSIX 1003.1 based
1973 format:
1975 \f[I]<language>\f[][\f[CB]_\f[]\f[I]<territory>\f[][\f[CB].\f[]\
1976 \f[I]<character-set>\f[][\f[CB],\f[]\f[I]<version>\f[]]]],
1978 but the two-letter code in
1979 .I <language>
1980 is sufficient for most purposes.
1984 If no man\~pages for a complicated locale are found the country part
1985 consisting of the first two characters (without the `\f[CB]_\f[]',
1986 `\f[CB].\f[]', and `\f[CB],\f[]', parts) of the locale is searched as
1987 well.
1991 If still not found the corresponding man\~page in the default language
1992 is used instead.
1994 As usual, this default can be specified by one of \f[CR]C\f[] or
1995 \f[CR]POSIX\f[].
1997 The man\~pages in the default language are usually in English.
2001 Several operating systems can be given by appending their names,
2002 separated by a comma.
2004 This is then specified by the environment variable
2005 .Env_var $SYSTEM
2006 or by the command line option
2007 .Opt_long systems .
2008 The precedence is similar to the locale case above from highest to
2009 lowest precedence:
2011 Topic
2012 .Opt_long systems
2014 .Topic
2015 .Env_var $GROFFER_OPT
2017 .Topic
2018 .Env_var $MANOPT
2020 .Topic
2021 .Env_var $SYSTEM .
2025 When searching for man\~pages this man\~path with the additional
2026 language and system specific directories is used.
2030 The search can further be restricted by limiting it to certain
2031 sections.
2033 A single section can be specified within each filespec argument,
2034 several sections as a colon-separated list in command line option
2035 .Opt_long sections
2036 or environment variable
2037 .Env_var $MANSECT .
2039 When no section was specified a set of standard sections is searched
2040 until a suitable man\~page was found.
2044 Finally, the search can be restricted to a so-called
2045 .IR extension .
2046 This is a postfix that acts like a subsection.
2048 It can be specified by
2049 .Opt_long extension
2050 or environment variable
2051 .Env_var $EXTENSION .
2055 For further details on man\~page searching, see
2056 .BR man (1).
2059 .\" --------------------------------------------------------------------
2060 .SH DECOMPRESSION
2061 .\" --------------------------------------------------------------------
2063 The program has a decompression facility.
2065 If standard input or a file that was retrieved from the command line
2066 parameters is compressed with a format that is supported by either
2067 .BR gzip (1)
2069 .BR bzip2 (1)
2070 it is decompressed on-the-fly.
2072 This includes the GNU
2073 .BR .gz ,
2074 .BR .bz2 ,
2075 and the traditional
2076 .B .Z
2077 compression.
2079 The program displays the concatenation of all decompressed input in
2080 the sequence that was specified on the command line.
2083 .\" --------------------------------------------------------------------
2084 .SH "ENVIRONMENT"
2085 .\" --------------------------------------------------------------------
2087 The groffer programs supports many system variables, most of them by
2088 courtesy of other programs.
2090 All environment variables of
2091 .BR groff (@MAN1EXT@)
2092 and GNU
2093 .BR man (1)
2094 and some standard system variables are honored.
2097 .\" --------------------------------------------------------------------
2098 .SS "Native groffer Variables"
2099 .\" --------------------------------------------------------------------
2102 .Env_var $GROFFER_OPT
2103 Store options for a run of groffer.
2105 The options specified in this variable are overridden by the options
2106 given on the command line.
2108 The content of this variable is run through the shell builitin `eval';
2109 so arguments containing white-space or special shell characters should
2110 be quoted.
2113 .\" --------------------------------------------------------------------
2114 .SS "System Variables"
2115 .\" --------------------------------------------------------------------
2117 The groffer program is a shell script that is run through
2118 .BR /bin/sh ,
2119 which can be internally linked to programs like
2120 .BR bash (1).
2121 The corresponding system environment is automatically effective.
2123 The following variables have a special meaning for groffer.
2127 .Env_var $DISPLAY
2128 If this variable is set this indicates that the X window system is
2129 running.
2131 Testing this variable decides on whether graphical or text output is
2132 generated.
2134 This variable should not be changed by the user carelessly, but it can
2135 be used to start the graphical groffer on a remote X terminal.
2137 For example, depending on your system, groffer can be started on the
2138 second monitor by the command
2139 .Shell_cmd DISPLAY=:0.1\~groffer\~ what.ever &
2143 .Env_var $LC_ALL
2144 .TP+
2145 .Env_var $LC_MESSAGES
2146 .TP+
2147 .Env_var $LANG
2148 If one of these variables is set (in the above sequence), its content
2149 is interpreted as the locale, the language to be used, especially when
2150 retrieving man\~pages.
2152 A locale name is typically of the form
2153 .IR language [\c
2154 .B _\c
2155 .IR territory [\c
2156 .B .\c
2157 .IR codeset [\c
2158 .B @\c
2159 .IR modifier ]]],
2160 where
2161 .I language
2162 is an ISO 639 language code,
2163 .I territory
2164 is an ISO 3166 country code, and
2165 .I codeset
2166 is a character set or encoding identifier like ISO-8859-1 or UTF-8;
2168 .BR setlocale (3).
2170 The locale values\~\c
2171 .B C
2173 .B POSIX
2174 stand for the default, i.e. the man\~page directories without a
2175 language prefix.
2177 This is the same behavior as when all 3\~variables are unset.
2181 .Env_var $PAGER
2182 This variable can be used to set the pager for the tty output.
2184 For example, to disable the use of a pager completely set this
2185 variable to the
2186 .BR cat (1)
2187 program
2188 .Shell_cmd PAGER=cat\~groffer\~ anything
2192 .Env_var $PATH
2193 All programs within the groffer shell script are called without a
2194 fixed path.
2196 Thus this environment variable determines the set of programs used
2197 within the run of groffer.
2201 .Env_var $POSIXLY_CORRECT
2202 If set to a non-empty value this chooses the POSIX mode for option
2203 processing, that means that option processing will be finished as soon
2204 as a non-option argument is found.
2206 Usually, you do not want to set this environment variable.
2209 .\" --------------------------------------------------------------------
2210 .SS "Groff Variables"
2211 .\" --------------------------------------------------------------------
2213 The groffer program internally calls groff, so all environment
2214 variables documented in
2215 .BR groff (@MAN1EXT@)
2216 are internally used within groffer as well.
2218 The following variables have a direct meaning for the groffer program.
2221 .Env_var $GROFF_TMPDIR
2222 If the value of this variable is an existing, writable directory,
2223 groffer uses it for storing its temporary files, just as groff does.
2226 .\" --------------------------------------------------------------------
2227 .SS "Man Variables"
2228 .\" --------------------------------------------------------------------
2230 Parts of the functionality of the man\~program were implemented in
2231 groffer; support for all environment variables documented in
2232 .BR man (1)
2233 was added to groffer, but the meaning was slightly modified due to the
2234 different approach in groffer; but the user interface is the same.
2236 The man environment variables can be overwritten by options provided
2237 with
2238 .Env_var $MANOPT ,
2239 which in turn is overwritten by the command line.
2243 .Env_var $EXTENSION
2244 Restrict the search for man\~pages to files having this extension.
2246 This is overridden by option
2247 .Opt_long extension ;
2248 see there for details.
2252 .Env_var $MANOPT
2253 This variable contains options as a preset for
2254 .BR man (1).
2255 As not all of these are relevant for groffer only the essential parts
2256 of its value are extracted.
2258 The options specified in this variable overwrite the values of the
2259 other environment variables taht are specific to man.
2261 All options specified in this variable are overridden by the options
2262 given on the command line.
2266 .Env_var $MANPATH
2267 If set, this variable contains the directories in which the man\~page
2268 trees are stored.
2270 This is overridden by option
2271 .Opt_long manpath .
2275 .Env_var $MANSECT
2276 If this is a colon separated list of section names, the search for
2277 man\~pages is restricted to those manual sections in that order.
2279 This is overridden by option
2280 .Opt_long sections .
2284 .Env_var $SYSTEM
2285 If this is set to a comma separated list of names these are interpreted
2286 as man\~page trees for different operating systems.
2288 This variable can be overwritten by option
2289 .Opt_long systems ;
2290 see there for details.
2294 The environment variable
2295 .Env_var $MANROFFSEQ
2296 is ignored by groffer because the necessary preprocessors are
2297 determined automatically.
2300 .\" --------------------------------------------------------------------
2301 .SH "CONFIGURATION FILES"
2302 .\" --------------------------------------------------------------------
2304 The groffer program can be preconfigured by two configuration files.
2306 Both of them are shell scripts that are called at the beginning of
2307 groffer using the `\c
2308 .CB .\~\c
2309 .IR filename '
2310 syntax.
2314 .File_name /etc/groff/groffer.conf
2315 System-wide configuration file for groffer.
2319 .File_name $HOME/.groff/groffer.conf
2320 User-specific configuration file for groffer, where
2321 .Env_var $HOME
2322 denotes the user's home directory.
2324 This script is called after the system-wide configuration file to
2325 enable overriding by the user.
2329 It makes sense to use these configuration files for the following
2330 tasks:
2332 .Topic
2333 Preset environment variables recognized by groffer; preferably a
2334 variable should only be set when it is unset in order not to override
2335 a user-provided value.
2337 .Topic
2338 Preset command line options by prepending them to
2339 .Env_var $GROFFER_OPT ;
2340 prepending should be preferred to appending and setting in order not
2341 to delete the environment variable provided by the 
2343 .Topic
2344 Write a function for calling a viewer program for a special
2345 .I mode
2346 and feed this name into its corresponding
2347 .Opt_long \f[I]mode\f[]\-viewer
2348 option.
2350 Note that the name of such a function must coincide with some existing
2351 program in the system path
2352 .Env_var $PATH
2353 in order to be recognized by groffer.
2357 As an example, consider the following configuration file.
2360 .ft CR
2363 #! /bin/sh
2364 # ~/.groff/groffer.conf
2365 if test "$DISPLAY" = ""; then
2366   DISPLAY='localhost:0.0';
2368 GROFF_OPT="--resolution=100 $GROFF_OPT";
2369 gxditview()
2371   /usr/local/bin/gxditview --fg DarkBlue "$@";
2373 GROFF_OPT="--x-viewer gxditview $GROFF_OPT";
2380 This has the following effects:
2381 .Topic
2382 allows to start groffer in a graphical mode (here on first running X
2383 display by
2384 .IR localhost:0.0 )
2385 even from a text terminal (empty
2386 .Env_var $DISPLAY );
2387 .Topic
2388 all graphical modes use a resolution of
2389 .I 100 dpi
2390 where applicable;
2391 .Topic
2393 .BR gxditview (@MAN1EXT@)
2394 program is told to use
2395 .I DarkBlue
2396 as the text color by defining a shell function with the program's name
2397 .Topic
2398 force
2399 .I gxditview
2400 to be used in X mode by option
2401 .Opt_long x\­viewer .
2405 These configurations can be overridden by command line options and by
2406 environment variable
2407 .Env_var $GROFFER_OPT .
2410 .\" --------------------------------------------------------------------
2411 .SH "EXAMPLES"
2412 .\" --------------------------------------------------------------------
2414 The usage of groffer is very easy.
2416 Usually, it is just called with a file name or man\~page.
2418 The following examples, however, show that groffer has much more fancy
2419 capabilities.
2423 .Shell_cmd "groffer\~/usr/local/share/doc/groff/meintro.ms.gz"
2424 Decompress, format and display the compressed file
2425 .I meintro.ms.gz
2426 in the directory
2427 .IR /usr/local/share/doc/groff ,
2428 using a default graphical viewer when in X window, or the
2429 .BR less (1)
2430 pager program when not in X.
2434 .Shell_cmd "groffer\~groff.7\~groff\~\[cq]troff(1)\[cq]\~man:roff"
2436 The arguments that are not existing files are looked-up as the
2437 following man\~pages:
2438 .I groff
2439 (in man\~section\~7),
2440 .I groff
2441 (automatic search, should be found in man\~section\~1),
2442 .I troff
2443 (in section\~1),
2445 .I roff
2446 (in the section with the lowest number, being\~7 in this case).
2448 The quotes around
2449 .I \[cq]troff(1)\[cq]
2450 are necessary because the paranthesis are special shell characters;
2451 escaping them with a backslash character
2452 .I \[rs](
2454 .I \[rs])
2455 would be possible, too.
2457 The formatted files are concatenated and displayed in one piece.
2461 .Shell_cmd "LANG=de\~groffer\~--man\~--www\~--www-viever=netscape\~ls"
2463 Retrieve the German man\~page (language
2464 .IR de )
2465 for the
2466 .B ls
2467 program (the English version is used if there is no German version),
2468 decompress it, format it into the html format (www mode) and view the
2469 result in the default web browser
2470 .I netscape .
2471 The option
2472 .Opt_long man
2473 guarantees that the man\~page is retrieved, even when a local file
2474 .I ls
2475 exists in the actual directory.
2479 .Shell_cmd "groffer\~-Q\~'man:roff(7)'"
2481 Get the man\~page called
2482 .I roff
2483 in man\~section 7 and print its unformatted content (source code
2484 because of option
2485 .Opt_short Q )
2486 on standard output.
2490 .Shell_cmd "cat\~file.gz\~|\~groffer\~-Z\~-mfoo"
2492 Decompress the standard input, switch to
2493 .I groff
2494 using macro package
2495 .I foo
2496 (groff option
2497 .Opt_short m ) in non-postprocessing mode (groff option
2498 .Opt_short Z );
2499 this produces the groff intermediate output, see
2500 .BR groff_out (@MAN7EXT@).
2504 .Shell_cmd "echo\~'\[rs]f[CB]WOW!'\~|"
2505 .TP+
2506 .Shell_cmd+ "groffer --x --bg red --fg yellow --geometry 200x100 -"
2508 Display the word \f[CB]WOW!\f[] in a small window in constant-width
2509 bold font, using color yellow on red background.
2512 .\" --------------------------------------------------------------------
2513 .SH "COMPATIBILITY"
2514 .\" --------------------------------------------------------------------
2517 .B groffer
2518 shell script is compatible to both POSIX and GNU.
2520 POSIX compatibility refers to
2521 .B IEEE P1003.2/D11.2
2522 of September 1991, a very early version of this standard.
2524 The script uses only a quite restricted set of shell language elements
2525 and shell builtins, common to all POSIX versions; the only external
2526 program used is `sed', again only the most basic POSIX features of
2527 `sed' are used.
2529 The groffer script should work on most actual free and commercial
2530 operating systems.
2534 The groffer program provides its own parser for command line options;
2535 it can handle option arguments and file names containing white space
2536 and a large set of special characters.
2540 The groffer shell script was tested with the following common
2541 implementations of the POSIX shell:
2542 .BR ash (1),
2543 .BR bash (1),
2544 .BR ksh (1),
2545 POSIX
2546 .BR sh (1),
2547 and others.
2549 Free POSIX compatible shells and shell utilities for most operating
2550 systems are available at the
2551 .URL http://\:www.gnu.org/software/ "GNU software archive" .
2555 The best performance was obtained with the
2556 .I ash
2557 shell; so groffer tries to run under
2558 .I ash
2559 whenever possible.
2561 If not available the shell under which the script was started in the
2562 first place is used instead.
2564 This can be modified by the option
2565 .Opt_long shell .
2569 The groffer program provides its own parser for command line arguments
2570 that is compatible to both POSIX
2571 .BR getopts (1)
2572 and GNU
2573 .BR getopt (1).
2575 The following usual types of options are supported.
2578 .Topic
2579 A single minus always refers to single character options, for example,
2580 .Opt_short Qmfoo
2581 is equivalent to
2582 .Opt_short Q\~\-m\~foo.
2585 .Topic
2586 Long options that means option with names longer than one character
2587 are always prededed by a double minus; an option argument can either
2588 go to the next command line argument or be appended with an equal sign
2589 to the argument; for example,
2590 .Opt_alt -- long=arg
2591 is equivalent to
2592 .Opt_alt -- long\~arg .
2595 .Topic
2596 An argument of
2597 .Opt_--
2598 ends option parsing; all further command line arguments are
2599 interpreted as filespec arguments.
2602 .Topic
2603 By default, all command line arguments that are neither options nor
2604 option arguments are interpreted as filespec parameters and stored
2605 until option parsing has finished.
2607 For example, the command line
2608 .Shell_cmd "groffer file1 -a -o arg file2"
2609 is, by default, equivalent to
2610 .Shell_cmd "groffer -a -o arg -- file1 file2"
2614 This behavior can be changed by setting the environment variable
2615 .Env_var $POSIXLY_CORRECT
2616 to a non-empty value; in this case, option processing is stopped as
2617 soon as the first non-option argument is found.
2619 For example, in posixly correct mode, the command line
2620 .Shell_cmd "groffer file1 -a -o arg file 2"
2621 is equivalent to
2622 .Shell_cmd "groffer -- file1 -a -o arg file 2"
2623 As this leads to unwanted behavior in most cases, most people do not
2624 want to set
2625 .Env_var $POSIXLY_CORRECT .
2628 .\" --------------------------------------------------------------------
2629 .SH "SEE ALSO"
2630 .\" --------------------------------------------------------------------
2633 .BR groff (@MAN1EXT@)
2634 .TP+
2635 .BR troff (@MAN1EXT@)
2636 Details on the options and environment variables available in groff;
2637 all of them can be used with groffer.
2641 .BR grog (@MAN1EXT@)
2642 Internally, groffer tries to guess the groff command line options from
2643 the input using this program.
2647 .BR groff_out (@MAN5EXT@)
2648 Documentation on the groff intermediate output (ditroff output).
2652 .BR xdvi (1)
2653 .TP+
2654 .BR dvilx (1)
2655 Viewers for groffer's
2656 .I dvi
2657 mode.
2661 .BR gv (1)
2662 .TP+
2663 .BR ghostview (1)
2664 Viewers for groffer's
2665 .I ps
2666 mode.
2669 .TP+
2670 .BR gs (1)
2671 Transformer from
2672 .I ps
2674 .IR pdf ;
2675 and a
2676 .I ps
2677 viewer.
2681 .BR xpdf (1)
2682 Viewers for
2683 .I pdf
2684 files.
2688 .BR gxditview (@MAN1EXT@)
2689 .TP+
2690 .BR xditview (1x)
2691 Viewers for groffer's
2692 .I x
2693 mode.
2697 .BR gzip (1)
2698 .TP+
2699 .BR bzip2 (1)
2700 The decompression programs supported by groffer.
2704 .BR man (1)
2705 The standard program to diplay man\~pages.
2707 The information there is only useful if it is the man\~page for
2708 .IR "GNU\~man" .
2709 Then it documents the options and environment variables that are
2710 supported by groffer.
2713 .\" --------------------------------------------------------------------
2714 .SH "AUTHOR"
2715 .\" --------------------------------------------------------------------
2717 Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
2720 This document is distributed under the terms of the FDL (GNU Free
2721 Documentation License) version 1.1 or later.
2723 You should have received a copy of the FDL on your system, it is also
2724 available on-line at the
2725 .URL http://\:www.gnu.org/\:copyleft/\:fdl.html "GNU copyleft site" .
2728 This document is part of
2729 .IR groff ,
2730 the GNU roff distribution.
2732 It was written by
2733 .MTO bwarken@mayn.de "Bernd Warken" .
2735 .cp \n[groffer_C]
2737 \" --------------------------------------------------------------------
2738 .\" Emacs settings
2739 .\" --------------------------------------------------------------------
2741 .\" Local Variables:
2742 .\" mode: nroff
2743 .\" End: