{
    "content": [
        {
            "type": "text",
            "text": "# GRN(1) (man)\n\n**Summary:** grn - groff preprocessor for gremlin files\n\n**Synopsis:** grn [-Cv] [-T dev] [-M dir] [-F dir] [file ...]\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| -T | — | — | able devices. |\n| -M | — | — | that order) the current directory, the home directory, /usr/lib/groff/site-tmac, /usr/ share/groff/site-tmac, and /usr/s |\n| -F | — | — | file before the default font directories /usr/share/groff/site-font, /usr/share/groff/ 1.22.4/font, and /usr/lib/font. |\n| -C | — | — | newline. |\n| -v | — | — |  |\n\n## See Also\n\n- gremlin(1)\n- groff(1)\n- pic(1)\n- ideal(1)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (2 lines)\n- **DESCRIPTION** (11 lines)\n- **OPTIONS** (2 lines) — 5 subsections\n  - -T (2 lines)\n  - -M (3 lines)\n  - -F (3 lines)\n  - -C (2 lines)\n  - -v (1 lines)\n- **GRN COMMANDS** (49 lines) — 1 subsections\n  - default (20 lines)\n- **NOTES ABOUT GROFF** (18 lines)\n- **GREMLIN FILE FORMAT** (48 lines)\n- **ELEMENT SPECIFICATIONS** (68 lines)\n- **NOTES ON COORDINATES** (8 lines)\n- **NOTES ON SUN/X11 COORDINATES** (4 lines)\n- **FILES** (3 lines)\n- **AUTHORS** (3 lines)\n- **SEE ALSO** (5 lines)\n\n## Full Content\n\n### NAME\n\ngrn - groff preprocessor for gremlin files\n\n### SYNOPSIS\n\ngrn [-Cv] [-T dev] [-M dir] [-F dir] [file ...]\n\n### DESCRIPTION\n\ngrn  is a preprocessor for including gremlin pictures in groff input.  grn writes to standard\noutput, processing only input lines between two that start with .GS  and  .GE.   Those  lines\nmust  contain  grn commands (see below).  These commands request a gremlin file, and the pic‐\nture in that file is converted and placed in the troff input stream.  The .GS request may  be\nfollowed by a C, L, or R to center, left, or right justify the whole gremlin picture (default\njustification is center).  If no file is mentioned, the standard input is read.  At  the  end\nof  the  picture,  the position on the page is the bottom of the gremlin picture.  If the grn\nentry is ended with .GF instead of .GE, the position is left at the top of the picture.\n\nPlease note that currently only the -me macro package has support for .GS, .GE, and .GF.\n\n### OPTIONS\n\nWhitespace is permitted between a command-line option and its argument.\n\n#### -T\n\nable devices.\n\n#### -M\n\nthat order) the current directory, the home directory, /usr/lib/groff/site-tmac, /usr/\nshare/groff/site-tmac, and /usr/share/groff/1.22.4/tmac.\n\n#### -F\n\nfile before the default font directories /usr/share/groff/site-font, /usr/share/groff/\n1.22.4/font, and /usr/lib/font.\n\n#### -C\n\nnewline.\n\n#### -v\n\n### GRN COMMANDS\n\nEach input line between .GS and .GE may have one grn command.  Commands consist of one or two\nstrings separated by white space, the first string being the command and the second its oper‐\nand.  Commands may be upper or lower case and abbreviated down to one character.\n\nCommands that affect a picture's environment (those listed before  default,  see  below)  are\nonly  in  effect for the current picture: The environment is reinitialized to the defaults at\nthe start of the next picture.  The commands are as follows:\n\n1 N\n2 N\n3 N\n4 N    Set gremlin's text size number 1 (2, 3, or 4) to N points.  The default is 12 (16, 24,\nand 36, respectively).\n\nroman f\nitalics f\nbold f\nspecial f\nSet  the  roman  (italics,  bold, or special) font to troff's font f (either a name or\nnumber).  The default is R (I, B, and S, respectively).\n\nl f\nstipple f\nSet the stipple font to troff's stipple font f (name or number).  The command  stipple\nmay be abbreviated down as far as ‘st’ (to avoid confusion with special).  There is no\ndefault for stipples (unless one is set by the default command), and it is invalid  to\ninclude a gremlin picture with polygons without specifying a stipple font.\n\nx N\nscale N\nMagnify  the picture (in addition to any default magnification) by N, a floating point\nnumber larger than zero.  The command scale may be abbreviated down to ‘sc’.\n\nnarrow N\nmedium N\nthick N\nSet the thickness of gremlin's narrow (medium and  thick,  respectively)  lines  to  N\ntimes 0.15pt (this value can be changed at compile time).  The default is 1.0 (3.0 and\n5.0, respectively), which corresponds to 0.15pt (0.45pt and 0.75pt, respectively).   A\nthickness  value of zero selects the smallest available line thickness.  Negative val‐\nues cause the line thickness to be proportional to the current point size.\n\npointscale <off/on>\nScale text to match the picture.  Gremlin text is usually printed in  the  point  size\nspecified  with  the  commands 1, 2, 3, or 4, regardless of any scaling factors in the\npicture.  Setting pointscale will cause the point sizes  to  scale  with  the  picture\n(within  troff's  limitations,  of  course).  An operand of anything but off will turn\ntext scaling on.\n\n#### default\n\nReset the picture environment defaults to the settings in the current  picture.   This\nis  meant  to  be used as a global parameter setting mechanism at the beginning of the\ntroff input file, but can be used at any time to reset the default settings.\n\nwidth N\nForces the picture to be N inches wide.  This overrides any scaling factors present in\nthe same picture.  ‘width 0’ is ignored.\n\nheight N\nForces picture to be N inches high, overriding other scaling factors.  If both ‘width’\nand ‘height’ are specified the tighter constraint will determine the scale of the pic‐\nture.   Height  and  width  commands are not saved with a default command.  They will,\nhowever, affect point size scaling if that option is set.\n\nfile name\nGet picture from gremlin file name located the current directory (or  in  the  library\ndirectory;  see  the -M option above).  If two file commands are given, the second one\noverrides the first.  If name doesn't exist, an error message is reported and process‐\ning continues from the .GE line.\n\n### NOTES ABOUT GROFF\n\nSince  grn  is  a  preprocessor, it doesn't know about current indents, point sizes, margins,\nnumber registers, etc.  Consequently, no troff input can be placed between the  .GS  and  .GE\nrequests.   However,  gremlin  text  is now processed by troff, so anything valid in a single\nline of troff input is valid in a line of gremlin text (barring ‘.’ directives at the  begin‐\nning of a line).  Thus, it is possible to have equations within a gremlin figure by including\nin the gremlin file eqn expressions enclosed by previously defined delimiters (e.g. $$).\n\nWhen using grn along with other preprocessors, it is best to run tbl before grn, pic,  and/or\nideal to avoid overworking tbl.  Eqn should always be run last.\n\nA  picture is considered an entity, but that doesn't stop troff from trying to break it up if\nit falls off the end of a page.  Placing the picture between ‘keeps’ in -me macros  will  en‐\nsure proper placement.\n\ngrn uses troff's number registers g1 through g9 and sets registers g1 and g2 to the width and\nheight of the gremlin figure (in device units) before entering the .GS request (this  is  for\nthose who want to rewrite these macros).\n\n### GREMLIN FILE FORMAT\n\nThere  exist two distinct gremlin file formats, the original format from the AED graphic ter‐\nminal version, and the SUN or X11 version.  An extension to the SUN/X11 version allowing ref‐\nerence points with negative coordinates is not compatible with the AED version.  As long as a\ngremlin file does not contain negative coordinates, either format will be read  correctly  by\neither  version  of  gremlin  or grn.  The other difference from SUN/X11 format is the use of\nnames for picture objects (e.g., POLYGON, CURVE) instead of numbers.  Files representing  the\nsame picture are shown in Table 1 in each format.\n\n\nsungremlinfile        gremlinfile\n0 240.00 128.00       0 240.00 128.00\nCENTCENT              2\n240.00 128.00         240.00 128.00\n185.00 120.00         185.00 120.00\n240.00 120.00         240.00 120.00\n296.00 120.00         296.00 120.00\n*                     -1.00 -1.00\n2 3                   2 3\n10 A Triangle         10 A Triangle\nPOLYGON               6\n224.00 416.00         224.00 416.00\n96.00 160.00          96.00 160.00\n384.00 160.00         384.00 160.00\n*                     -1.00 -1.00\n5 1                   5 1\n0                     0\n-1                    -1\n\nTable 1.  File examples\n\n\n•      The  first  line of each gremlin file contains either the string gremlinfile (AED ver‐\nsion) or sungremlinfile (SUN/X11)\n\n•      The second line of the file contains an orientation, and x and y values  for  a  posi‐\ntioning point, separated by spaces.  The orientation, either 0 or 1, is ignored by the\nSUN/X11 version.  0 means that gremlin will display things in horizontal format (draw‐\ning area wider than it is tall, with menu across top).  1 means that gremlin will dis‐\nplay things in vertical format (drawing area taller than it is wide, with menu on left\nside).   x  and y are floating point values giving a positioning point to be used when\nthis file is read into another file.  The stuff on this line really isn't all that im‐\nportant; a value of “1 0.00 0.00” is suggested.\n\n•      The  rest of the file consists of zero or more element specifications.  After the last\nelement specification is a line containing the string “-1”.\n\n•      Lines longer than 127 characters are chopped to this limit.\n\n### ELEMENT SPECIFICATIONS\n\n•      The first line of each element contains a single decimal number giving the type of the\nelement (AED version) or its ASCII name (SUN/X11 version).  See Table 2.\n\n\ngremlin File Format − Object Type Specification\n\nAED Number   SUN/X11 Name           Description\n0       BOTLEFT        bottom-left-justified text\n1       BOTRIGHT       bottom-right-justified text\n2       CENTCENT       center-justified text\n3       VECTOR         vector\n4       ARC            arc\n5       CURVE          curve\n6       POLYGON        polygon\n7       BSPLINE        b-spline\n8       BEZIER         Bézier\n10       TOPLEFT        top-left-justified text\n11       TOPCENT        top-center-justified text\n12       TOPRIGHT       top-right-justified text\n\n13       CENTLEFT       left-center-justified text\n14       CENTRIGHT      right-center-justified text\n15       BOTCENT        bottom-center-justified text\n\nTable 2.\nType Specifications in gremlin Files\n\n\n•      After  the  object type comes a variable number of lines, each specifying a point used\nto display the element.  Each line contains an  x-coordinate  and  a  y-coordinate  in\nfloating  point  format,  separated  by spaces.  The list of points is terminated by a\nline containing the string “-1.0  -1.0”  (AED  version)  or  a  single  asterisk,  “*”\n(SUN/X11 version).\n\n•      After the points comes a line containing two decimal values, giving the brush and size\nfor the element.  The brush determines the style in which things are drawn.  For  vec‐\ntors, arcs, and curves there are six valid brush values:\n\n\n1 −       thin dotted lines\n2 −       thin dot-dashed lines\n3 −       thick solid lines\n4 −       thin dashed lines\n5 −       thin solid lines\n6 −       medium solid lines\n\nFor  polygons,  one more value, 0, is valid.  It specifies a polygon with an invisible\nborder.  For text, the brush selects a font as follows:\n\n\n1 −       roman (R font in groff)\n2 −       italics (I font in groff)\n3 −       bold (B font in groff)\n4 −       special (S font in groff)\n\nIf you're using grn to run your pictures through groff, the  font  is  really  just  a\nstarting  font:  The  text  string can contain formatting sequences like “\\fI” or “\\d”\nwhich may change the font (as well as do many other things).  For text, the size field\nis a decimal value between 1 and 4.  It selects the size of the font in which the text\nwill be drawn.  For polygons, this size field is interpreted as a  stipple  number  to\nfill the polygon with.  The number is used to index into a stipple font at print time.\n\n•      The  last  line  of each element contains a decimal number and a string of characters,\nseparated by a single space.  The number is a count of the number of characters in the\nstring.   This  information  is  only  used  for  text elements, and contains the text\nstring.  There can be spaces inside the text.  For arcs,  curves,  and  vectors,  this\nline of the element contains the string “0”.\n\n### NOTES ON COORDINATES\n\ngremlin  was  designed  for  AEDs, and its coordinates reflect the AED coordinate space.  For\nvertical pictures, x-values range 116 to 511, and y-values from 0  to  483.   For  horizontal\npictures,  x-values  range  from  0  to  511  and y-values range from 0 to 367.  Although you\nneedn't absolutely stick to this range, you'll get best results if you at least stay in  this\nvicinity.  Also, point lists are terminated by a point of (-1, -1), so you shouldn't ever use\nnegative coordinates.  gremlin writes out coordinates using format “%f1.2”; it's  probably  a\ngood idea to use the same format if you want to modify the grn code.\n\n### NOTES ON SUN/X11 COORDINATES\n\nThere  is  no  longer a restriction on the range of coordinates used to create objects in the\nSUN/X11 version of gremlin.  However, files with negative coordinates will cause problems  if\ndisplayed on the AED.\n\n### FILES\n\n/usr/share/groff/1.22.4/font/devname/DESC\nDevice description file for device name.\n\n### AUTHORS\n\nDavid Slattengren and Barry Roitblat wrote the original Berkeley grn.  Daniel Senderowicz and\nWerner Lemberg modified it for groff.\n\n### SEE ALSO\n\ngremlin(1), groff(1), pic(1), ideal(1)\n\n\n\ngroff 1.22.4                                23 March 2022                                     GRN(1)\n\n"
        }
    ],
    "structuredContent": {
        "command": "GRN",
        "section": "1",
        "mode": "man",
        "summary": "grn - groff preprocessor for gremlin files",
        "synopsis": "grn [-Cv] [-T dev] [-M dir] [-F dir] [file ...]",
        "flags": [
            {
                "flag": "-T",
                "long": null,
                "arg": null,
                "description": "able devices."
            },
            {
                "flag": "-M",
                "long": null,
                "arg": null,
                "description": "that order) the current directory, the home directory, /usr/lib/groff/site-tmac, /usr/ share/groff/site-tmac, and /usr/share/groff/1.22.4/tmac."
            },
            {
                "flag": "-F",
                "long": null,
                "arg": null,
                "description": "file before the default font directories /usr/share/groff/site-font, /usr/share/groff/ 1.22.4/font, and /usr/lib/font."
            },
            {
                "flag": "-C",
                "long": null,
                "arg": null,
                "description": "newline."
            },
            {
                "flag": "-v",
                "long": null,
                "arg": null,
                "description": ""
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "gremlin",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/gremlin/1/json"
            },
            {
                "name": "groff",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/groff/1/json"
            },
            {
                "name": "pic",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pic/1/json"
            },
            {
                "name": "ideal",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ideal/1/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "-T",
                        "lines": 2,
                        "flag": "-T"
                    },
                    {
                        "name": "-M",
                        "lines": 3,
                        "flag": "-M"
                    },
                    {
                        "name": "-F",
                        "lines": 3,
                        "flag": "-F"
                    },
                    {
                        "name": "-C",
                        "lines": 2,
                        "flag": "-C"
                    },
                    {
                        "name": "-v",
                        "lines": 1,
                        "flag": "-v"
                    }
                ]
            },
            {
                "name": "GRN COMMANDS",
                "lines": 49,
                "subsections": [
                    {
                        "name": "default",
                        "lines": 20
                    }
                ]
            },
            {
                "name": "NOTES ABOUT GROFF",
                "lines": 18,
                "subsections": []
            },
            {
                "name": "GREMLIN FILE FORMAT",
                "lines": 48,
                "subsections": []
            },
            {
                "name": "ELEMENT SPECIFICATIONS",
                "lines": 68,
                "subsections": []
            },
            {
                "name": "NOTES ON COORDINATES",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "NOTES ON SUN/X11 COORDINATES",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ]
    }
}