]> git.donarmstrong.com Git - lilypond.git/blob - tex/titledefs.tex
* tex/titledefs.tex: Replaced \ifx\blabla\undefined
[lilypond.git] / tex / titledefs.tex
1 % titledefs.tex
2 %
3 % LilyPond titling for LaTeX
4 %
5 % Note:
6 %
7 %    Defining a value, but leaving it empty:
8 %        \def\lilypondfoo{}
9 %    makes LaTeX break on the \\ in:
10 %        \ifx\lilypondfoo\undefined\else{\lilypondfoo\\}\fi
11 %
12 \edef\titledefsELC{\the\endlinechar}%
13 \endlinechar -1\relax
14
15 % The feta characters for use in titles
16 \input feta20.tex
17
18 \font\fetasixteen=feta16
19 \def\fetafont{\fetasixteen}
20 \def\fetachar#1{\hbox{\fetasixteen#1}}
21
22 \def\makelilypondtitle{
23   \begin{center}
24     \lilypondifundefined{lilyponddedication}
25     {}
26     {\normalfont\lilyponddedication\\}
27     
28     \bfseries
29     
30     \lilypondifundefined{lilypondtitle}
31     {}
32     {\huge\lilypondtitle\\}
33     
34     \lilypondifundefined{lilypondsubtitle}
35     {}
36     {\Large\lilypondsubtitle\\}
37     
38     \lilypondifundefined{lilypondsubsubtitle}
39     {}
40     {\large\lilypondsubsubtitle\\}
41   \end{center}
42   
43   \bigskip
44   
45   \begin{minipage}[t]{0.45\textwidth}
46     \lilypondifundefined{lilypondpoet}
47     {}
48     {\lilypondpoet\\}
49     
50     \lilypondifundefined{lilypondtexttranslator}
51     {}
52     {\lilypondtexttranslator\\}
53     
54     \lilypondifundefined{lilypondmeter}
55     {}
56     {\lilypondmeter\\}
57   \end{minipage}
58   
59   \hspace*{\fill}
60   
61   \begin{minipage}[t]{0.45\textwidth}
62     \begin{flushright}
63       \lilypondifundefined{lilypondcomposer}
64       {}
65       {\large\normalfont\scshape\lilypondcomposer\\}
66       
67       \lilypondifundefined{lilypondopus}
68       {}
69       {\lilypondopus\\}
70       
71       \lilypondifundefined{lilypondarranger}
72       {}
73       {\lilypondarranger\\}
74     \end{flushright}
75   \end{minipage}
76   
77   \par
78   
79   \lilypondifundefined{lilypondinstrument}
80   {}
81   {\center{\large\lilypondinstrument}
82     \par}
83   
84   \lilypondifundefined{lilypondpiece}
85   {}
86   {\flushleft{\large\normalfont\lilypondpiece}
87     \par}
88   
89 % \leavevmode
90
91   \global\let\lilypondopus\undefined
92   \global\let\lilypondpiece\undefined
93   \global\let\mustmakelilypondtitle\undefined
94 }
95
96 \def\makelilypondpiecetitle{
97   \bigskip\myfilbreak
98
99   \lilypondifundefined{lilypondopus}
100   {}
101   {\flushright{\lilypondopus}
102     \par}
103   
104   \lilypondifundefined{lilypondpiece}
105   {}
106   {\flushleft{\large\normalfont\scshape\lilypondpiece}
107     \par}
108   
109   \nopagebreak
110
111   \global\let\lilypondopus\undefined
112   \global\let\lilypondpiece\undefined
113   \global\let\mustmakelilypondpiecetitle\undefined
114 }
115
116 % header -- head ?
117 % these names can't be changed: they're used in mutopia headers
118
119 \def\theheader{
120   \lilypondifundefined{lilypondhead}
121   {}
122   \lilypondhead
123 }
124
125 \def\thefooter{
126   \lilypondifundefined{lilypondfooter}
127   {}
128   \lilypondfooter
129 }
130
131 \def\makelilypondtagline{
132   \lilypondifundefined{lilypondtagline}
133   {}
134   \lilypondtagline
135 }
136
137 \def\thecopyright{
138   \lilypondifundefined{lilypondcopyright}
139   \thefooter
140   \lilypondcopyright
141 }
142
143 % Moved header and footer definitions here from the lilypond script.
144 % Separate page styles for first, last and ordinary (plain) pages.
145
146 \makeatletter
147
148 \renewcommand{\ps@plain}{
149   \renewcommand{\@oddfoot}{
150     \parbox{\textwidth}{\mbox{}\thefooter}}
151   \renewcommand{\@evenfoot}{
152     \@oddfoot}
153   \renewcommand{\@evenhead}{
154     \hbox to \textwidth{\textbf{\thepage}\hfill{\small\theheader}}}
155   \renewcommand{\@oddhead}{
156     \hbox to \textwidth{{\small\theheader}\hfill\textbf{\thepage}}}
157 }
158
159 \newcommand{\ps@firstpage}{
160   \renewcommand{\@oddfoot}{
161     \parbox{\textwidth}{\mbox{}\thecopyright}}
162   \renewcommand{\@evenfoot}{
163     \@oddfoot}
164 }
165
166 \newcommand{\ps@lastpage}{
167   \renewcommand{\@oddfoot}{
168     \parbox{\textwidth}{\mbox{}\makelilypondtagline}}
169   \renewcommand{\@evenfoot}{
170     \@oddfoot}
171 }
172
173 \makeatother
174
175 \endlinechar \titledefsELC
176 \endinput