284 lines
7.9 KiB
HTML
284 lines
7.9 KiB
HTML
<!-- Creator : groff version 1.24.1 -->
|
|
<!-- CreationDate: Mon Mar 16 21:28:01 2026 -->
|
|
<!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=UTF-8">
|
|
<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-20.html</title>
|
|
|
|
</head>
|
|
<hr>
|
|
[ <a href="pic-19.html">prev</a> | <a href="pic-21.html">next</a> | <a href="pic.html">top</a> ]
|
|
<hr>
|
|
|
|
|
|
<h2>20. Some Larger Examples
|
|
<a name="20. Some Larger Examples"></a>
|
|
</h2>
|
|
|
|
|
|
<p style="margin-top: 1em"><font color="#000000">Here are a
|
|
few larger examples, with complete source code. One of our
|
|
earlier examples is generated in an instructive way using a
|
|
for loop:</font></p>
|
|
|
|
|
|
<p style="margin-left:28%; margin-top: 1em"><font color="#000000">.PS
|
|
<br>
|
|
# Draw a demonstration up left arrow with grid box overlay
|
|
<br>
|
|
define gridarrow <br>
|
|
{ <br>
|
|
move right 0.1 <br>
|
|
[ <br>
|
|
{arrow up left $1;} <br>
|
|
box wid 0.5 ht 0.5 dotted with .nw at last arrow .end; <br>
|
|
for i = 2 to ($1 / 0.5) do <br>
|
|
{ <br>
|
|
box wid 0.5 ht 0.5 dotted with .sw at last box .se; <br>
|
|
} <br>
|
|
move down from last arrow .center; <br>
|
|
[ <br>
|
|
sprintf("\fBarrow up left %g\fP", $1) <br>
|
|
] <br>
|
|
] <br>
|
|
move right 0.1 from last [] .e; <br>
|
|
} <br>
|
|
gridarrow(0.5); <br>
|
|
gridarrow(1); <br>
|
|
gridarrow(1.5); <br>
|
|
gridarrow(2); <br>
|
|
undef gridarrow <br>
|
|
.PE</font></p>
|
|
|
|
|
|
<p align="center" style="margin-top: 1em"><font color="#000000"><img src="img/pic-49.png" alt="Image img/pic-49.png"></font></p>
|
|
|
|
|
|
<p align="center" style="margin-top: 1em"><font color="#000000">Figure
|
|
20-1: Diagonal arrows (dotted boxes show the implied
|
|
0.5-inch grid)</font></p>
|
|
|
|
|
|
<p style="margin-top: 1em"><font color="#000000">Here’s
|
|
an example concocted to demonstrate layout of a large,
|
|
multiple-part pattern:</font></p>
|
|
|
|
|
|
<p style="margin-left:28%; margin-top: 1em"><font color="#000000">.PS
|
|
<br>
|
|
define filter {box ht 0.25 rad 0.125} <br>
|
|
lineht = 0.25; <br>
|
|
Top: [ <br>
|
|
right; <br>
|
|
box "\fBms\fR" "sources"; <br>
|
|
move; <br>
|
|
box "\fBHTML\fR" "sources"; <br>
|
|
move; <br>
|
|
box "\fBlinuxdoc-sgml\fP" "sources" wid
|
|
1.5; <br>
|
|
move; <br>
|
|
box "\fBTexinfo\fP"
|
|
"sources";</font></p>
|
|
|
|
|
|
<p style="margin-left:28%; margin-top: 1em"><font color="#000000">line
|
|
down from 1st box .s lineht; <br>
|
|
A: line down; <br>
|
|
line down from 2nd box .s; filter "\fBhtml2ms\fP";
|
|
<br>
|
|
B: line down; <br>
|
|
line down from 3rd box .s; filter "\fBformat\fP";
|
|
<br>
|
|
C: line down; <br>
|
|
line down from 4th box .s; filter
|
|
"\fBtexi2roff\fP"; <br>
|
|
D: line down; <br>
|
|
] <br>
|
|
move down 1 from last [] .s; <br>
|
|
Anchor: box wid 1 ht 0.75 "\fBms\fR"
|
|
"intermediate" "form"; <br>
|
|
arrow from Top.A.end to Anchor.nw; <br>
|
|
arrow from Top.B.end to 1/3 of the way between Anchor.nw and
|
|
Anchor.ne; <br>
|
|
arrow from Top.C.end to 2/3 of the way between Anchor.nw and
|
|
Anchor.ne; <br>
|
|
arrow from Top.D.end to Anchor.ne <br>
|
|
{ <br>
|
|
# PostScript column <br>
|
|
move to Anchor .sw; <br>
|
|
line down left then down ->; <br>
|
|
filter "\fBpic\fP"; <br>
|
|
arrow; <br>
|
|
filter "\fBeqn\fP"; <br>
|
|
arrow; <br>
|
|
filter "\fBtbl\fP"; <br>
|
|
arrow; <br>
|
|
filter "\fBgroff\fP"; <br>
|
|
arrow; <br>
|
|
box "PostScript";</font></p>
|
|
|
|
|
|
<p style="margin-left:28%; margin-top: 1em"><font color="#000000">#
|
|
HTML column <br>
|
|
move to Anchor .se; <br>
|
|
line down right then down ->; <br>
|
|
A: filter dotted "\fBpic2img\fP"; <br>
|
|
arrow; <br>
|
|
B: filter dotted "\fBeqn2html\fP"; <br>
|
|
arrow; <br>
|
|
C: filter dotted "\fBtbl2html\fP"; <br>
|
|
arrow; <br>
|
|
filter "\fBms2html\fP"; <br>
|
|
arrow; <br>
|
|
box "HTML";</font></p>
|
|
|
|
|
|
<p style="margin-left:28%; margin-top: 1em"><font color="#000000">#
|
|
Nonexistence caption <br>
|
|
box dashed wid 1 at B + (2,0) "These tools"
|
|
"don’t yet exist"; <br>
|
|
line chop 0 chop 0.1 dashed from last box .nw to A.e ->;
|
|
<br>
|
|
line chop 0 chop 0.1 dashed from last box .w to B.e ->;
|
|
<br>
|
|
line chop 0 chop 0.1 dashed from last box .sw to C.e ->;
|
|
<br>
|
|
} <br>
|
|
.PE</font></p>
|
|
|
|
|
|
<p align="center" style="margin-top: 1em"><font color="#000000"><img src="img/pic-50.png" alt="Image img/pic-50.png"></font></p>
|
|
|
|
|
|
<p align="center" style="margin-top: 1em"><font color="#000000">Figure
|
|
20-2: Hypothetical production flow for dual-mode
|
|
publishing</font></p>
|
|
|
|
|
|
<p align="center" style="margin-top: 1em"><font color="#000000"><img src="img/pic-51.png" alt="Image img/pic-51.png"></font></p>
|
|
|
|
|
|
<p align="center" style="margin-top: 1em"><font color="#000000">Figure
|
|
20-3: Three-dimensional Boxes</font></p>
|
|
|
|
<p style="margin-top: 1em"><font color="#000000">Here the
|
|
source code for figure 20-3:</font></p>
|
|
|
|
|
|
<p style="margin-left:28%; margin-top: 1em"><font color="#000000">.PS
|
|
<br>
|
|
# a three-dimensional block <br>
|
|
# <br>
|
|
# tblock(<width>, <height>,
|
|
<text>)</font></p>
|
|
|
|
|
|
<p style="margin-left:28%; margin-top: 1em"><font color="#000000">define
|
|
tblock { [ <br>
|
|
box ht $2 wid $1 \ <br>
|
|
color "gold" outlined "black" \ <br>
|
|
xslanted 0 yslanted 0 \ <br>
|
|
$3; <br>
|
|
box ht .1 wid $1 \ <br>
|
|
color "yellow" outlined "black" \ <br>
|
|
xslanted .1 yslanted 0 \ <br>
|
|
with .sw at last box .nw; <br>
|
|
box ht $2 wid .1 \ <br>
|
|
color "goldenrod" outlined "black" \
|
|
<br>
|
|
xslanted 0 yslanted .1 \ <br>
|
|
with .nw at 2nd last box .ne; <br>
|
|
] }</font></p>
|
|
|
|
|
|
<p style="margin-left:28%; margin-top: 1em"><font color="#000000">tblock(1,
|
|
.5, "Master" "1"); <br>
|
|
move -.1 <br>
|
|
tblock(.5, 1, "Slave"); <br>
|
|
.PE</font></p>
|
|
|
|
<p style="margin-top: 1em"><font color="#000000">Here is a
|
|
flow chart with source code to demonstrate how a polygon
|
|
attaches to other objects:</font></p>
|
|
|
|
|
|
<p style="margin-left:28%; margin-top: 1em"><font color="#000000">.PS
|
|
<br>
|
|
down; <br>
|
|
h = 0.25; <br>
|
|
w = 0.375; <br>
|
|
l = 0.75; <br>
|
|
r = 0.1; <br>
|
|
box rad r fill 0.3 outlined "green"; <br>
|
|
"Start" at last box; <br>
|
|
arrow down l from last box.s; <br>
|
|
polygon \</font></p>
|
|
|
|
<table width="100%" border="0" rules="none" frame="void"
|
|
cellspacing="0" cellpadding="0">
|
|
<tr valign="top" align="left">
|
|
<td width="11%"></td>
|
|
<td width="89%">
|
|
|
|
|
|
<p><font color="#000000">down h right w \</font></p></td></tr>
|
|
<tr valign="top" align="left">
|
|
<td width="11%"></td>
|
|
<td width="89%">
|
|
|
|
|
|
<p><font color="#000000">then down h left w \</font></p></td></tr>
|
|
<tr valign="top" align="left">
|
|
<td width="11%"></td>
|
|
<td width="89%">
|
|
|
|
|
|
<p><font color="#000000">then up h left w \</font></p></td></tr>
|
|
<tr valign="top" align="left">
|
|
<td width="11%"></td>
|
|
<td width="89%">
|
|
|
|
|
|
<p><font color="#000000">with .v1 at last arrow.end
|
|
\</font></p> </td></tr>
|
|
<tr valign="top" align="left">
|
|
<td width="11%"></td>
|
|
<td width="89%">
|
|
|
|
|
|
<p><font color="#000000">fill 0.3 outlined
|
|
"blue";</font></p> </td></tr>
|
|
</table>
|
|
|
|
|
|
<p style="margin-left:28%;"><font color="#000000">"Done?"
|
|
at last polygon.c; <br>
|
|
arrow down l from last polygon.v3 " Yes" ljust;
|
|
<br>
|
|
box rad r fill 0.3 outlined "green"; <br>
|
|
"End" at last box.c; <br>
|
|
move to last polygon.v2; <br>
|
|
line right "" "No"; <br>
|
|
arrow up l - h/2 then left lineht + w; <br>
|
|
.PE</font></p>
|
|
|
|
|
|
<p align="center" style="margin-top: 1em"><font color="#000000"><img src="img/pic-52.png" alt="Image img/pic-52.png"></font></p>
|
|
|
|
|
|
<p align="center" style="margin-top: 1em"><font color="#000000">Figure
|
|
20-3: Flowchart for demonstrating polygon
|
|
attachment</font></p>
|
|
<hr>
|
|
[ <a href="pic-19.html">prev</a> | <a href="pic-21.html">next</a> | <a href="pic.html">top</a> ]
|
|
<hr>
|