0
|
1 #!/bin/sh
|
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
|
|
12 booke=$1
|
13
|
13 output=dottes.tex
|
0
|
14
|
13
|
15 cp dottes.tex.header $output
|
|
16
|
|
17 # Now, for each tune, add
|
|
18 #
|
|
19 # \addcontentsline{toc}{subsection}{<Tune title>}
|
|
20 # \begin{abc}[name=<filename>]
|
|
21 # ... ABC ...
|
|
22 # \end{abc}
|
|
23
|
|
24 find $booke -name "*.abc" | sort |
|
|
25 while read filename
|
|
26 do
|
|
27 title=`grep "^T:" $filename | sed -e "s/^T: *//"`
|
|
28 name=`basename $filename .abc`
|
|
29 echo "\\\\addcontentsline{toc}{subsection}{$title}" >> $output
|
|
30 echo "\\\\begin{abc}[name=$name]" >> $output
|
|
31 cat $filename >> $output
|
|
32 echo "\\\\end{abc}" >> $output
|
|
33 done
|
|
34
|
|
35 echo "\\\\end{document}" >> $output
|
|
36
|
|
37 #pdflatex -shell-escape $output
|
|
38 #pdflatex -shell-escape $output
|