Mercurial > dottes
changeset 330:473d335235b8
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.
author | Jim Hague <jim.hague@acm.org> |
---|---|
date | Mon, 05 Aug 2013 18:06:00 +0100 |
parents | 48eb1da4a4c8 |
children | 583c06d0e9ef |
files | dottes.tex |
diffstat | 1 files changed, 22 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- 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} +} % -----