-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiagram-doodles.tex
52 lines (48 loc) · 1.47 KB
/
diagram-doodles.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
\newcommand{\skyline}[1]{
\foreach [count=\col] \val in {#1} {
\foreach \y in {1,...,\val} {
\draw[thick, line cap = round] (\col, \y) rectangle ++(1,1);
}
}
}
\newcommand{\skylinelabeled}[1]{
\foreach [count=\col] \val in {#1} {
\foreach \y in {1,...,\val} {
\draw[thick, line cap = round] (\col, \y) rectangle ++(1,1);
}
\node at ({\col+0.5}, 0) {$\val$};
}
}
\newcommand{\skylinefilled}[1]{
\foreach [count=\col] \val in {#1} {
\ifthenelse{\equal{\val}{0}}{}{
\foreach \y in {1,...,\val} {
\draw[fill=gray!50, thick, line cap = round] (\col, \y) rectangle ++(1,1);
}
}
}
}
\newcommand{\skylinefilledunderlines}[1]{
\foreach [count=\col] \val in {#1} {
\ifthenelse{\equal{\val}{0}}{}{
\foreach \y in {1,...,\val} {
\draw[fill=gray!50, thick, line cap = round] (\col, \y) rectangle ++(1,1);
}
\draw[shorten <= 2pt, shorten >= 2pt] (\col, -0.55) -- ++(1,0);
}
}
}
\newcommand{\ferrers}[1]{
\foreach [count=\row] \val in {#1} {
\foreach \x in {1,...,\val} {
\draw[thick, line cap = round] (\x, -\row) rectangle ++(1,1);
}
}
}
\newcommand{\ferrersfilled}[1]{
\foreach [count=\row] \val in {#1} {
\foreach \x in {1,...,\val} {
\draw[fill=gray!50, thick, line cap = round] (\x, -\row) rectangle ++(1,1);
}
}
}