2 Copyright (C) 1989-1995 Free Software Foundation, Inc.
4 Permission is granted to make and distribute verbatim copies of
5 this manual provided the copyright notice and this permission notice
6 are preserved on all copies.
8 Permission is granted to copy and distribute modified versions of this
9 manual under the conditions for verbatim copying, provided that the
10 entire resulting derived work is distributed under the terms of a
11 permission notice identical to this one.
13 Permission is granted to copy and distribute translations of this
14 manual into another language, under the above conditions for modified
15 versions, except that this permission notice may be included in
16 translations approved by the Free Software Foundation instead of in
19 .\" Like TP, but if specified indent is more than half
20 .\" the current line-length - indent, use the default indent.
22 .ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
25 .ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
29 .\" The BSD man macros can't handle " in arguments to font change macros,
30 .\" so use \(ts instead of ".
32 .TH @G@PIC @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
34 @g@pic \- compile pictures for troff or TeX
56 This manual page describes the GNU version of
58 which is part of the groff document formatting system.
60 compiles descriptions of pictures embedded within
62 or \*(tx input files into commands that are understood by \*(tx or
64 Each picture starts with a line beginning with
66 and ends with a line beginning with
72 is passed through without change.
74 It is the user's responsibility to provide appropriate definitions of the
79 When the macro package being used does not supply such definitions
80 (for example, old versions of \-ms),
81 appropriate definitions can be obtained with
83 these will center each picture.
86 Options that do not take arguments may be grouped behind a single
90 can be used to mark the end of the options.
93 refers to the standard input.
100 even when followed by a character other than space or newline.
103 Safer mode; do not execute
106 This can be useful when operating on untrustworthy input.
109 Don't use the groff extensions to the troff drawing commands.
110 You should use this if you are using a postprocessor that doesn't support
112 The extensions are described in
113 .BR groff_out (@MAN5EXT@).
116 option also causes pic
117 not to use zero-length lines to draw dots in troff mode.
123 Be more compatible with
129 are not passed through transparently.
132 are passed through with the initial
136 A line beginning with
138 is given special treatment:
139 it takes an optional integer argument specifying
140 the line thickness (pen size) in milliinches;
141 a missing argument restores the previous line thickness;
142 the default line thickness is 8 milliinches.
143 The line thickness thus specified takes effect only
144 when a non-negative line thickness has not been
145 specified by use of the
147 attribute or by setting the
152 Print the version number.
155 In \*(tx mode draw dots using zero-length lines.
157 The following options supported by other versions of
162 Draw all lines using the \eD escape sequence.
167 Generate output for the
171 This is unnecessary because the
175 is device-independent.
177 This section describes only the differences between GNU pic and the original
179 Many of these differences also apply to newer versions of Unix pic.
182 \*(tx mode is enabled by the
185 In \*(tx mode, pic will define a vbox called
188 You must yourself print that vbox using, for example, the command
192 \ecenterline{\ebox\egraph}
195 Actually, since the vbox has a height of zero this will produce
196 slightly more vertical space above the picture than below it;
200 \ecenterline{\eraise 1em\ebox\egraph}
205 You must use a \*(tx driver that supports the
211 are passed through transparently; a
213 is added to the end of the line to avoid unwanted spaces.
214 You can safely use this feature to change fonts or to
217 Anything else may well produce undesirable results; use at your own risk.
218 Lines beginning with a period are not given any special treatment.
221 \fBfor\fR \fIvariable\fR \fB=\fR \fIexpr1\fR \fBto\fR \fIexpr2\fR \
222 [\fBby\fR [\fB*\fR]\fIexpr3\fR] \fBdo\fR \fIX\fR \fIbody\fR \fIX\fR
229 is less than or equal to
239 is not given, increment
248 will instead be multiplied by
251 can be any character not occurring in
254 \fBif\fR \fIexpr\fR \fBthen\fR \fIX\fR \fIif-true\fR \fIX\fR \
255 [\fBelse\fR \fIY\fR \fIif-false\fR \fIY\fR]
258 if it is non-zero then do
263 can be any character not occurring in
266 can be any character not occurring in
269 \fBprint\fR \fIarg\fR\|.\|.\|.
270 Concatenate the arguments and print as a line on stderr.
273 must be an expression, a position, or text.
274 This is useful for debugging.
276 \fBcommand\fR \fIarg\fR\|.\|.\|.
277 Concatenate the arguments
278 and pass them through as a line to troff or\*(tx.
281 must be an expression, a position, or text.
282 This has a similar effect to a line beginning with
286 but allows the values of variables to be passed through.
288 \fBsh\fR \fIX\fR \fIcommand\fR \fIX\fR
293 can be any character not occurring in
296 \fBcopy\fR \fB"\fIfilename\fB"\fR
299 at this point in the file.
301 \fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fIX\fR \fIbody\fR \fIX\fR \
302 [\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]
305 \fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fImacro\fR \
306 [\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]
309 once for each line of
311 the line is split into blank-delimited words,
324 is not given, lines are taken from the current input up to
329 lines will be read only until a line the first word of which is
331 that line will then be discarded.
333 can be any character not occurring in
341 copy thru % circle at ($1,$2) % until "END"
367 The commands to be performed for each line can also be taken
368 from a macro defined earlier by giving the name of the macro
376 \fBreset\fI variable1\fB,\fI variable2 .\^.\^.
377 Reset pre-defined variables
380 \&.\^.\^. to their default values.
381 If no arguments are given, reset all pre-defined variables
382 to their default values.
383 Note that assigning a value to
385 also causes all pre-defined variables that control dimensions
386 to be reset to their default values times the new value of scale.
388 \fBplot\fR \fIexpr\fR [\fB"\fItext\*(ic\fB"\fR]
389 This is a text object which is constructed by using
391 as a format string for sprintf
396 is omitted a format string of
399 Attributes can be specified in the same way as for a normal text
401 Be very careful that you specify an appropriate format string;
402 pic does only very limited checking of the string.
403 This is deprecated in favour of
411 must already be defined,
414 will be changed only in the innermost block in which it is defined.
417 defines the variable in the current block if it is not already defined there,
418 and then changes the value in the current block.)
420 Arguments of the form
424 are also allowed to be of the form
430 can contain balanced occurrences of
436 or imbalanced occurrences of
441 The syntax for expressions has been significantly extended:
456 (base 10, ie 10\v'-.4m'\fIx\*(ic\fR\v'.4m')
463 (return a random number between 0 and 1)
466 (return a random number between 1 and
492 \fB"\fIstr1\*(ic\fB" == "\fIstr2\*(ic\fB"\fR
494 \fB"\fIstr1\*(ic\fB" != "\fIstr2\*(ic\fB"\fR
497 String comparison expressions must be parenthesised in some contexts
503 is acceptable as an attribute;
508 is the current direction.
513 means draw a line 2 inches long in the current direction.
515 The maximum width and height of the picture are taken from the variables
519 Initially these have values 8.5 and 11.
521 Scientific notation is allowed for numbers.
528 Text attributes can be compounded.
536 There is no limit to the depth to which blocks can be examined.
540 [A: [B: [C: box ]]] with .A.B.C.sw at 1,2
543 circle at last [\^].A.B.C
547 Arcs now have compass points
548 determined by the circle of which the arc is a part.
550 Circles and arcs can be dotted or dashed.
551 In \*(tx mode splines can be dotted or dashed.
553 Boxes can have rounded corners.
556 attribute specifies the radius of the quarter-circles at each corner.
561 attribute is given, a radius of
567 A box with rounded corners can be dotted or dashed.
571 line can have a second argument specifying a maximum height for
573 If the width of zero is specified the width will be ignored in computing
574 the scaling factor for the picture.
575 Note that GNU pic will always scale a picture by the same amount
576 vertically as horizontally.
577 This is different from the
579 2.0 pic which may scale a picture by a
580 different amount vertically than horizontally if a height is
583 Each text object has an invisible box associated with it.
584 The compass points of a text object are determined by this box.
585 The implicit motion associated with the object is also determined
587 The dimensions of this box are taken from the width and height attributes;
588 if the width attribute is not supplied then the width will be taken to be
590 if the height attribute is not supplied then the height will be taken to be
591 the number of text strings associated with the object
600 In places where a quoted text string can be used,
601 an expression of the form
603 .BI sprintf(\(ts format \(ts,\ arg ,\fR.\|.\|.\fB)
606 this will produce the arguments formatted according to
608 which should be a string as described in
610 appropriate for the number of arguments supplied,
619 The thickness of the lines used to draw objects is controlled by the
622 This gives the thickness of lines in points.
623 A negative value means use the default thickness:
624 in \*(tx output mode, this means use a thickness of 8 milliinches;
625 in \*(tx output mode with the
627 option, this means use the line thickness specified by
630 in troff output mode, this means use a thickness proportional
632 A zero value means draw the thinnest possible line supported by
634 Initially it has a value of -1.
641 .B circle thickness 1.5
644 would draw a circle using a line with a thickness of 1.5 points.
645 The thickness of lines is not affected by the
648 variable, nor by the width or height given in the
652 Boxes (including boxes with rounded corners),
653 circles and ellipses can be filled by giving then an attribute of
655 This takes an optional argument of an expression with a value between
656 0 and 1; 0 will fill it with white, 1 with black, values in between
657 with a proportionally gray shade.
658 A value greater than 1 can also be used:
659 this means fill with the
660 shade of gray that is currently being used for text and lines.
661 Normally this will be black, but output devices may provide
662 a mechanism for changing this.
663 Without an argument, then the value of the variable
666 Initially this has a value of 0.5.
667 The invisible attribute does not affect the filling of objects.
668 Any text associated with a filled object will be added after the
669 object has been filled, so that the text will not be obscured
672 Arrow heads will be drawn as solid triangles if the variable
674 is non-zero and either \*(tx mode is enabled or
677 option has been given.
682 The troff output of pic is device-independent.
685 option is therefore redundant.
686 All numbers are taken to be in inches; numbers are never interpreted
687 to be in troff machine units.
692 This will only work when the postprocessor is
694 Any text associated with an object having the
696 attribute will be rotated about the center of the object
697 so that it is aligned in the direction from the start point
698 to the end point of the object.
699 Note that this attribute will have no effect for objects whose start and
700 end points are coincident.
709 is a single token: no space is allowed between the
718 line from `i'th box.nw to `i+1'th box.se
722 .Tp \w'\fB@MACRODIR@/tmac.pic'u+3n
725 Example definitions of the
731 .BR @g@troff (@MAN1EXT@),
732 .BR groff_out (@MAN5EXT@),
737 AT&T Bell Laboratories, Computing Science Technical Report No.\ 116,
738 PIC \(em A Graphics Language for Typesetting.
739 (This can be obtained by sending a mail message to netlib@research.att.com
740 with a body of `send\ 116\ from\ research/cstr'.)
743 Input characters that are illegal for
747 code 0 or between 013 and 037 octal or between 0200 and 0237 octal)
748 are rejected even in \*(tx mode.
750 The interpretation of
752 is incompatible with the pic in 10th edition Unix,
753 which interprets 0 as black and 1 as white.