179543Sru.ig
2151497SruCopyright (C) 1989-2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
375584Sru
475584SruPermission is granted to make and distribute verbatim copies of
575584Sruthis manual provided the copyright notice and this permission notice
675584Sruare preserved on all copies.
775584Sru
875584SruPermission is granted to copy and distribute modified versions of this
975584Srumanual under the conditions for verbatim copying, provided that the
1075584Sruentire resulting derived work is distributed under the terms of a
1175584Srupermission notice identical to this one.
1275584Sru
1375584SruPermission is granted to copy and distribute translations of this
1475584Srumanual into another language, under the above conditions for modified
1575584Sruversions, except that this permission notice may be included in
1675584Srutranslations approved by the Free Software Foundation instead of in
1775584Sruthe original English.
1875584Sru..
19104862Sru.
20104862Sru.
2175584Sru.\" Like TP, but if specified indent is more than half
2275584Sru.\" the current line-length - indent, use the default indent.
2375584Sru.de Tp
2475584Sru.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
2575584Sru.el .TP "\\$1"
2675584Sru..
27104862Sru.
28114402Sru.ie t \{\
29114402Sru.  ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
30114402Sru.  ds lx L\h'-0.36m'\v'-0.22v'\s-2A\s0\h'-0.15m'\v'0.22v'\*(tx
31114402Sru.\}
32114402Sru.el \{\
33114402Sru.  ds tx TeX
34114402Sru.  ds lx LaTeX
35114402Sru.\}
36104862Sru.
3775584Sru.ie \n(.g .ds ic \/
38104862Sru.el       .ds ic \^
39104862Sru.
4075584Sru.\" The BSD man macros can't handle " in arguments to font change macros,
4175584Sru.\" so use \(ts instead of ".
4275584Sru.tr \(ts"
43104862Sru.
44104862Sru.
4575584Sru.TH @G@PIC @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
46104862Sru.
47104862Sru.
4875584Sru.SH NAME
49104862Sru.
5075584Sru@g@pic \- compile pictures for troff or TeX
51104862Sru.
52104862Sru.
5375584Sru.SH SYNOPSIS
54104862Sru.
5575584Sru.B @g@pic
5675584Sru[
5775584Sru.B \-nvCSU
5875584Sru]
5975584Sru[
6075584Sru.I filename
61104862Sru\&.\|.\|.\&
6275584Sru]
6375584Sru.br
6475584Sru.B @g@pic
6575584Sru.B \-t
6675584Sru[
6775584Sru.B \-cvzCSU
6875584Sru]
6975584Sru[
7075584Sru.I filename
71104862Sru\&.\|.\|.\&
7275584Sru]
73104862Sru.
74104862Sru.
7575584Sru.SH DESCRIPTION
76104862Sru.
7775584SruThis manual page describes the GNU version of
7875584Sru.BR pic ,
7975584Sruwhich is part of the groff document formatting system.
8075584Sru.B pic
8175584Srucompiles descriptions of pictures embedded within
8275584Sru.B troff
8375584Sruor \*(tx input files into commands that are understood by \*(tx or
8475584Sru.BR troff .
8575584SruEach picture starts with a line beginning with
8675584Sru.B .PS
8775584Sruand ends with a line beginning with
8875584Sru.BR .PE .
8975584SruAnything outside of
9075584Sru.B .PS
9175584Sruand
9275584Sru.B .PE
9375584Sruis passed through without change.
9475584Sru.LP
9575584SruIt is the user's responsibility to provide appropriate definitions of the
9675584Sru.B PS
9775584Sruand
9875584Sru.B PE
9975584Srumacros.
10075584SruWhen the macro package being used does not supply such definitions
10175584Sru(for example, old versions of \-ms),
10275584Sruappropriate definitions can be obtained with
10375584Sru.BR \-mpic :
104114402SruThese will center each picture.
105104862Sru.
106104862Sru.
10775584Sru.SH OPTIONS
108104862Sru.
10975584SruOptions that do not take arguments may be grouped behind a single
11075584Sru.BR \- .
11175584SruThe special option
11275584Sru.B \-\^\-
11375584Srucan be used to mark the end of the options.
11475584SruA filename of
11575584Sru.B \-
11675584Srurefers to the standard input.
117104862Sru.
11875584Sru.TP
11975584Sru.B \-C
12075584SruRecognize
12175584Sru.B .PS
12275584Sruand
12375584Sru.B .PE
12475584Srueven when followed by a character other than space or newline.
125104862Sru.
12675584Sru.TP
12775584Sru.B \-S
12875584SruSafer mode; do not execute
12975584Sru.B sh
13075584Srucommands.
13175584SruThis can be useful when operating on untrustworthy input.
13275584Sru(enabled by default)
133104862Sru.
13475584Sru.TP
13575584Sru.B \-U
13675584SruUnsafe mode; revert the default option
13775584Sru.BR \-S .
138104862Sru.
13975584Sru.TP
14075584Sru.B \-n
14175584SruDon't use the groff extensions to the troff drawing commands.
14275584SruYou should use this if you are using a postprocessor that doesn't support
14375584Sruthese extensions.
14475584SruThe extensions are described in
14575584Sru.BR groff_out (@MAN5EXT@).
14675584SruThe
14775584Sru.B \-n
14875584Sruoption also causes
14975584Sru.B pic
15075584Srunot to use zero-length lines to draw dots in troff mode.
151104862Sru.
15275584Sru.TP
15375584Sru.B \-t
15475584Sru\*(tx mode.
155104862Sru.
15675584Sru.TP
15775584Sru.B \-c
15875584SruBe more compatible with
15975584Sru.BR tpic .
16075584SruImplies
16175584Sru.BR \-t .
16275584SruLines beginning with
16375584Sru.B \e
16475584Sruare not passed through transparently.
16575584SruLines beginning with
16675584Sru.B .
16775584Sruare passed through with the initial
16875584Sru.B .
16975584Sruchanged to
17075584Sru.BR \e .
17175584SruA line beginning with
17275584Sru.B .ps
17375584Sruis given special treatment:
17475584Sruit takes an optional integer argument specifying
17575584Sruthe line thickness (pen size) in milliinches;
17675584Srua missing argument restores the previous line thickness;
17775584Sruthe default line thickness is 8 milliinches.
17875584SruThe line thickness thus specified takes effect only
17975584Sruwhen a non-negative line thickness has not been
18075584Sruspecified by use of the
18175584Sru.B thickness
18275584Sruattribute or by setting the
18375584Sru.B linethick
18475584Sruvariable.
185104862Sru.
18675584Sru.TP
18775584Sru.B \-v
18875584SruPrint the version number.
189104862Sru.
19075584Sru.TP
19175584Sru.B \-z
19275584SruIn \*(tx mode draw dots using zero-length lines.
193104862Sru.
19475584Sru.LP
19575584SruThe following options supported by other versions of
19675584Sru.B pic
19775584Sruare ignored:
198104862Sru.
19975584Sru.TP
20075584Sru.B \-D
20175584SruDraw all lines using the \eD escape sequence.
20275584Sru.B pic
20375584Srualways does this.
204104862Sru.
20575584Sru.TP
20675584Sru.BI \-T \ dev
20775584SruGenerate output for the
20875584Sru.B troff
20975584Srudevice
21075584Sru.IR dev .
21175584SruThis is unnecessary because the
21275584Sru.B troff
21375584Sruoutput generated by
21475584Sru.B pic
21575584Sruis device-independent.
216104862Sru.
217104862Sru.
21875584Sru.SH USAGE
219104862Sru.
22075584SruThis section describes only the differences between GNU
22175584Sru.B pic
22275584Sruand the original version of
22375584Sru.BR pic .
22475584SruMany of these differences also apply to newer versions of Unix
22575584Sru.BR pic .
226104862SruA complete documentation is available in the file
227104862Sru.LP
228104862Sru.RS
229104862Sru.B @DOCDIR@/pic.ms
230104862Sru.RE
231104862Sru.
23275584Sru.SS \*(tx mode
233104862Sru.
23475584Sru\*(tx mode is enabled by the
23575584Sru.B \-t
23675584Sruoption.
23775584SruIn \*(tx mode,
23875584Sru.B pic
23975584Sruwill define a vbox called
24075584Sru.B \egraph
24175584Srufor each picture.
242114402SruUse the
243114402Sru.B figname
244114402Srucommand to change the name of the vbox.
24575584SruYou must yourself print that vbox using, for example, the command
24675584Sru.RS
24775584Sru.LP
24875584Sru.B
24975584Sru\ecenterline{\ebox\egraph}
25075584Sru.RE
25175584Sru.LP
252114402SruActually, since the vbox has a height of zero (it is defined with
253114402Sru\evtop) this will produce slightly more vertical space above the
254114402Srupicture than below it;
25575584Sru.RS
25675584Sru.LP
25775584Sru.B
25875584Sru\ecenterline{\eraise 1em\ebox\egraph}
25975584Sru.RE
26075584Sru.LP
26175584Sruwould avoid this.
26275584Sru.LP
263114402SruTo make the vbox having a positive height and a depth of zero
264114402Sru(as used e.g.\& by \*(lx's
265114402Sru.BR \%graphics.sty ),
266114402Srudefine the following macro in your document:
267114402Sru.RS
268114402Sru.LP
269114402Sru.B \edef\egpicbox#1{%
270114402Sru.br
271114402Sru.B "   \evbox{\eunvbox\ecsname #1\eendcsname\ekern 0pt}}"
272114402Sru.RE
273114402Sru.LP
274114402SruNow you can simply say
275114402Sru.B \egpicbox{graph}
276114402Sruinstead of \ebox\egraph.
277114402Sru.LP
27875584SruYou must use a \*(tx driver that supports the
27975584Sru.B tpic
28075584Sruspecials, version 2.
28175584Sru.LP
28275584SruLines beginning with
28375584Sru.B \e
28475584Sruare passed through transparently; a
28575584Sru.B %
28675584Sruis added to the end of the line to avoid unwanted spaces.
28775584SruYou can safely use this feature to change fonts or to
28875584Sruchange the value of
28975584Sru.BR \ebaselineskip .
29075584SruAnything else may well produce undesirable results; use at your own risk.
29175584SruLines beginning with a period are not given any special treatment.
292104862Sru.
29375584Sru.SS Commands
294104862Sru.
29575584Sru.TP
29675584Sru\fBfor\fR \fIvariable\fR \fB=\fR \fIexpr1\fR \fBto\fR \fIexpr2\fR \
29775584Sru[\fBby\fR [\fB*\fR]\fIexpr3\fR] \fBdo\fR \fIX\fR \fIbody\fR \fIX\fR
29875584SruSet
29975584Sru.I variable
30075584Sruto
30175584Sru.IR expr1 .
30275584SruWhile the value of
30375584Sru.I variable
30475584Sruis less than or equal to
30575584Sru.IR expr2 ,
30675584Srudo
30775584Sru.I body
30875584Sruand increment
30975584Sru.I variable
31075584Sruby
31175584Sru.IR expr3 ;
31275584Sruif
31375584Sru.B by
31475584Sruis not given, increment
31575584Sru.I variable
31675584Sruby 1.
31775584SruIf
31875584Sru.I expr3
31975584Sruis prefixed by
32075584Sru.B *
32175584Sruthen
32275584Sru.I variable
32375584Sruwill instead be multiplied by
32475584Sru.IR expr3 .
325151497SruThe value of
326151497Sru.I expr3
327151497Srucan be negative for the additive case;
328151497Sru.I variable
329151497Sruis then tested whether it is greater than or equal to
330151497Sru.IR expr2 .
331151497SruFor the multiplicative case,
332151497Sru.I expr3
333151497Srumust be greater than zero.
334151497SruIf the constraints aren't met, the loop isn't executed.
33575584Sru.I X
33675584Srucan be any character not occurring in
33775584Sru.IR body .
338104862Sru.
33975584Sru.TP
34075584Sru\fBif\fR \fIexpr\fR \fBthen\fR \fIX\fR \fIif-true\fR \fIX\fR \
34175584Sru[\fBelse\fR \fIY\fR \fIif-false\fR \fIY\fR]
34275584SruEvaluate
34375584Sru.IR expr ;
34475584Sruif it is non-zero then do
34575584Sru.IR if-true ,
34675584Sruotherwise do
34775584Sru.IR if-false .
34875584Sru.I X
34975584Srucan be any character not occurring in
35075584Sru.IR if-true .
35175584Sru.I Y
35275584Srucan be any character not occurring in
35375584Sru.IR if-false .
354104862Sru.
35575584Sru.TP
35675584Sru\fBprint\fR \fIarg\fR\|.\|.\|.
35775584SruConcatenate the arguments and print as a line on stderr.
35875584SruEach
35975584Sru.I arg
36075584Srumust be an expression, a position, or text.
36175584SruThis is useful for debugging.
362104862Sru.
36375584Sru.TP
36475584Sru\fBcommand\fR \fIarg\fR\|.\|.\|.
36575584SruConcatenate the arguments
366104862Sruand pass them through as a line to troff or \*(tx.
36775584SruEach
36875584Sru.I arg
36975584Srumust be an expression, a position, or text.
37075584SruThis has a similar effect to a line beginning with
371104862Sru.B .\&
37275584Sruor
37375584Sru.BR \e ,
37475584Srubut allows the values of variables to be passed through.
375151497SruFor example,
376151497Sru.RS
377151497Sru.IP
378151497Sru.ft B
379151497Sru.nf
380151497Sru\&.PS
381151497Srux = 14
382151497Srucommand ".ds string x is " x "."
383151497Sru\&.PE
384151497Sru\e*[string]
385151497Sru.ft
386151497Sru.fi
387151497Sru.RE
388151497Sru.IP
389151497Sruprints
390151497Sru.RS
391151497Sru.IP
392151497Sru.B x is 14.
393151497Sru.RE
394104862Sru.
39575584Sru.TP
39675584Sru\fBsh\fR \fIX\fR \fIcommand\fR \fIX\fR
39775584SruPass
39875584Sru.I command
39975584Sruto a shell.
40075584Sru.I X
40175584Srucan be any character not occurring in
40275584Sru.IR command .
403104862Sru.
40475584Sru.TP
40575584Sru\fBcopy\fR \fB"\fIfilename\fB"\fR
40675584SruInclude
40775584Sru.I filename
40875584Sruat this point in the file.
409104862Sru.
41075584Sru.TP
41175584Sru\fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fIX\fR \fIbody\fR \fIX\fR \
41275584Sru[\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]
41375584Sru.ns
41475584Sru.TP
41575584Sru\fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fImacro\fR \
41675584Sru[\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]
41775584SruThis construct does
41875584Sru.I body
41975584Sruonce for each line of
42075584Sru.IR filename ;
42175584Sruthe line is split into blank-delimited words,
42275584Sruand occurrences of
42375584Sru.BI $ i
42475584Sruin
42575584Sru.IR body ,
42675584Srufor
42775584Sru.I i
42875584Srubetween 1 and 9,
42975584Sruare replaced by the
43075584Sru.IR i -th
43175584Sruword of the line.
43275584SruIf
43375584Sru.I filename
43475584Sruis not given, lines are taken from the current input up to
43575584Sru.BR .PE .
43675584SruIf an
43775584Sru.B until
43875584Sruclause is specified,
43975584Srulines will be read only until a line the first word of which is
44075584Sru.IR word ;
44175584Sruthat line will then be discarded.
44275584Sru.I X
44375584Srucan be any character not occurring in
44475584Sru.IR body .
44575584SruFor example,
44675584Sru.RS
44775584Sru.IP
44875584Sru.ft B
44975584Sru.nf
45075584Sru\&.PS
45175584Srucopy thru % circle at ($1,$2) % until "END"
45275584Sru1 2
45375584Sru3 4
45475584Sru5 6
45575584SruEND
45675584Srubox
45775584Sru\&.PE
45875584Sru.ft
45975584Sru.fi
46075584Sru.RE
46175584Sru.IP
46275584Sruis equivalent to
46375584Sru.RS
46475584Sru.IP
46575584Sru.ft B
46675584Sru.nf
46775584Sru\&.PS
46875584Srucircle at (1,2)
46975584Srucircle at (3,4)
47075584Srucircle at (5,6)
47175584Srubox
47275584Sru\&.PE
47375584Sru.ft
47475584Sru.fi
47575584Sru.RE
47675584Sru.IP
47775584SruThe commands to be performed for each line can also be taken
47875584Srufrom a macro defined earlier by giving the name of the macro
47975584Sruas the argument to
48075584Sru.BR thru .
481104862Sru.
48275584Sru.LP
48375584Sru.B reset
48475584Sru.br
48575584Sru.ns
48675584Sru.TP
487104862Sru\fBreset\fI variable1\fR[\fB,\fR]\fI variable2 .\^.\^.
48875584SruReset pre-defined variables
48975584Sru.IR variable1 ,
49075584Sru.I variable2
49175584Sru\&.\^.\^. to their default values.
49275584SruIf no arguments are given, reset all pre-defined variables
49375584Sruto their default values.
49475584SruNote that assigning a value to
49575584Sru.B scale
49675584Srualso causes all pre-defined variables that control dimensions
49775584Sruto be reset to their default values times the new value of scale.
498104862Sru.
49975584Sru.TP
50075584Sru\fBplot\fR \fIexpr\fR [\fB"\fItext\*(ic\fB"\fR]
50175584SruThis is a text object which is constructed by using
50275584Sru.I text
50375584Sruas a format string for sprintf
50475584Sruwith an argument of
50575584Sru.IR expr .
50675584SruIf
50775584Sru.I text
50875584Sruis omitted a format string of
50975584Sru.B "\(ts%g\(ts"
51075584Sruis used.
51175584SruAttributes can be specified in the same way as for a normal text
51275584Sruobject.
51375584SruBe very careful that you specify an appropriate format string;
51475584Sru.B pic
51575584Srudoes only very limited checking of the string.
51675584SruThis is deprecated in favour of
51775584Sru.BR sprintf .
518104862Sru.
51975584Sru.TP
520104862Sru.IB variable\  := \ expr
52175584SruThis is similar to
52275584Sru.B =
52375584Sruexcept
52475584Sru.I variable
52575584Srumust already be defined,
526104862Sruand
527104862Sru.I expr
528104862Sruwill be assigned to
52975584Sru.I variable
530104862Sruwithout creating a variable local to the current block.
53175584Sru(By contrast,
53275584Sru.B =
53375584Srudefines the variable in the current block if it is not already defined there,
534104862Sruand then changes the value in the current block only.)
535104862SruFor example, the following:
536104862Sru.RS
537104862Sru.IP
538104862Sru.ft B
539104862Sru.nf
540104862Sru\&.PS
541104862Srux = 3
542104862Sruy = 3
543104862Sru[
544104862Sru  x := 5
545104862Sru  y = 5
546104862Sru]
547104862Sruprint x " " y
548104862Sru\&.PE
549104862Sru.ft
550104862Sru.fi
551104862Sru.RE
552104862Sru.IP
553104862Sruprints
554151497Sru.RS
555151497Sru.IP
556151497Sru.B 5 3
557151497Sru.RE
558104862Sru.
55975584Sru.LP
56075584SruArguments of the form
56175584Sru.IP
562104862Sru.I X anything X
56375584Sru.LP
56475584Sruare also allowed to be of the form
56575584Sru.IP
56675584Sru.BI {\  anything\  }
56775584Sru.LP
56875584SruIn this case
56975584Sru.I anything
57075584Srucan contain balanced occurrences of
57175584Sru.B {
57275584Sruand
57375584Sru.BR } .
57475584SruStrings may contain
57575584Sru.I X
57675584Sruor imbalanced occurrences of
57775584Sru.B {
57875584Sruand
57975584Sru.BR } .
580104862Sru.
58175584Sru.SS Expressions
582104862Sru.
58375584SruThe syntax for expressions has been significantly extended:
584104862Sru.
58575584Sru.LP
58675584Sru.IB  x\  ^\  y
58775584Sru(exponentiation)
58875584Sru.br
58975584Sru.BI sin( x )
59075584Sru.br
59175584Sru.BI cos( x )
59275584Sru.br
59375584Sru.BI atan2( y , \ x )
59475584Sru.br
59575584Sru.BI log( x )
59675584Sru(base 10)
59775584Sru.br
59875584Sru.BI exp( x )
599104862Sru(base 10, ie
600104862Sru.ie t 10\v'-.4m'\fIx\*(ic\fR\v'.4m')
601104862Sru.el   10^\fIx\fR)
60275584Sru.br
60375584Sru.BI sqrt( x )
60475584Sru.br
60575584Sru.BI int( x )
60675584Sru.br
60775584Sru.B rand()
60875584Sru(return a random number between 0 and 1)
60975584Sru.br
61075584Sru.BI rand( x )
61175584Sru(return a random number between 1 and
61275584Sru.IR x ;
61375584Srudeprecated)
61475584Sru.br
61575584Sru.BI srand( x )
61675584Sru(set the random number seed)
61775584Sru.br
61875584Sru.BI max( e1 , \ e2 )
61975584Sru.br
62075584Sru.BI min( e1 , \ e2 )
62175584Sru.br
62275584Sru.BI ! e
62375584Sru.br
62475584Sru\fIe1\fB && \fIe2\fR
62575584Sru.br
62675584Sru\fIe1\fB || \fIe2\fR
62775584Sru.br
62875584Sru\fIe1\fB == \fIe2\fR
62975584Sru.br
63075584Sru\fIe1\fB != \fIe2\fR
63175584Sru.br
63275584Sru\fIe1\fB >= \fIe2\fR
63375584Sru.br
63475584Sru\fIe1\fB > \fIe2\fR
63575584Sru.br
63675584Sru\fIe1\fB <= \fIe2\fR
63775584Sru.br
63875584Sru\fIe1\fB < \fIe2\fR
63975584Sru.br
64075584Sru\fB"\fIstr1\*(ic\fB" == "\fIstr2\*(ic\fB"\fR
64175584Sru.br
64275584Sru\fB"\fIstr1\*(ic\fB" != "\fIstr2\*(ic\fB"\fR
64375584Sru.br
644104862Sru.
64575584Sru.LP
64675584SruString comparison expressions must be parenthesised in some contexts
64775584Sruto avoid ambiguity.
648104862Sru.
64975584Sru.SS Other Changes
650104862Sru.
65175584SruA bare expression,
65275584Sru.IR expr ,
65375584Sruis acceptable as an attribute;
65475584Sruit is equivalent to
65575584Sru.IR dir\ expr ,
65675584Sruwhere
65775584Sru.I dir
65875584Sruis the current direction.
65975584SruFor example
660151497Sru.LP
661151497Sru.RS
66275584Sru.B line 2i
663151497Sru.RE
66475584Sru.LP
665104862Srumeans draw a line 2\ inches long in the current direction.
666104862SruThe `i' (or `I') character is ignored; to use another measurement unit,
667104862Sruset the
668104862Sru.I scale
669104862Sruvariable to an appropriate value.
670104862Sru.
67175584Sru.LP
67275584SruThe maximum width and height of the picture are taken from the variables
67375584Sru.B maxpswid
67475584Sruand
67575584Sru.BR maxpsht .
67675584SruInitially these have values 8.5 and 11.
677104862Sru.
67875584Sru.LP
67975584SruScientific notation is allowed for numbers.
68075584SruFor example
68175584Sru.RS
682151497Sru.LP
68375584Sru.B
68475584Srux = 5e\-2
68575584Sru.RE
686104862Sru.
68775584Sru.LP
68875584SruText attributes can be compounded.
68975584SruFor example,
69075584Sru.RS
691151497Sru.LP
69275584Sru.B
69375584Sru"foo" above ljust
69475584Sru.RE
695151497Sru.LP
696151497Sruis valid.
697104862Sru.
69875584Sru.LP
69975584SruThere is no limit to the depth to which blocks can be examined.
70075584SruFor example,
70175584Sru.RS
702151497Sru.LP
70375584Sru.B
70475584Sru[A: [B: [C: box ]]] with .A.B.C.sw at 1,2
70575584Sru.br
70675584Sru.B
70775584Srucircle at last [\^].A.B.C
70875584Sru.RE
709151497Sru.LP
71075584Sruis acceptable.
711104862Sru.
71275584Sru.LP
71375584SruArcs now have compass points
71475584Srudetermined by the circle of which the arc is a part.
715104862Sru.
71675584Sru.LP
717151497SruCircles, ellipses, and arcs can be dotted or dashed.
718151497SruIn \*(tx mode splines can be dotted or dashed also.
719104862Sru.
72075584Sru.LP
72175584SruBoxes can have rounded corners.
72275584SruThe
72375584Sru.B rad
72475584Sruattribute specifies the radius of the quarter-circles at each corner.
72575584SruIf no
72675584Sru.B rad
72775584Sruor
72875584Sru.B diam
72975584Sruattribute is given, a radius of
73075584Sru.B boxrad
73175584Sruis used.
73275584SruInitially,
73375584Sru.B boxrad
734104862Sruhas a value of\ 0.
73575584SruA box with rounded corners can be dotted or dashed.
736104862Sru.
73775584Sru.LP
73875584SruThe
73975584Sru.B .PS
74075584Sruline can have a second argument specifying a maximum height for
74175584Sruthe picture.
74275584SruIf the width of zero is specified the width will be ignored in computing
74375584Sruthe scaling factor for the picture.
74475584SruNote that GNU
74575584Sru.B pic
746104862Sruwill always scale a picture by the same amount vertically as well as
747104862Sruhorizontally.
74875584SruThis is different from the
74975584Sru.SM DWB
75075584Sru2.0
75175584Sru.B pic
75275584Sruwhich may scale a picture by a different amount vertically than
75375584Sruhorizontally if a height is specified.
754104862Sru.
75575584Sru.LP
75675584SruEach text object has an invisible box associated with it.
75775584SruThe compass points of a text object are determined by this box.
75875584SruThe implicit motion associated with the object is also determined
75975584Sruby this box.
76075584SruThe dimensions of this box are taken from the width and height attributes;
76175584Sruif the width attribute is not supplied then the width will be taken to be
76275584Sru.BR textwid ;
76375584Sruif the height attribute is not supplied then the height will be taken to be
76475584Sruthe number of text strings associated with the object
76575584Srutimes
76675584Sru.BR textht .
76775584SruInitially
76875584Sru.B textwid
76975584Sruand
77075584Sru.B textht
77175584Sruhave a value of 0.
772104862Sru.
77375584Sru.LP
774104862SruIn (almost all) places where a quoted text string can be used,
77575584Sruan expression of the form
77675584Sru.IP
77775584Sru.BI sprintf(\(ts format \(ts,\  arg ,\fR.\|.\|.\fB)
77875584Sru.LP
77975584Srucan also be used;
78075584Sruthis will produce the arguments formatted according to
78175584Sru.IR format ,
78275584Sruwhich should be a string as described in
78375584Sru.BR printf (3)
784104862Sruappropriate for the number of arguments supplied.
785104862Sru.
78675584Sru.LP
78775584SruThe thickness of the lines used to draw objects is controlled by the
78875584Sru.B linethick
78975584Sruvariable.
79075584SruThis gives the thickness of lines in points.
79175584SruA negative value means use the default thickness:
79275584Sruin \*(tx output mode, this means use a thickness of 8 milliinches;
79375584Sruin \*(tx output mode with the
79475584Sru.B -c
79575584Sruoption, this means use the line thickness specified by
79675584Sru.B .ps
79775584Srulines;
79875584Sruin troff output mode, this means use a thickness proportional
79975584Sruto the pointsize.
80075584SruA zero value means draw the thinnest possible line supported by
80175584Sruthe output device.
80275584SruInitially it has a value of -1.
80375584SruThere is also a
80475584Sru.BR thick [ ness ]
80575584Sruattribute.
80675584SruFor example,
80775584Sru.RS
80875584Sru.LP
80975584Sru.B circle thickness 1.5
81075584Sru.RE
81175584Sru.LP
81275584Sruwould draw a circle using a line with a thickness of 1.5 points.
81375584SruThe thickness of lines is not affected by the
81475584Sruvalue of the
81575584Sru.B scale
81675584Sruvariable, nor by the width or height given in the
81775584Sru.B .PS
81875584Sruline.
819104862Sru.
82075584Sru.LP
82175584SruBoxes (including boxes with rounded corners),
822104862Srucircles and ellipses can be filled by giving them an attribute of
82375584Sru.BR fill [ ed ].
82475584SruThis takes an optional argument of an expression with a value between
82575584Sru0 and 1; 0 will fill it with white, 1 with black, values in between
82675584Sruwith a proportionally gray shade.
82775584SruA value greater than 1 can also be used:
82875584Sruthis means fill with the
82975584Srushade of gray that is currently being used for text and lines.
83075584SruNormally this will be black, but output devices may provide
83175584Srua mechanism for changing this.
83275584SruWithout an argument, then the value of the variable
83375584Sru.B fillval
83475584Sruwill be used.
83575584SruInitially this has a value of 0.5.
83675584SruThe invisible attribute does not affect the filling of objects.
83775584SruAny text associated with a filled object will be added after the
83875584Sruobject has been filled, so that the text will not be obscured
83975584Sruby the filling.
840104862Sru.
84175584Sru.LP
842104862SruThree additional modifiers are available to specify colored objects:
843104862Sru.BR outline [ d ]
844104862Srusets the color of the outline,
845104862Sru.B shaded
846104862Sruthe fill color, and
847151497Sru.B colo\fR[\fPu\fR]\fPr\fR[\fPed\fR]
848104862Srusets both.
849104862SruAll three keywords expect a suffix specifying the color, for example
850104862Sru.RS
851104862Sru.LP
852104862Sru.B circle shaded """green""" outline """black"""
853104862Sru.RE
854104862Sru.LP
855104862SruCurrently, color support isn't available in \*(tx mode.
856104862SruPredefined color names for
857104862Sru.B groff
858104862Sruare in the device macro files, for example
859104862Sru.BR ps.tmac ;
860104862Sruadditional colors can be defined with the
861104862Sru.B .defcolor
862104862Srurequest (see the manual page of
863104862Sru.BR @g@troff (@MAN1EXT@)
864104862Srufor more details).
865104862Sru.LP
866114402SruTo change the name of the vbox in \*(tx mode, set the pseudo-variable
867114402Sru.B figname
868114402Sru(which is actually a specially parsed command) within a picture.
869114402SruExample:
870114402Sru.RS
871114402Sru.LP
872114402Sru.B .PS
873114402Sru.br
874114402Sru.B figname = foobar;
875114402Sru.br
876114402Sru.B ...
877114402Sru.br
878114402Sru.B .PE
879114402Sru.RE
880114402Sru.LP
881114402SruThe picture is then available in the box
882114402Sru.BR \efoobar .
883114402Sru.LP
884104862Sru.B pic
885104862Sruassumes that at the beginning of a picture both glyph and fill color are
886104862Sruset to the default value.
887104862Sru.
888104862Sru.LP
88975584SruArrow heads will be drawn as solid triangles if the variable
89075584Sru.B arrowhead
891104862Sruis non-zero and either \*(tx mode is enabled or the
892104862Sru.B \-n
893104862Sruoption has not been given.
89475584SruInitially
89575584Sru.B arrowhead
896104862Sruhas a value of\ 1.
897104862SruNote that solid arrow heads are always filled with the current outline
898104862Srucolor.
899104862Sru.
90075584Sru.LP
90175584SruThe troff output of
90275584Sru.B pic
90375584Sruis device-independent.
90475584SruThe
90575584Sru.B \-T
90675584Sruoption is therefore redundant.
90775584SruAll numbers are taken to be in inches; numbers are never interpreted
90875584Sruto be in troff machine units.
909104862Sru.
91075584Sru.LP
91175584SruObjects can have an
91275584Sru.B aligned
91375584Sruattribute.
914104862SruThis will only work if the postprocessor is
91575584Sru.BR grops .
91675584SruAny text associated with an object having the
91775584Sru.B aligned
91875584Sruattribute will be rotated about the center of the object
91975584Sruso that it is aligned in the direction from the start point
92075584Sruto the end point of the object.
92175584SruNote that this attribute will have no effect for objects whose start and
92275584Sruend points are coincident.
923104862Sru.
92475584Sru.LP
92575584SruIn places where
92675584Sru.IB n th
92775584Sruis allowed
92875584Sru.BI ` expr 'th
92975584Sruis also allowed.
93075584SruNote that
93175584Sru.B 'th
93275584Sruis a single token: no space is allowed between the
93375584Sru.B '
93475584Sruand the
93575584Sru.BR th .
93675584SruFor example,
93775584Sru.IP
938104862Sru.ft B
93975584Sru.nf
94075584Srufor i = 1 to 4 do {
94175584Sru   line from `i'th box.nw to `i+1'th box.se
94275584Sru}
943104862Sru.ft
94475584Sru.fi
945104862Sru.
946104862Sru.
94775584Sru.SH CONVERSION
948104862Sru.
94975584SruTo obtain a stand-alone picture from a
95075584Sru.B pic
95175584Srufile, enclose your
95275584Sru.B pic
95375584Srucode with
95475584Sru.B .PS
95575584Sruand
95675584Sru.B .PE
95775584Srurequests;
95875584Sru.B roff
95975584Sruconfiguration commands may be added at the beginning of the file, but no
96075584Sru.B roff
96175584Srutext.
962104862Sru.
96375584Sru.LP
96475584SruIt is necessary to feed this file into
96575584Sru.B groff
96675584Sruwithout adding any page information, so you must check which
96775584Sru.B .PS
96875584Sruand
96975584Sru.B .PE
97075584Srurequests are actually called.
97175584SruFor example, the mm macro package adds a page number, which is very
97275584Sruannoying.
97375584SruAt the moment, calling standard
97475584Sru.B groff
97575584Sruwithout any macro package works.
97675584SruAlternatively, you can define your own requests, e.g. to do nothing:
97775584Sru.LP
97875584Sru.RS
97975584Sru.nf
98075584Sru.ft B
98175584Sru\&.de PS
98275584Sru\&..
98375584Sru\&.de PE
98475584Sru\&..
98575584Sru.ft
98675584Sru.fi
98775584Sru.RE
988104862Sru.
98975584Sru.LP
99075584Sru.B groff
99175584Sruitself does not provide direct conversion into other graphics file
99275584Sruformats.
99375584SruBut there are lots of possibilities if you first transform your picture
99475584Sruinto PostScript\*R format using the
99575584Sru.B groff
99675584Sruoption
99775584Sru.BR -Tps .
99875584SruSince this
99975584Sru.IR ps -file
100075584Srulacks BoundingBox information it is not very useful by itself, but it
100175584Srumay be fed into other conversion programs, usually named
100275584Sru.BI ps2 other
100375584Sruor
100475584Sru.BI psto other
100575584Sruor the like.
100675584SruMoreover, the PostScript interpreter
100775584Sru.B ghostscript
100875584Sru.RB ( gs )
100975584Sruhas built-in graphics conversion devices that are called with the option
101075584Sru.LP
101175584Sru.RS
101275584Sru.BI "gs -sDEVICE=" <devname>
101375584Sru.RE
101475584Sru.LP
101575584SruCall
1016151497Sru.LP
101775584Sru.RS
101875584Sru.B gs --help
101975584Sru.RE
102075584Sru.LP
102175584Srufor a list of the available devices.
1022104862Sru.
102375584Sru.LP
102475584SruAs the Encapsulated PostScript File Format
102575584Sru.B EPS
102675584Sruis getting more and more important, and the conversion wasn't regarded
102775584Srutrivial in the past you might be interested to know that there is a
102875584Sruconversion tool named
102975584Sru.B ps2eps
103075584Sruwhich does the right job.
103175584SruIt is much better than the tool
103275584Sru.B ps2epsi
103375584Srupackaged with
103475584Sru.BR gs .
103575584Sru.LP
103675584SruFor bitmapped graphic formats, you should use
103775584Sru.BR pstopnm ;
103875584Sruthe resulting (intermediate)
103975584Sru.B PNM
104075584Srufile can be then converted to virtually any graphics format using the tools
104175584Sruof the
104275584Sru.B netpbm
104375584Srupackage .
1044104862Sru.
1045104862Sru.
104675584Sru.SH FILES
1047104862Sru.
104875584Sru.Tp \w'\fB@MACRODIR@/pic.tmac'u+3n
104975584Sru.B
105075584Sru@MACRODIR@/pic.tmac
105175584SruExample definitions of the
105275584Sru.B PS
105375584Sruand
105475584Sru.B PE
105575584Srumacros.
1056104862Sru.
1057104862Sru.
105875584Sru.SH "SEE ALSO"
1059104862Sru.
106075584Sru.BR @g@troff (@MAN1EXT@),
106175584Sru.BR groff_out (@MAN5EXT@),
106275584Sru.BR tex (1),
106375584Sru.BR gs (1),
106475584Sru.BR ps2eps (1),
106575584Sru.BR pstopnm (1),
106675584Sru.BR ps2epsi (1),
106775584Sru.BR pnm (5)
106875584Sru.LP
106975584SruTpic: Pic for \*(tx
107075584Sru.LP
107175584SruBrian W. Kernighan,
107275584SruPIC \(em A Graphics Language for Typesetting (User Manual).
107375584SruAT&T Bell Laboratories, Computing Science Technical Report No.\ 116
1074104862Sru<http://cm.bell-labs.com/cm/cs/cstr/116.ps.gz>
107575584Sru(revised May, 1991).
107675584Sru.LP
107775584Sru.B ps2eps
107875584Sruis available from CTAN mirrors, e.g.
107975584Sru.br
108075584Sru<ftp://ftp.dante.de/tex-archive/support/ps2eps/>
108175584Sru.LP
108275584SruW. Richard Stevens - Turning PIC Into HTML
108375584Sru.br
108475584Sru<http://www.kohala.com/start/troff/pic2html.html>
108575584Sru.LP
108675584SruW. Richard Stevens - Examples of picMacros
108775584Sru.br
108875584Sru<http://www.kohala.com/start/troff/pic.examples.ps>
1089104862Sru.
1090104862Sru.
109175584Sru.SH BUGS
1092104862Sru.
1093104862SruInput characters that are invalid for
109475584Sru.B groff
1095151497Sru(i.e., those with
109675584Sru.SM ASCII
1097104862Srucode 0, or 013 octal, or between 015 and 037 octal, or between 0200 and 0237
1098104862Sruoctal) are rejected even in \*(tx mode.
109975584Sru.LP
110075584SruThe interpretation of
110175584Sru.B fillval
110275584Sruis incompatible with the pic in 10th edition Unix,
110375584Sruwhich interprets 0 as black and 1 as white.
110475584Sru.LP
110575584SruPostScript\*R is a registered trademark of Adobe Systems Incorporation.
110679543Sru.
110779543Sru.\" Local Variables:
110879543Sru.\" mode: nroff
110979543Sru.\" End:
1110