-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathforest-animate-examples.tex
More file actions
79 lines (64 loc) · 1.58 KB
/
forest-animate-examples.tex
File metadata and controls
79 lines (64 loc) · 1.58 KB
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
\documentclass{article}
\usepackage{forest-animate}
\pagestyle{empty}
\begin{document}
\centering
\section{Cumulative animation}
\begin{forest}
animate={controls}{1}
[VP
[V]
[DP,phantom,frame=3{not phantom,for children={fill=white,typeset node}}
[D,frame=1{fill=yellow}]
[NP,frame=2{fill=yellow}]
]
]
\end{forest}
\bigskip\bigskip\bigskip
\begin{forest}
animate={controls}{10}
[root,repeat={15}{append={[,
content/.pgfmath=n,
child anchor=north,
frame/.wrap pgfmath arg={{####1}{text=red,edge=red}}{n},
frame/.wrap pgfmath arg={{####1}{text=black,edge=black}}{n()+n_children("!u")}
]}}]
\end{forest}
\bigskip\bigskip\bigskip
% it's easy to program consecutive frames: use "delay"!
\begin{forest}
animate={controls}{10}
[root,repeat={15}{append={[,
content/.pgfmath=n,
child anchor=north,
frame/.wrap pgfmath arg={{####1}{text=red,edge=red,delay={text=blue,typeset node,edge=blue}}}{n},
]}}]
\end{forest}
\bigskip\bigskip\bigskip
\begin{forest}
animate={controls}{1}
[What,frame=3{content=SO WHAT!,red}
[if,for descendants={phantom,frame=1{not phantom}}
[the][tree][size]
]
[changes?,phantom,frame=2{not phantom}
]
]
\end{forest}
\bigskip\bigskip\bigskip
\section{Non-cumulative animation}
\begin{forest}
animate non-cumulative={controls}{1}{
for root'={for tree={
content=\textbf{####1},
typeset node,
for root'=new frame,
}}
},
[VP[V][DP[D][NP]]]
\end{forest}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: