]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/templates.itely
lilypond-book robustness: ensure EOL at the end of @verbatim
[lilypond.git] / Documentation / user / templates.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond-learning.tely
3 @ignore
4     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5
6     When revising a translation, copy the HEAD committish of the
7     version that you are working on.  See TRANSLATION for details.
8 @end ignore
9
10 @c \version "2.12.0"
11
12 @node Templates
13 @appendix Templates
14
15 This section of the manual contains templates with the LilyPond score
16 already set up for you.  Just add notes, run LilyPond, and enjoy
17 beautiful printed scores!
18
19 @c bad node name for ancient notation to avoid conflict
20 @menu
21 * Single staff::
22 * Piano templates::
23 * String quartet::
24 * Vocal ensembles::
25 * Orchestral templates::
26 * Ancient notation templates::
27 * Jazz combo::
28 * lilypond-book templates::
29 @end menu
30
31
32 @node Single staff
33 @appendixsec Single staff
34
35 @appendixsubsec Notes only
36
37 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,addversion]
38 {single-staff-template-with-only-notes.ly}
39
40
41 @appendixsubsec Notes and lyrics
42
43 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,addversion]
44 {single-staff-template-with-notes-and-lyrics.ly}
45
46 @appendixsubsec Notes and chords
47
48 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
49 {single-staff-template-with-notes-and-chords.ly}
50
51 @appendixsubsec Notes, lyrics, and chords.
52
53 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
54 {single-staff-template-with-notes,-lyrics,-and-chords.ly}
55
56
57 @node Piano templates
58 @appendixsec Piano templates
59
60 @appendixsubsec Solo piano
61
62 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
63 {piano-template-simple.ly}
64
65 @appendixsubsec Piano and melody with lyrics
66
67 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
68 {piano-template-with-melody-and-lyrics.ly}
69
70 @appendixsubsec Piano centered lyrics
71
72 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
73 {piano-template-with-centered-lyrics.ly}
74
75 @appendixsubsec Piano centered dynamics
76
77 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
78 {piano-template-with-centered-dynamics.ly}
79
80
81 @node String quartet
82 @appendixsec String quartet
83
84 @appendixsubsec String quartet
85
86 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
87 {string-quartet-template-simple.ly}
88
89 @appendixsubsec String quartet parts
90
91 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
92 {string-quartet-template-with-separate-parts.ly}
93
94
95 @node Vocal ensembles
96 @appendixsec Vocal ensembles
97
98 @appendixsubsec SATB vocal score
99
100 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
101 {vocal-ensemble-template.ly}
102
103 @appendixsubsec SATB vocal score and automatic piano reduction
104
105 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
106 {vocal-ensemble-template-with-automatic-piano-reduction.ly}
107
108 @appendixsubsec SATB with aligned contexts
109
110 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
111 {vocal-ensemble-template-with-lyrics-aligned-below-and-above-the-staves.ly}
112
113
114 @node Orchestral templates
115 @appendixsec Orchestral templates
116
117 @appendixsubsec Orchestra, choir and piano
118 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
119 {orchestra,-choir-and-piano-template.ly}
120
121
122 @c bad node name to avoid node name conflict
123 @node Ancient notation templates
124 @appendixsec Ancient notation templates
125
126 @appendixsubsec Transcription of mensural music
127
128 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
129 {ancient-notation-template----modern-transcription-of-mensural-music.ly}
130
131 @appendixsubsec Gregorian transcription template
132
133 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
134 {ancient-notation-template----modern-transcription-of-gregorian-music.ly}
135
136 @node Jazz combo
137 @appendixsec Jazz combo
138
139 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
140 {jazz-combo-template.ly}
141
142
143
144
145 @ignore
146 This isn't very useful, and only duplicates material in
147 "global issues".  And if this info changes, this section often
148 gets forgotten.
149
150 @no de Other templates
151 @se ction Other templates
152 @su bsection All headers
153
154 This template displays all available headers.  Some of them are only
155 used in the Mutopia project; they don't affect the printed output at
156 all.  They are used if you want the piece to be listed with different
157 information in the Mutopia database than you wish to have printed on the
158 music.  For example, Mutopia lists the composer of the famous D major
159 violin concerto as TchaikovskyPI, whereas perhaps you wish to print
160 "Petr Tchaikowski" on your music.
161
162 @ The `line-width' is for \header.
163 @li lypond[quote,verbatim,ragged-right,line-width]
164 \version "2.12.0"
165 \header {
166   dedication = "dedication"
167   title = "Title"
168   subtitle = "Subtitle"
169   subsubtitle = "Subsubtitle"
170   composer = "Composer (xxxx-yyyy)"
171   opus = "Opus 0"
172   piece = "Piece I"
173   meter = "meter"
174   instrument = "Instrument"
175   arranger = "Arranger"
176   poet = "Poet"
177   texttranslator = "Translator"
178   copyright = "public domain"
179
180   % These are headers used by the Mutopia Project
181   % http://www.mutopiaproject.org/
182   mutopiatitle = ""
183   mutopiacomposer = ""
184   mutopiapoet = ""
185   mutopiainstrument = ""
186   date = "composer's dates"
187   source = "urtext "
188   maintainer = "your name here"
189   maintainerEmail = "your email here"
190   maintainerWeb = "your home page"
191   lastupdated = "2004/Aug/26"
192 }
193
194 \score {
195   { c'4 }
196   \header {
197     piece = "piece1"
198     opus = "opus1"
199   }
200 }
201
202 \score {
203   { c'4 }
204   \header {
205     piece = "piece2"
206     opus = "opus2"
207   }
208 }
209 @end lilypond
210 @end ignore
211
212
213 @node lilypond-book templates
214 @appendixsec lilypond-book templates
215
216 These templates are for use with @code{lilypond-book}.  If you're not familiar
217 with this program, please refer to @rprogram{LilyPond-book}.
218
219 @appendixsubsec LaTeX
220
221 You can include LilyPond fragments in a LaTeX document.
222
223 @example
224 \documentclass[]@{article@}
225
226 \begin@{document@}
227
228 Normal LaTeX text.
229
230 \begin@{lilypond@}
231 \relative c'' @{
232 a4 b c d
233 @}
234 \end@{lilypond@}
235
236 More LaTeX text.
237
238 \begin@{lilypond@}
239 \relative c'' @{
240 d4 c b a
241 @}
242 \end@{lilypond@}
243 \end@{document@}
244 @end example
245
246 @appendixsubsec Texinfo
247
248 You can include LilyPond fragments in Texinfo; in fact, this entire manual
249 is written in Texinfo.
250
251 @example
252 \input texinfo
253 @@node Top
254
255 Texinfo text
256
257 @@lilypond[verbatim,fragment,ragged-right]
258 a4 b c d
259 @@end lilypond
260
261 More Texinfo text
262
263 @@lilypond[verbatim,fragment,ragged-right]
264 d4 c b a
265 @@end lilypond
266
267 @@bye
268 @end example
269
270
271 @appendixsubsec xelatex
272
273 @verbatim
274 \documentclass{article}
275 \usepackage{ifxetex}
276 \ifxetex
277 %xetex specific stuff
278 \usepackage{xunicode,fontspec,xltxtra}
279 \setmainfont[Numbers=OldStyle]{Times New Roman}
280 \setsansfont{Arial}
281 \else
282 %This can be empty if you are not going to use pdftex
283 \usepackage[T1]{fontenc}
284 \usepackage[utf8]{inputenc}
285 \usepackage{mathptmx}%Times
286 \usepackage{helvet}%Helvetica
287 \fi
288 %Here you can insert all packages that pdftex also understands
289 \usepackage[ngerman,finnish,english]{babel}
290 \usepackage{graphicx}
291
292 \begin{document}
293 \title{A short document with LilyPond and xelatex}
294 \maketitle
295
296 Normal \textbf{font} commands inside the \emph{text} work,
297 because they \textsf{are supported by \LaTeX{} and XeteX.}
298 If you want to use specific commands like \verb+\XeTeX+, you
299 should include them again in a \verb+\ifxetex+ environment.
300 You can use this to print the \ifxetex \XeTeX{} command \else
301 XeTeX command \fi which is not known to normal \LaTeX .
302
303 In normal text you can easily use LilyPond commands, like this:
304
305 \begin{lilypond}
306 {a2 b c'8 c' c' c'}
307 \end{lilypond}
308
309 \noindent
310 and so on.
311
312 The fonts of snippets set with LilyPond will have to be set from
313 inside
314 of the snippet. For this you should read the AU on how to use
315 lilypond-book.
316
317 \selectlanguage{ngerman}
318 Auch Umlaute funktionieren ohne die \LaTeX -Befehle, wie auch alle
319 anderen
320 seltsamen Zeichen: __ ______, wenn sie von der Schriftart
321 unterst__tzt werden.
322 \end{document}
323 @end verbatim
324
325