From cdf1efc9003e581de5783ce70bde60b797bfe628 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Thu, 18 Jul 2013 15:37:23 +0100 Subject: [PATCH] Go back to using the filename as the hyperlink name. Latex hyperlinks don't cope with having accented characters in the hyperlink name. --- dottes.tex | 28 ++++++++++++++-------------- makeBookeTunePages.sh | 6 ++++-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/dottes.tex b/dottes.tex index 9f7b839..f9211a4 100644 --- a/dottes.tex +++ b/dottes.tex @@ -46,33 +46,33 @@ \makeatother % Show the main tune graphic and optional change. -% Args are tune title, tune subtitle, composer, tune graphic filename, -% change title. -\newcommand{\showtune}[5]{% +% Args are tune name, tune title, tune subtitle, composer, tune graphic +% filename, change name, change title. +\newcommand{\showtune}[7]{% \vfill \begin{center} \phantomsection \begin{tabular*}{\textwidth}{@{} p{0.25\textwidth} @{\extracolsep{\fill}} c >{\raggedleft\arraybackslash}p{0.25\textwidth} @{}} - & \Large{#1} & \emph{#3} \\ - \ifemptyarg{#2}{}{% - & #2 & \\ + & \Large{#2} & \emph{#4} \\ + \ifemptyarg{#3}{}{% + & #3 & \\ }% \end{tabular*} \hypertarget{#1}{% - \includegraphics[width=\textwidth,height=0.85\textheight,keepaspectratio]{#4} + \includegraphics[width=\textwidth,height=0.85\textheight,keepaspectratio]{#5} } - \addcontentsline{toc}{section}{#1} + \addcontentsline{toc}{section}{#2} \end{center} - \ifemptyarg{#5}{}{% - Change: \hyperlink{#5}{#5} + \ifemptyarg{#6}{}{% + Change: \hyperlink{#6}{#7} }% } % Show the tune first line. Generate table row. -% Args are the tune title and the first line graphic filename. -\newcommand{\showfirstline}[2]{% - \hyperlink{#1}{#1} & % - \raisebox{-.4\height}{\includegraphics[width=0.77\textwidth]{#2}} \\ +% Args are the tune name, tune title and the first line graphic filename. +\newcommand{\showfirstline}[3]{% + \hyperlink{#1}{#2} & % + \raisebox{-.4\height}{\includegraphics[width=0.77\textwidth]{#3}} \\ } % ----- Paper size document setup diff --git a/makeBookeTunePages.sh b/makeBookeTunePages.sh index 4d2a82d..e7694de 100755 --- a/makeBookeTunePages.sh +++ b/makeBookeTunePages.sh @@ -45,13 +45,15 @@ find $booke -name "*.abc" | sort | composer=`$dir/abcfield.py --field C --latex $filename` changefile=`$dir/abcfield.py --field N $filename | grep "Change:" | sed -e "s/Change: *//"` + changename="" changetitle="" if [ -n "$changefile" ]; then + changename=`basename $changefile .abc` changetitle=`$dir/abcfield.py --field T --latex $booke/$changefile` fixtitle "$changetitle" changetitle=$retval fi - echo -E "\showtune{$title}{$subtitle}{$composer}{$graphicsdir/$name}{$changetitle}" >> $tunesoutput + echo -E "\showtune{$name}{$title}{$subtitle}{$composer}{$graphicsdir/$name}{$changename}{$changetitle}" >> $tunesoutput - echo -E "\showfirstline{$title}{$graphicsdir/firstline-$name}" >> $indexoutput + echo -E "\showfirstline{$name}{$title}{$graphicsdir/firstline-$name}" >> $indexoutput done