annotate makeBooke.sh @ 438:bef458fc9ba5

Set tempo and add some rough chords to Battle of the Somme.
author Jim Hague <jim.hague@acm.org>
date Thu, 17 Oct 2013 13:45:49 +0100
parents 2a7d03d6a89f
children 0206ab9fd6ba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
266
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
1 #!/bin/bash
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
2 #
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
3 # Build the Booke. Move subfiles into place and build the Booke into a PDF.
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
4 #
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
5 # The Booke tune content and all EPS and PDF tune graphics must be
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
6 # present already. Run makeGraphics.sh first and then
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
7 # makeBookeTunePages.sh.
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
8 #
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
9
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
10 if [ $# != 2 ]; then
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
11 echo "Usage: makeBooke.sh <book dir name> <A4|A5>"
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
12 exit 1
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
13 fi
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
14
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
15 dir=`pwd`
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
16
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
17 booke=$dir/$1
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
18 papersize=$2
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
19 builddir=$dir/build
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
20 booketex=$dir/dottes.tex
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
21 bookepdf=$builddir/dottes.pdf
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
22
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
23 mkdir -p $builddir
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
24
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
25 cp dottes.tex $builddir
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
26 cp buildno.txt $builddir
304
9c5cabaabbec Replace buzzard EPS with cropped PDF.
Jim Hague <jim.hague@acm.org>
parents: 266
diff changeset
27 cp buzzard.pdf $builddir
359
2a7d03d6a89f Use txt2tags to format intro text.
Jim Hague <jim.hague@acm.org>
parents: 327
diff changeset
28 for item in title subtitle instrument
266
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
29 do
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
30 rm -f $builddir/$item.txt
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
31 if [ -r $booke/$item.txt ]; then
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
32 cp $booke/$item.txt $builddir
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
33 else
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
34 touch $builddir/$item.txt
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
35 fi
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
36 done
359
2a7d03d6a89f Use txt2tags to format intro text.
Jim Hague <jim.hague@acm.org>
parents: 327
diff changeset
37 for item in intro
2a7d03d6a89f Use txt2tags to format intro text.
Jim Hague <jim.hague@acm.org>
parents: 327
diff changeset
38 do
2a7d03d6a89f Use txt2tags to format intro text.
Jim Hague <jim.hague@acm.org>
parents: 327
diff changeset
39 rm -f $builddir/$item.tex
2a7d03d6a89f Use txt2tags to format intro text.
Jim Hague <jim.hague@acm.org>
parents: 327
diff changeset
40 if [ -r $booke/$item.txt ]; then
2a7d03d6a89f Use txt2tags to format intro text.
Jim Hague <jim.hague@acm.org>
parents: 327
diff changeset
41 txt2tags --no-headers --target=tex --outfile=$builddir/$item.tex $booke/$item.txt
2a7d03d6a89f Use txt2tags to format intro text.
Jim Hague <jim.hague@acm.org>
parents: 327
diff changeset
42 else
2a7d03d6a89f Use txt2tags to format intro text.
Jim Hague <jim.hague@acm.org>
parents: 327
diff changeset
43 touch $builddir/$item.tex
2a7d03d6a89f Use txt2tags to format intro text.
Jim Hague <jim.hague@acm.org>
parents: 327
diff changeset
44 fi
2a7d03d6a89f Use txt2tags to format intro text.
Jim Hague <jim.hague@acm.org>
parents: 327
diff changeset
45 done
266
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
46
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
47 for filename in $dir/*.${papersize}.tex
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
48 do
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
49 name=`basename $filename .${papersize}.tex`
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
50 cp $filename $builddir/$name.tex
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
51 done
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
52
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
53 cd $builddir
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
54
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
55 xelatex $booketex
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
56 xelatex $booketex
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
57 xelatex $booketex
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
58
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
59 mv $bookepdf $dir/$1-${papersize}.pdf
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
60
06e140f48543 Revise scripts for building printed Bookes.
Jim Hague <jim.hague@acm.org>
parents:
diff changeset
61 cd $dir