Mercurial > dottes
comparison makeBooke.sh @ 16:780f49972b68
Update book making command.
Switched to A5 portrait. In landscape it stretches the image to fit the
width, and that causes a lot of longer tunes to become too high to fit
properly on the page.
Build the book in a separate build directory. The build generates lots
of .abc files and so forth, which it is convenient to have elsewhere
so you can ignore them. I did experimend with \abcinclude, but that has
a lot of expectations about the files being in the current directory.
If a tune has multiple titles, pick the first.
Adjust abcm2ps options to preserve the line breaks in the ABC.
author | Jim Hague <jim.hague@acm.org> |
---|---|
date | Mon, 27 Feb 2012 13:04:37 +0000 |
parents | 232a778181e3 |
children | b61b090cd4c7 |
comparison
equal
deleted
inserted
replaced
15:ff87ffab32d8 | 16:780f49972b68 |
---|---|
7 if [ $# != 1 ]; then | 7 if [ $# != 1 ]; then |
8 echo "Usage: make.sh <book dir name>" | 8 echo "Usage: make.sh <book dir name>" |
9 exit 1 | 9 exit 1 |
10 fi | 10 fi |
11 | 11 |
12 booke=$1 | 12 dir=`pwd` |
13 | |
14 booke=$dir/$1 | |
15 builddir=$dir/build | |
13 output=dottes.tex | 16 output=dottes.tex |
14 | 17 |
15 cp dottes.tex.header $output | 18 mkdir -p $builddir |
19 | |
20 cp dottes.tex.header $builddir/$output | |
16 | 21 |
17 # Now, for each tune, add | 22 # Now, for each tune, add |
18 # | 23 # |
19 # \addcontentsline{toc}{subsection}{<Tune title>} | 24 # \addcontentsline{toc}{subsection}{<Tune title>} |
20 # \begin{abc}[name=<filename>] | 25 # \begin{abc}[name=<filename>] |
22 # \end{abc} | 27 # \end{abc} |
23 | 28 |
24 find $booke -name "*.abc" | sort | | 29 find $booke -name "*.abc" | sort | |
25 while read filename | 30 while read filename |
26 do | 31 do |
27 title=`grep "^T:" $filename | sed -e "s/^T: *//"` | 32 title=`grep "^T:" $filename | head -1 | sed -e "s/^T: *//"` |
28 name=`basename $filename .abc` | 33 name=`basename $filename .abc` |
29 echo "\\\\addcontentsline{toc}{subsection}{$title}" >> $output | 34 echo "\\\\addcontentsline{toc}{subsection}{$title}" >> $builddir/$output |
30 echo "\\\\begin{abc}[name=$name]" >> $output | 35 echo "\\\\begin{abc}[options=-j0 +c,name=$name]" >> $builddir/$output |
31 cat $filename >> $output | 36 cat $filename >> $builddir/$output |
32 echo "\\\\end{abc}" >> $output | 37 echo "\\\\end{abc}" >> $builddir/$output |
33 done | 38 done |
34 | 39 |
35 echo "\\\\end{document}" >> $output | 40 cat dottes.tex.footer >> $builddir/$output |
36 | 41 |
37 #pdflatex -shell-escape $output | 42 cd $builddir |
38 #pdflatex -shell-escape $output | 43 pdflatex -shell-escape $output |
44 pdflatex -shell-escape $output |