Debian Codegraph @

utils/tpic2pdftex/example.pic

raw
1 %$Id: example.pic,v 1.19 2007/01/14 14:03:51 hahe Exp hahe $
2 %***********************************************************************
3 \pdfcompresslevel=0
4 \def\gpicbox#1{\vbox{\unvbox\csname #1\endcsname\kern0pt}}
5 \newcount\piccount\piccount=0
6 \def\sep{\advance\piccount by 1%
7 \kern5pt\hrule\kern5pt\rlap{\smash{\lower10pt\hbox{\the\piccount}}}}
8 \sep
9 %***********************************************************************
10 % 1
11 .PS
12 box dotted thickness 1; arrow;
13 circle dotted 0.02 fill 0.1 "Hello"; arrowhead = 7; arrow; circle fill 0.1;
14 arrowhead = 2; arrow; circle fill 0.9; arrow; box dashed 0.1
15 .PE
16 \centerline{A\gpicbox{graph}B}
17 \sep
18 %***********************************************************************
19 % 2
20 .PS
21 ellipse; arrow;
22 \pdfliteral {q 1 0 0 RG}
23 ellipse dotted thickness 2;
24 \pdfliteral {Q}
25 arrow;
26 ellipse dashed "$\sqrt{3/7\cdot{2\over5}}$" "No.~2"; arrow;
27 \pdfliteral {q 0 0 1 RG}
28 \pdfliteral { 0.5 0.5 0.0 rg}
29 box rad 0.25 fill 0.05 "Hello"; arrow;
30 \pdfliteral {Q}
31 box dotted fill 0.2
32 .PE
33 \centerline{A\gpicbox{graph}B}
34 \sep
35 %***********************************************************************
36 % 3
37 .PS
38 line; arc; arc cw; line
39 .PE
40 \centerline{A\gpicbox{graph}B}
41 \sep
42 %***********************************************************************
43 % 4
44 .PS
45 spline right 1 then down .5 left 1 then right 1 ->;
46 line dashed right 1 then down .5 left 1 then right 1 -> at last spline
47 .PE
48 \centerline{A\gpicbox{graph}B}
49 \sep
50 %***********************************************************************
51 % 5
52 .PS
53 \pdfliteral {q 0 1 0 RG}
54 spline dashed right 1 then down .5 left 1 then down ->
55 \pdfliteral {Q}
56 line dotted 0.02 right 1 then down .5 left 1 then down -> at last spline
57 .PE
58 \centerline{A\gpicbox{graph}B}
59 \sep
60 %***********************************************************************
61 % 6
62 .PS
63 spline left then up right then down right ->
64 .PE
65 \centerline{A\vrule\gpicbox{graph}\vrule B}
66 \sep
67 %***********************************************************************
68 % 7
69 .PS
70 spline right then up then left then down ->
71 line dotted right then up then left then down -> at last spline
72 .PE
73 \centerline{A\gpicbox{graph}B}
74 \sep
75 %***********************************************************************
76 % 8
77 .PS
78 circle "x"
79 circle "y" at 1st circle - (0.4, 0.6)
80 circle "z" at 1st circle + (0.4, -0.6)
81 arrow from 1st circle to 2nd circle chop
82 arrow from 2st circle to 3rd circle chop
83 arrow from 3rd circle to 1st circle chop
84 .PE
85 \centerline{A\gpicbox{graph}B}
86 \sep
87 %***********************************************************************
88 % 9
89 % example borrowed from file cstr116.pdf or cstr116.ps:
90 % PIC --- A Graphics Language for Typesetting, User Manual,
91 % Brian W. Kernighan, Revised, May, 1991
92 .PS
93 define ndblock{
94 box wid boxwid/2 ht boxht/2
95 down; box same with .t at bottom of last box; box same
96 }
97 boxht = .2; boxwid = .3; circlerad = .3; dx = 0.05
98 down; box; box; box; box ht 3*boxht "." "." "."
99 L: box; box; box invis wid 2*boxwid "hashtab:" with .e at 1st box .w
100 right
101 Start: box wid .5 with .sw at 1st box.ne + (.4,.2) "..."
102 N1: box wid .2 "n1"; D1: box wid .3 "d1"
103 N3: box wid .4 "n3"; D3: box wid .3 "d3"
104 box wid .4 "..."
105 N2: box wid .5 "n2"; D2: box wid .2 "d2"
106 arrow right from 2nd box
107 ndblock
108 spline -> right .2 from 3rd last box then to N1.sw + (dx,0)
109 spline -> right .3 from 2nd last box then to D1.sw + (dx,0)
110 arrow right from last box
111 ndblock
112 spline -> right .2 from 3rd last box to N2.sw - (dx,.2) to N2.sw + (dx,0)
113 spline -> right .3 from 2nd last box to D2.sw - (dx,.2) to D2.sw + (dx,0)
114 arrow right 2* linewid from L
115 ndblock
116 spline -> right .2 from 3rd last box to N3.sw + (dx,0)
117 spline -> right .3 from 2nd last box to D3.sw + (dx,0)
118 circlerad=.3
119 circle invis "ndblock" at last box.e + (1.2,.2)
120 arrow dashed from last circle.w to last box chop 0 chop .3
121 box invis wid 2*boxwid "ndtable:" with .e at Start.w
122 .PE
123 \centerline{A\gpicbox{graph}B}
124 \sep
125 %***********************************************************************
126 \end
127