diff makeGraphics.sh @ 748:ce5c7214f9aa

Introduce mechanism for having different tune images for compact printed output. Sort alternate .abc in subdir 'Compact' under the booke dir. Use that as the graphic for A5 output, assuming it will be vertically more compact. Use Bear Dance as an example, as it has commentary that currently overflows an A5 landscape page. For the moment, transposed Bookes don't transpose and so don't use Compact.
author Jim Hague <jim.hague@acm.org>
date Fri, 13 Oct 2017 15:44:15 +0100
parents aa803fd1c3a6
children b83b49f2a0a0
line wrap: on
line diff
--- a/makeGraphics.sh	Fri Oct 13 10:50:18 2017 +0100
+++ b/makeGraphics.sh	Fri Oct 13 15:44:15 2017 +0100
@@ -17,7 +17,7 @@
 mkdir -p $graphicsdir
 
 # Now, for each tune, make the tune graphic.
-find $booke -name "*.abc" | sort |
+find $booke -depth 1 -name "*.abc" | sort |
     while read filename
     do
         name=`basename $filename .abc`
@@ -42,3 +42,24 @@
         pdfcrop $graphicsdir/firstline-$name-tocrop.pdf $graphicsdir/firstline-$name.pdf
         rm $graphicsdir/firstline-$name-tocrop.pdf
     done
+
+# And make any compact tune graphics.
+if [ ! -d ${booke}/Compact ]; then
+    exit
+fi
+
+find ${booke}/Compact -depth 1 -name "*.abc" | sort |
+    while read filename
+    do
+        name=`basename $filename .abc`
+
+        # Make the tune graphic.
+        abcm2ps -E -F singletune -O $graphicsdir/compact-${name}.eps $filename
+        # Make $name.eps so we can build with LaTeX.
+        mv $graphicsdir/compact-${name}001.eps $graphicsdir/compact-${name}.eps
+        # And make the corresponding PDF.
+        epstopdf --outfile=$graphicsdir/compact-${name}-tocrop.pdf $graphicsdir/compact-${name}.eps
+        # And crop it, so the graphic is as big as possible on the page.
+        pdfcrop $graphicsdir/compact-${name}-tocrop.pdf $graphicsdir/compact-${name}.pdf
+        rm $graphicsdir/compact-${name}-tocrop.pdf
+    done