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 \makeatother
% Show the main tune graphic and optional change. % Show the main tune graphic and optional change.
% Args are tune title, tune subtitle, composer, tune graphic filename, % Args are tune name, tune title, tune subtitle, composer, tune graphic
% change title. % filename, change name, change title.
\newcommand{\showtune}[5]{% \newcommand{\showtune}[7]{%
\vfill \vfill
\begin{center} \begin{center}
\phantomsection \phantomsection
\begin{tabular*}{\textwidth}{@{} p{0.25\textwidth} @{\extracolsep{\fill}} c >{\raggedleft\arraybackslash}p{0.25\textwidth} @{}} \begin{tabular*}{\textwidth}{@{} p{0.25\textwidth} @{\extracolsep{\fill}} c >{\raggedleft\arraybackslash}p{0.25\textwidth} @{}}
& \Large{#1} & \emph{#3} \\ & \Large{#2} & \emph{#4} \\
\ifemptyarg{#2}{}{% \ifemptyarg{#3}{}{%
& #2 & \\ & #3 & \\
}% }%
\end{tabular*} \end{tabular*}
\hypertarget{#1}{% \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} \end{center}
\ifemptyarg{#5}{}{% \ifemptyarg{#6}{}{%
Change: \hyperlink{#5}{#5} Change: \hyperlink{#6}{#7}
}% }%
} }
% Show the tune first line. Generate table row. % Show the tune first line. Generate table row.
% Args are the tune title and the first line graphic filename. % Args are the tune name, tune title and the first line graphic filename.
\newcommand{\showfirstline}[2]{% \newcommand{\showfirstline}[3]{%
\hyperlink{#1}{#1} & % \hyperlink{#1}{#2} & %
\raisebox{-.4\height}{\includegraphics[width=0.77\textwidth]{#2}} \\ \raisebox{-.4\height}{\includegraphics[width=0.77\textwidth]{#3}} \\
} }
% ----- Paper size document setup % ----- Paper size document setup

View File

@ -45,13 +45,15 @@ find $booke -name "*.abc" | sort |
composer=`$dir/abcfield.py --field C --latex $filename` composer=`$dir/abcfield.py --field C --latex $filename`
changefile=`$dir/abcfield.py --field N $filename | grep "Change:" | sed -e "s/Change: *//"` changefile=`$dir/abcfield.py --field N $filename | grep "Change:" | sed -e "s/Change: *//"`
changename=""
changetitle="" changetitle=""
if [ -n "$changefile" ]; then if [ -n "$changefile" ]; then
changename=`basename $changefile .abc`
changetitle=`$dir/abcfield.py --field T --latex $booke/$changefile` changetitle=`$dir/abcfield.py --field T --latex $booke/$changefile`
fixtitle "$changetitle" fixtitle "$changetitle"
changetitle=$retval changetitle=$retval
fi 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 done