-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathcatalog9
executable file
·39 lines (38 loc) · 1.58 KB
/
catalog9
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
#!/bin/sh
# ls plate*/f1.png | ./catalog9 | decksh | pdf -pagesize $portrait
awk '
BEGIN {
print "deck"
width=2112
height=2688
scale=17
bgcolor="linen"
}
{
pic[NR] = $1
}
END {
printf "// leftover=%d\n", (NR%9)-1
for (i=1; i <=NR; i++) {
platenum[i]=substr(pic[i],6)
if (i%9 == 0) {
printf "slide \"%s\"\n", bgcolor
printf "cimage \"%s\" \"Plate %d\" 20 80 %d %d %g\n", pic[i-8], platenum[i-8], width, height, scale
printf "cimage \"%s\" \"Plate %d\" 50 80 %d %d %g\n", pic[i-7], platenum[i-7], width, height, scale
printf "cimage \"%s\" \"Plate %d\" 80 80 %d %d %g\n", pic[i-6], platenum[i-6], width, height, scale
printf "cimage \"%s\" \"Plate %d\" 20 50 %d %d %g\n", pic[i-5], platenum[i-5], width, height, scale
printf "cimage \"%s\" \"Plate %d\" 50 50 %d %d %g\n", pic[i-4], platenum[i-4], width, height, scale
printf "cimage \"%s\" \"Plate %d\" 80 50 %d %d %g\n", pic[i-3], platenum[i-3], width, height, scale
printf "cimage \"%s\" \"Plate %d\" 20 20 %d %d %g\n", pic[i-2], platenum[i-2], width, height, scale
printf "cimage \"%s\" \"Plate %d\" 50 20 %d %d %g\n", pic[i-1], platenum[i-1], width, height, scale
printf "cimage \"%s\" \"Plate %d\" 80 20 %d %d %g\neslide\n", pic[i], platenum[i], width, height, scale
}
}
for (l=NR-leftover; l <= NR; l++) {
printf "slide \"%s\"\n", bgcolor
printf "cimage \"%s\" \"Plate %d\" 20 80 %d %d %g\n", pic[l-1], platenum[l-1], width, height, scale
printf "cimage \"%s\" \"Plate %d\" 50 80 %d %d %g\n", pic[l], platenum[l], width, height, scale
printf "eslide\n"
}
print "edeck"
}' $*