-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathinsert.tex
77 lines (72 loc) · 1.83 KB
/
insert.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
77
\documentclass[margin=0.5cm]{standalone}
\usepackage{array}
\usepackage{amsmath}
%
% Cooper Pierce <[email protected]>
%
% For use in the book,
% 1. compile with latexmk,
% 2. use dvisvgm
% E.g., latexmk insert
% && dvisvgm --no-fonts --clipjoin --bbox=papersize insert
% && mv insert-1.svg insert.svg
% (for whatever reason my version of pdflatex makes a two page dvi)
%
%
\usepackage{tikz}
\usetikzlibrary{arrows}
\usepackage{forest}
\begin{document}
\pagecolor{white}
\tikzset{%
/forest,
forest node/.style={circle, inner sep=0pt, text centered},
arn n/.append style={
text=white,
font=\sffamily\bfseries,
draw=black,
fill=black,
text width=1.5em,
},
arn r/.append style={%
text=white,
font=\sffamily\bfseries\tiny,
draw=red,
fill=red,
text width=1.5em,
},
}
\forestset{%
default preamble={
for tree={
font=\sffamily,
forest node,
edge path={
\noexpand\path[color=black, -stealth', \forestoption{edge}]
(!u.parent anchor) -- (.child anchor)\forestoption{edge label};
},
l sep+=.25cm,
s sep+=.25cm,
fit=band,
}
}
}
\begin{tabular}{m{0.8cm} m{2em} m{0.5cm} m{2em} m{1.5cm}}
Empty
&
\( \xrightarrow[a\,\mapsto\,2]{\text{ins.}} \)
&
\begin{forest}
[a\,:\,2, arn r]
\end{forest}
&
\( \xrightarrow[b\,\mapsto\,3]{\text{ins.}} \)
&
\begin{forest}
[a\,:\,2, arn r,
[,phantom]
[b\,:\,3, arn r]
]
\end{forest}
\end{tabular}
\end{document}