4 Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
6 Copyright (C) 1989 - 2004, 2007 Free Software Foundation, Inc.
8 Permission is granted to make and distribute verbatim copies of
9 this manual provided the copyright notice and this permission notice
10 are preserved on all copies.
12 Permission is granted to copy and distribute modified versions of this
13 manual under the conditions for verbatim copying, provided that the
14 entire resulting derived work is distributed under the terms of a
15 permission notice identical to this one.
17 Permission is granted to copy and distribute translations of this
18 manual into another language, under the above conditions for modified
19 versions, except that this permission notice may be included in
20 translations approved by the Free Software Foundation instead of in
24 .do nr __compat \n[.C]
27 .\" Like TP, but if specified indent is more than half
28 .\" the current line-length - indent, use the default indent.
30 .ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
35 . ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
36 . ds lx L\h'-0.36m'\v'-0.22v'\s-2A\s0\h'-0.15m'\v'0.22v'\*(tx
46 .\" The BSD man macros can't handle " in arguments to font change macros,
47 .\" so use \(ts instead of ".
51 .TH @U_P_PIC@ @MAN1EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
55 @L_P_PIC@ \- compile pictures for troff or TeX
83 compiles descriptions of pictures embedded within
85 or \*(tx input files into commands that are understood by \*(tx or
87 Each picture starts with a line beginning with
89 and ends with a line beginning with
95 is passed through without change.
97 It is the user's responsibility to provide appropriate definitions of the
102 When the macro package being used does not supply such definitions
103 (for example, old versions of \-ms),
104 appropriate definitions can be obtained with
106 These will center each picture.
111 Options that do not take arguments may be grouped behind a single
115 can be used to mark the end of the options.
118 refers to the standard input.
126 even when followed by a character other than space or newline.
130 Safer mode; do not execute
133 This can be useful when operating on untrustworthy input.
138 Unsafe mode; revert the default option
143 Don't use the @L_ROFF@ extensions to the troff drawing commands.
144 You should use this if you are using a postprocessor that doesn't support
146 The extensions are described in
147 .BR @L_ROFF@-out (@MAN5EXT@).
152 not to use zero-length lines to draw dots in troff mode.
160 Be more compatible with
166 are not passed through transparently.
169 are passed through with the initial
173 A line beginning with
175 is given special treatment:
176 it takes an optional integer argument specifying
177 the line thickness (pen size) in milliinches;
178 a missing argument restores the previous line thickness;
179 the default line thickness is 8 milliinches.
180 The line thickness thus specified takes effect only
181 when a non-negative line thickness has not been
182 specified by use of the
184 attribute or by setting the
190 Print the version number.
194 In \*(tx mode draw dots using zero-length lines.
197 The following options supported by other versions of
203 Draw all lines using the \eD escape sequence.
209 Generate output for the
213 This is unnecessary because the
217 is device-independent.
222 This section describes only the differences between
224 and the original version of
226 Many of these differences also apply to newer versions of Unix
228 A complete documentation is available in the file
236 \*(tx mode is enabled by the
241 will define a vbox called
246 command to change the name of the vbox.
247 You must yourself print that vbox using, for example, the command
251 \ecenterline{\ebox\egraph}
254 Actually, since the vbox has a height of zero (it is defined with
255 \evtop) this will produce slightly more vertical space above the
256 picture than below it;
260 \ecenterline{\eraise 1em\ebox\egraph}
265 To make the vbox having a positive height and a depth of zero
266 (as used e.g.\& by \*(lx's
267 .BR \%graphics.sty ),
268 define the following macro in your document:
271 .B \edef\egpicbox#1{%
273 .B " \evbox{\eunvbox\ecsname #1\eendcsname\ekern 0pt}}"
276 Now you can simply say
278 instead of \ebox\egraph.
280 You must use a \*(tx driver that supports the
286 are passed through transparently; a
288 is added to the end of the line to avoid unwanted spaces.
289 You can safely use this feature to change fonts or to
292 Anything else may well produce undesirable results; use at your own risk.
293 Lines beginning with a period are not given any special treatment.
298 \fBfor\fR \fIvariable\fR \fB=\fR \fIexpr1\fR \fBto\fR \fIexpr2\fR \
299 [\fBby\fR [\fB*\fR]\fIexpr3\fR] \fBdo\fR \fIX\fR \fIbody\fR \fIX\fR
306 is less than or equal to
316 is not given, increment
325 will instead be multiplied by
329 can be negative for the additive case;
331 is then tested whether it is greater than or equal to
333 For the multiplicative case,
335 must be greater than zero.
336 If the constraints aren't met, the loop isn't executed.
338 can be any character not occurring in
342 \fBif\fR \fIexpr\fR \fBthen\fR \fIX\fR \fIif-true\fR \fIX\fR \
343 [\fBelse\fR \fIY\fR \fIif-false\fR \fIY\fR]
346 if it is non-zero then do
351 can be any character not occurring in
354 can be any character not occurring in
358 \fBprint\fR \fIarg\fR\|.\|.\|.
359 Concatenate the arguments and print as a line on stderr.
362 must be an expression, a position, or text.
363 This is useful for debugging.
366 \fBcommand\fR \fIarg\fR\|.\|.\|.
367 Concatenate the arguments
368 and pass them through as a line to troff or \*(tx.
371 must be an expression, a position, or text.
372 This has a similar effect to a line beginning with
376 but allows the values of variables to be passed through.
384 command ".ds string x is " x "."
398 \fBsh\fR \fIX\fR \fIcommand\fR \fIX\fR
403 can be any character not occurring in
407 \fBcopy\fR \fB"\fIfilename\fB"\fR
410 at this point in the file.
413 \fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fIX\fR \fIbody\fR \fIX\fR \
414 [\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]
417 \fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fImacro\fR \
418 [\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]
421 once for each line of
423 the line is split into blank-delimited words,
436 is not given, lines are taken from the current input up to
441 lines will be read only until a line the first word of which is
443 that line will then be discarded.
445 can be any character not occurring in
453 copy thru % circle at ($1,$2) % until "END"
479 The commands to be performed for each line can also be taken
480 from a macro defined earlier by giving the name of the macro
489 \fBreset\fI variable1\fR[\fB,\fR]\fI variable2 .\^.\^.
490 Reset pre-defined variables
493 \&.\^.\^. to their default values.
494 If no arguments are given, reset all pre-defined variables
495 to their default values.
496 Note that assigning a value to
498 also causes all pre-defined variables that control dimensions
499 to be reset to their default values times the new value of scale.
502 \fBplot\fR \fIexpr\fR [\fB"\fItext\*(ic\fB"\fR]
503 This is a text object which is constructed by using
505 as a format string for sprintf
510 is omitted a format string of
513 Attributes can be specified in the same way as for a normal text
515 Be very careful that you specify an appropriate format string;
517 does only very limited checking of the string.
518 This is deprecated in favour of
522 .IB variable\ := \ expr
527 must already be defined,
532 without creating a variable local to the current block.
535 defines the variable in the current block if it is not already defined there,
536 and then changes the value in the current block only.)
537 For example, the following:
562 Arguments of the form
566 are also allowed to be of the form
572 can contain balanced occurrences of
578 or imbalanced occurrences of
585 The syntax for expressions has been significantly extended:
602 .ie t 10\v'-.4m'\fIx\*(ic\fR\v'.4m')
610 (return a random number between 0 and 1)
613 (return a random number between 1 and
618 (set the random number seed)
642 \fB"\fIstr1\*(ic\fB" == "\fIstr2\*(ic\fB"\fR
644 \fB"\fIstr1\*(ic\fB" != "\fIstr2\*(ic\fB"\fR
648 String comparison expressions must be parenthesised in some contexts
655 is acceptable as an attribute;
660 is the current direction.
667 means draw a line 2\ inches long in the current direction.
668 The `i' (or `I') character is ignored; to use another measurement unit,
671 variable to an appropriate value.
674 The maximum width and height of the picture are taken from the variables
678 Initially these have values 8.5 and 11.
681 Scientific notation is allowed for numbers.
690 Text attributes can be compounded.
701 There is no limit to the depth to which blocks can be examined.
706 [A: [B: [C: box ]]] with .A.B.C.sw at 1,2
709 circle at last [\^].A.B.C
715 Arcs now have compass points
716 determined by the circle of which the arc is a part.
719 Circles, ellipses, and arcs can be dotted or dashed.
720 In \*(tx mode splines can be dotted or dashed also.
723 Boxes can have rounded corners.
726 attribute specifies the radius of the quarter-circles at each corner.
731 attribute is given, a radius of
737 A box with rounded corners can be dotted or dashed.
740 Boxes can have slanted sides.
741 This effectively changes the shape of a box from a rectangle to an
742 arbitrary parallelogram.
747 attributes specify the x and y\~offset of the box's upper right corner
748 from its default position.
753 line can have a second argument specifying a maximum height for
755 If the width of zero is specified the width will be ignored in computing
756 the scaling factor for the picture.
759 will always scale a picture by the same amount vertically as well as
761 This is different from the
765 which may scale a picture by a different amount vertically than
766 horizontally if a height is specified.
769 Each text object has an invisible box associated with it.
770 The compass points of a text object are determined by this box.
771 The implicit motion associated with the object is also determined
773 The dimensions of this box are taken from the width and height attributes;
774 if the width attribute is not supplied then the width will be taken to be
776 if the height attribute is not supplied then the height will be taken to be
777 the number of text strings associated with the object
787 In (almost all) places where a quoted text string can be used,
788 an expression of the form
790 .BI sprintf(\(ts format \(ts,\ arg ,\fR.\|.\|.\fB)
793 this will produce the arguments formatted according to
795 which should be a string as described in
797 appropriate for the number of arguments supplied.
800 The thickness of the lines used to draw objects is controlled by the
803 This gives the thickness of lines in points.
804 A negative value means use the default thickness:
805 in \*(tx output mode, this means use a thickness of 8 milliinches;
806 in \*(tx output mode with the
808 option, this means use the line thickness specified by
811 in troff output mode, this means use a thickness proportional
813 A zero value means draw the thinnest possible line supported by
815 Initially it has a value of -1.
822 .B circle thickness 1.5
825 would draw a circle using a line with a thickness of 1.5 points.
826 The thickness of lines is not affected by the
829 variable, nor by the width or height given in the
834 Boxes (including boxes with rounded corners or slanted sides),
835 circles and ellipses can be filled by giving them an attribute of
837 This takes an optional argument of an expression with a value between
838 0 and 1; 0 will fill it with white, 1 with black, values in between
839 with a proportionally gray shade.
840 A value greater than 1 can also be used:
841 this means fill with the
842 shade of gray that is currently being used for text and lines.
843 Normally this will be black, but output devices may provide
844 a mechanism for changing this.
845 Without an argument, then the value of the variable
848 Initially this has a value of 0.5.
849 The invisible attribute does not affect the filling of objects.
850 Any text associated with a filled object will be added after the
851 object has been filled, so that the text will not be obscured
855 Three additional modifiers are available to specify colored objects:
857 sets the color of the outline,
860 .B colo\fR[\fPu\fR]\fPr\fR[\fPed\fR]
862 All three keywords expect a suffix specifying the color, for example
865 .B circle shaded """green""" outline """black"""
868 Currently, color support isn't available in \*(tx mode.
869 Predefined color names for
871 are in the device macro files, for example
873 additional colors can be defined with the
875 request (see the manual page of
876 .BR @L_TROFF@ (@MAN1EXT@)
879 To change the name of the vbox in \*(tx mode, set the pseudo-variable
881 (which is actually a specially parsed command) within a picture.
894 The picture is then available in the box
898 assumes that at the beginning of a picture both glyph and fill color are
899 set to the default value.
902 Arrow heads will be drawn as solid triangles if the variable
904 is non-zero and either \*(tx mode is enabled or the
906 option has not been given.
910 Note that solid arrow heads are always filled with the current outline
916 is device-independent.
919 option is therefore redundant.
920 All numbers are taken to be in inches; numbers are never interpreted
921 to be in troff machine units.
927 This will only work if the postprocessor is
929 Any text associated with an object having the
931 attribute will be rotated about the center of the object
932 so that it is aligned in the direction from the start point
933 to the end point of the object.
934 Note that this attribute will have no effect for objects whose start and
935 end points are coincident.
945 is a single token: no space is allowed between the
954 line from `i'th box.nw to `i+1'th box.se
962 To obtain a stand-alone picture from a
972 configuration commands may be added at the beginning of the file, but no
977 It is necessary to feed this file into
979 without adding any page information, so you must check which
983 requests are actually called.
984 For example, the mm macro package adds a page number, which is very
986 At the moment, calling standard
988 without any macro package works.
989 Alternatively, you can define your own requests, e.g. to do nothing:
1004 itself does not provide direct conversion into other graphics file
1006 But there are lots of possibilities if you first transform your picture
1007 into PostScript\*R format using the
1013 lacks BoundingBox information it is not very useful by itself, but it
1014 may be fed into other conversion programs, usually named
1019 Moreover, the PostScript interpreter
1022 has built-in graphics conversion devices that are called with the option
1025 .BI "gs -sDEVICE=" <devname>
1034 for a list of the available devices.
1037 As the Encapsulated PostScript File Format
1039 is getting more and more important, and the conversion wasn't regarded
1040 trivial in the past you might be interested to know that there is a
1041 conversion tool named
1043 which does the right job.
1044 It is much better than the tool
1049 For bitmapped graphic formats, you should use
1051 the resulting (intermediate)
1053 file can be then converted to virtually any graphics format using the tools
1061 .Tp \w'\fB@MACRODIR@/pic.tmac'u+3n
1064 Example definitions of the
1073 .BR @L_TROFF@ (@MAN1EXT@),
1074 .BR @L_ROFF@-out (@MAN5EXT@),
1085 PIC \(em A Graphics Language for Typesetting (User Manual).
1086 AT&T Bell Laboratories, Computing Science Technical Report No.\ 116
1087 <http://cm.bell-labs.com/cm/cs/cstr/116.ps.gz>
1088 (revised May, 1991).
1091 is available from CTAN mirrors, e.g.
1093 <ftp://ftp.dante.de/tex-archive/support/ps2eps/>
1095 W. Richard Stevens - Turning PIC Into HTML
1097 <http://www.kohala.com/start/troff/pic2html.html>
1099 W. Richard Stevens - Examples of picMacros
1101 <http://www.kohala.com/start/troff/pic.examples.ps>
1106 Input characters that are invalid for
1110 code 0, or 013 octal, or between 015 and 037 octal, or between 0200 and 0237
1111 octal) are rejected even in \*(tx mode.
1113 The interpretation of
1115 is incompatible with the pic in 10th edition Unix,
1116 which interprets 0 as black and 1 as white.
1118 PostScript\*R is a registered trademark of Adobe Systems Incorporation.