* release of groffer 0.9.21
[s-roff.git] / contrib / groffer / groffer.man
blobb5af5fafc3509a066aeea77e2bea69294770545b
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 Last update : 2 August 2005
20 Source file position: <groff-source>/contrib/groffer/groffer.man
22 .de author
23 This file was written by \m[blue]Bernd Warken\m[].
25 .de copyleft
26 Copyright (C) 2001,2002,2004,2005 Free Software Foundation, Inc.
29 This file is part of
30 .IR \%groffer ,
31 which is part of
32 .IR \%groff ,
33 a free software project.
35 You can redistribute it and/or modify it under the terms of the
36 .nh
37 .B GNU General Public License
38 .hy
39 as published by the
40 .nh
41 .BR "Free Software Foundation" ,
42 .hy
43 either version 2, or (at your option) any later version.
46 You should have received a copy of the GNU General Public License
47 along with
48 .IR groff ,
49 see the files \%\f[CB]COPYING\f[] and \%\f[CB]LICENSE\f[] in the top
50 directory of the
51 .I groff
52 source package.
54 Or read the
55 .I man\~page
56 .BR gpl (1).
57 You can also write to the
58 .nh
59 .B Free Software Foundation, 51 Franklin St - Fifth Floor, Boston,
60 .BR "MA 02110-1301, USA" .
61 .hy
64 .\" --------------------------------------------------------------------
65 .\" Setup
66 .\" --------------------------------------------------------------------
68 .mso www.tmac
70 .if n \{\
71 .  mso tty-char.tmac
72 .  ftr CR R
73 .  ftr CI I
74 .  ftr CB B
75 .\}
77 .if '\*[.T]'dvi' \{\
78 .  ftr CB CW
79 .\}
81 .ds Ellipsis ".\|.\|.\""
83 .\" --------------------------------------------------------------------
84 .\" setup for the macro definitions below
85 .\"
86 .\" naming:  namespace:cathegory_macro.variable_name  (experimental)
88 .\" --------------------------------------------------------------------
89 .\" configuration of prompt for `.Shell_cmd'* macros
90 .ds groffer:Shell_cmd.prompt_text sh#\"    prompt for shell commands
91 .ds groffer:Shell_cmd+.prompt_text >\"     prompt on continuation lines
92 .ds groffer:Shell_cmd_base.prompt_font I\" font for prompts
94 .\" automatically determine setup from the configuration above
95 .als @f groffer:Shell_cmd_base.prompt_font\"
96 .als @t groffer:Shell_cmd.prompt_text\"
97 .als @t+ groffer:Shell_cmd+.prompt_text\"
98 .ds groffer:Shell_cmd.prompt \f[\*[@f]]\*[@t]\f[]\"            needed
99 .ds groffer:Shell_cmd+.prompt \f[\*[@f]]\*[@t+]\f[]\"          needed
100 .nr @w \w'\*[groffer:Shell_cmd.prompt]'\"
101 .nr @w+ \w'\*[groffer:Shell_cmd+.prompt]'\"
102 .ft \*[@f]
103 .\" Full prompt width is maximum of texts plus 1m
104 .nr groffer:Shell_cmd_base.prompt_width (\n[@w]>?\n[@w+]+1m)\" needed
106 .rm @f
107 .rm @f+
108 .rm @t
109 .rm @t+
110 .rr @w
111 .rr @w+
113 .\" --------------------------------------------------------------------
114 .\" static register for inter-macro communication in `.Synopsis'*
115 .nr groffer:Synopsis.level 0
117 .\" --------------------------------------------------------------------
118 .\" static registers for inter-macro communication in `.TP'*
119 .nr groffer:TP.level 0
120 .rr groffer:TP_header.flag
121 .rr groffer:TP_body.flag
122 .rr groffer:TP.indent
125 .\" --------------------------------------------------------------------
126 .\" Macro definitions
128 .\" Ignore all arguments like a comment, even after a .eo call.
129 .de c
131 .c --------------------------------------------------------------------
132 .c .CB  (<text>...)
134 .c Print in constant-width bold font.
136 .de CB
137 .  ft CB
138 .  Text \\$*
139 .  ft
141 .c --------------------------------------------------------------------
142 .c .CI  (<text>...)
144 .c Print in constant-width italic font.
146 .de CI
147 .  ft CI
148 .  Text \\$*
149 .  ft
151 .c --------------------------------------------------------------------
152 .c .CR  (<text>...)
154 .c Print in constant-width roman font.
156 .de CR
157 .  ft CR
158 .  Text \\$*
159 .  ft
161 .c --------------------------------------------------------------------
162 .c .Error  (<text>...)
164 .c Print error message to terminal and abort.
166 .de Error
167 .  tm \\$*
168 .  ab
170 .c --------------------------------------------------------------------
171 .c .Env_var  (<env_var_name> [<punct>])
173 .c Display an environment variable, with optional punctuation.
175 .de Env_var
176 .  nh
177 .  SM
178 .  Text \f[CB]\\$1\f[]\\$2
179 .  hy
181 .c --------------------------------------------------------------------
182 .c .File_name  (<path_name>)
184 .c Display a file or directory name in CB font.
186 .de File_name
187 .  Header_CB \\$@
189 .c --------------------------------------------------------------------
190 .c .Header_CB  (<path_name>)
192 .c Display a line in CB font, for example after .TP
194 .de Header_CB
195 .  nh
196 .  Text \f[CB]\\$1\f[]\\$2
197 .  hy
199 .c --------------------------------------------------------------------
200 .c .Opt_-  ([<punct>])
202 .c Print `-' (minus sign); optional punctuation. 
204 .de Opt_-
205 .  ie (\\n[.$] == 0) \
206 .    Opt_alt - ""
207 .  el \
208 .    Opt_alt - "" "\\$1"
210 .c --------------------------------------------------------------------
211 .c .Opt_[-]  ([<punct>])
213 .c Print `Opt_[-]' (minus sign in brackets); optional punctuation. 
215 .de Opt_[-]
216 .  ie (\\n[.$] == 0) \
217 .    Opt_[alt] - ""
218 .  el \
219 .    Opt_[alt] - "" "\\$1"
221 .c --------------------------------------------------------------------
222 .c .Opt_--  ([<punct>])
224 .c Print `--' (double minus); optional punctuation. 
226 .de Opt_--
227 .  ie (\\n[.$] == 0) \
228 .    Opt_alt -- ""
229 .  el \
230 .    Opt_alt -- "" "\\$1"
232 .c --------------------------------------------------------------------
233 .c .Opt_[--]  ([<punct>])
235 .c Print `Opt_[--]' (double minus in brackets); optional punctuation. 
237 .de Opt_[--]
238 .  ie (\\n[.$] == 0) \
239 .    Opt_[alt] -- ""
240 .  el \
241 .    Opt_[alt] -- "" "\\$1"
243 .c --------------------------------------------------------------------
244 .c .Opt_alt  ([<minus> <opt>]... [<arg> [<punct>]])
246 .c Alternate options separated by a vertical bar.
248 .c Arguments:
249 .c   minus: either `-' or `--' (font CB).
250 .c   opt: a name for an option, empty allowed (font CB).
251 .c   arg: optionally, the argument to the option (font I).
252 .c   punct: optional punctuation (in the starting font).
253 .c Result:
254 .c   The minus/opt argument pairs, each
255 .c   separated by a vertical bar `|', optionally add 'arg', separated
256 .c   a space character ` '.
258 .c Example:
259 .c  .Opt_alt - T -- device -- device-troff device .
260 .c  results in
261 .c  -T|--device|--device-troff device.
263 .de Opt_alt
264 .  Opt_alt_base "" | "" \\$@
266 .c --------------------------------------------------------------------
267 .c .Opt_[alt]  ([<minus> <opt>]... [<arg> [<punct>]])
269 .c Alternate options in brackets for section SYNOPSIS.
271 .c Arguments:
272 .c   minus: either `-' or `--' (font CB).
273 .c   opt: a name for an option, empty allowed (font CB).
274 .c   arg: optionally, the argument to the option (font I).
275 .c   punct: optional punctuation (in the starting font).
276 .c Global strings written to:
277 .c   `@oa_prefix': left enclosing character (`[')
278 .c   `@oa_sep': separator (`|')
279 .c   `@oa_postfix': right enclosing character (`]')
280 .c Result:
281 .c   The minus/opt argument pairs, each separated by a vertical
282 .c   bar `|', optionally add 'arg', separated by a space character ` '.
284 .c Example:
285 .c  .Opt_[alt] - T -- device -- device-troff device .
286 .c  results in
287 .c  [-T|--device|--device-troff device].
289 .de Opt_[alt]
290 .  Opt_alt_base [ | ] \\$@
292 .c --------------------------------------------------------------------
293 .c .Opt_alt_base  (<pre> <sep> <post> [<minus> <opt>]... [arg [punct]])
295 .c Alternating options; base macro for many others; do not use directly.
297 .c Arguments:
298 .c   <pre>: prefix, result is preceded by this.
299 .c   <sep>: separator between minus/opt pairs.
300 .c   <post>: postfix, is appended to the result.
301 .c   <minus>: either `-' or `--' (font CB).
302 .c   <opt>: a name for an option, empty allowed (font CB).
303 .c   <arg>: optionally, the argument to the option (font I).
304 .c   <punct>: optional punctuation (in the starting font).
305 .c Result:
306 .c   String `<pre>' followed by the <minus>/<opt> argument pairs, each
307 .c   separated by string `<sep>', optionally add '<arg>', separated by
308 .c   a single space ` ', followed by the string `<post>'.  Terminated
309 .c   by the optional punctuation <punct>.
311 .de Opt_alt_base
312 .  nr @font \\n[.f]\"
313 .  if (\\n[.$] < 3) \
314 .    Error .\\0: not enough arguments.
315 .  ds @pre \)\\$1\)\"                   prefix
316 .  ds @sep \)\\$2\)\"                   separator
317 .  ds @post \)\\$3\)\"                  postfix
318 .  shift 3
319 .  nr @count 0
320 .  ds @res \f[CR]\\*[@pre]\"
321 .  while (\\n[.$] >= 2) \{\
322 .    c                                  do the pairs, break on no `-'
323 .    if !'\\$1'-' \{\
324 .      if !'\\$1'--' \
325 .        break
326 .    \}
327 .    c                                  separator
328 .    if (\\n[@count] > 0) \
329 .      as @res \f[CR]\\*[@sep]\:\"
330 .    nr @count +1
331 .    c                                  combine minus with option name
332 .    as @res \f[CB]\\-\"
333 .    if '\\$1'--' \
334 .      as @res \\-\"
335 .    as @res \\$2\"
336 .    shift 2
337 .  \}
338 .  if (\\n[.$] >= 3) \
339 .    Error .\\0: wrong arguments: \\$@
340 .  c                                    all pairs are done
341 .  ie (\\n[.$] == 0) \
342 .    as @res \f[CR]\\*[@post]\"
343 .  el \{\
344 .    c                                  optional option argument
345 .    if !'\\$1'' \
346 .      as @res \f[CR] \,\f[I]\\$1\"
347 .    shift
348 .    c                                  postfix
349 .    as @res \\f[CR]\\*[@post]\"
350 .    if (\\n[.$] >= 1) \{\
351 .      c                                add punctuation
352 .      as @res \f[\\n[@font]]\\$1\"
353 .    \}
354 .  \}
355 .  nh
356 .  Text \\*[@res]
357 .  hy
358 .  ft \\n[@font]
359 .  rr @count
360 .  rr @font
361 .  rm @pre
362 .  rm @post
363 .  rm @sep
364 .  rm @res
366 .c --------------------------------------------------------------------
367 .c .Opt_def  ([<minus> <opt>]... [<arg> [<punct>]])
369 .c Definitions of options in section OPTIONS.
371 .c Arguments:
372 .c   minus: either `-' or `--' (font CB).
373 .c   opt: a name for an option, empty allowed (font CB).
374 .c   arg: optionally, the argument to the option (font I).
375 .c   punct: optional punctuation (in the starting font).
376 .c Result:
377 .c   The header for an indented paragraph, consisting of
378 .c   minus/opt argument pairs, each, separated by a space
379 .c   character ` ', optionally add 'arg', separated a space
380 .c   character ` '.
382 .c Example:
383 .c  .Opt_def - T -- device -- device-troff device .
384 .c  results in
385 .c  -T --device --device-troff device.
386 .c  as the header of for indented paragraph.
388 .de Opt_def
389 .  TP
390 .    Opt_alt_base "" "\~|\~" "" \\$@
392 .c --------------------------------------------------------------------
393 .c .Opt_element  ([<minus> <opt>]... [<arg> [<punct>]])
395 .c Definitions of options in section OPTIONS.
397 .c Arguments:
398 .c   minus: either `-' or `--' (font CB).
399 .c   opt: a name for an option, empty allowed (font CB).
400 .c   arg: optionally, the argument to the option (font I).
401 .c   punct: optional punctuation (in the starting font).
402 .c Result:
403 .c   The minus/opt argument pairs, each, separated by a space
404 .c   character ` ', optionally add 'arg', separated a space
405 .c   character ` '.
407 .c Example:
408 .c  .Opt_element - T -- device -- device-troff device .
409 .c  results in
410 .c  -T --device --device-troff device.
412 .de Opt_element
413 .  Opt_alt_base "" "\~" "" \\$@
415 .c --------------------------------------------------------------------
416 .als Opt_list Opt_element
418 .c --------------------------------------------------------------------
419 .c .Opt_long  ([<name> [<punct>]])
421 .c Print `--name' somewhere in the text; optional punctuation.
423 .de Opt_long
424 .  Opt_alt -- "\\$1" "" "\\$2"
426 .c --------------------------------------------------------------------
427 .c .Opt_long_arg  ([<name> <arg> [<punct>]])
429 .c Print `--name=arg' somewhere in the text; optional punctuation.
431 .de Opt_long_arg
432 .  Opt_alt -- "\\$1=\\$2" "" "\\$3"
434 .c --------------------------------------------------------------------
435 .c .Opt_[long]  ([<name> [<punct>]])
437 .c Print `--name' somewhere in the text; optional punctuation.
439 .de Opt_[long]
440 .  Opt_[alt] -- "\\$1" "" "\\$2"
442 .c --------------------------------------------------------------------
443 .c .Opt_short  ([<name> [<punct>]])
445 .c Print `-name' somewhere in the Text; optional punctuation.
447 .de Opt_short
448 .  Opt_alt - "\\$1" "" "\\$2"
450 .c --------------------------------------------------------------------
451 .c .Opt_[short]  ([name [punct]])
453 .c Print `[-name]' somewhere in the Text; optional punctuation.
455 .de Opt_[short]
456 .  Opt_[alt] - "\\$1" "" "\\$2"
458 .c --------------------------------------------------------------------
459 .c .Shell_cmd  (<CR> [<CI>] ...)
461 .c A shell command line; display args alternating in fonts CR and CI.
463 .c Examples:
464 .c   .Shell_cmd "groffer --dpi 100 file"
465 .c     result: `sh#  groffer --dpi 100 file'
466 .c             with 'sh#' in font I, the rest in CR
468 .c   .Shell_cmd groffer\~--dpi\~100\~file
469 .c     result: the same as above
471 .c   .Shell_cmd "groffer --dpi=" value " file"
472 .c     result: sh#  groffer --dpi=value file
473 .c             with `groffer --dpi=' and `file' in CR; `value' in CI
475 .c   .Shell_cmd groffer\~--dpi= value \~file
476 .c     result: the same as the previous example
478 .de Shell_cmd
479 .  groffer:Shell_cmd_base "\*[groffer:Shell_cmd.prompt]" \\$@
481 .c --------------------------------------------------------------------
482 .c .Shell_cmd+  (<CR> [<CI>] ...)
484 .c A continuation line for .Shell_cmd.
486 .de Shell_cmd+
487 .  groffer:Shell_cmd_base "\*[groffer:Shell_cmd+.prompt]" \\$@
489 .c --------------------------------------------------------------------
490 .c .Shell_cmd_base  (<prompt> [<CR> [<CI>] ...])
492 .c A shell command line; display args alternating in fonts CR and CI.
493 .c Internal, do not use directly.
495 .c Globals: read-only register @.Shell_cmd_width
497 .de groffer:Shell_cmd_base
498 .  if (\\n[.$] <= 0) \
499 .    return
500 .  nr @+font \\n[.f]\"
501 .  ds @prompt \\$1\"
502 .  ft CR
503 .  c gap between prompt and command
504 .  nr @+gap \\n[groffer:Shell_cmd_base.prompt_width]-\\w'\\*[@prompt]'\"
505 .  ds @res \\*[@prompt]\h'\\n[@+gap]u'\"
506 .  shift
507 .  ds @cf CR\"
508 .  while (\\n[.$] > 0) \{\
509 .    as @res \\f[\\*[@cf]]\\$1\"
510 .    shift
511 .    ie '\\*[@cf]'CR' \
512 .      ds @cf I\"
513 .    el \
514 .      ds @cf CR\"
515 .  \}
516 .  br
517 .  ad l
518 .  nh
519 .  nf
520 .  Text \\*[@res]\"
521 .  fi
522 .  hy
523 .  ad
524 .  br
525 .  ft \\n[@+font]
526 .  rr @+font
527 .  rr @+gap
528 .  rm @cf
529 .  rm @res
531 .c --------------------------------------------------------------------
532 .c .Synopsis  ()
534 .c Begin a synopsis section, to be ended by a ./Synopsis macro.
536 .de Synopsis
537 .  if (\\n[groffer:Synopsis.level] > 0) \
538 .    Error .\\$0: previous .Synopsis was not closed by ./Synopsis.
539 .  nh
540 .  ds @1 \\$1\"
541 .  nr @old_indent \\n(.i
542 .  ad l
543 .  in +\w'\fB\\*[@1]\0'u
544 .  ti \\n[@old_indent]u
545 .  B \\*[@1]\0\c
546 .  rr @old_indent
547 .  rm @1
548 .  nr groffer:Synopsis.level +1\"        marker for ./Synopsis
550 .c  --------------------------------------------------------------------
551 .c ./Synopsis  ()
553 .c Close a synopsis section opened by the previous .Synopsis macro.
555 .de /Synopsis
556 .  if (\\n[groffer:Synopsis.level] <= 0) \
557 .    Error .\\$0: no previous call of .Synopsis
558 .  br
559 .  ad
560 .  in
561 .  hy
562 .  nr groffer:Synopsis.level -1
564 .c  --------------------------------------------------------------------
565 .c .Text  (<text>...)
567 .c Treat the arguments as text, no matter how they look.
569 .de Text
570 .  if (\\n[.$] == 0) \
571 .    return
572 .  nh
573 .  nop \)\\$*\)
574 .  hy
576 .c --------------------------------------------------------------------
577 .c .Topic  ([<indent>])
579 .c A bulleted paragraph
581 .de Topic
582 .  ie (\\n[.$] = 0) \
583 .    ds @indent 2m\"
584 .  el \
585 .    ds @indent \\$1\"
586 .  TP \\*[@indent]
587 .  Text \[bu]
588 .  rm @indent
590 .c --------------------------------------------------------------------
591 .c .TP+  ()
593 .c Continuation line for .TP header.
595 .de TP+
596 .  br
597 .  ns
598 .  TP \\$1
600 .c --------------------------------------------------------------------
601 .c .TP_header  ([<indent>])
603 .c Start a multi-line header for a .TP-like paragraph
605 .de TP_header
606 .  if (\\n[groffer:TP.level] < 0) \
607 .    Error .\\$0: wrong level.
608 .  nr groffer:TP.level +1
609 .  P
610 .  ie (\\n[.$] == 0) \
611 .    rr groffer:TP.indent
612 .  el \
613 .    nr groffer:TP.indent \\$1
614 .  nr groffer:TP_header.flag 1
616 .c --------------------------------------------------------------------
617 .c .TP_body  ([<indent>])
619 .c End a previous .TP-header and beging the body of the paragraph.
621 .de TP_body
622 .  if !rgroffer:TP_header.flag \
623 .    Error .\\$0: no previous call of .TP_header
624 .  if (\\n[groffer:TP.level] <= 0) \
625 .    Error .\\$0: wrong level.
626 .  br
627 .  ie (\\n[.$] == 0) \{\
628 .    ie rgroffer:TP.indent \{\
629 .      RS \\n[groffer:TP.indent]u
630 .    \}
631 .    el \
632 .      RS
633 .  \}
634 .  el \
635 .    RS \\$1u
636 .  rr groffer:TP.indent
637 .  rr groffer:TP_header.flag
638 .  nr groffer:TP_body.flag 1
640 .c --------------------------------------------------------------------
641 .c TP_end  ()
643 .c End of former .TP_body paragraph.
645 .de TP_end
646 .  if !rgroffer:TP_body.flag \
647 .    Error .\\$0: no previous .TP_body.
648 .  if (\\n[groffer:TP.level] <= 0) \
649 .    Error TP_end: wrong level.
650 .  nr groffer:TP.level -1
651 .  rr grogger:TP.indent
652 .  rr groffer:TP_header.flag
653 .  rr groffer:TP_body.flag
654 .  br
655 .  RE
658 .\" End of macro definitions
661 .\" --------------------------------------------------------------------
662 .\" SH "SYNOPSIS"
663 .\" --------------------------------------------------------------------
665 .ad l
666 .Synopsis groffer
667 .RI [ option... ]
668 .Opt_[--]
669 .RI [ "filespec" "\*[Ellipsis]]"
670 ./Synopsis
672 .Synopsis groffer
673 .Opt_alt -- apropos -- apropos-data -- apropos-devel -- apropos-progs name
674 ./Synopsis
676 .Synopsis groffer
677 .Opt_alt - h -- help
678 ./Synopsis
680 .Synopsis groffer
681 .Opt_alt - v -- version
682 ./Synopsis
685 .\" --------------------------------------------------------------------
686 .SH DESCRIPTION
687 .\" --------------------------------------------------------------------
690 .B \%groffer
691 program is the easiest way to use
692 .BR \%groff (@MAN1EXT@).
693 It can display arbitrary documents written in the
694 .BR \%groff (@MAN7EXT@)
695 language or other
696 .BR \%roff (@MAN7EXT@)
697 languages that are compatible to the original
698 .I \%troff
699 language.
702 .B \%groffer
703 program also includes many of the features for finding and displaying
704 the \%UNIX manual pages
706 .RI ( man\~pages ),
708 such that it can be used as a replacement for a
709 .BR \%man (1)
710 program.
712 Moreover, compressed files that can be handled by
713 .BR \%gzip (1)
715 .BR \%bzip2 (1)
716 are decompressed on-the-fly.
720 The normal usage is quite simple by supplying a file name or name of a
721 .I \%man\~page
722 without further options.
724 But the option handling has many possibilities for creating special
725 behaviors.
727 This can be done either in configuration files, with the shell
728 environment variable
729 .BR \%$GROFFER_OPT ,
730 or on the command line.
732 For example, it makes sense to specify a faster shell in a
733 configuration file.
737 The output can be generated and viewed in several different ways
738 available for
739 .IR \%groff .
741 This includes the
742 .I \%groff
743 native X\~\%viewer
744 .BR \%gxditview (@MAN1EXT@),
745 each Postcript or
746 .I \%dvi
747 display program, a web browser by generating
748 .I \%html
750 .IR \%www\~mode ,
751 or several
752 .I \%text\~modes
753 in text terminals.
757 Most of the options that must be named when running
758 .B \%groff
759 directly are determined automatically for
760 .BR \%groffer ,
761 due to the internal usage of the
762 .BR \%grog (@MAN1EXT@)
763 program.
765 But all parts can also be controlled manually by arguments.
769 Several file names can be specified on the command line arguments.
771 They are transformed into a single document in the normal way of
772 .BR \%groff .
776 Option handling is done in GNU style.
778 Options and file names can be mixed freely.
780 The option
781 .RB ` \-\- '
782 closes the option handling, all following arguments are treated as
783 file names.
785 Long options can be abbreviated.
788 .\" --------------------------------------------------------------------
789 .SH "OPTION OVERVIEW"
790 .\" --------------------------------------------------------------------
793 .I breaking options
796 .Opt_[alt] -- apropos name
797 .Opt_[alt] -- apropos\-data name
798 .Opt_[alt] -- apropos\-devel name
799 .Opt_[alt] -- apropos\-progs name
800 .Opt_[alt] - h -- help
801 .Opt_[alt] - v -- version
806 .I \%groffer mode options
809 .Opt_[alt] -- auto
810 .Opt_[alt] -- default
811 .Opt_[alt] -- default\-modes mode1,mode2,\*[Ellipsis]
812 .Opt_[alt] -- dvi
813 .Opt_[alt] -- dvi\-viewer prog
814 .Opt_[alt] -- groff
815 .Opt_[alt] -- html
816 .Opt_[alt] -- html\-viewer prog
817 .Opt_[alt] -- man
818 .Opt_[alt] -- mode display_mode
819 .Opt_[alt] -- no-man
820 .Opt_[alt] -- pdf
821 .Opt_[alt] -- pdf\-viewer prog
822 .Opt_[alt] -- ps
823 .Opt_[alt] -- ps\-viewer prog
824 .Opt_[alt] -- text
825 .Opt_[alt] -- tty
826 .Opt_[alt] -- tty\-viewer prog
827 .Opt_[alt] -- www
828 .Opt_[alt] -- www\-viewer prog
829 .Opt_[alt] -- x -- X
830 .Opt_[alt] -- x\-viewer -- X\-viewer prog
835 .I development options
838 .Opt_[alt] -- debug
839 .Opt_[alt] -- do\-nothing
840 .Opt_[alt] -- shell prog
841 .Opt_[alt] - Q -- source
842 .Opt_[alt] - V
847 .I options related to \%groff
850 .Opt_[alt] - T -- device device
851 .Opt_[alt] - Z -- intermediate\-output -- ditroff
853 All further
854 .B \%groff
855 short options are accepted.
860 .I X\~\%Window\~\%Toolkit options
863 .Opt_[alt] -- bd pixels
864 .Opt_[alt] -- bg -- background color
865 .Opt_[alt] -- bw pixels
866 .Opt_[alt] -- display X-display
867 .Opt_[alt] -- fg -- foreground color
868 .Opt_[alt] -- ft -- font font_name
869 .Opt_[alt] -- geometry size_pos
870 .Opt_[alt] -- resolution value
871 .Opt_[alt] -- rv
872 .Opt_[alt] -- title string
873 .Opt_[alt] -- xrm X-resource
878 .I options from GNU man
881 .Opt_[alt] -- all
882 .Opt_[alt] -- ascii
883 .Opt_[alt] -- ditroff
884 .Opt_[alt] -- extension suffix
885 .Opt_[alt] -- locale language
886 .Opt_[alt] -- local-file
887 .Opt_[alt] -- manpath dir1:dir2:\*[Ellipsis]
888 .Opt_[alt] -- pager program
889 .Opt_[alt] -- sections sec1:sec2:\*[Ellipsis]
890 .Opt_[alt] -- systems sys1,sys2,\*[Ellipsis]
891 .Opt_[alt] -- troff-device device
892 .Opt_[alt] -- whatis
894 Further long options of GNU
895 .B man
896 are accepted as well.
901 .I filespec argument
905 .I filespec
906 parameters means standard input.
909 .TP 10m
910 .Opt_short ""
911 stands for standard input (can occur several times).
915 .I filename
916 the path name of an existing file.
920 .BI man: name ( section )
921 .TP+
922 .IB name ( section )
923 search the \%man\~page
924 .I \%name
925 in \%man\~section
926 .IR section .
930 .BI man: name . s
931 .TP+
932 .IB name . s
934 .I s
935 is a character in
936 .BR \%[1-9on] ,
937 search for a \%man\~page
938 .I \%name
939 in \%man\~section
940 .IR s .
944 .BI man: name
945 \%man\~page in the lowest \%man\~section that has
946 .IR \%name .
950 .I "s name"
952 .I s
953 is a character in
954 .BR \%[1-9on] ,
955 search for a \%man\~page
956 .I \%name
957 in \%man\~section
958 .IR s .
962 .I name
963 if 
964 .I \%name
965 is not an existing file search for the man\~page
966 .I \%name
967 in the lowest man\~section.
972 .\" --------------------------------------------------------------------
973 .SH "OPTION DETAILS"
974 .\" --------------------------------------------------------------------
977 .B \%groffer
978 program can usually be run with very few options.
980 But for special purposes, it supports many options.
982 These can be classified in 5 option classes.
986 All short options of
987 .B \%groffer
988 are compatible with the short options of
989 .BR \%groff (@MAN1EXT@).
991 All long options of
992 .B \%groffer
993 are compatible with the long options of
994 .BR \%man (1).
997 .\" --------------------------------------------------------------------
998 .SS "groffer breaking Options"
999 .\" --------------------------------------------------------------------
1001 As soon as one of these options is found on the command line it is
1002 executed, printed to standard output, and the running
1003 .B \%groffer
1004 is terminated thereafter.
1006 All other arguments are ignored.
1009 .Opt_def -- apropos name
1010 Start the
1011 .BR \%apropos (1)
1012 command for searching within
1013 .I \%man\~page
1014 descriptions.
1016 That slightly differs from the strange behavior of the
1017 .Opt_long apropos
1018 program of
1019 .BR \%man (1),
1020 which has no argument of its own, but takes the file arguments
1021 instead.
1023 Practically both concepts are compatible.
1026 .Opt_def -- apropos\-data name
1027 Show only the
1028 .BR \%apropos (1)
1029 descriptions for data documents, in the
1030 .BR \%man (7)
1031 sections 4, 5, and 7.
1034 .Opt_def -- apropos\-devel name
1035 Show only the
1036 .BR apropos (1)
1037 descriptions for development documents, in the
1038 .BR man (7)
1039 sections 2, 3, and 9.
1042 .Opt_def -- apropos\-progs name
1043 Show only the
1044 .BR \%apropos (1)
1045 descriptions for documents on programs, in the
1046 .BR \%man (7)
1047 sections 1, 6, and 8.
1050 .Opt_def - h -- help
1051 Print a helping information with a short explanation of option sto
1052 standard output.
1055 .Opt_def - v -- version
1056 Print version information to standard output.
1059 .\" --------------------------------------------------------------------
1060 .SS "groffer Mode Options"
1061 .\" --------------------------------------------------------------------
1063 The display mode and the viewer programs are determined by these
1064 options.
1066 If none of these mode and viewer options is specified
1067 .B \%groffer
1068 tries to find a suitable display mode automatically.
1071 .Opt_def -- auto
1072 Equivalent to
1073 .Opt_long_arg mode auto .
1076 .Opt_def -- default
1077 Reset all configuration from previously processed command line options
1078 to the default values.
1080 This is useful to wipe out all former options of the configuration, in
1081 .Env_var $GROFFER_OPT ,
1082 and restart option processing using only the rest of the command line.
1085 .Opt_def -- default\-modes mode1,mode2,\*[Ellipsis]
1086 Set the sequence of modes for
1087 .I \%auto\~mode
1088 to the comma separated list given in the argument.
1091 .Opt_long mode
1092 for details on modes.  Display in the default manner; actually, this
1093 means to try the modes
1094 .IR x ,
1095 .IR ps ,
1097 .I \%tty
1098 in this sequence.
1102 .Opt_def -- dvi
1103 Equivalent to
1104 .Opt_long_arg mode \%dvi .
1107 .Opt_def -- dvi\-viewer prog
1108 Set the viewer program for
1109 .IR \%dvi\~mode .
1111 This can be a file name or a program to be searched in
1112 .Env_var $PATH .
1114 Known
1115 .I \%dvi
1116 viewers inlude
1117 .BR \%xdvi (1)
1119 .BR \%dvilx (1)
1121 In each case, arguments can be provided additionally.
1124 .Opt_def -- groff
1125 Equivalent to
1126 .Opt_long_arg mode groff .
1129 .Opt_def -- html
1130 Equivalent to
1131 .Opt_long_arg mode html .
1134 .Opt_def -- html\-viewer
1135 Set the web browser program for viewing in
1136 .I \%html\~mode .
1138 Each program that accepts html input and allows the
1139 .BI \%file://localhost/ dir / file
1140 syntax on the command line is suitable as viewer program; it can be
1141 the path name of an executable file or a program in
1142 .Env_var $PATH .
1144 In each case, arguments can be provided additionally.
1147 .Opt_def -- mode value
1149 Set the display mode.
1151 The following mode values are recognized:
1156 .Header_CB auto
1157 Select the automatic determination of the display mode.
1159 The sequence of modes that are tried can be set with the
1160 .Opt_long default\-modes
1161 option.
1163 Useful for restoring the
1164 .I \%default\~mode
1165 when a different mode was specified before.
1169 .Header_CB dvi
1170 Display formatted input in a
1171 .I \%dvi
1172 viewer program.
1174 By default, the formatted input is displayed with the
1175 .BR \%xdvi (1)
1176 program.
1177 .Opt_long dvi .
1181 .Header_CB groff
1182 After the file determination, switch
1183 .B \%groffer
1184 to process the input like
1185 .BR \%groff (@MAN1EXT@)
1186 would do.
1188 This disables the
1189 .I \%groffer
1190 viewing features.
1194 .Header_CB html
1195 Translate the input into html format and display the result in a web
1196 browser program.
1198 By default, the existence of a sequence of standard web browsers is
1199 tested, starting with
1200 .BR \%konqueror (1)
1202 .BR \%mozilla (1).
1203 The text html viewer is
1204 .BR \%lynx (1).
1208 .Header_CB pdf
1209 Display formatted input in a
1210 .I \%PDF
1211 (Portable Document Format) viewer
1212 program.
1214 By default, the input is formatted by
1215 .B \%groff
1216 using the Postscript device, then it is transformed into the PDF file
1217 format using
1218 .BR \%gs (1),
1219 and finally displayed either with the
1220 .BR \%xpdf (1)
1221 or the
1222 .BR \%acroread (1)
1223 program.
1225 PDF has a big advantage because the text is displayed graphically and
1226 is searchable as well.
1228 But as the transformation takes a considerable amount of time, this
1229 mode is not suitable as a default device for the
1230 .I \%auto\~mode .
1234 .Header_CB ps
1235 Display formatted input in a Postscript viewer program.
1237 By default, the formatted input is displayed with the
1238 .BR \%ghostview (@MAN1EXT@)
1239 program.
1243 .Header_CB text
1244 Format in a
1245 .I \%groff\~text\~mode
1246 and write the result to standard output without a pager or viewer
1247 program.
1249 The text device,
1250 .I \%latin1
1251 by default, can be chosen with option
1252 .Opt_short T .
1256 .Header_CB tty
1257 Format in a
1258 .I \%groff\~text\~mode
1259 and write the result to standard output using a text pager program,
1260 even when in X\~\%Window.
1264 .Header_CB www
1265 Equivalent to
1266 .Opt_long_arg mode html .
1270 .Header_CB x
1271 Display the formatted input in a native
1272 .I roff
1273 viewer.
1275 By default, the formatted input is displayed with the
1276 .BR \%gxditview (@MAN1EXT@)
1277 program being distributed together with
1278 .BR \%groff .
1279 But the standard X\~tool
1280 .BR \%xditview (1)
1281 can also be chosen with the option
1282 .Opt_long x\-viewer .
1283 The default resolution is
1284 .BR 75\~dpi ,
1286 .B 100\~dpi
1287 are also possible.
1289 The default
1290 .I groff
1291 device
1292 for the resolution of
1293 .B 75\~dpi
1295 .BR X75\-12 ,
1297 .B 100\~dpi
1298 it is
1299 .BR X100 .
1301 The corresponding
1302 .I "groff intermediate output"
1303 for the actual device is generated and the result is displayed.
1305 For a resolution of
1306 .BR 100\~dpi ,
1307 the default width of the geometry of the display program is chosen to
1308 .BR 850\~dpi .
1312 .Header_CB X
1313 Equivalent to
1314 .Opt_long_arg mode x .
1318 The following modes do not use the
1319 .I \%groffer
1320 viewing features.
1322 They are only interesting for advanced applications.
1326 .Header_CB groff
1327 Generate device output with plain
1328 .I \%groff
1329 without using the special viewing features of
1330 .IR \%groffer .
1331 If no device was specified by option
1332 .Opt_short T
1334 .I \%groff
1335 default
1336 .B \%ps
1337 is assumed.
1341 .Header_CB source
1342 Display the source code of the input without formatting; equivalent to
1343 .Opt_short Q .
1349 .Opt_def -- pdf
1350 Equivalent to
1351 .Opt_long_arg mode pdf .
1354 .Opt_def -- pdf\-viewer prog
1355 Set the viewer program for
1356 .IR \%pdf\~mode .
1358 This can be a file name or a program to be searched in
1359 .Env_var $PATH .
1361 In each case, arguments can be provided additionally.
1364 .Opt_def -- ps
1365 Equivalent to
1366 .Opt_long_arg mode ps .
1369 .Opt_def -- ps\-viewer prog
1370 Set the viewer program for
1371 .IR \%ps\~mode .
1373 This can be a file name or a program to be searched in
1374 .Env_var $PATH .
1376 Common Postscript viewers inlude
1377 .BR \%gv (1),
1378 .BR \%ghostview (1),
1380 .BR \%gs (1),
1382 In each case, arguments can be provided additionally.
1385 .Opt_def -- text
1386 Equivalent to
1387 .Opt_long_arg mode text .
1390 .Opt_def -- tty
1391 Equivalent to
1392 .Opt_long_arg mode tty .
1395 .Opt_def -- tty\-viewer prog
1396 Choose a text pager for mode
1397 .IR tty .
1398 The standard pager is
1399 .BR less (1).
1400 This option is eqivalent to
1401 .I man
1402 option
1403 .Opt_long_arg pager prog .
1406 .Opt_def -- www
1407 Equivalent to
1408 .Opt_long_arg mode html .
1411 .Opt_def -- www\-viewer prog
1412 Equivalent to
1413 .Opt_long html\-viewer .
1416 .Opt_def -- X -- x
1417 Equivalent to
1418 .Opt_long_arg mode x .
1421 .Opt_def -- X\-viewer -- x\-viewer prog
1422 Set the viewer program for
1423 .IR \%x\~mode .
1425 Suitable viewer programs are
1426 .BR \%gxditview (@MAN1EXT@)
1427 which is the default and
1428 .BR \%xditview (1).
1430 But the argument can be any executable file or a program in
1431 .Env_var $PATH .
1433 In each case, arguments can be provided additionally.
1437 .Opt_--
1438 Signals the end of option processing; all remaining arguments are
1439 interpreted as
1440 .I \%filespec
1441 parameters.
1445 Besides these,
1446 .B \%groffer
1447 accepts all arguments that are valid for the
1448 .BR \%groff (@MAN1EXT@)
1449 program.
1452 .RB \%non- groffer
1453 options are sent unmodified via
1454 .B \%grog
1456 .BR \%groff .
1458 Postprocessors, macro packages, compatibility with
1459 .I classical
1460 .IR \%troff ,
1461 and much more can be manually specified.
1464 .\" --------------------------------------------------------------------
1465 .SH "Options for Development"
1466 .\" --------------------------------------------------------------------
1468 .Opt_def -- debug
1469 Enable three debugging informations.
1471 A function call stack is printed at each opening and closing of a
1472 function call; a landmark information is printed to determine how far
1473 the program is running, and the early deletion of the temporary
1474 formatting files is prohibited.
1477 .Opt_def -- do-nothing
1478 This is like
1479 .Opt_long version ,
1480 but without the output; no viewer is started.
1482 This makes only sense in development.
1485 .Opt_def -- shell "shell_program"
1486 Specify the shell under which the
1487 .File_name \%groffer2.sh
1488 script should be run.
1490 If the argument
1491 .I shell_program
1492 is empty a former shell option is cancelled and the default shell is
1493 restored.
1495 Some shells run considerably faster than the standard shell.
1497 It makes sense to set this option in a configuration file.
1500 .Opt_def - Q -- source
1501 Output the roff source code of the input files without further
1502 processing.
1504 This is the equivalent
1505 .Opt_long_arg mode source .
1508 .Opt_def - V
1509 This is an advanced option for debugging only.
1511 Instead of displaying the formatted input, a lot of
1512 .I \%groffer
1513 specific information is printed to standard output:
1516 .Topic
1517 the output file name in the temporary directory,
1519 .Topic
1520 the display mode of the actual
1521 .B \%groffer
1522 run,
1524 .Topic
1525 the display program for viewing the output with its arguments,
1527 .Topic
1528 the active parameters from the config files, the arguments in
1529 .Env_var $GROFFER_OPT ,
1530 and the arguments of the command line,
1532 .Topic
1533 the pipeline that would be run by the
1534 .B \%groff
1535 program, but without executing it.
1540 Other useful debugging options are the
1541 .B \%groff
1542 option
1543 .Opt_short Z
1545 .Opt_long_arg mode groff .
1548 .\" --------------------------------------------------------------------
1549 .SH "Options related to groff"
1550 .\" --------------------------------------------------------------------
1552 All short options of
1553 .B \%groffer
1554 are compatible with the short options of
1555 .BR \%groff (@MAN1EXT@).
1557 The following of
1558 .B \%groff
1559 options have either an additional special meaning within
1560 .B \%groffer
1561 or make sense for normal usage.
1565 Because of the special outputting behavior of the
1566 .B \%groff
1567 option
1568 .Opt_short Z
1569 .B \%groffer
1570 was designed to be switched into
1571 .I \%groff\~mode ;
1573 .I \%groffer
1574 viewing features are disabled there.
1576 The other
1577 .B \%groff
1578 options do not switch the mode, but allow to customize the formatting
1579 process.
1582 .Opt_def - a
1583 This generates an ascii approximation of output in the
1584 .IR \%text\~modes .
1586 That could be important when the text pager has problems with control
1587 sequences in
1588 .IR "tty mode" .
1591 .Opt_def - m file
1593 .I \%file
1594 as a
1595 .I \%groff
1596 macro file.
1598 This is useful in case it cannot be recognized automatically.
1601 .Opt_def - P opt_or_arg
1602 Send the argument
1603 .I \%opt_or_arg
1604 as an option or option argument to the actual
1605 .B \%groff
1606 postprocessor.
1609 .Opt_def - T -- device devname
1611 This option determines
1612 .BR \%groff 's
1613 output device.
1615 The most important devices are the text output devices for referring
1616 to the different character sets, such as
1617 .BR \%ascii ,
1618 .BR \%utf8 ,
1619 .BR \%latin1 ,
1620 and others.
1622 Each of these arguments switches
1623 .B \%groffer
1624 into a
1625 .I \%text\~mode
1626 using this device, to
1627 .I \%mode\~tty
1628 if the actual mode is not a
1629 .IR \%text\~mode .
1631 The following
1632 .I \%devname
1633 arguments are mapped to the corresponding
1634 .B \%groffer
1635 .Opt_long_arg mode \fIdevname\fR
1636 option:
1637 .BR \%dvi ,
1638 .BR \%html ,
1640 .BR \%ps .
1642 .B \%X*
1643 arguments are mapped to
1644 .IR \%mode\~x .
1645 Each other
1646 .I \%devname
1647 argument switches to
1648 .I \%mode\~groff
1649 using this device.
1652 .Opt_def - X
1653 is equivalent to
1654 .BR "groff \-X" .
1655 It displays the
1656 .I groff intermediate output
1657 with
1658 .BR gxditview .
1659 As the quality is relatively bad this option is deprecated; use
1660 .Opt_long X
1661 instead because the
1662 .I \%x\~mode
1663 uses an
1664 .IR X *
1665 device for a better display.
1668 .Opt_def - Z -- intermediate-output -- ditroff
1669 Switch into
1670 .I \%groff\~mode
1671 and format the input with the
1672 .I \%groff intermediate output
1673 without postprocessing; see
1674 .BR \%groff_out (@MAN5EXT@).
1675 This is equivalent to option
1676 .Opt_long ditroff
1678 .IR \%man ,
1679 which can be used as well.
1683 All other
1684 .B \%groff
1685 options are supported by
1686 .BR \%groffer ,
1687 but they are just transparently transferred to
1688 .B \%groff
1689 without any intervention.
1691 The options that are not explicitly handled by
1692 .B \%groffer
1693 are transparently passed to
1694 .BR \%groff .
1696 Therefore these transparent options are not documented here, but in
1697 .BR \%groff (@MAN1EXT@).
1698 Due to the automatism in
1699 .BR \%groffer ,
1700 none of these
1701 .B \%groff
1702 options should be needed, except for advanced usage.
1705 .\" --------------------------------------------------------------------
1706 .SS "X\~\%Window\~\%Toolkit Options"
1707 .\" --------------------------------------------------------------------
1709 The following long options were adapted from the corresponding
1710 X\~\%Toolkit options.
1712 .B \%groffer
1713 will pass them to the actual viewer program if it is an X\~\%Window
1714 program.
1716 Otherwise these options are ignored.
1720 Unfortunately these options use the old style of a single minus for
1721 long options.
1724 .B \%groffer
1725 that was changed to the standard with using a double minus for long
1726 options, for example,
1727 .B \%groffer
1728 uses the option
1729 .Opt_long font
1730 for the X\~\%option
1731 .Opt_short font .
1736 .BR \%X (1),
1737 .BR \%X (7),
1738 and the documentation on the X\~\%Toolkit\~\%options for more details on
1739 these options and their arguments.
1742 .Opt_def -- background color
1743 Set the background color of the viewer window.
1746 .Opt_def -- bd pixels
1747 Specifies the color of the border surrounding the viewer window.
1750 .Opt_def -- bg color
1751 This is equivalent to
1752 .Opt_long background .
1755 .Opt_def -- bw pixels
1756 Specifies the width in pixels of the border surrounding the viewer
1757 window.
1760 .Opt_def -- display X-display
1761 Set the X\~\%display on which the viewer program shall be started, see the
1762 .I X\~\%Window
1763 documentation for the syntax of the argument.
1766 .Opt_def -- foreground color
1767 Set the foreground color of the viewer window.
1770 .Opt_def -- fg color
1771 This is equivalent to
1772 .Opt_short foreground .
1775 .Opt_def -- font font_name
1776 Set the font used by the viewer window.
1778 The argument is an X\~\%font\~\%name.
1781 .Opt_def -- ft font_name
1782 This is equivalent to
1783 .Opt_long ft .
1786 .Opt_def -- geometry size_pos
1787 Set the geometry of the display window, that means its size and its
1788 starting position.
1791 .BR \%X (7)
1792 for the syntax of the argument.
1795 .Opt_def -- resolution value
1796 Set X\~\%resolution in dpi (dots per inch) in some viewer programs.
1798 The only supported dpi values are
1799 .B 75
1801 .BR 100 .
1803 Actually, the default resolution for
1804 .B \%groffer
1805 is set to
1806 .BR 75\~dpi .
1807 The resolution also sets the default device in
1808 .IR "mode x" .
1811 .Opt_def -- rv
1812 Reverse foreground and background color of the viewer window.
1815 .Opt_def -- title "'some text'"
1816 Set the title for the viewer window.
1819 .Opt_def -- xrm "'resource'"
1820 Set X\~\%resource.
1823 .\" --------------------------------------------------------------------
1824 .SS "Options for man"
1825 .\" --------------------------------------------------------------------
1827 The long options of
1828 .B \%groffer
1829 were synchronized with the long options of GNU
1830 .BR man .
1832 All long options of GNU
1833 .B man
1834 are recognized, but not all of these options are important to
1835 .BR \%groffer ,
1836 so most of them are just ignored.
1840 The following two options were added to
1841 .B \%groffer
1842 for choosing whether the file name arguments are interpreted as names
1843 for local files or as a search pattern for
1844 .IR \%man\~pages .
1846 The default is looking up for local files.
1849 .Opt_def -- man
1850 Check the non-option command line arguments
1852 .RI ( filespecs )
1854 first on being
1855 .IR \%man\~pages ,
1856 then whether they represent an existing file.
1858 By default, a
1859 .I \%filespec
1860 is first tested whether it is an existing file.
1863 .Opt_def -- no-man -- local-file
1864 Do not check for
1865 .IR \%man\~pages .
1867 .Opt_long local-file
1868 is the corresponding
1869 .B man
1870 option.
1874 In the following, the
1875 .B man
1876 options that have a special meaning for
1877 .B \%groffer
1878 are documented.
1882 The full set of long and short options of the GNU
1883 .B man
1884 program can be passed via the environment variable
1885 .Env_var $MANOPT ;
1887 .BR \%man (1)
1888 if your system has GNU
1889 .B man
1890 installed.
1893 .Opt_def -- all
1894 In searching
1895 .IR \%man\~pages ,
1896 retrieve all suitable documents instead of only one.
1899 .Opt_def - 7 -- ascii
1901 .IR \%text\~modes ,
1902 display ASCII translation of special characters for critical environment.
1904 This is equivalent to
1905 .BR "groff -mtty_char" ;
1907 .BR groff_tmac (@MAN5EXT@).
1910 .Opt_def -- ditroff
1911 Eqivalent to
1912 .B \%groffer
1913 .Opt_short Z .
1916 .Opt_def -- extension suffix
1917 Restrict
1918 .I \%man\~page
1919 search to file names that have
1920 .I \%suffix
1921 appended to their section element.
1923 For example, in the file name
1924 .I \%/usr/share/man/man3/terminfo.3ncurses.gz
1926 .I \%man\~page
1927 extension is
1928 .IR \%ncurses .
1931 .Opt_def -- locale language
1933 Set the language for
1934 .IR \%man\~pages .
1936 This has the same effect, but overwrites
1937 .Env_var $LANG
1940 .Opt_def -- location
1941 Print the location of the retrieved files to standard error.
1944 .Opt_def -- no-location
1945 Do not display the location of retrieved files; this resets a former
1946 call to
1947 .Opt_long location .
1949 This was added by
1950 .BR \%groffer .
1953 .Opt_def -- manpath "'dir1:dir2:\*[Ellipsis]'"
1954 Use the specified search path for retrieving
1955 .I \%man\~pages
1956 instead of the program defaults.
1958 If the argument is set to the empty string "" the search for
1959 .I \%man\~page
1960 is disabled.
1963 .Opt_def -- pager
1964 Set the pager program in
1965 .IR \%tty\~mode ;
1966 default is
1967 .BR \%less .
1968 This is equivalent to
1969 .Opt_long tty\-viewer .
1972 .Opt_def -- sections "'sec1:sec2:\*[Ellipsis]'"
1973 Restrict searching for
1974 .I \%man\~pages
1975 to the given
1976 .IR sections ,
1977 a colon-separated list.
1980 .Opt_def -- systems "'sys1,sys2,\*[Ellipsis]'"
1981 Search for
1982 .I \%man\~pages
1983 for the given operating systems; the argument
1984 .I \%systems
1985 is a comma-separated list.
1988 .Opt_def -- whatis
1989 Instead of displaying the content, get the one-liner description from
1990 the retrieved
1991 .I \%man\~page
1992 files \[em] or say that it is not a
1993 .IR \%man\~page .
1996 .Opt_def -- where
1997 Eqivalent to
1998 .Opt_long location .
2001 .\" --------------------------------------------------------------------
2002 .SS "Filespec Arguments"
2003 .\" --------------------------------------------------------------------
2006 .I \%filespec
2007 parameter is an argument meaning an input source, such as a file name
2008 or template for searching
2009 .IR \%man\~pages .
2011 These input sources are collected and composed into a single output
2012 file such as
2013 .B \%groff
2014 does.
2018 The strange \%POSIX behavior that maps all arguments behind the first
2019 non-option argument into
2020 .I \%filespec
2021 arguments is ignored.
2023 The GNU behavior to recognize options even when mixed with
2024 .I \%filespec
2025 arguments is used througout.
2027 But, as usual, the double minus argument
2028 .Opt_long
2029 still takes all following arguments as
2030 .I \%filespec
2031 arguments.
2035 Each
2036 .I \%filespec
2037 parameters can have one of the following forms.
2042 .I \%filespec
2043 parameters means that
2044 .B \%groffer
2045 waits for standard input.
2047 The minus option
2048 .Opt_short ""
2049 stands for standard input, too, but can occur several times.
2051 Next
2052 .I \%filespec
2053 is tested whether it is the path name of an existing file.
2055 Otherwise it is assumed as a searching pattern for a
2056 .IR \%man\~page .
2060 On each system, the
2061 .I \%man\~pages
2062 are sorted according to their content into several sections.
2065 .I classical man sections
2066 have a single-character name, either are a digit from
2067 .B 1
2069 .B 9
2070 or one of the characters
2071 .B n
2073 .BR o .
2075 In the following, a stand-alone character
2076 .I s
2077 means this scheme.
2081 The internal precedence of
2082 .B \%man
2083 for searching
2084 .I \%man\~pages
2085 with the same name within several sections goes according to the
2086 classical single-character sequence.
2088 On some systems, this single character can be extended by a following
2089 string.
2091 But the special
2092 .B \%groffer
2093 .I \%man\~page
2094 facility is based on the classical single character sections.
2098 .BI \%man: name ( section )
2100 .IB \%name ( section )
2101 search the \%man\~page
2102 .I \%name
2103 in \%man\~section\~\c
2104 .IR \%section ,
2105 where
2106 .I \%section
2107 can be any string, but it must exist in the
2108 .I \%man
2109 system.
2113 Next some patterns based on the
2114 .I classical man sections
2115 were constructed.
2117 .BI \%man: name . s
2119 .IB \%name . s
2120 search for a \%man\~page
2121 .I \%name
2122 in \%man\~section
2123 .I s
2125 .I s
2126 is a
2127 .I classical man section
2128 mentioned above.
2130 Otherwise search for a
2131 .I \%man\~page
2132 named
2133 .IR \%name.s
2134 in the lowest
2135 .B man\~section .
2140 .BI \%man: name
2141 searches for a
2142 .I \%man\~page
2143 in the lowest
2144 .I \%man\~section
2145 that has a document called
2146 .IR \%name .
2150 The pattern
2151 .I \%s\~name
2152 originates from a strange argument parsing of the
2153 .B man
2154 program.
2157 .I s
2158 is a
2159 .I classical man section
2160 interpret it as a search for a
2161 .I \%man\~page
2162 called
2163 .I \%name
2164 in man\~section
2165 .IR s ,
2166 otherwise interpret
2167 .I s
2168 as a file argument and
2169 .I \%name
2170 as another
2171 .I \%filespec
2172 argument.
2176 We are left with the argument
2177 .I \%name
2178 which is not an existing file.
2180 So this searches for the
2181 .I \%man\~page
2182 called
2183 .I \%name
2184 in the lowest
2185 .I \%man\~section
2186 that has a document for this name.
2190 Several file name arguments can be supplied.
2192 They are mixed by
2193 .B \%groff
2194 into a single document.
2196 Note that the set of option arguments must fit to all of these file
2197 arguments.
2199 So they should have at least the same style of the
2200 .I \%groff
2201 language.
2204 .\" --------------------------------------------------------------------
2205 .SH "OUTPUT MODES"
2206 .\" --------------------------------------------------------------------
2208 By default, the
2209 .B \%groffer
2210 program collects all input into a single file, formats it with the
2211 .B \%groff
2212 program for a certain device, and then chooses a suitable viewer
2213 program.
2215 The device and viewer process in
2216 .B \%groffer
2217 is called a
2218 .IR \%mode .
2220 The mode and viewer of a running
2221 .B \%groffer
2222 program is selected automatically, but the user can also choose it
2223 with options.
2226 The modes are selected by option the arguments of
2227 .Opt_long_arg mode \fIanymode .
2228 Additionally, each of this argument can be specified as an option of
2229 its own, such as
2230 .Opt_long \fIanymode .
2231 Most of these modes have a viewer program, which can be chosen by an
2232 option that is constructed like
2233 .Opt_long \fIanymode\fR\-viewer .
2237 Several different modes are offered, graphical modes for
2238 .IR \%X\~Window ,
2239 .IR \%text\~modes ,
2240 and some direct
2241 .I \%groff\~modes
2242 for debugging and development.
2246 By default,
2247 .B \%groffer
2248 first tries whether
2249 .I \%x\~mode
2250 is possible, then
2251 .IR \%ps\~mode ,
2252 and finally
2253 .IR \%tty\~mode .
2255 This mode testing sequence for
2256 .I \%auto\~mode
2257 can be changed by specifying a comma separated list of modes with the
2258 option
2259 .Opt_long default\-modes.
2263 The searching for
2264 .I \%man\~pages
2265 and the decompression of the input are active in every mode.
2268 .\" --------------------------------------------------------------------
2269 .SS "Graphical Display Modes"
2270 .\" --------------------------------------------------------------------
2272 The graphical display modes work only in the
2273 .I X\~\%Window environment
2274 (or similar implementations within other windowing environments).
2276 The environment variable
2277 .Env_var $DISPLAY
2278 and the option
2279 .Opt_long display
2280 are used for specifying the X\~\%display to be used.
2282 If neither is given,
2283 .B \%groffer
2284 assumes that no X and changes to one
2285 .IR \%text\~mode .
2287 You can change this automatic behavior by the option
2288 .Opt_long default\-modes .
2292 Known viewers for the graphical display modes and their standard
2293 X\~\%Window viewer progams are
2295 .Topic
2296 X\~\%Window
2297 .I roff
2298 viewers such as
2299 .BR \%gxditview (@MAN1EXT@)
2301 .BR \%xditview (1)
2303 .IR \%x\~mode ),
2305 .Topic
2306 in a Postscript viewer
2308 .RI ( \%ps\~mode ),
2311 .Topic
2312 in a dvi viewer program
2314 .RI ( \%dvi\~mode ),
2317 .Topic
2318 in a PDF viewer
2320 .RI ( \%pdf\~mode ),
2323 .Topic
2324 in a web browser
2326 .RI ( html
2328 .IR \%www\~mode ),
2335 .I \%pdf\~mode
2336 has a major advantage \[em] it is the only graphical diplay mode that
2337 allows to search for text within the viewer; this can be a really
2338 important feature.
2340 Unfortunately, it takes some time to transform the input into the PDF
2341 format, so it was not chosen as the major mode.
2345 These graphical viewers can be customized by options of the
2346 X\~\%Window\~\%Toolkit.
2348 But the
2349 .B \%groffer
2350 options use a leading double minus instead of the single minus used by
2352 .I X\~\%Window\~\%Toolkit .
2355 .\" --------------------------------------------------------------------
2356 .SS "Text modes"
2357 .\" --------------------------------------------------------------------
2359 There are two modes for text output,
2360 .I \%mode\~text
2361 for plain output without a pager and
2362 .I \%mode\~tty
2363 for a text output on a text terminal using some pager program.
2367 If the variable
2368 .Env_var \%$DISPLAY
2369 is not set or empty,
2370 .B \%groffer
2371 assumes that it should use
2372 .IR \%tty\~\%mode .
2376 In the actual implementation, the
2377 .I groff
2378 output device
2379 .I \%latin1
2380 is chosen for
2381 .IR \%text\~modes .
2383 This can be changed by specifying option
2384 .Opt_short T
2386 .Opt_long device .
2390 The pager to be used can be specified by one of the options
2391 .Opt_long pager
2393 .Opt_long tty\-viewer ,
2394 or by the environment variable
2395 .Env_var $PAGER .
2396 If all of this is not used the
2397 .BR \%less (1)
2398 program with the option
2399 .Opt_short r
2400 for correctly displaying control sequences is used as the default
2401 pager.
2404 .\" --------------------------------------------------------------------
2405 .SS "Special Modes for Debugging and Development"
2406 .\" --------------------------------------------------------------------
2408 These modes use the
2409 .I \%groffer
2410 file determination and decompression.
2412 This is combined into a single input file that is fed directly into
2413 .B \%groff
2414 with different strategy without the
2415 .I \%groffer
2416 viewing facilities.
2418 These modes are regarded as advanced, they are useful for debugging
2419 and development purposes.
2424 .I \%source\~mode
2425 with option
2426 .Opt_short Q
2428 .Opt_long source
2429 just displays the decompressed input.
2434 .I \%groff\~mode
2435 passes the input to
2436 .B \%groff
2437 using only some suitable options provided to
2438 .BR \%groffer .
2440 This enables the user to save the generated output into a file or pipe
2441 it into another program.
2446 .IR \%groff\~\%mode ,
2447 the option
2448 .Opt_short Z
2449 disables post-processing, thus producing the
2451 .I groff intermediate
2452 .IR output .
2455 In this mode, the input is formatted, but not postprocessed; see
2456 .BR \%groff_out (@MAN5EXT@)
2457 for details.
2462 .B \%groff
2463 short options are supported by
2464 .BR \%groffer .
2467 .\" --------------------------------------------------------------------
2468 .SH "MAN\~PAGE\~SEARCHING"
2469 .\" --------------------------------------------------------------------
2471 The default behavior of
2472 .B \%groffer
2473 is to first test whether a file parameter represents a local file; if
2474 it is not an existing file name, it is assumed to represent a name of
2476 .IR \%man\~page .
2478 This behavior can be modified by the following options.
2482 .Opt_long man
2483 forces to interpret all file parameters as filespecs for searching
2484 .IR \%man\~pages .
2487 .Opt_long no\-man
2488 .TP+
2489 .Opt_long local\-file
2490 disable the
2491 .I man
2492 searching; so only local files are displayed.
2496 If neither a local file nor a
2497 .I \%man\~page
2498 was retrieved for some file parameter a warning is issued on standard
2499 error, but processing is continued.
2504 .B \%groffer
2505 program provides a search facility for
2506 .IR \%man\~pages .
2508 All long options, all environment variables, and most of the
2509 functionality of the GNU
2510 .BR \%man (1)
2511 program were implemented.
2513 This inludes the extended file names of
2514 .IR \%man\~pages ,
2515 for example, the
2516 .I \%man\~page
2518 .B \%groff
2519 in man\~section 7 may be stored under
2520 .File_name /usr/share/man/man7/groff.7.gz ,
2521 where
2522 .File_name /usr/share/man/
2523 is part of the man\~path, the subdirectory
2524 .I \%man7
2525 and the file extension
2526 .I .7
2527 refer to the man\~section 7;
2528 .I \%.gz
2529 shows the compression of the file.
2534 .I cat\~pages
2535 (preformatted
2536 .IR \%man\~pages )
2537 are intentionally excluded from the search because
2538 .B \%groffer
2539 is a
2540 .I roff
2541 program that wants to format by its own.
2543 With the excellent performance of the actual computers, the
2544 preformatted
2545 .I \%man\~pages
2546 aren't necessary any longer.
2550 The algorithm for retrieving
2551 \I \%man\~pages
2552 uses five search methods.
2554 They are successively tried until a method works.
2557 .Topic
2558 The search path can be manually specified by using the option
2559 .Opt_long manpath .
2560 An empty argument disables the
2561 .I \%man\~page
2562 searching.
2564 This overwrites the other methods.
2567 .Topic
2568 If this is not available the environment variable
2569 .Env_var $MANPATH
2570 is searched.
2573 .Topic
2574 If this is empty, the program tries to read it from the environment
2575 variable
2576 .Env_var $MANOPT .
2579 .Topic
2580 If this does not work a reasonable default path from
2581 .Env_var $PATH
2582 is searched for
2583 .IR \%man\~pages .
2586 .Topic
2587 If this does not work, the
2588 .BR \%manpath (1)
2589 program for determining a path of
2590 .I man
2591 directories is tried.
2595 After this, the path elements for the language (locale) and operating
2596 system specific
2597 .I \%man\~pages
2598 are added to the
2599 .IR man\~path ;
2600 their sequence is determined automatically.
2602 For example, both
2603 .File_name /usr/share/man/linux/fr
2605 .File_name /usr/share/man/fr/linux
2606 for french linux
2607 .I \%man\~pages
2608 are found.
2610 The language and operating system names are determined from both
2611 environment variables and command line options.
2615 The locale (language) is determined like in GNU
2616 .BR man ,
2617 that is from highest to lowest precedence:
2618 .Topic
2619 .Opt_long locale
2621 .Topic
2622 .Env_var $GROFFER_OPT
2624 .Topic
2625 .Env_var $MANOPT
2627 .Topic
2628 .Env_var $LCALL
2630 .Topic
2631 .Env_var $LC_MESSAGES
2633 .Topic
2634 .Env_var $LANG .
2638 The language locale is usually specified in the \%POSIX 1003.1 based
2639 format:
2642 \f[I]<language>\f[][\f[CB]_\f[]\f[I]<territory>\f[][\f[CB].\f[]\
2643 \f[I]<character-set>\f[][\f[CB],\f[]\f[I]<version>\f[]]]],
2646 but the two-letter code in
2648 .I <language>
2650 is sufficient for most purposes.
2654 If no
2655 .I \%man\~pages
2656 for a complicated locale are found the country part consisting of the
2657 first two characters (without the `\f[CB]_\f[]', `\f[CB].\f[]', and
2658 `\f[CB],\f[]' parts) of the locale is searched as well.
2662 If still not found the corresponding
2663 .I \%man\~page
2664 in the default language is used instead.
2666 As usual, this default can be specified by one of \f[CR]C\f[] or
2667 \f[CR]\%POSIX\f[].
2670 .I \%man\~pages
2671 in the default language are usually in English.
2675 Several operating systems can be given by appending their names,
2676 separated by a comma.
2678 This is then specified by the environment variable
2679 .Env_var $SYSTEM
2680 or by the command line option
2681 .Opt_long systems .
2682 The precedence is similar to the locale case above from highest to
2683 lowest precedence:
2685 Topic
2686 .Opt_long systems
2688 .Topic
2689 .Env_var $GROFFER_OPT
2691 .Topic
2692 .Env_var $MANOPT
2694 .Topic
2695 .Env_var $SYSTEM .
2699 When searching for
2700 .I \%man\~pages
2701 this
2702 .I man\~path
2703 with the additional language and system specific directories is used.
2707 The search can further be restricted by limiting it to certain
2708 sections.
2710 A single section can be specified within each filespec argument,
2711 several sections as a colon-separated list in command line option
2712 .Opt_long sections
2713 or environment variable
2714 .Env_var $MANSECT .
2716 When no section was specified a set of standard sections is searched
2717 until a suitable
2718 .I \%man\~page
2719 was found.
2723 Finally, the search can be restricted to a so-called
2724 .IR extension .
2725 This is a postfix that acts like a subsection.
2727 It can be specified by
2728 .Opt_long extension
2729 or environment variable
2730 .Env_var $EXTENSION .
2734 For further details on
2735 .I \%man\~page
2736 searching, see
2737 .BR \%man (1).
2740 .\" --------------------------------------------------------------------
2741 .SH DECOMPRESSION
2742 .\" --------------------------------------------------------------------
2744 The program has a decompression facility.
2746 If standard input or a file that was retrieved from the command line
2747 parameters is compressed with a format that is supported by either
2748 .BR \%gzip (1)
2750 .BR \%bzip2 (1)
2751 it is decompressed on-the-fly.
2753 This includes the GNU
2754 .BR \%.gz ,
2755 .BR \%.bz2 ,
2756 and the traditional
2757 .B \%.Z
2758 compression.
2760 The program displays the concatenation of all decompressed input in
2761 the sequence that was specified on the command line.
2764 .\" --------------------------------------------------------------------
2765 .SH "ENVIRONMENT"
2766 .\" --------------------------------------------------------------------
2769 .B \%groffer
2770 program supports many system variables, most of them by courtesy of
2771 other programs.
2773 All environment variables of
2774 .BR \%groff (@MAN1EXT@)
2775 and GNU
2776 .BR \%man (1)
2777 and some standard system variables are honored.
2780 .\" --------------------------------------------------------------------
2781 .SS "Native groffer Variables"
2782 .\" --------------------------------------------------------------------
2785 .Env_var $GROFFER_OPT
2786 Store options for a run of
2787 .BR \%groffer .
2789 The options specified in this variable are overridden by the options
2790 given on the command line.
2792 The content of this variable is run through the shell builtin `eval';
2793 so arguments containing white-space or special shell characters should
2794 be quoted.
2797 .\" --------------------------------------------------------------------
2798 .SS "System Variables"
2799 .\" --------------------------------------------------------------------
2802 .B \%groffer
2803 program is a shell script that is run through
2804 .File_name /bin/sh ,
2805 which can be internally linked to programs like
2806 .BR \%bash (1).
2807 The corresponding system environment is automatically effective.
2809 The following variables have a special meaning for
2810 .BR \%groffer .
2814 .Env_var $DISPLAY
2815 If this variable is set this indicates that the X\~\%Window system is
2816 running.
2818 Testing this variable decides on whether graphical or text output is
2819 generated.
2821 This variable should not be changed by the user carelessly, but it can
2822 be used to start the graphical
2823 .B \%groffer
2824 on a remote X\~\%terminal.
2826 For example, depending on your system,
2827 .B \%groffer
2828 can be started on the second monitor by the command
2829 .Shell_cmd DISPLAY=:0.1\~groffer\~ what.ever &
2833 .Env_var $LC_ALL
2834 .TP+
2835 .Env_var $LC_MESSAGES
2836 .TP+
2837 .Env_var $LANG
2838 If one of these variables is set (in the above sequence), its content
2839 is interpreted as the locale, the language to be used, especially when
2840 retrieving
2841 \IR \%man\~pages .
2843 A locale name is typically of the form
2845 .IR language [\c
2846 .B _\c
2847 .IR territory [\c
2848 .B .\c
2849 .IR codeset [\c
2850 .B @\c
2851 .IR modifier ]]],
2853 where
2854 .I \%language
2855 is an ISO 639 language code,
2856 .I \%territory
2857 is an ISO 3166 country code, and
2858 .I \%codeset
2859 is a character set or encoding identifier like ISO-8859-1 or UTF-8;
2861 .BR \%setlocale (3).
2863 The locale values\~\c
2864 .B C
2866 .B \%POSIX
2867 stand for the default, i.e. the
2868 .I \%man\~page
2869 directories without a language prefix.
2871 This is the same behavior as when all 3\~variables are unset.
2875 .Env_var $PAGER
2876 This variable can be used to set the pager for the tty output.
2878 For example, to disable the use of a pager completely set this
2879 variable to the
2880 .BR \%cat (1)
2881 program
2882 .Shell_cmd PAGER=cat\~groffer\~ anything
2886 .Env_var $PATH
2887 All programs within the
2888 .B \%groffer
2889 shell script are called without a fixed path.
2891 Thus this environment variable determines the set of programs used
2892 within the run of
2893 .BR \%groffer .
2896 .\" --------------------------------------------------------------------
2897 .SS "Groff Variables"
2898 .\" --------------------------------------------------------------------
2901 .B \%groffer
2902 program internally calls
2903 .BR \%groff ,
2904 so all environment variables documented in
2905 .BR \%groff (@MAN1EXT@)
2906 are internally used within
2907 .B \%groffer
2908 as well.
2910 The following variables have a direct meaning for the
2911 .B \%groffer
2912 program.
2915 .Env_var $GROFF_TMPDIR
2916 If the value of this variable is an existing, writable directory,
2917 .B \%groffer
2918 uses it for storing its temporary files, just as groff does.
2921 .\" --------------------------------------------------------------------
2922 .SS "Man Variables"
2923 .\" --------------------------------------------------------------------
2925 Parts of the functionality of the
2926 .B man
2927 program were implemented in
2928 .BR \%groffer ;
2929 support for all environment variables documented in
2930 .BR \%man (1)
2931 was added to
2932 .BR \%groffer ,
2933 but the meaning was slightly modified due to the different approach in
2934 .BR \%groffer ;
2935 but the user interface is the same.
2938 .B man
2939 environment variables can be overwritten by options provided with
2940 .Env_var $MANOPT ,
2941 which in turn is overwritten by the command line.
2945 .Env_var $EXTENSION
2946 Restrict the search for
2947 .I \%man\~pages
2948 to files having this extension.
2950 This is overridden by option
2951 .Opt_long extension ;
2952 see there for details.
2956 .Env_var $MANOPT
2957 This variable contains options as a preset for
2958 .BR \%man (1).
2959 As not all of these are relevant for
2960 .B \%groffer
2961 only the essential parts of its value are extracted.
2963 The options specified in this variable overwrite the values of the
2964 other environment variables that are specific to
2965 .IR man .
2967 All options specified in this variable are overridden by the options
2968 given on the command line.
2972 .Env_var $MANPATH
2973 If set, this variable contains the directories in which the
2974 .I \%man\~page
2975 trees are stored.
2977 This is overridden by option
2978 .Opt_long manpath .
2982 .Env_var $MANSECT
2983 If this is a colon separated list of section names, the search for
2984 .I \%man\~pages
2985 is restricted to those manual sections in that order.
2987 This is overridden by option
2988 .Opt_long sections .
2992 .Env_var $SYSTEM
2993 If this is set to a comma separated list of names these are interpreted
2995 .I \%man\~page
2996 trees for different operating systems.
2998 This variable can be overwritten by option
2999 .Opt_long systems ;
3000 see there for details.
3004 The environment variable
3005 .Env_var $MANROFFSEQ
3006 is ignored by
3007 .B \%groffer
3008 because the necessary preprocessors are determined automatically.
3011 .\" --------------------------------------------------------------------
3012 .SH "CONFIGURATION FILES"
3013 .\" --------------------------------------------------------------------
3016 .B \%groffer
3017 program can be preconfigured by two configuration files.
3021 .File_name /etc/groff/groffer.conf
3022 System-wide configuration file for
3023 .BR \%groffer .
3027 .File_name $HOME/.groff/groffer.conf
3028 User-specific configuration file for
3029 .BR \%groffer ,
3030 where
3031 .Env_var $HOME
3032 denotes the user's home directory.
3034 This file is called after the system-wide configuration file to enable
3035 overriding by the user.
3039 The precedence of option delivery is given in the following.
3041 The configuration file in
3042 .File_name /etc
3043 has the lowest precedence; it is overwritten by the configuration file
3044 in the home directory; both configuration files are overwritten by the
3045 environment variable
3046 .Env_var $GROFFER_OPT ;
3047 everything is overwritten by the command line.
3051 In the configuration files, arbitrary spaces are allowed at the
3052 beginning of each line, they are just ignored.
3054 Apart from that, the lines of the configuration lines either start
3055 with a minus character, all other lines are interpreted as shell
3056 commands.
3060 The lines with the beginning minus are interpreted as
3061 .B groffer
3062 options.
3064 This easily allows to set general
3065 .B \%groffer
3066 options that should be used with any call of
3067 .BR \%groffer .
3069 Each line can represent a single short option, a short option cluster,
3070 or a long option with two minus signs, eventually with an argument.
3072 The argument can be appended either after a space character or an
3073 equal sign
3074 .RB ` = '.
3075 The argument can be surrounded by quotes, but this is not necessary.
3077 The options from these lines are collected and prepended to the
3078 existing value of
3079 .Env_var $GROFFER_OPT
3080 at the end of each configuration file.
3084 After the transformation of the minus lines, the configuration files
3085 have been transferred into a shell script that is called within
3086 .B \%groffer
3087 using the `\c
3088 .CB \.\~\c
3089 .IR \%filename '
3090 shell syntax.
3094 It makes sense to use these configuration files for the following
3095 tasks:
3097 .Topic
3098 Preset command line options by writing them into lines starting with a
3099 minus sign.
3101 .Topic
3102 Preset environment variables recognized by
3103 .BR \%groffer ;
3104 but do not forget to export them.
3106 .Topic
3107 Write a function for calling a viewer program for a special
3108 .I \%mode
3109 and feed this name into its corresponding
3110 .Opt_long \f[I]mode\f[]\-viewer
3111 option.
3113 Note that the name of such a function must either be given as the full
3114 file name or coincide with some existing program in the system path
3115 .Env_var $PATH
3116 in order to be recognized by
3117 .BR groffer .
3119 .Topic
3120 Enter
3121 .Opt_long shell
3122 to specify a shell for the run of
3123 .File_name groffer2.sh .
3124 Some shells run much faster than the standard shell; the fastest
3125 Bourne shell that I know is
3126 .BR ash (1).
3127 It makes really sense to add a line like
3128 .Opt_long shell=ash
3129 to your configuration file as long as the given shell is installed on
3130 your system.
3134 As an example, consider the following configuration file in
3135 .File_name ~/.groff/groffer.conf ,
3136 say.
3139 .ft CR
3142 # groffer configuration file
3144 # groffer options that are used in each call of groffer
3145 \-\-shell=ash
3146 \-\-foreground=DarkBlue
3147 \-\-resolution=100
3148 \-\-x\-viewer='gxditview \-geometry 900x1200'
3150 # some shell commands
3151 if test "$DISPLAY" = ""; then
3152   export DISPLAY='localhost:0.0'
3154 date >>~/mygroffer.log
3161 The lines starting with
3162 .B #
3163 are command lines.
3165 This configuration sets four
3166 .B \%groffer
3167 options (the lines starting with `\-') and runs two shell commands (the
3168 rest of the script).
3170 This has the following effects:
3173 .Topic
3175 .B ash
3176 as the shell to run the
3177 .B \%groffer
3178 script; if it works it should be faster than the usual
3179 .BR sh .
3182 .Topic
3183 Use a text color of
3184 .B \%DarkBlue
3185 in all viewers that support this, such as
3186 .BR \%gxditview .
3189 .Topic
3190 Use a resolution of
3191 .B 100\~dpi
3192 in all viewers that support this, such as
3193 .BR \%gxditview .
3195 By this, the default device in
3196 .I x mode
3197 is set to
3198 .BR X100 .
3201 .Topic
3202 Force
3203 .BR \%gxditview (@MAN1EXT@)
3204 as the
3205 .I \%x-mode
3206 viewer using the geometry option for setting the width to
3207 .B 900\~dpi
3208 and the height to
3209 .BR 1200\~dpi .
3210 This geometry is suitable for a resolution of
3211 .BR 100\~dpi .
3214 .Topic
3215 If the environment variable
3216 .Env_var $DISPLAY
3217 is empty set it to
3218 .IR localhost:0.0 .
3220 That allows to start
3221 .B \%groffer
3222 in the standard X\~\%display, even when the program is called from a
3223 text console.
3226 .Topic
3227 Just for fun, the date of each
3228 .B \%groffer
3229 start is written to the file
3230 .File_name mygroffer.log
3231 in the home directory.
3234 .\" --------------------------------------------------------------------
3235 .SH "EXAMPLES"
3236 .\" --------------------------------------------------------------------
3238 The usage of
3239 .B \%groffer
3240 is very easy.
3242 Usually, it is just called with a file name or
3243 .IR \%man\~page .
3245 The following examples, however, show that
3246 .B \%groffer
3247 has much more fancy capabilities.
3251 .Shell_cmd "groffer\~/usr/local/share/doc/groff/meintro.ms.gz"
3252 Decompress, format and display the compressed file
3253 .File_name meintro.ms.gz
3254 in the directory
3255 .File_name /usr/local/share/doc/groff ,
3256 using
3257 .B \%gxditview
3258 as graphical viewer when in X\~\%Window, or the
3259 .BR \%less (1)
3260 pager program when not in X.
3264 .Shell_cmd "groffer\~groff"
3265 If the file
3266 .File_name \%./groff
3267 exists use it as input.
3269 Otherwise interpret the argument as a search for the
3270 .I \%man\~page
3271 named
3272 .B \%groff
3273 in the smallest possible
3274 .IR \%man\~section ,
3275 being section 1 in this case.
3279 .Shell_cmd "groffer\~man:groff"
3280 search for the
3281 .I \%man\~page
3283 .B \%groff
3284 even when the file
3285 .File_name ./groff
3286 exists.
3290 .Shell_cmd "groffer\~groff.7"
3291 .TP+
3292 .Shell_cmd "groffer\~7\~groff"
3293 search the
3294 .I \%man\~page
3296 .B \%groff
3298 .I \%man\~section
3299 .BR 7 .
3300 This section search works only for a digit or a single character from
3301 a small set.
3305 .Shell_cmd "groffer\~fb.modes"
3306 If the file
3307 .File_name ./fb.modes
3308 does not exist interpret this as a search for the
3309 .I \%man\~page
3311 .BR fb.modes .
3312 As the extension
3313 .I \%modes
3314 is not a single character in classical section style the argument is
3315 not split to a search for
3316 .BR fb .
3320 .Shell_cmd "groffer\~groff\~\[cq]troff(1)\[cq]\~man:roff"
3322 The arguments that are not existing files are looked-up as the
3323 following
3324 .IR \%man\~pages :
3325 .B \%groff
3326 (automatic search, should be found in \fIman\fP\~section\~1),
3327 .B \%troff
3328 (in section\~1),
3330 .B \%roff
3331 (in the section with the lowest number, being\~7 in this case).
3333 The quotes around
3335 .I \[cq]troff(1)\[cq]
3337 are necessary because the paranthesis are special shell characters;
3338 escaping them with a backslash character
3339 .I \[rs](
3341 .I \[rs])
3342 would be possible, too.
3344 The formatted files are concatenated and displayed in one piece.
3348 .Shell_cmd "LANG=de\~groffer\~--man\~--www\~--www-viever=mozilla\~ls"
3350 Retrieve the German
3351 .I \%man\~page
3352 (language
3353 .IR de )
3354 for the
3355 .B ls
3356 program, decompress it, format it to
3357 .I \%html
3358 format
3360 .RI ( \%www\~mode )
3362 and view the result in the web browser
3363 .BR \%galeon .
3364 The option
3365 .Opt_long man
3366 guarantees that the
3367 .I \%man\~page
3368 is retrieved, even when a local file
3369 .File_name \%ls
3370 exists in the actual directory.
3374 .Shell_cmd "groffer\~--source\~'man:roff(7)'"
3376 Get the
3377 .I \%man\~page
3378 called
3379 .I \%roff
3380 in \fIman\fP\~section 7, decompress it, and print its unformatted
3381 content, its source code.
3385 .Shell_cmd "cat\~file.gz\~|\~groffer\~-Z\~-mfoo"
3387 Decompress the standard input, send this to
3388 .I \%groff intermediate output mode
3389 without post-processing
3390 .RB ( groff
3391 option
3392 .Opt_short Z ),
3393 using macro package by
3394 .I \%foo
3395 .RB ( groff
3396 option
3397 .Opt_short m ) .
3401 .Shell_cmd "echo\~'\[rs]f[CB]WOW!'\~|"
3402 .TP+
3403 .Shell_cmd+ "groffer --x --bg red --fg yellow --geometry 200x100 -"
3405 Display the word \f[CB]WOW!\f[] in a small window in constant-width
3406 bold font, using color yellow on red background.
3409 .\" --------------------------------------------------------------------
3410 .SH "COMPATIBILITY"
3411 .\" --------------------------------------------------------------------
3414 .B \%groffer
3415 program consists of two shell scripts.
3419 The starting script is the file
3420 .File_name \%groffer
3421 that is installed in a
3422 .File_name bin
3423 directory.
3425 It is generated from the source file
3426 .File_name \%groffer.sh .
3428 It is just a short starting script without any functions such that it
3429 can run on very poor shells.
3433 The main part of the
3434 .B \%groffer
3435 program is the file
3436 .File_name groffer2.sh
3437 that is installed in the
3438 .I groff
3439 library directory.
3441 This script can be run under a different shell by using the
3442 .B \%groffer
3443 option
3444 .Opt_long shell .
3448 Both scripts are compatible with both
3449 GNU and \%POSIX.
3451 \%POSIX compatibility refers to
3452 .B IEEE P1003.2/D11.2
3453 of September 1991, a very early version of the \%POSIX standard that
3454 is still freely available in the internet at
3455 .URL http://\:www.funet.fi/\:pub/\:doc/\:posix/\:p1003.2/\:d11.2/\:all \
3456 "\%POSIX P1003.2 draft 11.2" .
3460 Only a restricted set of shell language elements and shell builtins is
3461 used to achieve even compatibility with some Bourne shells that are
3462 not fully \%POSIX compatible.
3465 .B \%groffer
3466 shell scripts were tested on many shells, including the following
3467 Bourne shells:
3468 .BR \%ash (1),
3469 .BR \%bash (1),
3470 .BR \%dash (1),
3471 .BR \%ksh (1),
3472 .BR \%pdksh (1),
3473 .BR \%posh (1),
3475 .BR \%zsh (1).
3476 So it should work on most actual free and commercial operating
3477 systems.
3481 The shell for the run of
3482 .File_name groffer2.sh
3483 can be chosen by the option
3484 .Opt_long shell
3485 on the command line or the environment variable
3486 .Env_var $GROFF_OPT .
3487 If you want to add it to one of the
3488 .B \%groffer
3489 configuration files you must write a line starting with
3490 .Opt_long shell .
3495 .B \%groffer
3496 program provides its own parser for command line arguments that is
3497 compatible to both
3498 .I \%POSIX
3499 .BR \%getopts (1)
3501 .I \%GNU
3502 .BR \%getopt (1).
3503 It can handle option arguments and file names containing white space
3504 and a large set of special characters.
3506 The following standard types of options are supported.
3509 .Topic
3510 The option consisiting of a single minus
3511 .Opt_short
3512 refers to standard input.
3515 .Topic
3516 A single minus followed by characters refers to a single character
3517 option or a combination thereof; for example, the
3518 .B \%groffer
3519 short option combination
3520 .Opt_short Qmfoo
3521 is equivalent to
3522 .Opt_short Q\~\-m\~foo .
3525 .Topic
3526 Long options are options with names longer than one character; they
3527 are always preceded by a double minus.
3529 An option argument can either go to the next command line argument or
3530 be appended with an equal sign to the argument; for example,
3531 .Opt_alt -- long=arg
3532 is equivalent to
3533 .Opt_alt -- long\~arg .
3536 .Topic
3537 An argument of
3538 .Opt_--
3539 ends option parsing; all further command line arguments are
3540 interpreted as filespec parameters, i.e. file names or constructs for
3541 searching
3542 .IR \%man\~pages ).
3545 .Topic
3546 All command line arguments that are neither options nor option
3547 arguments are interpreted as filespec parameters and stored until
3548 option parsing has finished.
3550 For example, the command line
3551 .Shell_cmd "groffer file1 -a -o arg file2"
3552 is equivalent to
3553 .Shell_cmd "groffer -a -o arg -- file1 file2"
3557 The free mixing of options and filespec parameters follows the GNU
3558 principle.
3560 That does not fulfill the strange option behavior of \%POSIX that ends
3561 option processing as soon as the first non-option argument has been
3562 reached.
3564 The end of option processing can be forced by the option
3565 .RB ` \-\- '
3566 anyway.
3569 .\" --------------------------------------------------------------------
3570 .SH "BUGS"
3571 .\" --------------------------------------------------------------------
3573 Report bugs to the
3574 .MTO bug-groff@gnu.org "bug-groff mailing list" .
3576 Include a complete, self-contained example that will allow the bug to
3577 be reproduced, and say which version of
3578 .B \%groffer
3579 you are using.
3583 You can also use the
3584 .MTO groff@gnu.org "groff mailing list" ,
3585 but you must first subscribe to this list.
3587 You can do that by visiting the
3588 .URL http://\:lists.gnu.org/\:mailman/\:listinfo/\:groff \
3589 "groff mailing list web page" .
3594 .BR \%groff (@MAN1EXT@)
3595 for information on availability.
3598 .\" --------------------------------------------------------------------
3599 .SH "SEE ALSO"
3600 .\" --------------------------------------------------------------------
3603 .BR \%groff (@MAN1EXT@),
3604 .BR \%@g@troff (@MAN1EXT@)
3606 Details on the options and environment variables available in
3607 .BR \%groff ;
3608 all of them can be used with
3609 .BR \%groffer .
3614 .BR \%groff (@MAN7EXT@)
3615 Documentation of the
3616 .I \%groff
3617 language.
3621 .BR \%grog (@MAN1EXT@)
3622 Internally,
3623 .B \%groffer
3624 tries to guess the
3625 .B \%groff
3626 command line options from the input using this program.
3630 .BR groff_out (@MAN5EXT@)
3631 Documentation on the
3632 .I \%groff intermediate output
3634 .RI ( ditroff
3635 output).
3640 .BR groff_tmac (@MAN5EXT@)
3641 Documentation on the
3642 .I \%groff
3643 macro files.
3647 .BR \%man (1)
3648 The standard program to display
3649 .IR \%man\~pages .
3651 The information there is only useful if it is the
3652 .I \%man\~page
3653 for GNU
3654 .BR man .
3655 Then it documents the options and environment variables that are
3656 supported by
3657 .BR \%groffer .
3661 .BR \%ash (1),
3662 .BR \%bash (1),
3663 .BR \%dash (1),
3664 .BR \%ksh (1),
3665 .BR \%pdksh (1),
3666 .BR \%posh (1),
3667 .BR \%sh (1),
3668 .BR \%zsh (1)
3670 Bourne shells that were tested with
3671 .BR \%groffer .
3676 .BR \%gxditview (@MAN1EXT@),
3677 .BR \%xditview (1x)
3679 Viewers for
3680 .BR \%groffer 's
3681 .IR \%x\~mode .
3686 .BR \%kghostview (1),
3687 .BR \%ggv (1),
3688 .BR \%gv (1),
3689 .BR \%ghostview (1),
3690 .BR \%gs (1)
3692 Viewers for
3693 .BR \%groffer 's
3694 .IR \%ps\~mode .
3699 .BR \%kghostview (1),
3700 .BR \%ggv (1),
3701 .BR \%xpdf (1),
3702 .BR \%acroread (1),
3703 .BR \%kpdf (1)
3705 Viewers for
3706 .BR \%groffer 's
3707 .IR \%pdf\~mode .
3712 .BR \%kdvi (1),
3713 .BR \%xdvi (1),
3714 .BR \%dvilx (1)
3716 Viewers for
3717 .BR \%groffer 's
3718 .IR \%dvi\~mode .
3723 .BR \%konqueror (1),
3724 .BR \%mozilla (1),
3725 .BR \%lynx (1)
3727 Web-browsers for
3728 .BR \%groffer 's
3729 .I \%html
3731 .IR \%www\~mode .
3736 .BR \%less (1)
3737 Standard pager program for the
3738 .I \%tty\~mode .
3742 .BR \%gzip (1),
3743 .BR \%bzip2 (1)
3745 The decompression programs supported by
3746 .BR \%groffer .
3750 .\" --------------------------------------------------------------------
3751 .SH "AUTHOR"
3752 .\" --------------------------------------------------------------------
3753 .author
3756 .\" --------------------------------------------------------------------
3757 .SH "COPYING"
3758 .\" --------------------------------------------------------------------
3759 .copyleft
3762 .\" --------------------------------------------------------------------
3763 .\" Emacs settings
3764 .\" --------------------------------------------------------------------
3766 .\" Local Variables:
3767 .\" mode: nroff
3768 .\" End: