Mercurial > dottes
annotate makeGraphics.sh @ 42:0e7d2830cb8b
Put making tune graphics required by web and book into separate dir and make separately.
Web and book both require the tune PDF graphics. Break these out into a separate
direction and make with a separate process.
author | Jim Hague <jim.hague@laicatc.com> |
---|---|
date | Sun, 04 Mar 2012 12:00:30 +0000 |
parents | |
children | e666306c5ab1 |
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` |
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
|
24 abcm2ps -j0 +c -n -E -O $graphicsdir/$name.eps $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
|
25 # 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
|
26 mv $graphicsdir/${name}001.eps $graphicsdir/${name}.eps |
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 # And make the corresponding PDF for pdflatex. |
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 epstopdf --outfile=$graphicsdir/$name.pdf $graphicsdir/${name}.eps |
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
|
29 done |