First go at LaTeX booklet.

This commit is contained in:
Jim Hague 2012-02-27 08:50:45 +00:00
parent 478876a7dd
commit dd61d2757f
3 changed files with 78 additions and 1 deletions

39
dottes.tex.header Normal file
View File

@ -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}

View File

@ -1,4 +1,8 @@
#!/bin/sh #!/bin/sh
#
# Build the Booke. First assemble the book LaTeX, then build it
# into a PDF.
#
if [ $# != 1 ]; then if [ $# != 1 ]; then
echo "Usage: make.sh <book dir name>" echo "Usage: make.sh <book dir name>"
@ -6,5 +10,29 @@ if [ $# != 1 ]; then
fi fi
booke=$1 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}{<Tune title>}
# \begin{abc}[name=<filename>]
# ... 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

10
makeTestBooke.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
if [ $# != 1 ]; then
echo "Usage: make.sh <book dir name>"
exit 1
fi
booke=$1
find $booke -name "*.abc" | sort | xargs abcm2ps -F dottes.fmt -O $booke.ps