]> git.donarmstrong.com Git - lilypond.git/blobdiff - tex/titledefs.tex
release: 1.3.140
[lilypond.git] / tex / titledefs.tex
index d7118eabb7f29fbe1c7c458e279e60e75ea2b221..92e3747de496574ef465dca179be9c87836a4da2 100644 (file)
@@ -1,57 +1,53 @@
-%
-% ideally, we should create a LaTeX/TeX class
-% for setting music in different sizes.
-%
-% Version 0.1
-%
-\input lilyponddefs
-\def\EndLilyPondOutput{\endinput}
-%
-\def\thetitle{}
-\def\thesubtitle{}
-\def\thecomposer{}
-\def\thearranger{}
-\def\theinstrument{}
-\def\theopus{}
-\def\thepiece{}
-%
-% duh.  LaTeX has a \title too.
-\renewcommand*{\title}[1]{\def\thetitle{#1\\}}
-\newcommand*{\subtitle}[1]{\def\thesubtitle{#1\\}}
-\newcommand*{\composer}[1]{\def\thecomposer{#1\\}}
-\newcommand*{\arranger}[1]{\def\thearranger{#1}}
-\newcommand*{\instrument}[1]{\def\theinstrument{#1}}
-\newcommand*{\opus}[1]{\def\theopus{#1}}
-\newcommand*{\piece}[1]{\def\thepiece{#1}}
-%
-\newcommand*{\mudelatitle}[1]{\def\thetitle{#1\\}}
-\newcommand*{\mudelasubtitle}[1]{\def\thesubtitle{#1\\}}
-\newcommand*{\mudelacomposer}[1]{\def\thecomposer{#1\\}}
-\newcommand*{\mudelaarranger}[1]{\def\thearranger{#1}}
-\newcommand*{\mudelainstrument}[1]{\def\theinstrument{#1}}
-\newcommand*{\mudelaopus}[1]{\def\theopus{#1}}
-\newcommand*{\mudelapiece}[1]{\def\thepiece{#1}}
-%
-\def\makelilytitle
+%%
+%% LilyPond titling for LaTeX
+%%
+%% Note
+%%
+%%    Defining a value, but leaving it empty:
+%%        \def\lilypondfoo{}
+%%    makes LaTeX break on the \\ in:
+%%        \ifx\lilypondfoo\undefined\else{\lilypondfoo\\}\fi
+%%
+\def\makelilypondtitle
 {
-  {\center\bfseries\huge\center\thetitle}
-        \par
-       {\center\bfseries\Large\thesubtitle}
+  \begin{center}
+        \bfseries
+        \ifx\lilypondtitle\undefined\else{\huge\lilypondtitle\\}\fi
+        \ifx\lilypondsubtitle\undefined\else{\Large\lilypondsubtitle\\}\fi
+        \ifx\lilypondsubsubtitle\undefined\else{\large\lilypondsubsubtitle\\}\fi
+  \end{center}
   \bigskip
-  {\flushright\scshape\thecomposer\par}
   % urg
   \edef\saveparskip{\parskip}\parskip-5mm
-  {\flushright\theopus\par}
-  {\flushright\thearranger\par}
+  \begin{minipage}[t]{0.45\textwidth}
+        \ifx\lilypondpoet\undefined\else{\lilypondpoet\\}\fi
+        \ifx\lilypondmeter\undefined\else{\lilypondmeter\\}\fi
+  \end{minipage}\hspace*{\fill}
+  \begin{minipage}[t]{0.45\textwidth}
+      \begin{flushright}
+          \ifx\lilypondcomposer\undefined\else{\large\normalfont\scshape\lilypondcomposer\\}\fi
+          \ifx\lilypondopus\undefined\else{\lilypondopus\\}\fi
+          \ifx\lilypondarranger\undefined\else{\lilypondarranger\\}\fi
+        \end{flushright}%
+  \end{minipage}\par
   \parskip\saveparskip
-  {\center\large\theinstrument\par}
-  {\flushleft\scshape\large\thepiece}
+  \ifx\lilypondinstrument\undefined\else{\center{\large\lilypondinstrument}\par}\fi
+  \ifx\lilypondpiece\undefined\else{\flushleft{\large\normalfont\scshape\lilypondpiece}\par}\fi
+%  \leavevmode
+  \global\let\lilypondopus\relax%
+  \global\let\lilypondpiece\relax%
+  \global\let\mustmakelilypondtitle\undefined%
 }
-\def\makelilypiecetitle
+%
+\def\makelilypondpiecetitle
 {
-  \bigskip
-  {\flushright\theopus\par}
-  {\flushleft\scshape\large\thepiece}
+  \bigskip\myfilbreak
+  \ifx\lilypondopus\undefined\else{\flushright{\lilypondopus}\par}\fi
+  \ifx\lilypondpiece\undefined\else{\flushleft{\large\normalfont\scshape\lilypondpiece}\par}\fi
+  \nopagebreak%
+  \global\let\lilypondopus\relax%
+  \global\let\lilypondpiece\relax%
+  \global\let\mustmakelilypondpiecetitle\undefined%
 }
 \endinput