PIC(1)PIC(1)
unhandled troff command .de
unhandled troff command . \ $1 is height, $2 is width, both in inches
unhandled troff command .if
unhandled troff command .ie
unhandled troff command .el
unhandled troff command .in
unhandled troff command ..
unhandled troff command .de
unhandled troff command .in
unhandled troff command .if
unhandled troff command ..
NAME
pic – troff preprocessor for drawing pictures
SYNOPSIS
DESCRIPTION
.PS optional-width optional-height element-list .PE
or in a file mentioned in a
If
An
primitive attribute-list placename : element placename : position var = expr direction { element-list } [ element-list ] for var = expr to expr by expr do { anything } if expr then { anything } else { anything } copy file, copy thru macro, copy file thru macro sh { commandline } print expr reset optional var-list troff-command
Elements are separated by newlines or semicolons;
a long element may be continued by ending the line with a backslash.
Comments are introduced by a
After each primitive
the current position moves in the current direction
The
box circle ellipse arc line arrow spline move text-list
An
h(eigh)t expr wid(th) expr rad(ius) expr diam(eter) expr up opt-expr down opt-expr right opt-expr left opt-expr from position to position at position with corner by expr, expr then dotted opt-expr dashed opt-expr chop opt-expr -> <- <-> invis same fill opt-expr text-list expr
Missing attributes and values are filled in from defaults.
Not all attributes make sense for all primitives;
irrelevant ones are silently ignored.
The attribute
Text is normally an attribute of some primitive; by default it is placed at the geometrical center of the object. Stand-alone text is also permitted. A text list is a list of text items:
text-item: "..." positioning ... sprintf("format", expr, ...) positioning ... positioning: center ljust rjust above below
If there are multiple text items for some primitive,
they are arranged vertically and centered except as qualified.
Positioning requests apply to each item independently.
Text items may contain
A position is ultimately an
position: expr, expr place ± expr, expr place ± ( expr, expr ) ( position, position ) x from one, y the other expr [of the way] between position and position expr < position , position > ( position )
place: placename optional-corner corner of placename nth primitive optional-corner corner of nth primitive Here
An
optional-corner: .n .e .w .s .ne .se .nw .sw .c .start .end corner: top bot left right start end
Each object in a picture has an ordinal number;
nth: nth, nth last
The built-in variables and their default values are:
boxwid 0.75 boxht 0.5 circlerad 0.25 arcrad 0.25 ellipsewid 0.75 ellipseht 0.5 linewid 0.5 lineht 0.5 movewid 0.5 moveht 0.5 textwid 0 textht 0 arrowwid 0.05 arrowht 0.1 dashwid 0.1 arrowhead 2 scale 1
These may be changed at any time,
and the new values remain in force from picture to picture until changed again
or reset by a
Expressions in
expr: expr op expr - expr ! expr ( expr ) variable number place .x place .y place .ht place .wid place .rad sin(expr) cos(expr) atan2(expr,expr) log(expr) exp(expr) sqrt(expr) max(expr,expr) min(expr,expr) int(expr) rand() op: + - * / % < <= > >= == != && ||
The
define name { replacement text } undef name
Occurrences of
name(arg1, arg2, ...)
Non-existent arguments are replaced by null strings.
Replacement text
may contain newlines.
The
SOURCE
SEE ALSO
B. W. Kernighan,
“PICa Graphics Language for Typesetting”,
Unix Research System Programmer’s Manual,
Tenth Edition, Volume 2