2012-03-03 12:00:35 +00:00
|
|
|
#!/bin/bash
|
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
|
|
|
|
|
2012-02-27 13:04:37 +00:00
|
|
|
dir=`pwd`
|
|
|
|
|
|
|
|
booke=$dir/$1
|
|
|
|
builddir=$dir/build
|
2012-02-27 08:50:45 +00:00
|
|
|
output=dottes.tex
|
2012-02-25 14:32:23 +00:00
|
|
|
|
2012-02-27 13:04:37 +00:00
|
|
|
mkdir -p $builddir
|
|
|
|
|
|
|
|
cp dottes.tex.header $builddir/$output
|
2012-02-27 08:50:45 +00:00
|
|
|
|
|
|
|
# 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
|
2012-02-27 13:04:37 +00:00
|
|
|
title=`grep "^T:" $filename | head -1 | sed -e "s/^T: *//"`
|
2012-02-27 08:50:45 +00:00
|
|
|
name=`basename $filename .abc`
|
2012-03-02 12:30:43 +00:00
|
|
|
abcm2ps -j0 +c -n -E -O $builddir/$name.eps $filename
|
|
|
|
epstopdf --outfile=$builddir/$name.pdf $builddir/${name}001.eps
|
2012-03-03 12:00:35 +00:00
|
|
|
echo -E "\begin{center}" >> $builddir/$output
|
|
|
|
echo -E "\includegraphics[width=\textwidth]{$name}" >> $builddir/$output
|
|
|
|
echo -E "\addcontentsline{toc}{subsection}{$title}" >> $builddir/$output
|
|
|
|
echo -E "\end{center}" >> $builddir/$output
|
2012-02-27 08:50:45 +00:00
|
|
|
done
|
|
|
|
|
2012-02-27 13:04:37 +00:00
|
|
|
cat dottes.tex.footer >> $builddir/$output
|
2012-02-27 08:50:45 +00:00
|
|
|
|
2012-02-27 13:04:37 +00:00
|
|
|
cd $builddir
|
2012-03-02 12:30:43 +00:00
|
|
|
pdflatex $output
|
|
|
|
pdflatex $output
|
2012-02-29 14:05:18 +00:00
|
|
|
|
|
|
|
cd $dir
|
|
|
|
pdflatex dottesona4.tex
|