2 Copyright (C) 1989-2000, 2001, 2002 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
21 .\" Like TP, but if specified indent is more than half
22 .\" the current line-length - indent, use the default indent.
24 .ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
28 .ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
34 .\" The BSD man macros can't handle " in arguments to font change macros,
35 .\" so use \(ts instead of ".
39 .TH @G@PIC @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
44 @g@pic \- compile pictures for troff or TeX
71 This manual page describes the GNU version of
73 which is part of the groff document formatting system.
75 compiles descriptions of pictures embedded within
77 or \*(tx input files into commands that are understood by \*(tx or
79 Each picture starts with a line beginning with
81 and ends with a line beginning with
87 is passed through without change.
89 It is the user's responsibility to provide appropriate definitions of the
94 When the macro package being used does not supply such definitions
95 (for example, old versions of \-ms),
96 appropriate definitions can be obtained with
98 these will center each picture.
103 Options that do not take arguments may be grouped behind a single
107 can be used to mark the end of the options.
110 refers to the standard input.
118 even when followed by a character other than space or newline.
122 Safer mode; do not execute
125 This can be useful when operating on untrustworthy input.
130 Unsafe mode; revert the default option
135 Don't use the groff extensions to the troff drawing commands.
136 You should use this if you are using a postprocessor that doesn't support
138 The extensions are described in
139 .BR groff_out (@MAN5EXT@).
144 not to use zero-length lines to draw dots in troff mode.
152 Be more compatible with
158 are not passed through transparently.
161 are passed through with the initial
165 A line beginning with
167 is given special treatment:
168 it takes an optional integer argument specifying
169 the line thickness (pen size) in milliinches;
170 a missing argument restores the previous line thickness;
171 the default line thickness is 8 milliinches.
172 The line thickness thus specified takes effect only
173 when a non-negative line thickness has not been
174 specified by use of the
176 attribute or by setting the
182 Print the version number.
186 In \*(tx mode draw dots using zero-length lines.
189 The following options supported by other versions of
195 Draw all lines using the \eD escape sequence.
201 Generate output for the
205 This is unnecessary because the
209 is device-independent.
214 This section describes only the differences between GNU
216 and the original version of
218 Many of these differences also apply to newer versions of Unix
220 A complete documentation is available in the file
228 \*(tx mode is enabled by the
233 will define a vbox called
236 You must yourself print that vbox using, for example, the command
240 \ecenterline{\ebox\egraph}
243 Actually, since the vbox has a height of zero this will produce
244 slightly more vertical space above the picture than below it;
248 \ecenterline{\eraise 1em\ebox\egraph}
253 You must use a \*(tx driver that supports the
259 are passed through transparently; a
261 is added to the end of the line to avoid unwanted spaces.
262 You can safely use this feature to change fonts or to
265 Anything else may well produce undesirable results; use at your own risk.
266 Lines beginning with a period are not given any special treatment.
271 \fBfor\fR \fIvariable\fR \fB=\fR \fIexpr1\fR \fBto\fR \fIexpr2\fR \
272 [\fBby\fR [\fB*\fR]\fIexpr3\fR] \fBdo\fR \fIX\fR \fIbody\fR \fIX\fR
279 is less than or equal to
289 is not given, increment
298 will instead be multiplied by
301 can be any character not occurring in
305 \fBif\fR \fIexpr\fR \fBthen\fR \fIX\fR \fIif-true\fR \fIX\fR \
306 [\fBelse\fR \fIY\fR \fIif-false\fR \fIY\fR]
309 if it is non-zero then do
314 can be any character not occurring in
317 can be any character not occurring in
321 \fBprint\fR \fIarg\fR\|.\|.\|.
322 Concatenate the arguments and print as a line on stderr.
325 must be an expression, a position, or text.
326 This is useful for debugging.
329 \fBcommand\fR \fIarg\fR\|.\|.\|.
330 Concatenate the arguments
331 and pass them through as a line to troff or \*(tx.
334 must be an expression, a position, or text.
335 This has a similar effect to a line beginning with
339 but allows the values of variables to be passed through.
342 \fBsh\fR \fIX\fR \fIcommand\fR \fIX\fR
347 can be any character not occurring in
351 \fBcopy\fR \fB"\fIfilename\fB"\fR
354 at this point in the file.
357 \fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fIX\fR \fIbody\fR \fIX\fR \
358 [\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]
361 \fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fImacro\fR \
362 [\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]
365 once for each line of
367 the line is split into blank-delimited words,
380 is not given, lines are taken from the current input up to
385 lines will be read only until a line the first word of which is
387 that line will then be discarded.
389 can be any character not occurring in
397 copy thru % circle at ($1,$2) % until "END"
423 The commands to be performed for each line can also be taken
424 from a macro defined earlier by giving the name of the macro
433 \fBreset\fI variable1\fR[\fB,\fR]\fI variable2 .\^.\^.
434 Reset pre-defined variables
437 \&.\^.\^. to their default values.
438 If no arguments are given, reset all pre-defined variables
439 to their default values.
440 Note that assigning a value to
442 also causes all pre-defined variables that control dimensions
443 to be reset to their default values times the new value of scale.
446 \fBplot\fR \fIexpr\fR [\fB"\fItext\*(ic\fB"\fR]
447 This is a text object which is constructed by using
449 as a format string for sprintf
454 is omitted a format string of
457 Attributes can be specified in the same way as for a normal text
459 Be very careful that you specify an appropriate format string;
461 does only very limited checking of the string.
462 This is deprecated in favour of
466 .IB variable\ := \ expr
471 must already be defined,
476 without creating a variable local to the current block.
479 defines the variable in the current block if it is not already defined there,
480 and then changes the value in the current block only.)
481 For example, the following:
503 Arguments of the form
507 are also allowed to be of the form
513 can contain balanced occurrences of
519 or imbalanced occurrences of
526 The syntax for expressions has been significantly extended:
543 .ie t 10\v'-.4m'\fIx\*(ic\fR\v'.4m')
551 (return a random number between 0 and 1)
554 (return a random number between 1 and
559 (set the random number seed)
583 \fB"\fIstr1\*(ic\fB" == "\fIstr2\*(ic\fB"\fR
585 \fB"\fIstr1\*(ic\fB" != "\fIstr2\*(ic\fB"\fR
589 String comparison expressions must be parenthesised in some contexts
596 is acceptable as an attribute;
601 is the current direction.
606 means draw a line 2\ inches long in the current direction.
607 The `i' (or `I') character is ignored; to use another measurement unit,
610 variable to an appropriate value.
613 The maximum width and height of the picture are taken from the variables
617 Initially these have values 8.5 and 11.
620 Scientific notation is allowed for numbers.
628 Text attributes can be compounded.
637 There is no limit to the depth to which blocks can be examined.
641 [A: [B: [C: box ]]] with .A.B.C.sw at 1,2
644 circle at last [\^].A.B.C
649 Arcs now have compass points
650 determined by the circle of which the arc is a part.
653 Circles and arcs can be dotted or dashed.
654 In \*(tx mode splines can be dotted or dashed.
657 Boxes can have rounded corners.
660 attribute specifies the radius of the quarter-circles at each corner.
665 attribute is given, a radius of
671 A box with rounded corners can be dotted or dashed.
676 line can have a second argument specifying a maximum height for
678 If the width of zero is specified the width will be ignored in computing
679 the scaling factor for the picture.
682 will always scale a picture by the same amount vertically as well as
684 This is different from the
688 which may scale a picture by a different amount vertically than
689 horizontally if a height is specified.
692 Each text object has an invisible box associated with it.
693 The compass points of a text object are determined by this box.
694 The implicit motion associated with the object is also determined
696 The dimensions of this box are taken from the width and height attributes;
697 if the width attribute is not supplied then the width will be taken to be
699 if the height attribute is not supplied then the height will be taken to be
700 the number of text strings associated with the object
710 In (almost all) places where a quoted text string can be used,
711 an expression of the form
713 .BI sprintf(\(ts format \(ts,\ arg ,\fR.\|.\|.\fB)
716 this will produce the arguments formatted according to
718 which should be a string as described in
720 appropriate for the number of arguments supplied.
723 The thickness of the lines used to draw objects is controlled by the
726 This gives the thickness of lines in points.
727 A negative value means use the default thickness:
728 in \*(tx output mode, this means use a thickness of 8 milliinches;
729 in \*(tx output mode with the
731 option, this means use the line thickness specified by
734 in troff output mode, this means use a thickness proportional
736 A zero value means draw the thinnest possible line supported by
738 Initially it has a value of -1.
745 .B circle thickness 1.5
748 would draw a circle using a line with a thickness of 1.5 points.
749 The thickness of lines is not affected by the
752 variable, nor by the width or height given in the
757 Boxes (including boxes with rounded corners),
758 circles and ellipses can be filled by giving them an attribute of
760 This takes an optional argument of an expression with a value between
761 0 and 1; 0 will fill it with white, 1 with black, values in between
762 with a proportionally gray shade.
763 A value greater than 1 can also be used:
764 this means fill with the
765 shade of gray that is currently being used for text and lines.
766 Normally this will be black, but output devices may provide
767 a mechanism for changing this.
768 Without an argument, then the value of the variable
771 Initially this has a value of 0.5.
772 The invisible attribute does not affect the filling of objects.
773 Any text associated with a filled object will be added after the
774 object has been filled, so that the text will not be obscured
778 Three additional modifiers are available to specify colored objects:
780 sets the color of the outline,
783 .BR colo [ u ] r [ ed ]
785 All three keywords expect a suffix specifying the color, for example
788 .B circle shaded """green""" outline """black"""
791 Currently, color support isn't available in \*(tx mode.
792 Predefined color names for
794 are in the device macro files, for example
796 additional colors can be defined with the
798 request (see the manual page of
799 .BR @g@troff (@MAN1EXT@)
803 assumes that at the beginning of a picture both glyph and fill color are
804 set to the default value.
807 Arrow heads will be drawn as solid triangles if the variable
809 is non-zero and either \*(tx mode is enabled or the
811 option has not been given.
815 Note that solid arrow heads are always filled with the current outline
821 is device-independent.
824 option is therefore redundant.
825 All numbers are taken to be in inches; numbers are never interpreted
826 to be in troff machine units.
832 This will only work if the postprocessor is
834 Any text associated with an object having the
836 attribute will be rotated about the center of the object
837 so that it is aligned in the direction from the start point
838 to the end point of the object.
839 Note that this attribute will have no effect for objects whose start and
840 end points are coincident.
850 is a single token: no space is allowed between the
859 line from `i'th box.nw to `i+1'th box.se
867 To obtain a stand-alone picture from a
877 configuration commands may be added at the beginning of the file, but no
882 It is necessary to feed this file into
884 without adding any page information, so you must check which
888 requests are actually called.
889 For example, the mm macro package adds a page number, which is very
891 At the moment, calling standard
893 without any macro package works.
894 Alternatively, you can define your own requests, e.g. to do nothing:
909 itself does not provide direct conversion into other graphics file
911 But there are lots of possibilities if you first transform your picture
912 into PostScript\*R format using the
918 lacks BoundingBox information it is not very useful by itself, but it
919 may be fed into other conversion programs, usually named
924 Moreover, the PostScript interpreter
927 has built-in graphics conversion devices that are called with the option
930 .BI "gs -sDEVICE=" <devname>
938 for a list of the available devices.
941 As the Encapsulated PostScript File Format
943 is getting more and more important, and the conversion wasn't regarded
944 trivial in the past you might be interested to know that there is a
945 conversion tool named
947 which does the right job.
948 It is much better than the tool
953 For bitmapped graphic formats, you should use
955 the resulting (intermediate)
957 file can be then converted to virtually any graphics format using the tools
965 .Tp \w'\fB@MACRODIR@/pic.tmac'u+3n
968 Example definitions of the
977 .BR @g@troff (@MAN1EXT@),
978 .BR groff_out (@MAN5EXT@),
989 PIC \(em A Graphics Language for Typesetting (User Manual).
990 AT&T Bell Laboratories, Computing Science Technical Report No.\ 116
991 <http://cm.bell-labs.com/cm/cs/cstr/116.ps.gz>
995 is available from CTAN mirrors, e.g.
997 <ftp://ftp.dante.de/tex-archive/support/ps2eps/>
999 W. Richard Stevens - Turning PIC Into HTML
1001 <http://www.kohala.com/start/troff/pic2html.html>
1003 W. Richard Stevens - Examples of picMacros
1005 <http://www.kohala.com/start/troff/pic.examples.ps>
1010 Input characters that are invalid for
1014 code 0, or 013 octal, or between 015 and 037 octal, or between 0200 and 0237
1015 octal) are rejected even in \*(tx mode.
1017 The interpretation of
1019 is incompatible with the pic in 10th edition Unix,
1020 which interprets 0 as black and 1 as white.
1022 PostScript\*R is a registered trademark of Adobe Systems Incorporation.
1024 .\" Local Variables: