-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtombstone.tex
76 lines (63 loc) · 1.77 KB
/
tombstone.tex
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
% Improved version of
% http://blog.sterex.de/2013/04/latex-macro-for-tombstone-diagrams/
\def\tcompiler(from #1 to #2 in #3){%
\begin{picture}(100,50)
\put (0,50) {\line(1,0) {100}}
\put (0,25) {\line(0,1) {25}}
\put (100,50) {\line(0,-1) {25}}
% __ __ T bottom elements
\put (100,25) {\line(-1,0) {35}}
\put (0, 25) {\line(1,0) {35}}
% | | left and right
\put (35,25) {\line(0,-1) {25}}
\put (65,25) {\line(0,-1) {25}}
% |__| bottom
\put (35,0) {\line(1,0) {30}}
% From -> To
\put(10,37){\makebox(0,0) {#1}}
\put(50,37){\makebox(0,0) {$\rightarrow$}}
\put(80,37){\makebox(0,0) {#2}}
% In
\put(50,10){\makebox(0,0) {#3}}
\end{picture}
}
\def\tmachine(#1){%
\begin{picture}(30,25)
\put (0,25) {\line(1,0) {30}}
\put (0,25) {\line(2,-3) {15}}
\put (30,25) {\line(-2,-3) {15}}
\put (15,20) {\makebox(0,0) {#1}}
\end{picture}
}
\def\tprog(#1 in #2){%
\begin{picture}(50,45)
% Upper trapezoid
\put (10,25) {\line(-1,2) {10}}
\put (40,25) {\line(1,2) {10}}
\put (0,45) {\line(1,0) {50}}
\put (25,35) {\makebox(0,0) {#1}}
% Lower box
\put (10,0) {\line(1,0) {30}}
\put (10,0) {\line(0,1) {25}}
\put (40,0) {\line(0,1) {25}}
\put (25,13) {\makebox(0,0) {#2}}
\end{picture}
}
\def\tinter(#1 in #2){%
\begin{picture}(30,50)
% Upper box
\put (0,25) {\line(0,1) {25}}
\put (0,50) {\line(1,0) {30}}
\put (30,25) {\line(0,1) {25}}
\put (15,38) {\makebox(0,0) {#1}}
% Lower box
\put (0,0) {\line(1,0) {30}}
\put (0,0) {\line(0,1) {25}}
\put (30,0) {\line(0,1) {25}}
\put (15,13) {\makebox(0,0) {#2}}
\end{picture}
}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "hpps-notes"
%%% End: