{
    "content": [
        {
            "type": "text",
            "text": "# PIC (info)\n\n## NAME\n\npic - compile pictures for troff or TeX\n\n## SYNOPSIS\n\npic [-nvCSU] [file ...]\npic -t [-cvzCSU] [file ...]\n\n## DESCRIPTION\n\nThis manual page describes the GNU version of pic, which is part of the\ngroff document formatting system.  pic compiles  descriptions  of  pic-\ntures  embedded  within troff or TeX input files into commands that are\nunderstood by TeX or troff.  Each picture starts with a line  beginning\nwith  .PS and ends with a line beginning with .PE.  Anything outside of\n.PS and .PE is passed through without change.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS**\n- **USAGE**\n- **CONVERSION**\n- **FILES**\n- **SEE ALSO**\n- **BUGS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "PIC",
        "section": "",
        "mode": "info",
        "summary": "pic - compile pictures for troff or TeX",
        "synopsis": "pic [-nvCSU] [file ...]\npic -t [-cvzCSU] [file ...]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "troff",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/troff/1/json"
            },
            {
                "name": "groffout",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/groffout/5/json"
            },
            {
                "name": "tex",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/tex/1/json"
            },
            {
                "name": "gs",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/gs/1/json"
            },
            {
                "name": "ps2eps",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ps2eps/1/json"
            },
            {
                "name": "pstopnm",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/pstopnm/1/json"
            },
            {
                "name": "ps2epsi",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ps2epsi/1/json"
            },
            {
                "name": "pnm",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/pnm/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 43,
                "subsections": []
            },
            {
                "name": "USAGE",
                "lines": 355,
                "subsections": []
            },
            {
                "name": "CONVERSION",
                "lines": 47,
                "subsections": []
            },
            {
                "name": "FILES",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 23,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 10,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "pic - compile pictures for troff or TeX\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "pic [-nvCSU] [file ...]\n\npic -t [-cvzCSU] [file ...]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This manual page describes the GNU version of pic, which is part of the\ngroff document formatting system.  pic compiles  descriptions  of  pic-\ntures  embedded  within troff or TeX input files into commands that are\nunderstood by TeX or troff.  Each picture starts with a line  beginning\nwith  .PS and ends with a line beginning with .PE.  Anything outside of\n.PS and .PE is passed through without change.\n\nIt is the user's responsibility to provide appropriate  definitions  of\nthe  PS and PE macros.  When the macro package being used does not sup-\nply such definitions (for example, old versions  of  -ms),  appropriate\ndefinitions can be obtained with -mpic: These will center each picture.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "Options  that  do  not take arguments may be grouped behind a single -.\nThe special option -- can be used to mark the end of  the  options.   A\nfilename of - refers to the standard input.\n\n-C     Recognize  .PS  and  .PE even when followed by a character other\nthan space or newline.\n\n-S     Safer mode; do not execute sh commands.  This can be useful when\noperating on untrustworthy input (enabled by default).\n\n-U     Unsafe mode; revert the default option -S.\n\n-n     Don't  use  the  groff extensions to the troff drawing commands.\nYou should use this  if  you  are  using  a  postprocessor  that\ndoesn't  support these extensions.  The extensions are described\nin groffout(5).  The -n option also causes pic not to use zero-\nlength lines to draw dots in troff mode.\n\n-t     TeX mode.\n\n-c     Be more compatible with tpic.  Implies -t.  Lines beginning with\n\\ are not passed through transparently.  Lines beginning with  .\nare passed through with the initial .  changed to \\.  A line be-\nginning with .ps is given special treatment:  it  takes  an  op-\ntional integer argument specifying the line thickness (pen size)\nin milliinches; a missing argument restores  the  previous  line\nthickness;  the  default  line  thickness is 8 milliinches.  The\nline thickness thus specified takes effect only when a non-nega-\ntive  line thickness has not been specified by use of the thick-\nness attribute or by setting the linethick variable.\n\n-v     Print the version number.\n\n-z     In TeX mode draw dots using zero-length lines.\n\nThe following options supported by other versions of pic are ignored:\n\n-D     Draw all lines using the \\D escape sequence.   pic  always  does\nthis.\n\n-T dev Generate  output  for the troff device dev.  This is unnecessary\nbecause the troff output generated by pic is device-independent.\n",
                "subsections": []
            },
            "USAGE": {
                "content": "This section describes only the differences between  GNU  pic  and  the\noriginal version of pic.  Many of these differences also apply to newer\nversions of Unix pic.  A complete documentation  is  available  in  the\nfile\n\n/usr/share/doc/groff-base/pic.ms.gz\n\nTeX mode\nTeX  mode  is enabled by the -t option.  In TeX mode, pic will define a\nvbox called \\graph for each picture.  Use the figname command to change\nthe name of the vbox.  You must yourself print that vbox using, for ex-\nample, the command\n\n\\centerline{\\box\\graph}\n\nActually, since the vbox has a height  of  zero  (it  is  defined  with\n\\vtop) this will produce slightly more vertical space above the picture\nthan below it;\n\n\\centerline{\\raise 1em\\box\\graph}\n\nwould avoid this.\n\nTo make the vbox having a positive height and a depth of zero (as  used\ne.g. by LaTeX's graphics.sty), define the following macro in your docu-\nment:\n\n\\def\\gpicbox#1{%\n\\vbox{\\unvbox\\csname #1\\endcsname\\kern 0pt}}\n\nNow you can simply say \\gpicbox{graph} instead of \\box\\graph.\n\nYou must use a TeX driver that supports the tpic specials, version 2.\n\nLines beginning with \\ are passed through transparently; a %  is  added\nto  the  end  of the line to avoid unwanted spaces.  You can safely use\nthis feature to change fonts or to change the value  of  \\baselineskip.\nAnything  else  may  well  produce undesirable results; use at your own\nrisk.  Lines beginning with a period are not given any  special  treat-\nment.\n\nCommands\nfor variable = expr1 to expr2 [by [*]expr3] do X body X\nSet variable to expr1.  While the value of variable is less than\nor equal to expr2, do body and increment variable by  expr3;  if\nby  is not given, increment variable by 1.  If expr3 is prefixed\nby * then variable will instead be  multiplied  by  expr3.   The\nvalue  of  expr3 can be negative for the additive case; variable\nis then tested whether it is greater than  or  equal  to  expr2.\nFor  the  multiplicative  case, expr3 must be greater than zero.\nIf the constraints aren't met, the loop isn't executed.   X  can\nbe any character not occurring in body.\n\nif expr then X if-true X [else Y if-false Y]\nEvaluate  expr;  if it is non-zero then do if-true, otherwise do\nif-false.  X can be any character not occurring in  if-true.   Y\ncan be any character not occurring in if-false.\n\nprint arg...\nConcatenate  the  arguments and print as a line on stderr.  Each\narg must be an expression, a position, or text.  This is  useful\nfor debugging.\n\ncommand arg...\nConcatenate  the  arguments  and  pass them through as a line to\ntroff or TeX.  Each arg must be an expression,  a  position,  or\ntext.   This  has a similar effect to a line beginning with . or\n\\, but allows the values of variables to be passed through.  For\nexample,\n\n.PS\nx = 14\ncommand \".ds string x is \" x \".\"\n.PE\n\\*[string]\n\nprints\n\nx is 14.\n\nsh X command X\nPass  command  to a shell.  X can be any character not occurring\nin command.\n\ncopy \"filename\"\nInclude filename at this point in the file.\n\ncopy [\"filename\"] thru X body X [until \"word\"]\ncopy [\"filename\"] thru macro [until \"word\"]\nThis construct does body once for each  line  of  filename;  the\nline  is split into blank-delimited words, and occurrences of $i\nin body, for i between 1 and 9, are replaced by the i-th word of\nthe  line.   If  filename is not given, lines are taken from the\ncurrent input up to .PE.  If an until clause is specified, lines\nwill  be read only until a line the first word of which is word;\nthat line will then be discarded.  X can be  any  character  not\noccurring in body.  For example,\n\n.PS\ncopy thru % circle at ($1,$2) % until \"END\"\n1 2\n3 4\n5 6\nEND\nbox\n.PE\n\nis equivalent to\n\n.PS\ncircle at (1,2)\ncircle at (3,4)\ncircle at (5,6)\nbox\n.PE\n\nThe  commands  to  be  performed for each line can also be taken\nfrom a macro defined earlier by giving the name of the macro  as\nthe argument to thru.\n\nreset\nreset variable1[,] variable2 ...\nReset  pre-defined  variables  variable1, variable2 ... to their\ndefault values.  If no arguments are given,  reset  all  pre-de-\nfined  variables to their default values.  Note that assigning a\nvalue to scale also causes all pre-defined variables  that  con-\ntrol  dimensions  to  be reset to their default values times the\nnew value of scale.\n\nplot expr [\"text\"]\nThis is a text object which is constructed by using  text  as  a\nformat  string for sprintf with an argument of expr.  If text is\nomitted a format string of \"%g\"  is  used.   Attributes  can  be\nspecified  in the same way as for a normal text object.  Be very\ncareful that you specify an appropriate format string; pic  does\nonly very limited checking of the string.  This is deprecated in\nfavour of sprintf.\n\nvariable := expr\nThis is similar to = except variable must  already  be  defined,\nand  expr  will be assigned to variable without creating a vari-\nable local to the current block.  (By contrast,  =  defines  the\nvariable  in  the  current  block  if  it is not already defined\nthere, and then changes the value in the  current  block  only.)\nFor example, the following:\n\n.PS\nx = 3\ny = 3\n[\nx := 5\ny = 5\n]\nprint x \" \" y\n.PE\n\nprints\n\n5 3\n\nArguments of the form\n\nX anything X\n\nare also allowed to be of the form\n\n{ anything }\n\nIn  this  case  anything  can  contain balanced occurrences of { and }.\nStrings may contain X or imbalanced occurrences of { and }.\n\nExpressions\nThe syntax for expressions has been significantly extended:\n\nx ^ y (exponentiation)\nsin(x)\ncos(x)\natan2(y, x)\nlog(x) (base 10)\nexp(x) (base 10, i.e. 10^x)\nsqrt(x)\nint(x)\nrand() (return a random number between 0 and 1)\nrand(x) (return a random number between 1 and x; deprecated)\nsrand(x) (set the random number seed)\nmax(e1, e2)\nmin(e1, e2)\n!e\ne1 && e2\ne1 || e2\ne1 == e2\ne1 != e2\ne1 >= e2\ne1 > e2\ne1 <= e2\ne1 < e2\n\"str1\" == \"str2\"\n\"str1\" != \"str2\"\n\nString comparison expressions must be parenthesised in some contexts to\navoid ambiguity.\n\nOther Changes\nA  bare  expression, expr, is acceptable as an attribute; it is equiva-\nlent to dir expr, where dir is the current direction.  For example\n\nline 2i\n\nmeans draw a line 2 inches long in the current direction.  The 'i'  (or\n'I')  character  is  ignored;  to use another measurement unit, set the\nscale variable to an appropriate value.\n\nThe maximum width and height of the picture are taken  from  the  vari-\nables maxpswid and maxpsht.  Initially these have values 8.5 and 11.\n\nScientific notation is allowed for numbers.  For example\n\nx = 5e-2\n\nText attributes can be compounded.  For example,\n\n\"foo\" above ljust\n\nis valid.\n\nThere  is  no  limit to the depth to which blocks can be examined.  For\nexample,\n\n[A: [B: [C: box ]]] with .A.B.C.sw at 1,2\ncircle at last [].A.B.C\n\nis acceptable.\n\nArcs now have compass points determined by the circle of which the  arc\nis a part.\n\nCircles,  ellipses,  and  arcs  can  be  dotted or dashed.  In TeX mode\nsplines can be dotted or dashed also.\n\nBoxes can have rounded corners.  The rad attribute specifies the radius\nof  the quarter-circles at each corner.  If no rad or diam attribute is\ngiven, a radius of boxrad is used.  Initially, boxrad has a value of 0.\nA box with rounded corners can be dotted or dashed.\n\nBoxes  can have slanted sides.  This effectively changes the shape of a\nbox from a rectangle to an arbitrary parallelogram.  The  xslanted  and\nyslanted attributes specify the x and y offset of the box's upper right\ncorner from its default position.\n\nThe .PS line can have a second argument specifying a maximum height for\nthe  picture.   If the width of zero is specified the width will be ig-\nnored in computing the scaling factor for the picture.  Note  that  GNU\npic  will  always scale a picture by the same amount vertically as well\nas horizontally.  This is different from the  DWB  2.0  pic  which  may\nscale a picture by a different amount vertically than horizontally if a\nheight is specified.\n\nEach text object has an invisible box associated with it.  The  compass\npoints  of  a text object are determined by this box.  The implicit mo-\ntion associated with the object is also determined by  this  box.   The\ndimensions  of this box are taken from the width and height attributes;\nif the width attribute is not supplied then the width will be taken  to\nbe  textwid;  if  the  height attribute is not supplied then the height\nwill be taken to be the number of text strings associated with the  ob-\nject times textht.  Initially textwid and textht have a value of 0.\n\nIn  (almost  all) places where a quoted text string can be used, an ex-\npression of the form\n\nsprintf(\"format\", arg,...)\n\ncan also be used; this will produce the arguments  formatted  according\nto format, which should be a string as described in printf(3) appropri-\nate for the number of arguments supplied.\n\nThe thickness of the lines used to draw objects is  controlled  by  the\nlinethick  variable.   This  gives the thickness of lines in points.  A\nnegative value means use the default thickness:  in  TeX  output  mode,\nthis  means  use  a thickness of 8 milliinches; in TeX output mode with\nthe -c option, this means use  the  line  thickness  specified  by  .ps\nlines; in troff output mode, this means use a thickness proportional to\nthe pointsize.  A zero value means draw the thinnest possible line sup-\nported by the output device.  Initially it has a value of -1.  There is\nalso a thick[ness] attribute.  For example,\n\ncircle thickness 1.5\n\nwould draw a circle using a line with a thickness of 1.5  points.   The\nthickness  of lines is not affected by the value of the scale variable,\nnor by the width or height given in the .PS line.\n\nBoxes (including boxes with rounded corners or slanted sides),  circles\nand  ellipses  can  be  filled by giving them an attribute of fill[ed].\nThis takes an optional argument of an expression with a value between 0\nand  1; 0 will fill it with white, 1 with black, values in between with\na proportionally gray shade.  A value greater than 1 can also be  used:\nthis means fill with the shade of gray that is currently being used for\ntext and lines.  Normally this will be black, but  output  devices  may\nprovide  a  mechanism for changing this.  Without an argument, then the\nvalue of the variable fillval will be used.  Initially this has a value\nof  0.5.   The  invisible  attribute does not affect the filling of ob-\njects.  Any text associated with a filled object will  be  added  after\nthe  object  has  been filled, so that the text will not be obscured by\nthe filling.\n\nThree additional modifiers are available to  specify  colored  objects:\noutline[d]  sets  the  color of the outline, shaded the fill color, and\ncolo[u]r[ed] sets both.  All three keywords expect a suffix  specifying\nthe color, for example\n\ncircle shaded \"green\" outline \"black\"\n\nCurrently, color support isn't available in TeX mode.  Predefined color\nnames for groff are in the device macro files, for example ps.tmac; ad-\nditional colors can be defined with the .defcolor request (see the man-\nual page of troff(1) for more details).\n\nTo change the name of the vbox in TeX  mode,  set  the  pseudo-variable\nfigname  (which  is  actually a specially parsed command) within a pic-\nture.  Example:\n\n.PS\nfigname = foobar;\n...\n.PE\n\nThe picture is then available in the box \\foobar.\n\npic assumes that at the beginning of a  picture  both  glyph  and  fill\ncolor are set to the default value.\n\nArrow  heads will be drawn as solid triangles if the variable arrowhead\nis non-zero and either TeX mode is enabled or the  -n  option  has  not\nbeen given.  Initially arrowhead has a value of 1.  Note that solid ar-\nrow heads are always filled with the current outline color.\n\nThe troff output of pic is device-independent.  The -T option is there-\nfore  redundant.   All  numbers  are taken to be in inches; numbers are\nnever interpreted to be in troff machine units.\n\nObjects can have an aligned attribute.  This  will  only  work  if  the\npostprocessor  is grops, or gropdf.  Any text associated with an object\nhaving the aligned attribute will be rotated about the  center  of  the\nobject  so  that it is aligned in the direction from the start point to\nthe end point of the object.  Note that this attribute will have no ef-\nfect for objects whose start and end points are coincident.\n\nIn places where nth is allowed 'expr'th is also allowed.  Note that 'th\nis a single token: no space is allowed between the ' and the  th.   For\nexample,\n\nfor i = 1 to 4 do {\nline from 'i'th box.nw to 'i+1'th box.se\n}\n",
                "subsections": []
            },
            "CONVERSION": {
                "content": "To  obtain a stand-alone picture from a pic file, enclose your pic code\nwith .PS and .PE requests; roff configuration commands may be added  at\nthe beginning of the file, but no roff text.\n\nIt  is  necessary  to feed this file into groff without adding any page\ninformation, so you must check which .PS and .PE requests are  actually\ncalled.  For example, the mm macro package adds a page number, which is\nvery annoying.  At the moment, calling standard groff without any macro\npackage  works.   Alternatively, you can define your own requests, e.g.\nto do nothing:\n\n.de PS\n..\n.de PE\n..\n\ngroff itself does not provide direct  conversion  into  other  graphics\nfile  formats.  But there are lots of possibilities if you first trans-\nform your picture into PostScript(R)  format  using  the  groff  option\n-Tps.   Since this ps-file lacks BoundingBox information it is not very\nuseful by itself, but it may be fed  into  other  conversion  programs,\nusually  named  ps2other or pstoother or the like.  Moreover, the Post-\nScript interpreter ghostscript (gs) has  built-in  graphics  conversion\ndevices that are called with the option\n\ngs -sDEVICE=<devname>\n\nCall\n\ngs --help\n\nfor a list of the available devices.\n\nAn  alternative  may be to use the -Tpdf option to convert your picture\ndirectly into PDF format.  The MediaBox of the  file  produced  can  be\ncontrolled by passing a -P-p papersize to groff.\n\nAs the Encapsulated PostScript File Format EPS is getting more and more\nimportant, and the conversion wasn't regarded trivial in the  past  you\nmight  be  interested  to  know  that  there is a conversion tool named\nps2eps which does the right job.  It  is  much  better  than  the  tool\nps2epsi packaged with gs.\n\nFor  bitmapped  graphic  formats, you should use pstopnm; the resulting\n(intermediate) PNM file can be then converted to virtually any graphics\nformat using the tools of the netpbm package.\n",
                "subsections": []
            },
            "FILES": {
                "content": "/usr/share/groff/1.22.4/tmac/pic.tmac\nExample definitions of the PS and PE macros.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "troff(1),   groffout(5),   tex(1),   gs(1),   ps2eps(1),   pstopnm(1),\nps2epsi(1), pnm(5)\n\nEric S. Raymond, Making Pictures With GNU PIC.\n/usr/share/doc/groff-base/pic.ps (this file, together with  its  source\nfile, pic.ms, is part of the groff documentation)\n\nTpic: Pic for TeX\n\nBrian  W.  Kernighan,  PIC -- A Graphics Language for Typesetting (User\nManual) <http://cm.bell-labs.com/cm/cs/cstr/116.ps.gz>.  AT&T Bell Lab-\noratories,  Computing  Science  Technical  Report No. 116 (revised May,\n1991).\n\nps2eps  is  available  from  CTAN  mirrors,  e.g.  <ftp://ftp.dante.de/\ntex-archive/support/ps2eps/>\n\nW. Richard Stevens, Turning PIC into HTML <http://www.kohala.com/start/\ntroff/pic2html.html>\n\nW. Richard Stevens,  Examples  of  pic  Macros  <http://www.kohala.com/\nstart/troff/pic.examples.ps>\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Input  characters  that  are  invalid for groff (i.e., those with ASCII\ncode 0, or 013 octal, or between 015 and 037 octal, or between 0200 and\n0237 octal) are rejected even in TeX mode.\n\nThe interpretation of fillval is incompatible with the pic in 10th edi-\ntion Unix, which interprets 0 as black and 1 as white.\n\nPostScript(R) is a registered trademark of Adobe Systems Incorporation.\n\ngroff 1.22.4                     23 March 2022                          PIC(1)",
                "subsections": []
            }
        }
    }
}