+\gdef\lilypondstart{
+ \begingroup
+ \catcode `\@=11\relax
+ % \@nodocument is defined as \relax after `\begin{document}'
+ \lilypondifundefined{@nodocument}
+ {
+ % either plain TeX or texinfo or not at the beginning of LaTeX input
+ \def\x{\endgroup}
+ }
+ {
+ % provide a proper LaTeX preamble (for A4 paper format)
+ \def\x{
+ \endgroup
+ \def\lilyponddocument{}
+ \documentclass[a4paper]{article}
+ \pagestyle{empty}
+ % \begin is defined as \outer in texinfo, thus we use \csname
+ \csname begin\endcsname{document}
+ % center staves horizontally on page
+ \ifdim\lilypondpaperlinewidth\lilypondpaperunit > 0pt
+ \hsize\lilypondpaperlinewidth\lilypondpaperunit
+ % we abuse \scoreshift temporarily
+ \scoreshift \paperwidth
+ \advance\scoreshift -\the\hsize
+ \scoreshift 0.5\scoreshift
+ \advance\scoreshift -1in
+ \oddsidemargin \scoreshift
+ \evensidemargin \scoreshift
+ \fi
+ \parindent 0pt
+ }
+ }
+
+ \x
+
+ \lilypondifundefined{mustmakelilypondtitle}
+ {}
+ {\makelilypondtitle}
+
+ \lilypondifundefined{mustmakelilypondpiecetitle}
+ {}
+ {\makelilypondpiecetitle}
+}