-%
-% ideally, we should create a LaTeX/TeX class
-% for setting music in different sizes.
-%
-\input lilyponddefs
-\def\EndLilyPondOutput{\endinput}
-\def\thetitle{}
-\def\thecomposer{}
-\def\thearranger{}
-\def\theinstrument{}
-\def\theLineOne{}
-\def\theLineTwo{}
-\def\theLineThree{}
-\def\lineOne#1{\def\theLineOne{#1}}
-\def\lineTwo#1{\def\theLineTwo{#1}}
-\def\lineThree#1{\def\theLineThree{#1}}
-\def\title#1{\def\thetitle{#1}}
-\def\composer#1{\def\thecomposer{#1}}
-\def\arranger#1{\def\thearranger{#1}}
-\def\instrument#1{\def\theinstrument{#1}}
-
-\def\makelilytitle{
- \begin{center}
- {\Large\bfseries\thetitle}\\
- \vskip12pt
- {\scshape\theLineOne}
- {\hfill\scshape\thecomposer}
- \vskip4pt
- {\bfseries\theLineTwo}
- {\bfseries\thearranger}
- \end{center}
- \bfseries\theLineThree
- \bfseries\theinstrument
- \bigskip
- }
+% header -- head ?
+% these names can't be changed: they're used in mutopia headers
+
+\def\theheader{
+ \lilypondifundefined{lilypondhead}
+ {}
+ \lilypondhead
+}
+
+\def\thefooter{
+ \lilypondifundefined{lilypondfooter}
+ {}
+ \lilypondfooter
+}
+
+\def\makelilypondtagline{
+ \lilypondifundefined{lilypondtagline}
+ {}
+ \lilypondtagline
+}
+
+\def\thecopyright{
+ \lilypondifundefined{lilypondcopyright}
+ \thefooter
+ \lilypondcopyright
+}
+
+% Moved header and footer definitions here from the lilypond script.
+% Separate page styles for first, last and ordinary (plain) pages.
+
+\makeatletter
+
+\renewcommand{\ps@plain}{
+ \renewcommand{\@oddfoot}{
+ \parbox{\textwidth}{\mbox{}\thefooter}}
+ \renewcommand{\@evenfoot}{
+ \@oddfoot}
+ \renewcommand{\@evenhead}{
+ \hbox to \textwidth{\textbf{\thepage}\hfill{\small\theheader}}}
+ \renewcommand{\@oddhead}{
+ \hbox to \textwidth{{\small\theheader}\hfill\textbf{\thepage}}}
+}
+
+\newcommand{\ps@firstpage}{
+ \renewcommand{\@oddfoot}{
+ \parbox{\textwidth}{\mbox{}\thecopyright}}
+ \renewcommand{\@evenfoot}{
+ \@oddfoot}
+}
+
+\newcommand{\ps@lastpage}{
+ \renewcommand{\@oddfoot}{
+ \parbox{\textwidth}{\mbox{}\makelilypondtagline}}
+ \renewcommand{\@evenfoot}{
+ \@oddfoot}
+}
+
+\makeatother
+
+\endlinechar \titledefsELC
+\endinput