comparison makeBooke.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 93955def7313
children e666306c5ab1
comparison
equal deleted inserted replaced
41:62da0abc23d8 42:0e7d2830cb8b
1 #!/bin/bash 1 #!/bin/bash
2 # 2 #
3 # Build the Booke. First assemble the book LaTeX, then build it 3 # Build the Booke. First assemble the book LaTeX, then build it
4 # into a PDF. 4 # into a PDF.
5 #
6 # All EPS and PDF tune graphics must be present already. Run
7 # makeGraphics.sh to make these.
5 # 8 #
6 9
7 if [ $# != 1 ]; then 10 if [ $# != 1 ]; then
8 echo "Usage: makeBooke.sh <book dir name>" 11 echo "Usage: makeBooke.sh <book dir name>"
9 exit 1 12 exit 1
11 14
12 dir=`pwd` 15 dir=`pwd`
13 16
14 booke=$dir/$1 17 booke=$dir/$1
15 builddir=$dir/build 18 builddir=$dir/build
19 graphicsdir=$dir/graphics/$1
16 output=dottes.tex 20 output=dottes.tex
17 outputpdf=dottes.pdf 21 outputpdf=dottes.pdf
18 outputa4=dottesona4.tex 22 outputa4=dottesona4.tex
19 outputa4pdf=dottesona4.pdf 23 outputa4pdf=dottesona4.pdf
20 24
38 find $booke -name "*.abc" | sort | 42 find $booke -name "*.abc" | sort |
39 while read filename 43 while read filename
40 do 44 do
41 title=`grep "^T:" $filename | head -1 | sed -e "s/^T: *//"` 45 title=`grep "^T:" $filename | head -1 | sed -e "s/^T: *//"`
42 name=`basename $filename .abc` 46 name=`basename $filename .abc`
43 abcm2ps -j0 +c -n -E -O $builddir/$name.eps $filename
44 # Make $name.eps so we can build with LaTeX.
45 mv $builddir/${name}001.eps $builddir/${name}.eps
46 # And make the corresponding PDF for pdflatex.
47 epstopdf --outfile=$builddir/$name.pdf $builddir/${name}.eps
48
49 echo -E "\begin{center}" >> $builddir/$output 47 echo -E "\begin{center}" >> $builddir/$output
50 echo -E "\includegraphics[width=\textwidth]{$name}" >> $builddir/$output 48 echo -E "\includegraphics[width=\textwidth]{$graphicsdir/$name}" >> $builddir/$output
51 echo -E "\addcontentsline{toc}{subsection}{$title}" >> $builddir/$output 49 echo -E "\addcontentsline{toc}{subsection}{$title}" >> $builddir/$output
52 echo -E "\end{center}" >> $builddir/$output 50 echo -E "\end{center}" >> $builddir/$output
53 done 51 done
54 52
55 cat dottes.tex.footer >> $builddir/$output 53 cat dottes.tex.footer >> $builddir/$output