]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/invoking.itexi
* Documentation/user/lilypond.tely: Add dir entries for
[lilypond.git] / Documentation / user / invoking.itexi
1 @c -*-texinfo-*-
2 @node Invoking LilyPond
3 @chapter Invoking LilyPond
4
5 @menu
6 * Reporting bugs::              
7 * Website::                     
8 * Invoking ly2dvi::           Titling LilyPond scores.
9 @end menu
10
11 @cindex Invoking LilyPond
12 @cindex command line options
13 @cindex options, command line
14 @cindex switches
15
16 Usage:
17
18 @example
19         lilypond [@var{option}]@dots{} @var{file}@dots{}
20 @end example
21
22
23 When invoked with a filename that has no extension, LilyPond will try
24 to add @file{.ly} as an extension first.  To have LilyPond read from
25 stdin, use a dash @code{-} for @var{file}.
26
27 When LilyPond processes @file{filename.ly} it will produce
28 @file{filename.tex} as output (or @file{filename.ps} for PostScript
29 output).  If @file{filename.ly} contains more than one @code{\score}
30 block, then LilyPond will output the rest in numbered files, starting
31 with @file{filename-1.tex}.  Several files can be specified; they will
32 each be processed independently.  @footnote{The status of GUILE is not
33 reset across invocations, so be careful not to change any default
34 settings from within Scheme .}
35
36
37 @section Command line options
38
39 The following options are supported:
40
41 @table @code
42
43 @item -e,--evaluate=@var{code}
44   Evaluates the Scheme @var{code} before parsing @file{.ly}
45 files. Multiple @code{-e} options may be given. They will be evaluated
46 sequentially. The function @code{set-lily-option} may be invoked to
47 set various debugging options.
48
49
50
51 @item -f,--format=@var{format}
52 @c
53 @c
54 Output format for sheet music. Choices are @code{tex} (for @TeX{}
55 output, to be processed with plain @TeX{}, or through ly2dvi),
56 @code{pdftex} for PDF@TeX{} input, @code{ps} (for PostScript),
57 @code{scm} (for a Scheme dump), @code{sk} (for Sketch) and @code{as}
58 (for ASCII-art).
59
60 @strong{This option is only for developers}. Only the @TeX{} output of
61 these is usable for real work. More information can be found at
62 @uref{http://lilypond.org/wiki?OutputFormats}.
63
64
65 @cindex output format, setting
66 @cindex Sketch output
67 @cindex ASCII-art output
68 @cindex PDFTeX output
69 @cindex PostScript output
70 @cindex Scheme dump
71
72 @item -h,--help
73 Show a summary of usage.
74 @item --include, -I=@var{directory}
75 Add @var{directory} to the search path for input files.
76 @cindex file searching
77 @cindex search path
78 @item -i,--init=@var{file}
79 Set init file to @var{file} (default: @file{init.ly}).
80 @item -m,--no-paper
81 @cindex MIDI
82 Disable @TeX{} output. If you have a @code{\midi} definition midi output
83 will be generated.
84 @item -M,--dependencies
85 Output rules to be included in Makefile.
86 @item -o,--output=@var{FILE}
87 Set the default output file to @var{FILE}.
88
89 @ignore
90 @item -s,--safe
91 Disallow untrusted @code{\include} directives, in-line
92 Scheme evaluation, backslashes in @TeX{}, code.
93
94 @strong{WARNING}: the @code{--safe} option has not been reviewed for a
95 long time. Do not rely on it for automatic invocation (e.g. over the
96 web). Volunteers are welcome to do a new audit.
97 @end ignore
98
99 @item -v,--version
100 Show version information 
101 @item -V,--verbose
102 Be verbose: show full paths of all  files read, and give timing
103 information.
104
105 @item -w,--warranty
106 Show the warranty with which GNU LilyPond comes. (It comes with 
107 @strong{NO WARRANTY}!)
108 @end table
109
110 @section Environment variables
111
112
113 For processing both the @TeX{} and the PostScript output, you must
114 have appropriate environment variables set.  Scripts to do this are
115 included in @file{buildscripts/out/lilypond-profile} (for sh shells)
116 and @file{buildscripts/out/lilypond-login} (for C-shells), and should
117 normally be sourced as part of your login process. If these scripts
118 are not run from the system wide login process, then you must run it
119 yourself.
120
121 @cindex installing LilyPond
122
123 If you use sh, bash, or a similar shell, then add the following to
124 your @file{.profile}
125 @example
126         . lilypond-profile
127 @end example
128
129 If you use csh, tcsh or a similar shell, then add the following to
130 your @file{~/.login}
131 @example
132         source lilypond-login
133 @end example
134
135 These scripts set the following variables
136 @table @code
137 @item TEXMF
138  To make sure that @TeX{} and lilypond find data files (among
139 others @file{.tex}, @file{.mf} and @file{.tfm}),
140 you have to set @code{TEXMF} to point to the lilypond data
141 file tree. A typical setting would be
142 @example
143 @{/usr/share/lilypond/1.6.0,@{!!/usr/share/texmf@}@}
144 @end example
145
146
147 @item GS_LIB
148 For processing PostScript output (obtained with
149 @code{-f ps}) with Ghostscript you have to set @code{GS_LIB} to
150 point to the directory containing LilyPond PS files.
151
152 @item GS_FONTPATH
153 For processing PostScript output (obtained with
154 @code{-f ps}) with Ghostscript you have to set @code{GS_FONTPATH} to
155 point to the directory containing LilyPond PFA files.
156
157 When you print direct PS output, remember to send the PFA files to the
158 printer as well.
159 @end table
160
161
162 @cindex ghostscript
163 @cindex PostScript
164 @cindex GS_FONTPATH
165 @cindex GS_LIB
166 @cindex TEXMF
167 @cindex printing postscript
168
169 The LilyPond binary itself recognizes the following environment variables
170 @table @code
171 @item LILYPONDPREFIX
172 This specifies a directory where locale messages and
173 data files will be looked up by default. The directory should contain
174 subdirectories called @file{ly/}, @file{ps/}, @file{tex/}, etc.
175
176 @item LANG
177 This selects the language for the warning messages of LilyPond.
178 @end table
179
180 @cindex LANG
181 @cindex LILYPONDPREFIX
182
183
184
185 @cindex bugs
186 @cindex reporting bugs
187
188 @node Reporting bugs
189 @section Reporting bugs
190
191 Since there is no finder's fee which doubles every year, there is no
192 need to wait for the prize money to grow. So send a bug report today!
193
194 LilyPond development moves quickly, so if you have a problem, it is
195 wise to check if it has been fixed in a newer release.  If you think
196 you found a bug, please send in a bugreport.  When you send us a
197 bugreport, we have to diagnose the problem and if possible, duplicate
198 it.  To make this possible, it is important that you include the
199 following information in your report:
200
201 @itemize @bullet
202
203 @item A sample input which causes the error.  Please have mercy on the
204 developers, send a @emph{small} sample file.
205
206 @item The version number of lilypond.
207
208 @item A description of the platform you use (i.e., operating system,
209 system libraries, whether you downloaded a binary release)
210
211 @item If necessary, send a description of the bug itself.  If you
212 include output a ly2dvi run, please use @code{--verbose} option of
213 ly2dvi.
214
215 @end itemize
216
217 You can send the report to @email{bug-lilypond@@gnu.org}. This is a
218 mailinglist, but you don't have to be subscribed to it to post.
219
220 @node Website
221 @section Website
222
223 If you are reading this manual in print, it is possible that the
224 website contains updates to the manual. You can find the lilypond
225 website at @uref{http://www.lilypond.org/}.
226
227
228 @node Invoking ly2dvi
229 @section Invoking ly2dvi
230
231 Nicely titled output is created through a separate program:
232 @file{ly2dvi} is a script that uses LilyPond and La@TeX{} to create a
233 nicely titled piece of sheet music, in DVI format or PostScript.
234
235 @example
236         ly2dvi [@var{option}]@dots{} @var{file}@dots{}
237 @end example
238
239 To have ly2dvi read from stdin, use a dash @code{-} for @var{file}.
240
241 Ly2dvi supports the following options:
242
243 @table @code
244 @item -k,--keep
245     Keep the temporary directory including LilyPond and ly2dvi output
246 files. The temporary directory is created in the current directory as @code{ly2dvi.dir}.
247 @item -d,--dependencies
248     Write makefile dependencies for every input file.
249 @item -h,--help
250     Print usage help.
251 @item -I,--include=@var{dir}
252     Add @var{dir} to LilyPond's include path.
253 @item -m,--no-paper
254     Produce MIDI output only.
255 @item --no-lily
256     Do not run LilyPond; useful for debugging ly2dvi.
257 @item -o,--output=@var{file}
258     Generate output to @var{file}.  The extension of @var{file} is ignored.
259 @item -P,--postscript
260     Also generate PostScript output, using dvips.  The postscript uses
261 the standard @TeX{} bitmap fonts for your printer.
262 @item -p,--pdf
263     Also generate Portable Document Format (PDF).  This option will
264 generate a PS file using scalable fonts, and will run the PS file
265 through @code{ps2pdf} producing a PDF file.
266
267 @cindex PDF
268 @cindex Scalable fonts
269     
270     If you use lilypond-book or your own wrapper files, don't use
271 @code{\usepackage[[T1]@{fontenc@}} in the file header but don't forget
272 @code{\usepackage[latin1]@{inputenc@}} if you use any other
273 non-anglosaxian characters.
274
275     @item --preview
276     Also generate a picture of the first system of the score.
277 @item -s,--set=@var{key}=@var{val}
278     Add @var{key}= @var{val} to the settings, overriding those specified
279 in the files. Possible keys: @code{language}, @code{latexheaders},
280 @code{latexpackages}, @code{latexoptions}, @code{papersize},
281 @code{pagenumber}, @code{linewidth}, @code{orientation},
282 @code{textheight}.
283 @item -v,--version
284 Show version information 
285 @item -V,--verbose
286 Be verbose
287 @item -w,--warranty
288 Show the warranty with which GNU LilyPond comes. (It comes with 
289 @strong{NO WARRANTY}!)
290 @end table
291
292 @subsection Titling layout
293
294 Ly2dvi extracts the following header fields from the LY files to
295 generate titling:
296
297 @table @code
298 @item title
299     The title of the music. Centered on top of the first page.
300 @item subtitle
301     Subtitle, centered below the title.
302 @item poet
303     Name of the poet, left flushed below the subtitle.
304 @item composer
305     Name of the composer, right flushed below the subtitle.
306 @item meter
307     Meter string, left flushed below the poet.
308 @item opus
309     Name of the opus, right flushed below the composer.
310 @item arranger
311     Name of the arranger, right flushed below the opus.
312 @item instrument
313     Name of the instrument, centered below the arranger
314 @item piece
315     Name of the piece, left flushed below the instrument
316 @item head
317     A text to print in the header of all pages. It is not called
318 @code{header}, because @code{\header} is a reserved word in LilyPond.
319 @item copyright
320     A text to print in the footer of the first page. Default is to 
321     print the standard footer also on the first page.
322 @item footer
323     A text to print in the footer of all but the last page.
324 @item tagline
325     Line to print at the bottom of last page. The default text is ``Lily
326 was here, @var{version-number}''.
327 @end table
328
329
330 @cindex header
331 @cindex footer
332 @cindex page layout
333 @cindex titles
334
335
336
337 @subsection Additional parameters
338
339 Ly2dvi responds to several parameters specified in a @code{\paper}
340 section of the LilyPond file. They can be overridden by supplying a
341 @code{--set} command line option.
342
343 @table @code
344 @item language
345     Specify La@TeX{} language: the @code{babel} package will be
346 included.  Default: unset.
347
348         Read from the @code{\header} block.
349
350 @item latexheaders
351     Specify additional La@TeX{} headers file.
352
353         Normally read from the @code{\header} block. Default value: empty
354
355 @item latexpackages
356     Specify additional La@TeX{} packages file. This works cumulative,
357 so you can add multiple packages using multiple @code{-s=latexpackages} options.
358        Normally read from the @code{\header} block. Default value:
359 @code{geometry}.
360
361 @item latexoptions
362     Specify additional options for the La@TeX{}
363 @code{\documentclass}. You can put any valid value here. This was
364 designed to allow ly2dvi to produce output for double-sided paper,
365 with balanced margins and pagenumbers on alternating sides. To achieve
366 this specify @code{twoside}
367
368 @item orientation
369     Set orientation. Choices are @code{portrait} or @code{landscape}. Is
370 read from the @code{\paper} block, if set.
371         
372 @item textheight
373     The vertical extension of the music on the page. It is normally 
374     calculated automatically, based on the paper size.
375
376 @item linewidth
377         The music line width. It is normally read from the @code{\paper}
378 block.
379
380 @item papersize
381    The paper size (as a name, e.g. @code{a4}). It is normally read from
382 the @code{\paper} block.
383
384 @item pagenumber
385    If set to @code{no}, no page numbers will be printed.  If set to a
386 positive integer, start with this value as the first page number.
387
388   
389   @item fontenc
390      The font encoding, should be set identical to the @code{font-encoding}
391      property in the score.
392 @end table
393
394 @subsection Environment variables
395
396 @table @code
397 @item LANG
398 selects the language for the warning messages of Ly2dvi and LilyPond.
399
400 @item GUILE_MAX_SEGMENT_SIZE
401 is an option for GUILE, the scheme interpreter; it sets the size of
402 the chunks of memory allocated by GUILE.  By increasing this from its
403 default 8388608, the performance of LilyPond on large scores is
404 slightly improved.
405
406
407 @end table
408
409