/usr/share/doc/groff-base/html/pic-3.html is in groff 1.21-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | <!-- Creator : groff version 1.21 -->
<!-- CreationDate: Sun Apr 1 21:52:28 2012 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="generator" content="groff -Thtml, see www.gnu.org">
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<meta name="Content-Style" content="text/css">
<style type="text/css">
p { margin-top: 0; margin-bottom: 0; vertical-align: top }
pre { margin-top: 0; margin-bottom: 0; vertical-align: top }
table { margin-top: 0; margin-bottom: 0; vertical-align: top }
h1 { text-align: center }
</style>
<title>pic-3.html</title>
</head>
<hr>
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>
[ <a href="pic-2.html">prev</a> | <a href="pic-4.html">next</a> | <a href="pic.html">top</a> ]
<hr>
<h2>3. Basic PIC Concepts
<a name="3. Basic PIC Concepts"></a>
</h2>
<p style="margin-top: 1em">Pictures are described
procedurally, as collections of objects connected by
motions. Normally, <b>pic</b> tries to string together
objects left-to-right in the sequence they are described,
joining them at visually natural points. Here is an example
illustrating the flow of data in <b>pic</b> processing:</p>
<p align="center" style="margin-top: 1em"><img src="img/pic1.png" alt="Image img/pic1.png"></p>
<p align="center" style="margin-top: 1em">Figure 3-1: Flow
of <b>pic</b> data</p>
<p style="margin-top: 1em">This was produced from the
following <b>pic</b> program:</p>
<pre style="margin-left:10%; margin-top: 1em">.PS
ellipse "document";
arrow;
box width 0.6 "\fIpic\/\fP(1)"
arrow;
box width 1.1 "\fIgtbl\/\fP(1) or \fIgeqn\/\fP(1)" "(optional)" dashed;
arrow;
box width 0.6 "\fIgtroff\/\fP(1)";
arrow;
ellipse "PostScript"
.PE</pre>
<p style="margin-top: 1em">This little program illustrates
several <b>pic</b> basics. Firstly, we see how to invoke
three object types; ellipses, arrows, and boxes. We see how
to declare text lines to go within an object (and that text
can have font changes in it). We see how to change the line
style of an object from solid to dashed. And we see that a
box can be made wider than its default size to accommodate
more text (we’ll discuss this facility in detail in
the next section).</p>
<p style="margin-top: 1em">We also get to see
<b>pic</b>’s simple syntax. Statements are ended by
newlines or semicolons. String quotes are required around
all text arguments, whether or not they contain spaces. In
general, the order of command arguments and modifiers like
“width 1.2” or “dashed”
doesn’t matter, except that the order of text
arguments is significant.</p>
<p style="margin-top: 1em">Here are all but one of the
basic <b>pic</b> objects at their default sizes:</p>
<p align="center" style="margin-top: 1em"><img src="img/pic2.png" alt="Image img/pic2.png"></p>
<p align="center" style="margin-top: 1em">Figure 3-2: Basic
<b>pic</b> objects</p>
<p style="margin-top: 1em">The missing simple object type
is a <i>spline</i>. There is also a way to collect objects
into <i>block composites</i> which allows you to treat the
whole group as a single object (resembling a box) for many
purposes. We’ll describe both of these later on.</p>
<p style="margin-top: 1em">The box, ellipse, circle, and
block composite objects are <i>closed</i>; lines, arrows,
arcs and splines are <i>open</i>. This distinction is often
important in explaining command modifiers.</p>
<p style="margin-top: 1em">Figure 3-2 was produced by the
following <b>pic</b> program, which introduces some more
basic concepts:</p>
<pre style="margin-left:10%; margin-top: 1em">.PS
box "box";
move;
line "line" "";
move;
arrow "arrow" "";
move;
circle "circle";
move;
ellipse "ellipse";
move;
arc; down; move; "arc"
.PE</pre>
<p style="margin-top: 1em">The first thing to notice is the
<i>move</i> command, which moves a default distance (1/2
inch) in the current movement direction.</p>
<p style="margin-top: 1em">Secondly, see how we can also
decorate lines and arrows with text. The line and arrow
commands each take two arguments here, specifying text to go
above and below the object. If you wonder why one argument
would not do, contemplate the output of <b>arrow
"ow!"</b>:</p>
<p align="center" style="margin-top: 1em"><img src="img/pic3.png" alt="Image img/pic3.png"></p>
<p align="center" style="margin-top: 1em">Figure 3-3: Text
centered on an arrow</p>
<p style="margin-top: 1em">When a command takes one text
string, <b>pic</b> tries to place it at the object’s
geometric center. As you add more strings, <b>pic</b> treats
them as a vertical block to be centered. The program</p>
<pre style="margin-left:10%; margin-top: 1em">line "1";
line "1" "2";
line "1" "2" "3";
line "1" "2" "3" "4";
line "1" "2" "3" "4" "5";</pre>
<p style="margin-top: 1em">for example, gives you this:</p>
<p align="center" style="margin-top: 1em"><img src="img/pic4.png" alt="Image img/pic4.png"></p>
<p align="center" style="margin-top: 1em">Figure 3-4:
Effects of multiple text arguments</p>
<p style="margin-top: 1em">The last line of Figure
3.2’s program, ‘<b>arc; down; move;
"arc"</b>’, describing the captioned arc,
introduces several new ideas. Firstly, we see how to change
the direction in which objects are joined. Had we written
<b>arc; move; "arc"</b>, omitting <b>down</b> the
caption would have been joined to the top of the arc, like
this:</p>
<p align="center" style="margin-top: 1em"><img src="img/pic5.png" alt="Image img/pic5.png"></p>
<p align="center" style="margin-top: 1em">Figure 3-5:
Result of <b>arc; move;</b></p>
<p style="margin-top: 1em">This is because drawing an arc
changes the default direction to the one its exit end points
at. To reinforce this point, consider:</p>
<p align="center" style="margin-top: 1em"><img src="img/pic6.png" alt="Image img/pic6.png"></p>
<p align="center" style="margin-top: 1em">Figure 3-6:
Result of <b>arc cw; move;</b></p>
<p style="margin-top: 1em">All we’ve done differently
here is specify “cw” for a clockwise arc
(“ccw” specifies counter-clockwise direction).
Observe how it changes the default direction to down, rather
than up.</p>
<p style="margin-top: 1em">Another good way to see this via
with the following program:</p>
<pre style="margin-left:10%; margin-top: 1em">line; arc; arc cw; line</pre>
<p style="margin-top: 1em">which yields:</p>
<p align="center" style="margin-top: 1em"><img src="img/pic7.png" alt="Image img/pic7.png"></p>
<p align="center">Figure 3-7: Result of <b>line; arc; arc
cw; line</b></p>
<p style="margin-top: 1em">Notice that we did not have to
specify “up” for the second arc to be joined to
the end of the first.</p>
<p style="margin-top: 1em">Finally, observe that a string,
alone, is treated as text to be surrounded by an invisible
box of a size either specified by width and height
attributes or by the defaults <b>textwid</b> and
<b>textht</b>. Both are initially zero (because we
don’t know the default font size).</p>
<hr>
<a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>
[ <a href="pic-2.html">prev</a> | <a href="pic-4.html">next</a> | <a href="pic.html">top</a> ]
<hr>
|