From dd61d2757f55309be8b9b64f195ec3471194ff2a Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Mon, 27 Feb 2012 08:50:45 +0000 Subject: [PATCH] First go at LaTeX booklet. --- dottes.tex.header | 39 +++++++++++++++++++++++++++++++++++++++ makeBooke.sh | 30 +++++++++++++++++++++++++++++- makeTestBooke.sh | 10 ++++++++++ 3 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 dottes.tex.header create mode 100755 makeTestBooke.sh diff --git a/dottes.tex.header b/dottes.tex.header new file mode 100644 index 0000000..62dd81d --- /dev/null +++ b/dottes.tex.header @@ -0,0 +1,39 @@ +\documentclass[a5paper,landscape,10pt]{article} +\usepackage{abc} +\usepackage{graphicx} + +\setlength{\parindent}{0pt} + +% ----- + +\begin{document} + +\title{The Crie Havock Booke of Dottes} + +\author{Jim Hague} + +\date{\today} + +\maketitle + +\tableofcontents + +% ----- + +\section{Introduction} + +This book is aimed at providing the dots for all tunes commonly played at Cry Havoc music +sessions. + +The commands to typeset this file are: + +\begin{verbatim} + pdflatex -shell-escape tunebook-sample.tex + pdflatex -shell-escape tunebook-sample.tex +\end{verbatim} + +Read the \LaTeX{} source carefully to see how it works. + +% ----- + +\section{Tunes} diff --git a/makeBooke.sh b/makeBooke.sh index ff22c0f..93000f9 100755 --- a/makeBooke.sh +++ b/makeBooke.sh @@ -1,4 +1,8 @@ #!/bin/sh +# +# Build the Booke. First assemble the book LaTeX, then build it +# into a PDF. +# if [ $# != 1 ]; then echo "Usage: make.sh " @@ -6,5 +10,29 @@ if [ $# != 1 ]; then fi booke=$1 +output=dottes.tex -find $booke -name "*.abc" | sort | xargs abcm2ps -F dottes.fmt -O $booke.ps +cp dottes.tex.header $output + +# Now, for each tune, add +# +# \addcontentsline{toc}{subsection}{} +# \begin{abc}[name=] +# ... ABC ... +# \end{abc} + +find $booke -name "*.abc" | sort | + while read filename + do + title=`grep "^T:" $filename | sed -e "s/^T: *//"` + name=`basename $filename .abc` + echo "\\\\addcontentsline{toc}{subsection}{$title}" >> $output + echo "\\\\begin{abc}[name=$name]" >> $output + cat $filename >> $output + echo "\\\\end{abc}" >> $output + done + +echo "\\\\end{document}" >> $output + +#pdflatex -shell-escape $output +#pdflatex -shell-escape $output diff --git a/makeTestBooke.sh b/makeTestBooke.sh new file mode 100755 index 0000000..ff22c0f --- /dev/null +++ b/makeTestBooke.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ $# != 1 ]; then + echo "Usage: make.sh " + exit 1 +fi + +booke=$1 + +find $booke -name "*.abc" | sort | xargs abcm2ps -F dottes.fmt -O $booke.ps