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