Mercurial > dottes
annotate makeGraphics.sh @ 122:295ba8275ab4
Make output larger where possible.
This is done by
a) reducing the page margins
b) compressing the heading and removing all but Notes: fields.
The latter produced vertically smaller tune PDFs that will scale wider.
In the process, modify abctitle.py to extract the first of any header field, and
move formatting for a single tune into a .fmt file.
author | Jim Hague <jim.hague@laicatc.com> |
---|---|
date | Sat, 21 Apr 2012 19:47:30 +0100 |
parents | 8f3b50ede59c |
children | 67dc98ae4816 |
rev | line source |
---|---|
42
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
1 #!/bin/bash |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
2 # |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
3 # Make the tune graphics, EPS, PDF required by web and book into |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
4 # graphics/<book>. |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
5 # |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
6 |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
7 if [ $# != 1 ]; then |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
8 echo "Usage: makeGraphics.sh <book dir name>" |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
9 exit 1 |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
10 fi |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
11 |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
12 dir=`pwd` |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
13 |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
14 booke=$dir/$1 |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
15 graphicsdir=$dir/graphics/$1 |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
16 |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
17 mkdir -p $graphicsdir |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
18 |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
19 # Now, for each tune, make the tune graphic. |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
20 find $booke -name "*.abc" | sort | |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
21 while read filename |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
22 do |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
23 name=`basename $filename .abc` |
50
e666306c5ab1
Add list of tune first lines.
Jim Hague <jim.hague@laicatc.com>
parents:
42
diff
changeset
|
24 |
e666306c5ab1
Add list of tune first lines.
Jim Hague <jim.hague@laicatc.com>
parents:
42
diff
changeset
|
25 # Make the tune graphic. |
122
295ba8275ab4
Make output larger where possible.
Jim Hague <jim.hague@laicatc.com>
parents:
118
diff
changeset
|
26 abcm2ps -E -F singletune -O $graphicsdir/$name.eps $filename |
42
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
27 # Make $name.eps so we can build with LaTeX. |
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
28 mv $graphicsdir/${name}001.eps $graphicsdir/${name}.eps |
118
8f3b50ede59c
Switch to XeTeX to render. Opens up random OpenType fonts and UTF-8.
Jim Hague <jim.hague@acm.org>
parents:
50
diff
changeset
|
29 # And make the corresponding PDF. |
42
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
30 epstopdf --outfile=$graphicsdir/$name.pdf $graphicsdir/${name}.eps |
50
e666306c5ab1
Add list of tune first lines.
Jim Hague <jim.hague@laicatc.com>
parents:
42
diff
changeset
|
31 |
e666306c5ab1
Add list of tune first lines.
Jim Hague <jim.hague@laicatc.com>
parents:
42
diff
changeset
|
32 # and make the first line graphic. |
e666306c5ab1
Add list of tune first lines.
Jim Hague <jim.hague@laicatc.com>
parents:
42
diff
changeset
|
33 $dir/abcfirstline.py $filename > firstline.abc |
e666306c5ab1
Add list of tune first lines.
Jim Hague <jim.hague@laicatc.com>
parents:
42
diff
changeset
|
34 abcm2ps +c -M +Q -E -O $graphicsdir/firstline-$name.eps firstline.abc |
e666306c5ab1
Add list of tune first lines.
Jim Hague <jim.hague@laicatc.com>
parents:
42
diff
changeset
|
35 mv $graphicsdir/firstline-${name}001.eps $graphicsdir/firstline-${name}.eps |
e666306c5ab1
Add list of tune first lines.
Jim Hague <jim.hague@laicatc.com>
parents:
42
diff
changeset
|
36 rm firstline.abc |
e666306c5ab1
Add list of tune first lines.
Jim Hague <jim.hague@laicatc.com>
parents:
42
diff
changeset
|
37 epstopdf --outfile=$graphicsdir/firstline-$name.pdf $graphicsdir/firstline-${name}.eps |
42
0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Jim Hague <jim.hague@laicatc.com>
parents:
diff
changeset
|
38 done |