Go back to using the filename as the hyperlink name.

Latex hyperlinks don't cope with having accented characters in the hyperlink name.
This commit is contained in:
Jim Hague 2013-07-18 15:37:23 +01:00
parent e26974292c
commit cdf1efc900
2 changed files with 18 additions and 16 deletions

View File

@ -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

View File

@ -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