From fc446fb0aeabe0d6ad0cc25b1d4541cbaef81656 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Sun, 4 Mar 2012 12:00:30 +0000 Subject: [PATCH] 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. --- .hgignore | 1 + makeBooke.sh | 12 +++++------- makeGraphics.sh | 29 +++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 7 deletions(-) create mode 100755 makeGraphics.sh diff --git a/.hgignore b/.hgignore index 0e41b1b..db1efc0 100644 --- a/.hgignore +++ b/.hgignore @@ -8,3 +8,4 @@ syntax: glob syntax: regexp build/ +graphics/ diff --git a/makeBooke.sh b/makeBooke.sh index 15bf5a3..21c4d23 100755 --- a/makeBooke.sh +++ b/makeBooke.sh @@ -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 " @@ -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 diff --git a/makeGraphics.sh b/makeGraphics.sh new file mode 100755 index 0000000..511534e --- /dev/null +++ b/makeGraphics.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# +# Make the tune graphics, EPS, PDF required by web and book into +# graphics/. +# + +if [ $# != 1 ]; then + echo "Usage: makeGraphics.sh " + 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