# HG changeset patch # User Jim Hague # Date 1375722360 -3600 # Node ID 473d335235b865e8a2a14f28428c57fbc4809333 # Parent 48eb1da4a4c8f4d4217c0aacd3f9f8058e2e2c7d Put tune title, image and following content into a table. Use tabularx to put tune title, image and any following content into a table. This should (a) get the following content closer to the tune image, and (b) stop LaTeX splitting them over a page. diff -r 48eb1da4a4c8 -r 473d335235b8 dottes.tex --- a/dottes.tex Mon Aug 05 13:42:36 2013 +0100 +++ b/dottes.tex Mon Aug 05 18:06:00 2013 +0100 @@ -6,6 +6,7 @@ \usepackage[margin=0.75in]{geometry} \usepackage{graphicx} \usepackage{fancyhdr} +\usepackage{tabularx} \usepackage{longtable} \usepackage[UKenglish]{babel} \usepackage[UKenglish]{isodate} @@ -49,24 +50,22 @@ % Args are tune name, tune title, tune subtitle, composer, tune graphic % filename, change name, change title, credit. \newcommand{\showtune}[8]{% - \vfill - \begin{center} - \phantomsection - \addcontentsline{toc}{section}{#2} - \begin{tabular*}{\textwidth}{@{} p{0.25\textwidth} @{\extracolsep{\fill}} c >{\raggedleft\arraybackslash}p{0.25\textwidth} @{}} + \phantomsection + \begin{tabularx}{\textwidth}{LCR} + \addcontentsline{toc}{section}{#2} & \hypertarget{#1}{\Large{#2}} & \emph{#4} \\ \ifemptyarg{#3}{}{% & #3 & \\ - }% - \end{tabular*} - \includegraphics[width=\textwidth,height=0.85\textheight,keepaspectratio]{#5} - \end{center} - \ifemptyarg{#8}{}{% - From {#8}. - }% - \ifemptyarg{#6}{}{% - Change: \hyperlink{#6}{#7}. - }% + } + \multicolumn{3}{c}{% + \includegraphics[width=\textwidth,height=0.8\textheight,keepaspectratio]{#5}% + }\tabularnewline + \multicolumn{3}{p{\textwidth}}{% + \ifemptyarg{#8}{}{From {#8}. }% + \ifemptyarg{#6}{}{Change: \hyperlink{#6}{#7}.}% + }\tabularnewline + \end{tabularx} + \vfill } % Show the tune first line. Generate table row. @@ -226,7 +225,15 @@ \addcontentsline{toc}{chapter}{Tunes} +{ +\newcolumntype{L}{p{0.25\textwidth}}% +\newcolumntype{R}{>{\raggedleft\arraybackslash}p{0.25\textwidth}}% +\newcolumntype{C}{>{\centering\arraybackslash}X}% +\renewcommand{\tabularxcolumn}[1]{m{#1}}% +\renewcommand{\tabcolsep}{0pt} + \input{tunes.tex} +} % -----