view makeBookeTunePages.sh @ 738:69a7499817c8 build-default-284

On Nook and A5 prints, start a new page with each tune and centre vertically.. A5 mostly did, but ran into trouble with longer comments on a tune. This may give blank space after tunes where a long comment overflows onto another page, but I think for now it's better to have each tune at the top of the page. Or rather, and this is the other change, in the middle of the page. Centre the page content for A5 and Nook.
author Jim Hague <jim.hague@acm.org>
date Thu, 12 Oct 2017 14:50:51 +0100
parents 507d853433ef
children ce5c7214f9aa
line wrap: on
line source

#!/bin/bash
#
# Generate the LaTeX for the Booke tune pages (tunes.tex) and the index
# of first lines (firstlines.tex). These are generated into the build
# directory.
#
# All EPS and PDF tune graphics must be present already. Run
# makeGraphics.sh to make these.
#

if [ $# != 1 ]; then
    echo "Usage: makeBookeTunePages.sh <book dir name>"
    exit 1
fi

dir=`pwd`

booke=$dir/$1
builddir=$dir/build
graphicsdir=$dir/graphics/$1
tunesoutput=$builddir/$1-tunes.tex
indexoutput=$builddir/$1-firstlines.tex

mkdir -p $builddir

rm -f $tunesoutput $indexoutput

# Now, for each tune, make the tune graphic and add it, inside a
# centre section, so the document. Then add a TOC entry.
find $booke -name "*.abc" | sort |
    while read filename
    do
        $dir/abctemplate.py --latex --value "graphicsdir=$graphicsdir" --template $dir/dottes.tex.tune $filename >> $tunesoutput
        $dir/abctemplate.py --latex --value "graphicsdir=$graphicsdir" --template $dir/dottes.tex.firstline-tune $filename >> $indexoutput
    done