dottes/makeBooke.sh

39 lines
835 B
Bash
Raw Normal View History

2012-02-25 14:32:23 +00:00
#!/bin/sh
2012-02-27 08:50:45 +00:00
#
# Build the Booke. First assemble the book LaTeX, then build it
# into a PDF.
#
2012-02-25 14:32:23 +00:00
if [ $# != 1 ]; then
echo "Usage: make.sh <book dir name>"
exit 1
fi
booke=$1
2012-02-27 08:50:45 +00:00
output=dottes.tex
2012-02-25 14:32:23 +00:00
2012-02-27 08:50:45 +00:00
cp dottes.tex.header $output
# Now, for each tune, add
#
# \addcontentsline{toc}{subsection}{<Tune title>}
# \begin{abc}[name=<filename>]
# ... ABC ...
# \end{abc}
find $booke -name "*.abc" | sort |
while read filename
do
title=`grep "^T:" $filename | sed -e "s/^T: *//"`
name=`basename $filename .abc`
echo "\\\\addcontentsline{toc}{subsection}{$title}" >> $output
echo "\\\\begin{abc}[name=$name]" >> $output
cat $filename >> $output
echo "\\\\end{abc}" >> $output
done
echo "\\\\end{document}" >> $output
#pdflatex -shell-escape $output
#pdflatex -shell-escape $output