1GROG(1)                     General Commands Manual                    GROG(1)
2
3
4

NAME

6       grog — guess options for a following groff command
7

SYNOPSIS

9       grog [-C] [--run] [--warnings] [--ligatures] [ groff-option ....]  [--]
10            [ filespec ....]
11       grog -h | --help
12       grog -v | --version
13

DESCRIPTION

15       grog reads the input (file names or standard input) and  guesses  which
16       of  the groff(1) options are needed to perform the input with the groff
17       program.
18
19              The corresponding groff command is usually displayed in standard
20              output.   With  the  option  --run, the generated line is output
21              into standard error and the generated groff command  is  run  on
22              the standard output.
23

OPTIONS

25       The  option  -v  or --version prints information on the version number.
26       Also -h or --help prints usage  information.   Both  of  these  options
27       automatically end the grog program.  Other options are thenignored, and
28       no groff command line is generated.  The following 3  options  are  the
29       only grog options,
30
31       -C     this  option  means enabling the groff compatibility mode, which
32              is also transfered to the generated groff command line.
33
34       --ligatures
35              this option forces to include the arguments -P-y -PU within  the
36              generated groff command line.
37
38       --run  with  this  option, the command line is output at standard error
39              and then run on the computer.
40
41       --warnings
42              with this option, some more  warnings  are  output  to  standard
43              error.
44
45       All  other specified short options (words starting with one minus char‐
46       acter -) are interpreted as groff options or option  clusters  with  or
47       without  argument.  No space is allowed between options and their argu‐
48       ment.  Except from the -marg options, all options will  be  passed  on,
49       i.e.  they are included unchanged in the command for the output without
50       effecting the work of grog.
51
52       A filespec argument can either be the name of an  existing  file  or  a
53       single  minus  -  to  mean standard input.  If no filespec is specified
54       standard input is read automatically.
55

DETAILS

57       grog reads all filespec parameters as a whole.  It tries to guess which
58       of the following groff options are required for running the input under
59       groff: -e, -g, -G, -j, -J, -p, -R, -s,  -t.   -man,  -mdoc,  -mdoc-old,
60       -me, -mm, -mom, and -ms.
61
62       The  guessed  groff command including those options and the found file‐
63       spec parameters is put on the standard output.
64
65       It is possible to specify arbitrary groff options on the command  line.
66       These  are  passed  on  the output without change, except for the -marg
67       options.
68
69       The groff program has trouble when the wrong -marg option or several of
70       these  options are specified.  In these cases, grog will print an error
71       message and exit with an error code.  It is better to specify no  -marg
72       option.   Because  such an option is only accepted and passed when grog
73       does not find any of these options or the same option is found.
74
75       If several different -marg options are found by grog an  error  message
76       is  produced and the program is terminated with an error code.  But the
77       output is written with the wrong options nevertheless.
78
79       Remember that it is not necessary to determine a macro package.  A roff
80       file  can also be written in the groff language without any macro pack‐
81       age.  grog will produce an output without an -marg option.
82
83       As groff also works with pure text files  without  any  roff  requests,
84       grog cannot be used to identify a file to be a roff file.
85
86       The groffer(1) program heavily depends on a working grog.
87
88       The  grog  source  contains  two files written in different programming
89       languages: grog.pl is the Perl version, while grog.sh is a shell script
90       using  awk(1).  During the run of make(1), it is determined whether the
91       system contains a suitable version  of  perl(1).   If  so,  grog.pl  is
92       transformed into grog; otherwise grog.sh is used instead.
93

EXAMPLES

95       * Calling
96
97                grog meintro.me
98
99         results in
100
101                groff -me meintro.me
102
103         So  grog  recognized that the file meintro.me is written with the -me
104         macro package.
105
106       * On the other hand,
107
108                grog pic.ms
109
110         outputs
111
112                groff -p -t -e -ms pic.ms
113
114         Besides determining the macro package -ms, grog recognized  that  the
115         file  pic.ms  additionally needs -pte, the combination of -p for pic,
116         -t for tbl, and -e for eqn.
117
118       * If both of the former example files are combined by the command
119
120                grog meintro.me pic.ms
121
122         an error message is sent to standard error because groff cannot  work
123         with two different macro packages:
124
125                grog: error: there are several macro packages: -me -ms
126
127         Additionally  the  corresponding  output  with  the  wrong options is
128         printed to standard output:
129
130                groff -pte -me -ms meintro.me pic.ms
131
132         But the program is terminated with an error code.
133
134       * The call of
135
136                grog -ksS -Tdvi grnexmpl.g
137
138         contains several groff options that are just  passed  on  the  output
139         without  any  interface  to  grog.  These are the option cluster -ksS
140         consisting of -k, -s, and -S; and the option -T  with  argument  dvi.
141         The output is
142
143                groff -k -s -S -Tdvi grnexmpl.g
144
145         so  no  additional  option was added by grog.  As no option -marg was
146         found by grog this file does not use a macro package.
147

SEE ALSO

149       groff(1), groffer(1) troff(1), tbl(1), pic(1), chem(1), eqn(1),
150       refer(1), grn(1), grap(1), soelim(1)
151              Man-pages of section 1 can be viewed with either
152                     $ man name
153              for text mode or
154                     $ groffer name
155              for graphical mode (default is PDF mode).
156
157       groff_me(7), groff_ms(7), groff_mm(7), groff_mom(7), groff_man(7)
158              Man-pages of section 7 can be viewed with either with
159                     $ man 7 name
160              for text mode or
161                     $ groffer 7 name
162              for graphical mode (default is PDF mode).
163

COPYING

165       Copyright © 1989-2014 Free Software Foundation, Inc.
166
167       This file is part of grog, which is part of groff, a free software
168       project.  You can redistribute it and/or modify it under the terms of
169       the GNU General Public License version 2 (GPL2) as published by the
170       Free Software Foundation.
171
172       groff is distributed in the hope that it will be useful, but WITHOUT
173       ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
174       FITNESS FOR A PARTICULAR PURPOSE.
175
176       The text for GPL2 is available in the internet at GNU copyleft site
177http://www.gnu.org/licenses/gpl-2.0.txt⟩.
178

AUTHORS

180       Written by James Clark.
181
182       Maintained by Werner Lemberg ⟨wl@gnu.org⟩.
183
184       Rewritten and put under GPL by Bernd Warken ⟨groff-
185       bernd.warken-72@web.de⟩.
186
187
188
189Groff Version 1.22.3            4 November 2014                        GROG(1)
Impressum