-
Notifications
You must be signed in to change notification settings - Fork 74
/
catalog2
executable file
·48 lines (43 loc) · 1.02 KB
/
catalog2
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
#!/bin/sh
# ./catalog2 ls plate*/original*.jpg | decksh | pdf -pagesize 1920,1080
ims $* | awk '
BEGIN {
scale=35
bgcolor="linen"
}
{
pic[NR] = $1
width[NR]=$2
height[NR]=$3
plate[NR]=substr($1,6,2)
}
END {
print "deck"
printf "slide \"%s\"\nctext \"Du Bois Visualizations Recreations\" 50 92 3\n", bgcolor
left=5
x=left
y=80
colsize=90/13
rowsize=80/5
tocscale=4.5
for (i=1; i <=NR; i++) {
printf "image \"%s\" %g %g %d %d %g\n", pic[i], x, y, width[i], height[i], tocscale
printf "ctext \"Plate %s\" %g %g 1\n", plate[i], x, y-(rowsize*0.5)
x += colsize
if (x > 95) {
x = left
y -= rowsize
}
}
printf "eslide\n"
for (i=1; i <=NR; i++) {
if (i%2 == 0) {
printf "slide \"%s\"\n", bgcolor
printf "image \"%s\" 25 50 %d %d %g\n", pic[i-1], width[i-1], height[i-1], scale
printf "ctext \"Plate %s\" 25 3 1.5\n", plate[i-1]
printf "ctext \"Plate %s\" 75 3 1.5\n", plate[i]
printf "image \"%s\" 75 50 %d %d %g\neslide\n", pic[i], width[i], height[i], scale
}
}
print "edeck"
}'