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