{
    "mode": "info",
    "parameter": "grog",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/grog/json",
    "generated": "2026-08-02T22:05:19Z",
    "synopsis": "grog [-C] [-T device] [--run] [--warnings] [--ligatures] [groff-option\n...] [--] [filespec ...]\ngrog -h\ngrog --help\ngrog -v\ngrog --version",
    "sections": {
        "NAME": {
            "content": "grog - guess options for a following groff command\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "grog [-C] [-T device] [--run] [--warnings] [--ligatures] [groff-option\n...] [--] [filespec ...]\n\ngrog -h\ngrog --help\n\ngrog -v\ngrog --version\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "grog reads the input (file names or standard input) and  guesses  which\nof  the groff(1) options are needed to perform the input with the groff\nprogram.  A suitable device is now always written as -Tdevice including\nthe groff default as -T ps.\n\nThe  corresponding  groff command is usually displayed in standard out-\nput.  With the option --run, the generated line is output into standard\nerror  and  the  generated groff command is run on the standard output.\ngroffer(1) relies on a perfectly running groff(1).\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "The option -v or --version prints information on  the  version  number.\nAlso  -h or --help prints usage information.  Both of these options au-\ntomatically end the grog program.  Other options are  thenignored,  and\nno  groff  command  line is generated.  The following 3 options are the\nonly grog options,\n\n-C     this option means enabling the groff compatibility  mode,  which\nis also transfered to the generated groff command line.\n",
            "subsections": [
                {
                    "name": "--ligatures",
                    "content": "this  option forces to include the arguments -P-y -PU within the\ngenerated groff command line.\n\n--run  with this option, the command line is output at  standard  error\nand then run on the computer.\n",
                    "long": "--ligatures"
                },
                {
                    "name": "--warnings",
                    "content": "with  this option, some more warnings are output to standard er-\nror.\n\nAll other specified short options (words starting with one minus  char-\nacter  -)  are  interpreted as groff options or option clusters with or\nwithout argument.  No space is allowed between options and their  argu-\nment.   Except  from  the -marg options, all options will be passed on,\ni.e. they are included unchanged in the command for the output  without\neffecting the work of grog.\n\nA  filespec  argument  can  either be the name of an existing file or a\nsingle minus - to mean standard input.  If  no  filespec  is  specified\nstandard input is read automatically.\n",
                    "long": "--warnings"
                }
            ]
        },
        "DETAILS": {
            "content": "grog reads all filespec parameters as a whole.  It tries to guess which\nof the following groff options are required for running the input under\ngroff: -e, -g, -G, -j, -p, -R, -s, -t (preprocessors); and -man, -mdoc,\n-mdoc-old, -me, -mm, -mom, and -ms (macro packages).\n\nThe guessed groff command including those options and the  found  file-\nspec parameters is put on the standard output.\n\nIt  is possible to specify arbitrary groff options on the command line.\nThese are passed on the output without change, except for the -marg op-\ntions.\n\nThe groff program has trouble when the wrong -marg option or several of\nthese options are specified.  In these cases, grog will print an  error\nmessage  and exit with an error code.  It is better to specify no -marg\noption.  Because such an option is only accepted and passed  when  grog\ndoes not find any of these options or the same option is found.\n\nIf  several  different -marg options are found by grog an error message\nis produced and the program is terminated with an error code.  But  the\noutput is written with the wrong options nevertheless.\n\nRemember that it is not necessary to determine a macro package.  A roff\nfile can also be written in the groff language without any macro  pack-\nage.  grog will produce an output without an -marg option.\n\nAs  groff  also  works  with pure text files without any roff requests,\ngrog cannot be used to identify a file to be a roff file.\n\nThe groffer(1) program heavily depends on a working grog.\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "Calling\ngrog meintro.me\nresults in\ngroff -me meintro.me\nSo grog recognized that the file meintro.me is  written  with  the  -me\nmacro package.\nOn the other hand,\ngrog pic.ms\noutputs\ngroff -p -t -e -ms pic.ms\nBesides  determining  the  macro  package -ms, grog recognized that the\nfile pic.ms additionally needs -pte, the combination of -p for pic,  -t\nfor tbl, and -e for eqn.\nIf both of the former example files are combined by the command\ngrog meintro.me pic.ms\nan  error  message  is sent to standard error because groff cannot work\nwith two different macro packages:\ngrog: error: there are several macro packages: -me -ms\nAdditionally the corresponding output with the wrong options is printed\nto standard output:\ngroff -pte -me -ms meintro.me pic.ms\nBut the program is terminated with an error code.  The call of\ngrog -ksS -Tdvi grnexmpl.g\ncontains several groff options that are just passed on the output with-\nout any interface to grog.  These are the option cluster -ksS  consist-\ning of -k, -s, and -S; and the option -T with argument dvi.  The output\nis\ngroff -k -s -S -Tdvi grnexmpl.g\nso no additional option was added by grog.   As  no  option  -marg  was\nfound by grog this file does not use a macro package.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "grog was originally written by James Clark.  The current Perl implemen-\ntation was written by Bernd Warken <groff-bernd.warken-72@web.de>  with\ncontributions  from Ralph Corderoy, and is maintained by Werner Lemberg\n<wl@gnu.org>.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "groff(1), groffer(1)\n\ngroff 1.22.4                     23 March 2022                         GROG(1)",
            "subsections": []
        }
    },
    "summary": "grog - guess options for a following groff command",
    "flags": [
        {
            "flag": "",
            "long": "--ligatures",
            "arg": null,
            "description": "this option forces to include the arguments -P-y -PU within the generated groff command line. --run with this option, the command line is output at standard error and then run on the computer."
        },
        {
            "flag": "",
            "long": "--warnings",
            "arg": null,
            "description": "with this option, some more warnings are output to standard er- ror. All other specified short options (words starting with one minus char- acter -) are interpreted as groff options or option clusters with or without argument. No space is allowed between options and their argu- ment. Except from the -marg options, all options will be passed on, i.e. they are included unchanged in the command for the output without effecting the work of grog. A filespec argument can either be the name of an existing file or a single minus - to mean standard input. If no filespec is specified standard input is read automatically."
        }
    ],
    "examples": [
        "Calling",
        "grog meintro.me",
        "results in",
        "groff -me meintro.me",
        "So grog recognized that the file meintro.me is  written  with  the  -me",
        "macro package.",
        "On the other hand,",
        "grog pic.ms",
        "outputs",
        "groff -p -t -e -ms pic.ms",
        "Besides  determining  the  macro  package -ms, grog recognized that the",
        "file pic.ms additionally needs -pte, the combination of -p for pic,  -t",
        "for tbl, and -e for eqn.",
        "If both of the former example files are combined by the command",
        "grog meintro.me pic.ms",
        "an  error  message  is sent to standard error because groff cannot work",
        "with two different macro packages:",
        "grog: error: there are several macro packages: -me -ms",
        "Additionally the corresponding output with the wrong options is printed",
        "to standard output:",
        "groff -pte -me -ms meintro.me pic.ms",
        "But the program is terminated with an error code.  The call of",
        "grog -ksS -Tdvi grnexmpl.g",
        "contains several groff options that are just passed on the output with-",
        "out any interface to grog.  These are the option cluster -ksS  consist-",
        "ing of -k, -s, and -S; and the option -T with argument dvi.  The output",
        "is",
        "groff -k -s -S -Tdvi grnexmpl.g",
        "so no additional option was added by grog.   As  no  option  -marg  was",
        "found by grog this file does not use a macro package."
    ],
    "see_also": [
        {
            "name": "groff",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/groff/1/json"
        },
        {
            "name": "groffer",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/groffer/1/json"
        }
    ]
}