Put making tune graphics required by web and book into separate dir and make separately.

Web and book both require the tune PDF graphics. Break these out into a separate
direction and make with a separate process.
This commit is contained in:
Jim Hague 2012-03-04 12:00:30 +00:00
parent 77b53a2e23
commit fc446fb0ae
3 changed files with 35 additions and 7 deletions

View File

@ -8,3 +8,4 @@ syntax: glob
syntax: regexp
build/
graphics/

View File

@ -3,6 +3,9 @@
# Build the Booke. First assemble the book LaTeX, then build it
# into a PDF.
#
# All EPS and PDF tune graphics must be present already. Run
# makeGraphics.sh to make these.
#
if [ $# != 1 ]; then
echo "Usage: makeBooke.sh <book dir name>"
@ -13,6 +16,7 @@ dir=`pwd`
booke=$dir/$1
builddir=$dir/build
graphicsdir=$dir/graphics/$1
output=dottes.tex
outputpdf=dottes.pdf
outputa4=dottesona4.tex
@ -40,14 +44,8 @@ find $booke -name "*.abc" | sort |
do
title=`grep "^T:" $filename | head -1 | sed -e "s/^T: *//"`
name=`basename $filename .abc`
abcm2ps -j0 +c -n -E -O $builddir/$name.eps $filename
# Make $name.eps so we can build with LaTeX.
mv $builddir/${name}001.eps $builddir/${name}.eps
# And make the corresponding PDF for pdflatex.
epstopdf --outfile=$builddir/$name.pdf $builddir/${name}.eps
echo -E "\begin{center}" >> $builddir/$output
echo -E "\includegraphics[width=\textwidth]{$name}" >> $builddir/$output
echo -E "\includegraphics[width=\textwidth]{$graphicsdir/$name}" >> $builddir/$output
echo -E "\addcontentsline{toc}{subsection}{$title}" >> $builddir/$output
echo -E "\end{center}" >> $builddir/$output
done

29
makeGraphics.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
#
# Make the tune graphics, EPS, PDF required by web and book into
# graphics/<book>.
#
if [ $# != 1 ]; then
echo "Usage: makeGraphics.sh <book dir name>"
exit 1
fi
dir=`pwd`
booke=$dir/$1
graphicsdir=$dir/graphics/$1
mkdir -p $graphicsdir
# Now, for each tune, make the tune graphic.
find $booke -name "*.abc" | sort |
while read filename
do
name=`basename $filename .abc`
abcm2ps -j0 +c -n -E -O $graphicsdir/$name.eps $filename
# Make $name.eps so we can build with LaTeX.
mv $graphicsdir/${name}001.eps $graphicsdir/${name}.eps
# And make the corresponding PDF for pdflatex.
epstopdf --outfile=$graphicsdir/$name.pdf $graphicsdir/${name}.eps
done