view makeGraphics.sh @ 42:0e7d2830cb8b

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.
author Jim Hague <jim.hague@laicatc.com>
date Sun, 04 Mar 2012 12:00:30 +0000
parents
children e666306c5ab1
line wrap: on
line source

#!/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