comparison makeBookeTunePages.sh @ 312:8bc92e044e0a

Move tune and first line inclusion code into macros. Also use tune title, not name, as hyperlink targets. This removes the need to pass the name into the macros.
author Jim Hague <jim.hague@acm.org>
date Fri, 12 Jul 2013 11:36:14 +0100
parents c3b300378738
children cbe9c10b5a3e
comparison
equal deleted inserted replaced
311:dd4582ddbbf8 312:8bc92e044e0a
40 name=`basename $filename .abc` 40 name=`basename $filename .abc`
41 title=`$dir/abcfield.py --field T --latex $filename` 41 title=`$dir/abcfield.py --field T --latex $filename`
42 fixtitle "$title" 42 fixtitle "$title"
43 title=$retval 43 title=$retval
44 44
45 echo -E "\vfill \begin{center}" >> $tunesoutput
46 echo -E "\phantomsection" >> $tunesoutput
47 echo -E "\hypertarget{$name}{\includegraphics[width=\textwidth,height=0.85\textheight,keepaspectratio]{$graphicsdir/$name}}" >> $tunesoutput
48 echo -E "\addcontentsline{toc}{section}{$title}" >> $tunesoutput
49 echo -E "\end{center}" >> $tunesoutput
50
51 changefile=`$dir/abcfield.py --field N $filename | grep "Change:" | sed -e "s/Change: *//"` 45 changefile=`$dir/abcfield.py --field N $filename | grep "Change:" | sed -e "s/Change: *//"`
52 changetitle="" 46 changetitle=""
53 if [ -n "$changefile" ]; then 47 if [ -n "$changefile" ]; then
54 changetitle=`$dir/abcfield.py --field T --latex $booke/$changefile` 48 changetitle=`$dir/abcfield.py --field T --latex $booke/$changefile`
55 fixtitle "$changetitle" 49 fixtitle "$changetitle"
56 changetitle=$retval 50 changetitle=$retval
57 changename=`basename $changefile .abc`
58 echo -E "Change: \hyperlink{$changename}{$changetitle}" >> $tunesoutput
59 fi 51 fi
52 echo -E "\showtune[$changetitle]{$title}{$graphicsdir/$name}" >> $tunesoutput
60 53
61 echo -E "\hyperlink{$name}{$title} & \raisebox{-.25\height}{\includegraphics[width=0.65\textwidth,height=1.3cm]{$graphicsdir/firstline-$name}} \\\\" >> $indexoutput 54 echo -E "\showfirstline{$title}{$graphicsdir/firstline-$name}" >> $indexoutput
62 done 55 done