Mercurial > dottes
annotate makeBooke.sh @ 37:72b5d67756e1
Fix up troubles with \. echo -E disables expansion.
author | Jim Hague <jim.hague@laicatc.com> |
---|---|
date | Sat, 03 Mar 2012 12:00:35 +0000 |
parents | 80af9457d566 |
children | 01c4d873153f |
rev | line source |
---|---|
37
72b5d67756e1
Fix up troubles with \. echo -E disables expansion.
Jim Hague <jim.hague@laicatc.com>
parents:
34
diff
changeset
|
1 #!/bin/bash |
13 | 2 # |
3 # Build the Booke. First assemble the book LaTeX, then build it | |
4 # into a PDF. | |
5 # | |
0 | 6 |
7 if [ $# != 1 ]; then | |
8 echo "Usage: make.sh <book dir name>" | |
9 exit 1 | |
10 fi | |
11 | |
16 | 12 dir=`pwd` |
13 | |
14 booke=$dir/$1 | |
15 builddir=$dir/build | |
13 | 16 output=dottes.tex |
0 | 17 |
16 | 18 mkdir -p $builddir |
19 | |
20 cp dottes.tex.header $builddir/$output | |
13 | 21 |
22 # Now, for each tune, add | |
23 # | |
24 # \addcontentsline{toc}{subsection}{<Tune title>} | |
25 # \begin{abc}[name=<filename>] | |
26 # ... ABC ... | |
27 # \end{abc} | |
28 | |
29 find $booke -name "*.abc" | sort | | |
30 while read filename | |
31 do | |
16 | 32 title=`grep "^T:" $filename | head -1 | sed -e "s/^T: *//"` |
13 | 33 name=`basename $filename .abc` |
34
80af9457d566
Remove use of abc pacakge and do the graphics outselves.
Jim Hague <jim.hague@acm.org>
parents:
32
diff
changeset
|
34 abcm2ps -j0 +c -n -E -O $builddir/$name.eps $filename |
80af9457d566
Remove use of abc pacakge and do the graphics outselves.
Jim Hague <jim.hague@acm.org>
parents:
32
diff
changeset
|
35 epstopdf --outfile=$builddir/$name.pdf $builddir/${name}001.eps |
37
72b5d67756e1
Fix up troubles with \. echo -E disables expansion.
Jim Hague <jim.hague@laicatc.com>
parents:
34
diff
changeset
|
36 echo -E "\begin{center}" >> $builddir/$output |
72b5d67756e1
Fix up troubles with \. echo -E disables expansion.
Jim Hague <jim.hague@laicatc.com>
parents:
34
diff
changeset
|
37 echo -E "\includegraphics[width=\textwidth]{$name}" >> $builddir/$output |
72b5d67756e1
Fix up troubles with \. echo -E disables expansion.
Jim Hague <jim.hague@laicatc.com>
parents:
34
diff
changeset
|
38 echo -E "\addcontentsline{toc}{subsection}{$title}" >> $builddir/$output |
72b5d67756e1
Fix up troubles with \. echo -E disables expansion.
Jim Hague <jim.hague@laicatc.com>
parents:
34
diff
changeset
|
39 echo -E "\end{center}" >> $builddir/$output |
13 | 40 done |
41 | |
16 | 42 cat dottes.tex.footer >> $builddir/$output |
13 | 43 |
16 | 44 cd $builddir |
34
80af9457d566
Remove use of abc pacakge and do the graphics outselves.
Jim Hague <jim.hague@acm.org>
parents:
32
diff
changeset
|
45 pdflatex $output |
80af9457d566
Remove use of abc pacakge and do the graphics outselves.
Jim Hague <jim.hague@acm.org>
parents:
32
diff
changeset
|
46 pdflatex $output |
21
b61b090cd4c7
Produce an A4 PDF document with the A5 pages in booklet form.
Jim Hague <jim.hague@acm.org>
parents:
16
diff
changeset
|
47 |
b61b090cd4c7
Produce an A4 PDF document with the A5 pages in booklet form.
Jim Hague <jim.hague@acm.org>
parents:
16
diff
changeset
|
48 cd $dir |
b61b090cd4c7
Produce an A4 PDF document with the A5 pages in booklet form.
Jim Hague <jim.hague@acm.org>
parents:
16
diff
changeset
|
49 pdflatex dottesona4.tex |