4 Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
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 .\" Like TP, but if specified indent is more than half
25 .\" the current line-length - indent, use the default indent.
27 .ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
32 . ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
33 . ds lx L\h'-0.36m'\v'-0.22v'\s-2A\s0\h'-0.15m'\v'0.22v'\*(tx
43 .\" The BSD man macros can't handle " in arguments to font change macros,
44 .\" so use \(ts instead of ".
48 .TH @U_P_PIC@ @MAN1EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
52 @L_P_PIC@ \- compile pictures for troff or TeX
80 compiles descriptions of pictures embedded within
82 or \*(tx input files into commands that are understood by \*(tx or
84 Each picture starts with a line beginning with
86 and ends with a line beginning with
92 is passed through without change.
94 It is the user's responsibility to provide appropriate definitions of the
99 When the macro package being used does not supply such definitions
100 (for example, old versions of \-ms),
101 appropriate definitions can be obtained with
103 These will center each picture.
108 Options that do not take arguments may be grouped behind a single
112 can be used to mark the end of the options.
115 refers to the standard input.
123 even when followed by a character other than space or newline.
127 Safer mode; do not execute
130 This can be useful when operating on untrustworthy input.
135 Unsafe mode; revert the default option
140 Don't use the @L_ROFF@ extensions to the troff drawing commands.
141 You should use this if you are using a postprocessor that doesn't support
143 The extensions are described in
144 .BR @L_ROFF@_out (@MAN5EXT@).
149 not to use zero-length lines to draw dots in troff mode.
157 Be more compatible with
163 are not passed through transparently.
166 are passed through with the initial
170 A line beginning with
172 is given special treatment:
173 it takes an optional integer argument specifying
174 the line thickness (pen size) in milliinches;
175 a missing argument restores the previous line thickness;
176 the default line thickness is 8 milliinches.
177 The line thickness thus specified takes effect only
178 when a non-negative line thickness has not been
179 specified by use of the
181 attribute or by setting the
187 Print the version number.
191 In \*(tx mode draw dots using zero-length lines.
194 The following options supported by other versions of
200 Draw all lines using the \eD escape sequence.
206 Generate output for the
210 This is unnecessary because the
214 is device-independent.
219 This section describes only the differences between
221 and the original version of
223 Many of these differences also apply to newer versions of Unix
225 A complete documentation is available in the file
233 \*(tx mode is enabled by the
238 will define a vbox called
243 command to change the name of the vbox.
244 You must yourself print that vbox using, for example, the command
248 \ecenterline{\ebox\egraph}
251 Actually, since the vbox has a height of zero (it is defined with
252 \evtop) this will produce slightly more vertical space above the
253 picture than below it;
257 \ecenterline{\eraise 1em\ebox\egraph}
262 To make the vbox having a positive height and a depth of zero
263 (as used e.g.\& by \*(lx's
264 .BR \%graphics.sty ),
265 define the following macro in your document:
268 .B \edef\egpicbox#1{%
270 .B " \evbox{\eunvbox\ecsname #1\eendcsname\ekern 0pt}}"
273 Now you can simply say
275 instead of \ebox\egraph.
277 You must use a \*(tx driver that supports the
283 are passed through transparently; a
285 is added to the end of the line to avoid unwanted spaces.
286 You can safely use this feature to change fonts or to
289 Anything else may well produce undesirable results; use at your own risk.
290 Lines beginning with a period are not given any special treatment.
295 \fBfor\fR \fIvariable\fR \fB=\fR \fIexpr1\fR \fBto\fR \fIexpr2\fR \
296 [\fBby\fR [\fB*\fR]\fIexpr3\fR] \fBdo\fR \fIX\fR \fIbody\fR \fIX\fR
303 is less than or equal to
313 is not given, increment
322 will instead be multiplied by
326 can be negative for the additive case;
328 is then tested whether it is greater than or equal to
330 For the multiplicative case,
332 must be greater than zero.
333 If the constraints aren't met, the loop isn't executed.
335 can be any character not occurring in
339 \fBif\fR \fIexpr\fR \fBthen\fR \fIX\fR \fIif-true\fR \fIX\fR \
340 [\fBelse\fR \fIY\fR \fIif-false\fR \fIY\fR]
343 if it is non-zero then do
348 can be any character not occurring in
351 can be any character not occurring in
355 \fBprint\fR \fIarg\fR\|.\|.\|.
356 Concatenate the arguments and print as a line on stderr.
359 must be an expression, a position, or text.
360 This is useful for debugging.
363 \fBcommand\fR \fIarg\fR\|.\|.\|.
364 Concatenate the arguments
365 and pass them through as a line to troff or \*(tx.
368 must be an expression, a position, or text.
369 This has a similar effect to a line beginning with
373 but allows the values of variables to be passed through.
381 command ".ds string x is " x "."
395 \fBsh\fR \fIX\fR \fIcommand\fR \fIX\fR
400 can be any character not occurring in
404 \fBcopy\fR \fB"\fIfilename\fB"\fR
407 at this point in the file.
410 \fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fIX\fR \fIbody\fR \fIX\fR \
411 [\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]
414 \fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fImacro\fR \
415 [\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]
418 once for each line of
420 the line is split into blank-delimited words,
433 is not given, lines are taken from the current input up to
438 lines will be read only until a line the first word of which is
440 that line will then be discarded.
442 can be any character not occurring in
450 copy thru % circle at ($1,$2) % until "END"
476 The commands to be performed for each line can also be taken
477 from a macro defined earlier by giving the name of the macro
486 \fBreset\fI variable1\fR[\fB,\fR]\fI variable2 .\^.\^.
487 Reset pre-defined variables
490 \&.\^.\^. to their default values.
491 If no arguments are given, reset all pre-defined variables
492 to their default values.
493 Note that assigning a value to
495 also causes all pre-defined variables that control dimensions
496 to be reset to their default values times the new value of scale.
499 \fBplot\fR \fIexpr\fR [\fB"\fItext\*(ic\fB"\fR]
500 This is a text object which is constructed by using
502 as a format string for sprintf
507 is omitted a format string of
510 Attributes can be specified in the same way as for a normal text
512 Be very careful that you specify an appropriate format string;
514 does only very limited checking of the string.
515 This is deprecated in favour of
519 .IB variable\ := \ expr
524 must already be defined,
529 without creating a variable local to the current block.
532 defines the variable in the current block if it is not already defined there,
533 and then changes the value in the current block only.)
534 For example, the following:
559 Arguments of the form
563 are also allowed to be of the form
569 can contain balanced occurrences of
575 or imbalanced occurrences of
582 The syntax for expressions has been significantly extended:
599 .ie t 10\v'-.4m'\fIx\*(ic\fR\v'.4m')
607 (return a random number between 0 and 1)
610 (return a random number between 1 and
615 (set the random number seed)
639 \fB"\fIstr1\*(ic\fB" == "\fIstr2\*(ic\fB"\fR
641 \fB"\fIstr1\*(ic\fB" != "\fIstr2\*(ic\fB"\fR
645 String comparison expressions must be parenthesised in some contexts
652 is acceptable as an attribute;
657 is the current direction.
664 means draw a line 2\ inches long in the current direction.
665 The `i' (or `I') character is ignored; to use another measurement unit,
668 variable to an appropriate value.
671 The maximum width and height of the picture are taken from the variables
675 Initially these have values 8.5 and 11.
678 Scientific notation is allowed for numbers.
687 Text attributes can be compounded.
698 There is no limit to the depth to which blocks can be examined.
703 [A: [B: [C: box ]]] with .A.B.C.sw at 1,2
706 circle at last [\^].A.B.C
712 Arcs now have compass points
713 determined by the circle of which the arc is a part.
716 Circles, ellipses, and arcs can be dotted or dashed.
717 In \*(tx mode splines can be dotted or dashed also.
720 Boxes can have rounded corners.
723 attribute specifies the radius of the quarter-circles at each corner.
728 attribute is given, a radius of
734 A box with rounded corners can be dotted or dashed.
737 Boxes can have slanted sides.
738 This effectively changes the shape of a box from a rectangle to an
739 arbitrary parallelogram.
744 attributes specify the x and y\~offset of the box's upper right corner
745 from its default position.
750 line can have a second argument specifying a maximum height for
752 If the width of zero is specified the width will be ignored in computing
753 the scaling factor for the picture.
756 will always scale a picture by the same amount vertically as well as
758 This is different from the
762 which may scale a picture by a different amount vertically than
763 horizontally if a height is specified.
766 Each text object has an invisible box associated with it.
767 The compass points of a text object are determined by this box.
768 The implicit motion associated with the object is also determined
770 The dimensions of this box are taken from the width and height attributes;
771 if the width attribute is not supplied then the width will be taken to be
773 if the height attribute is not supplied then the height will be taken to be
774 the number of text strings associated with the object
784 In (almost all) places where a quoted text string can be used,
785 an expression of the form
787 .BI sprintf(\(ts format \(ts,\ arg ,\fR.\|.\|.\fB)
790 this will produce the arguments formatted according to
792 which should be a string as described in
794 appropriate for the number of arguments supplied.
797 The thickness of the lines used to draw objects is controlled by the
800 This gives the thickness of lines in points.
801 A negative value means use the default thickness:
802 in \*(tx output mode, this means use a thickness of 8 milliinches;
803 in \*(tx output mode with the
805 option, this means use the line thickness specified by
808 in troff output mode, this means use a thickness proportional
810 A zero value means draw the thinnest possible line supported by
812 Initially it has a value of -1.
819 .B circle thickness 1.5
822 would draw a circle using a line with a thickness of 1.5 points.
823 The thickness of lines is not affected by the
826 variable, nor by the width or height given in the
831 Boxes (including boxes with rounded corners or slanted sides),
832 circles and ellipses can be filled by giving them an attribute of
834 This takes an optional argument of an expression with a value between
835 0 and 1; 0 will fill it with white, 1 with black, values in between
836 with a proportionally gray shade.
837 A value greater than 1 can also be used:
838 this means fill with the
839 shade of gray that is currently being used for text and lines.
840 Normally this will be black, but output devices may provide
841 a mechanism for changing this.
842 Without an argument, then the value of the variable
845 Initially this has a value of 0.5.
846 The invisible attribute does not affect the filling of objects.
847 Any text associated with a filled object will be added after the
848 object has been filled, so that the text will not be obscured
852 Three additional modifiers are available to specify colored objects:
854 sets the color of the outline,
857 .B colo\fR[\fPu\fR]\fPr\fR[\fPed\fR]
859 All three keywords expect a suffix specifying the color, for example
862 .B circle shaded """green""" outline """black"""
865 Currently, color support isn't available in \*(tx mode.
866 Predefined color names for
868 are in the device macro files, for example
870 additional colors can be defined with the
872 request (see the manual page of
873 .BR @L_TROFF@ (@MAN1EXT@)
876 To change the name of the vbox in \*(tx mode, set the pseudo-variable
878 (which is actually a specially parsed command) within a picture.
891 The picture is then available in the box
895 assumes that at the beginning of a picture both glyph and fill color are
896 set to the default value.
899 Arrow heads will be drawn as solid triangles if the variable
901 is non-zero and either \*(tx mode is enabled or the
903 option has not been given.
907 Note that solid arrow heads are always filled with the current outline
913 is device-independent.
916 option is therefore redundant.
917 All numbers are taken to be in inches; numbers are never interpreted
918 to be in troff machine units.
924 This will only work if the postprocessor is
926 Any text associated with an object having the
928 attribute will be rotated about the center of the object
929 so that it is aligned in the direction from the start point
930 to the end point of the object.
931 Note that this attribute will have no effect for objects whose start and
932 end points are coincident.
942 is a single token: no space is allowed between the
951 line from `i'th box.nw to `i+1'th box.se
959 To obtain a stand-alone picture from a
969 configuration commands may be added at the beginning of the file, but no
974 It is necessary to feed this file into
976 without adding any page information, so you must check which
980 requests are actually called.
981 For example, the mm macro package adds a page number, which is very
983 At the moment, calling standard
985 without any macro package works.
986 Alternatively, you can define your own requests, e.g. to do nothing:
1001 itself does not provide direct conversion into other graphics file
1003 But there are lots of possibilities if you first transform your picture
1004 into PostScript\*R format using the
1010 lacks BoundingBox information it is not very useful by itself, but it
1011 may be fed into other conversion programs, usually named
1016 Moreover, the PostScript interpreter
1019 has built-in graphics conversion devices that are called with the option
1022 .BI "gs -sDEVICE=" <devname>
1031 for a list of the available devices.
1034 As the Encapsulated PostScript File Format
1036 is getting more and more important, and the conversion wasn't regarded
1037 trivial in the past you might be interested to know that there is a
1038 conversion tool named
1040 which does the right job.
1041 It is much better than the tool
1046 For bitmapped graphic formats, you should use
1048 the resulting (intermediate)
1050 file can be then converted to virtually any graphics format using the tools
1058 .Tp \w'\fB@MACRODIR@/pic.tmac'u+3n
1061 Example definitions of the
1070 .BR @L_TROFF@ (@MAN1EXT@),
1071 .BR @L_ROFF@_out (@MAN5EXT@),
1082 PIC \(em A Graphics Language for Typesetting (User Manual).
1083 AT&T Bell Laboratories, Computing Science Technical Report No.\ 116
1084 <http://cm.bell-labs.com/cm/cs/cstr/116.ps.gz>
1085 (revised May, 1991).
1088 is available from CTAN mirrors, e.g.
1090 <ftp://ftp.dante.de/tex-archive/support/ps2eps/>
1092 W. Richard Stevens - Turning PIC Into HTML
1094 <http://www.kohala.com/start/troff/pic2html.html>
1096 W. Richard Stevens - Examples of picMacros
1098 <http://www.kohala.com/start/troff/pic.examples.ps>
1103 Input characters that are invalid for
1107 code 0, or 013 octal, or between 015 and 037 octal, or between 0200 and 0237
1108 octal) are rejected even in \*(tx mode.
1110 The interpretation of
1112 is incompatible with the pic in 10th edition Unix,
1113 which interprets 0 as black and 1 as white.
1115 PostScript\*R is a registered trademark of Adobe Systems Incorporation.