Mercurial > dottes
changeset 181:6a0bdabfb255
Add a A4 portrait book with multiple tunes per page.
Also add a script to make all variants of a single book, and
look for <tune name>.tex files, and if one exists add it after the tune.
author | Jim Hague <jim.hague@acm.org> |
---|---|
date | Sat, 26 Jan 2013 13:47:01 +0000 |
parents | 3acc7c6ba9fc |
children | 8261dc4d0d0b |
files | dottes.html.header dottes.tex.a4header dottes.tex.a5header dottes.tex.header dottesA5onA4booklet.tex dottesona4.tex makeAll.sh makeBooke.sh makeBookeA4.sh makeBookeA5.sh |
diffstat | 10 files changed, 409 insertions(+), 195 deletions(-) [+] |
line wrap: on
line diff
--- a/dottes.html.header Sat Jan 26 13:45:23 2013 +0000 +++ b/dottes.html.header Sat Jan 26 13:47:01 2013 +0000 @@ -7,11 +7,16 @@ <p> @INTRO@ <p> -You can download a PDF with a booklet of these tunes. There is a -<a href="@BOOK@.pdf">single-sided A5 landscape book</a>, or if you -have a printer that can do duplex (i.e. print on both sides of the +You can download a PDF with a booklet of these tunes. There is an +<a href="@BOOK@-A5.pdf">A5 landscape book</a> with one +tune per page, or an <a href="@BOOK@-A4.pdf">A4 book with two or more tunes +per page. +<p> +If you have a printer that can do duplex (i.e. print on both sides of the paper), you might like the -<a href="@BOOK@-booklet.pdf">double-sided A4 producing an A5 booklet</a>. +<a href="@BOOK@-A5bookletA4.pdf">A5 booklet</a>. +Prin this onto A4 paper using both sides of the paper, and fold in half. +This makes an A5 booklet. <p> Issue @BUILD@ <p>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dottes.tex.a4header Sat Jan 26 13:47:01 2013 +0000 @@ -0,0 +1,89 @@ +\documentclass[a4paper,11pt]{article} +\usepackage{fontspec} +\usepackage{graphicx} +\usepackage{fancyhdr} +\usepackage{longtable} + +\usepackage{hyperref} +\hypersetup{ + bookmarks=true,% + colorlinks=true,% + citecolor=black,% + filecolor=black,% + linkcolor=black,% + urlcolor=black +} + +% ----- Common variables + +\def \build {\input{buildno.txt}} + +% ----- Appearance + +%\setmainfont{Century Schoolbook L} +\setmainfont{Times New Roman} + +% ----- Page setup + +\setlength{\parindent}{0pt} + +% Adjust margins for A4 portrait. Increase width by 4cm and height by 4cm. +\addtolength{\textwidth}{4cm} +\addtolength{\hoffset}{-2cm} + +\addtolength{\textheight}{4cm} +\addtolength{\voffset}{-2cm} + +% Move the top margin up a further cm. +\addtolength{\textheight}{1cm} +\addtolength{\voffset}{-1cm} + +% ----- + +% Don't show section numbers. +\setcounter{secnumdepth}{-1} + +% ----- + +\begin{document} + +% ----- Headers and footers + +\pagestyle{fancyplain} +\fancyhf{} +\lfoot{Issue \build} +\rfoot{\thepage} +\renewcommand{\headrulewidth}{0pt} + +% ----- Title page and contents + +\title{Ye Crie Havock Booke of Dottes \\ \input{subtitle.txt}} + +\author{Cry Havoc} + +\date{\today} + +\maketitle + +\newpage + +\tableofcontents + +\newpage + +% ----- + +\section{Introduction} + +\input{intro.txt} + +This book is a work in progress. You can download the latest version from +\url{http://dottes.cryhavoc.org.uk/}. + +% ----- + +\section{Tunes} + +Tunes are arranged in alphabetical order of tune title. + +\newpage
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dottes.tex.a5header Sat Jan 26 13:47:01 2013 +0000 @@ -0,0 +1,89 @@ +\documentclass[a5paper,landscape,11pt]{article} +\usepackage{fontspec} +\usepackage{graphicx} +\usepackage{fancyhdr} +\usepackage{longtable} + +\usepackage{hyperref} +\hypersetup{ + bookmarks=true,% + colorlinks=true,% + citecolor=black,% + filecolor=black,% + linkcolor=black,% + urlcolor=black +} + +% ----- Common variables + +\def \build {\input{buildno.txt}} + +% ----- Appearance + +%\setmainfont{Century Schoolbook L} +\setmainfont{Times New Roman} + +% ----- Page setup + +\setlength{\parindent}{0pt} + +% Adjust margins for A5 landscape. Increase width by 4cm and height by 4cm. +\addtolength{\textwidth}{4cm} +\addtolength{\hoffset}{-2cm} + +\addtolength{\textheight}{4cm} +\addtolength{\voffset}{-2cm} + +% Move the top margin up a further cm. +\addtolength{\textheight}{1cm} +\addtolength{\voffset}{-1cm} + +% ----- + +% Don't show section numbers. +\setcounter{secnumdepth}{-1} + +% ----- + +\begin{document} + +% ----- Headers and footers + +\pagestyle{fancyplain} +\fancyhf{} +\lfoot{Issue \build} +\rfoot{\thepage} +\renewcommand{\headrulewidth}{0pt} + +% ----- Title page and contents + +\title{Ye Crie Havock Booke of Dottes \\ \input{subtitle.txt}} + +\author{Cry Havoc} + +\date{\today} + +\maketitle + +\newpage + +\tableofcontents + +\newpage + +% ----- + +\section{Introduction} + +\input{intro.txt} + +This book is a work in progress. You can download the latest version from +\url{http://dottes.cryhavoc.org.uk/}. + +% ----- + +\section{Tunes} + +Tunes are arranged in alphabetical order of tune title. + +\newpage
--- a/dottes.tex.header Sat Jan 26 13:45:23 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -\documentclass[a5paper,landscape,11pt]{article} -\usepackage{fontspec} -\usepackage{graphicx} -\usepackage{fancyhdr} -\usepackage{longtable} - -\usepackage{hyperref} -\hypersetup{ - bookmarks=true,% - colorlinks=true,% - citecolor=black,% - filecolor=black,% - linkcolor=black,% - urlcolor=black -} - -% ----- Common variables - -\def \build {\input{buildno.txt}} - -% ----- Appearance - -%\setmainfont{Century Schoolbook L} -\setmainfont{Times New Roman} - -% ----- Page setup - -\setlength{\parindent}{0pt} - -% Adjust margins for A5 landscape. Increase width by 4cm and height by 4cm. -\addtolength{\textwidth}{4cm} -\addtolength{\hoffset}{-2cm} - -\addtolength{\textheight}{4cm} -\addtolength{\voffset}{-2cm} - -% Move the top margin up a further cm. -\addtolength{\textheight}{1cm} -\addtolength{\voffset}{-1cm} - -% ----- - -\begin{document} - -% ----- Headers and footers - -\pagestyle{fancyplain} -\fancyhf{} -\lfoot{Issue \build} -\rfoot{\thepage} -\renewcommand{\headrulewidth}{0pt} - -% ----- Title page and contents - -\title{Ye Crie Havock Booke of Dottes \\ \input{subtitle.txt}} - -\author{Cry Havoc} - -\date{\today} - -\maketitle - -\newpage - -\tableofcontents - -\newpage - -% ----- - -\section{Introduction} - -\input{intro.txt} - -This book is a work in progress. You can download the latest version from -\url{http://dottes.cryhavoc.org.uk/}. - -% ----- - -\section{Tunes} - -Tunes are arranged in alphabetical order of tune title. - -\newpage
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dottesA5onA4booklet.tex Sat Jan 26 13:47:01 2013 +0000 @@ -0,0 +1,14 @@ +% +% Take the A5 landscape dottes.pdf and produce a second PDF +% formatted for A4 portrait, which two pages per A4 page, +% and ordered for booklet printing. +% +% Print the resulting PDF with long side duplex. +% +\documentclass[a4paper,final]{article} +\usepackage{pdfpages} +\usepackage{ifpdf,ifxetex} + +\begin{document} +\includepdf[pages=-, nup=1x2, booklet=true]{dottesA5.pdf} +\end{document}
--- a/dottesona4.tex Sat Jan 26 13:45:23 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ -% -% Take the A5 landscape dottes.pdf and produce a second PDF -% formatted for A4 portrait, which two pages per A4 page, -% and ordered for booklet printing. -% -% Print the resulting PDF with long side duplex. -% -\documentclass[a4paper,final]{article} -\usepackage{pdfpages} -\usepackage{ifpdf,ifxetex} - -\begin{document} -\includepdf[pages=-, nup=1x2, booklet=true]{dottes.pdf} -\end{document}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/makeAll.sh Sat Jan 26 13:47:01 2013 +0000 @@ -0,0 +1,21 @@ +#!/bin/bash +# +# Build all forms of the Booke. + +if [ $# != 1 ]; then + echo "Usage: makeAll.sh <book dir name>" + exit 1 +fi + +makeABooke() +{ + ./makeGraphics.sh $1 + ./makeBookeA5.sh $1 + ./makeBookeA4.sh $1 + ./makeWebItems.sh $1 + ./makeWeb.sh $1 +} + +makeABooke $1 +./makeCello.sh $1 +make ABooke $1-Morris
--- a/makeBooke.sh Sat Jan 26 13:45:23 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,93 +0,0 @@ -#!/bin/bash -# -# Build the Booke. First assemble the book LaTeX, then build it -# into a PDF. -# -# All EPS and PDF tune graphics must be present already. Run -# makeGraphics.sh to make these. -# - -if [ $# != 1 ]; then - echo "Usage: makeBooke.sh <book dir name>" - exit 1 -fi - -dir=`pwd` - -booke=$dir/$1 -builddir=$dir/build -graphicsdir=$dir/graphics/$1 -output=dottes.tex -outputxdv=${output/%.tex/.xdv} -outputpdf=${output/%.tex/.pdf} -outputa4=dottesona4.tex -outputa4pdf=dottesona4.pdf - -mkdir -p $builddir - -cp buildno.txt $builddir -if [ -r $booke/subtitle.txt ]; then - cp $booke/subtitle.txt $builddir -else - touch $builddir/subtitle.txt -fi -if [ -r $booke/intro.txt ]; then - cp $booke/intro.txt $builddir -else - touch $builddir/intro.txt -fi -cp dottes.tex.header $builddir/$output - -# Now, for each tune, make the tune graphic and add it, inside a -# centre section, so the document. Then add a TOC entry. -find $booke -name "*.abc" | sort | - while read filename - do - title=`$dir/abcfield.py --field T --latex $filename` - name=`basename $filename .abc` - echo -E "\newpage" >> $builddir/$output - echo -E "\begin{center}" >> $builddir/$output - echo -E "\phantomsection" >> $builddir/$output - echo -E "\hypertarget{$name}{\includegraphics[width=\textwidth,height=0.9\textheight,keepaspectratio]{$graphicsdir/$name}}" >> $builddir/$output - echo -E "\addcontentsline{toc}{subsection}{$title}" >> $builddir/$output - echo -E "\end{center}" >> $builddir/$output - done - -cat dottes.tex.firstlines >> $builddir/$output - -find $booke -name "*.abc" | sort | - while read filename - do - title=`$dir/abcfield.py --field T --latex $filename` - name=`basename $filename .abc` - echo -E "\hyperlink{$name}{$title} & \raisebox{-.25\height}{\includegraphics[width=0.6\textwidth]{$graphicsdir/firstline-$name}} \\\\" >> $builddir/$output - done - -cat dottes.tex.footer >> $builddir/$output - -cp $outputa4 $builddir - -cd $builddir - -# The version of xetex on Squeeze doesn't do pass the A5 landscape instruction -# down to the PDF generator. So split out and do manually. -# -# And, sigh, this fails on Sid. The first page comes out as A4 portrait. -# So try to work out which we are using and run the appropriate command. -ver=`xetex -version | head -n 1` -ver=${ver/*TeX Live /} -ver=${ver/\/*/} -if [ "$ver" == "2009" ]; then - xelatex -no-pdf $output - xelatex -no-pdf $output - xdvipdfmx -p a5 -l $outputxdv -else - xelatex $output - xelatex $output -fi -xelatex $outputa4 - -mv $outputpdf $dir/$1.pdf -mv $outputa4pdf $dir/${1}-booklet.pdf - -cd $dir
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/makeBookeA4.sh Sat Jan 26 13:47:01 2013 +0000 @@ -0,0 +1,90 @@ +#!/bin/bash +# +# Build the Booke. First assemble the book LaTeX, then build it +# into a PDF. +# +# All EPS and PDF tune graphics must be present already. Run +# makeGraphics.sh to make these. +# + +if [ $# != 1 ]; then + echo "Usage: makeBookeA4.sh <book dir name>" + exit 1 +fi + +dir=`pwd` + +booke=$dir/$1 +builddir=$dir/build +graphicsdir=$dir/graphics/$1 +output=dottesA4.tex +outputxdv=${output/%.tex/.xdv} +outputpdf=${output/%.tex/.pdf} + +mkdir -p $builddir + +cp buildno.txt $builddir +if [ -r $booke/subtitle.txt ]; then + cp $booke/subtitle.txt $builddir +else + touch $builddir/subtitle.txt +fi +if [ -r $booke/intro.txt ]; then + cp $booke/intro.txt $builddir +else + touch $builddir/intro.txt +fi +cp dottes.tex.a4header $builddir/$output + +# Now, for each tune, make the tune graphic and add it, inside a +# centre section, so the document. Then add a TOC entry. +find $booke -name "*.abc" | sort | + while read filename + do + title=`$dir/abcfield.py --field T --latex $filename` + name=`basename $filename .abc` + echo -E "\begin{center}" >> $builddir/$output + echo -E "\phantomsection" >> $builddir/$output + echo -E "\hypertarget{$name}{\includegraphics[width=\textwidth,keepaspectratio]{$graphicsdir/$name}}" >> $builddir/$output + echo -E "\addcontentsline{toc}{subsection}{$title}" >> $builddir/$output + echo -E "\end{center}" >> $builddir/$output + text=$booke/$name.tex + if [ -r $text ]; then + cat $text >> $builddir/$output + fi + done + +cat dottes.tex.firstlines >> $builddir/$output + +find $booke -name "*.abc" | sort | + while read filename + do + title=`$dir/abcfield.py --field T --latex $filename` + name=`basename $filename .abc` + echo -E "\hyperlink{$name}{$title} & \raisebox{-.25\height}{\includegraphics[width=0.6\textwidth]{$graphicsdir/firstline-$name}} \\\\" >> $builddir/$output + done + +cat dottes.tex.footer >> $builddir/$output + +cd $builddir + +# The version of xetex on Squeeze doesn't do pass the A5 landscape instruction +# down to the PDF generator. So split out and do manually. +# +# And, sigh, this fails on Sid. The first page comes out as A4 portrait. +# So try to work out which we are using and run the appropriate command. +ver=`xetex -version | head -n 1` +ver=${ver/*TeX Live /} +ver=${ver/\/*/} +if [ "$ver" == "2009" ]; then + xelatex -no-pdf $output + xelatex -no-pdf $output + xdvipdfmx -p a5 -l $outputxdv +else + xelatex $output + xelatex $output +fi + +mv $outputpdf $dir/$1-A4.pdf + +cd $dir
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/makeBookeA5.sh Sat Jan 26 13:47:01 2013 +0000 @@ -0,0 +1,97 @@ +#!/bin/bash +# +# Build the Booke. First assemble the book LaTeX, then build it +# into a PDF. +# +# All EPS and PDF tune graphics must be present already. Run +# makeGraphics.sh to make these. +# + +if [ $# != 1 ]; then + echo "Usage: makeBookeA5.sh <book dir name>" + exit 1 +fi + +dir=`pwd` + +booke=$dir/$1 +builddir=$dir/build +graphicsdir=$dir/graphics/$1 +output=dottesA5.tex +outputxdv=${output/%.tex/.xdv} +outputpdf=${output/%.tex/.pdf} +outputa4=dottesA5onA4booklet.tex +outputa4pdf=dottesA5onA4booklet.pdf + +mkdir -p $builddir + +cp buildno.txt $builddir +if [ -r $booke/subtitle.txt ]; then + cp $booke/subtitle.txt $builddir +else + touch $builddir/subtitle.txt +fi +if [ -r $booke/intro.txt ]; then + cp $booke/intro.txt $builddir +else + touch $builddir/intro.txt +fi +cp dottes.tex.a5header $builddir/$output + +# Now, for each tune, make the tune graphic and add it, inside a +# centre section, so the document. Then add a TOC entry. +find $booke -name "*.abc" | sort | + while read filename + do + title=`$dir/abcfield.py --field T --latex $filename` + name=`basename $filename .abc` + echo -E "\newpage" >> $builddir/$output + echo -E "\begin{center}" >> $builddir/$output + echo -E "\phantomsection" >> $builddir/$output + echo -E "\hypertarget{$name}{\includegraphics[width=\textwidth,height=0.9\textheight,keepaspectratio]{$graphicsdir/$name}}" >> $builddir/$output + echo -E "\addcontentsline{toc}{subsection}{$title}" >> $builddir/$output + echo -E "\end{center}" >> $builddir/$output + text=$booke/$name.tex + if [ -r $text ]; then + cat $text >> $builddir/$output + fi + done + +cat dottes.tex.firstlines >> $builddir/$output + +find $booke -name "*.abc" | sort | + while read filename + do + title=`$dir/abcfield.py --field T --latex $filename` + name=`basename $filename .abc` + echo -E "\hyperlink{$name}{$title} & \raisebox{-.25\height}{\includegraphics[width=0.6\textwidth]{$graphicsdir/firstline-$name}} \\\\" >> $builddir/$output + done + +cat dottes.tex.footer >> $builddir/$output + +cp $outputa4 $builddir + +cd $builddir + +# The version of xetex on Squeeze doesn't do pass the A5 landscape instruction +# down to the PDF generator. So split out and do manually. +# +# And, sigh, this fails on Sid. The first page comes out as A4 portrait. +# So try to work out which we are using and run the appropriate command. +ver=`xetex -version | head -n 1` +ver=${ver/*TeX Live /} +ver=${ver/\/*/} +if [ "$ver" == "2009" ]; then + xelatex -no-pdf $output + xelatex -no-pdf $output + xdvipdfmx -p a5 -l $outputxdv +else + xelatex $output + xelatex $output +fi +xelatex $outputa4 + +mv $outputpdf $dir/$1-A5.pdf +mv $outputa4pdf $dir/${1}-A5bookletA4.pdf + +cd $dir