dottes/makeBooke.sh

39 lines
835 B
Bash
Executable File

#!/bin/sh
#
# Build the Booke. First assemble the book LaTeX, then build it
# into a PDF.
#
if [ $# != 1 ]; then
echo "Usage: make.sh <book dir name>"
exit 1
fi
booke=$1
output=dottes.tex
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