1 @node Invoking LilyPond
3 @chapter Invoking LilyPond
4 @cindex Invoking LilyPond
5 @cindex command line options
6 @cindex options, command line
12 lilypond [@var{options}] @var{file}@dots{}
17 When invoked with a filename that has no extension, LilyPond will try
18 to add @file{.ly} as an extension first. To have LilyPond read from
19 stdin, use a dash @code{-} for @var{file}.
21 When LilyPond processes @file{filename.ly} it will produce
22 @file{filename.tex} as output (or @file{filename.ps} for PostScript
23 output). If @file{filename.ly} contains more than one @code{\score}
24 block, then LilyPond will output the rest in numbered files, starting
25 with @file{filename-1.tex}. Several files can be specified; they will
26 each be processed independently. @footnote{The status of GUILE is not
27 reset across invocations, so be careful not to change any default
28 settings from within Scheme .}
30 @section Command line options
32 The following options are supported:
36 @item -e,--evaluate=@var{code}
37 Evaluates the Scheme @var{code} before parsing @file{.ly}
38 files. Multiple @code{-e} options may be given. They will be evaluated
41 @item -f,--format=@var{format} Output format for sheet music. Choices
42 are @code{tex} (for @TeX{} output, to be processed with plain @TeX{},
43 or through ly2dvi), @code{pdftex} for PDF@TeX{} input, @code{ps} (for
44 PostScript), @code{scm} (for a Scheme dump), and @code{as} (for
47 Unless you have special requirements, you should use @TeX{}
48 output. All other options are experimental.
50 Show a summary of usage.
51 @item --include, -I=@var{directory}
52 Add @var{directory} to the search path for input files.
53 @cindex file searching
55 @item -i,--init=@var{file}
56 Set init file to @var{file} (default: @file{init.ly}).
59 Disable @TeX{} output. If you have a @code{\midi} definition midi output
61 @item -M,--dependencies
62 Output rules to be included in Makefile.
63 @item -o,--output=@var{FILE}
64 Set the default output file to @var{FILE}.
66 Disallow untrusted @code{\include} directives, in-line
67 Scheme evaluation, backslashes in @TeX{}, code.
69 @strong{WARNING}: the @code{--safe} option has not been reviewed for a
70 long time. Do not rely on it for automatic invocation (e.g. over the
71 web). Volunteers are welcome to do a new audit.
73 Show version information
75 Be verbose: show full paths of all files read, and give timing
79 Show the warranty with which GNU LilyPond comes. (It comes with
80 @strong{NO WARRANTY}!)
83 @section Environment variables
86 For processing both the @TeX{} and the PostScript output, you must
87 have appropriate environment variables set. Scripts to do this are
88 included in @file{buildscripts/out/lilypond-profile} (for sh shells)
89 and @file{buildscripts/out/lilypond-login} (for C-shells), and should
90 normally be sourced as part of your login process. If these scripts
91 are not run from the system wide login process, then you must run it
94 @cindex installing LilyPond
96 If you use sh, bash, or a similar shell, then add the following to
102 If you use csh, tcsh or a similar shell, then add the following to
105 source lilypond-login
108 These scripts set the following variables
111 This is to make sure that @TeX{} and lilypond find data files (among
112 others @file{.tex}, @file{.mf} and @file{.tfm}). A typical setting would be
114 @{/usr/share/lilypond/1.6.0,@{!!/usr/share/texmf@}@}
117 you have to set @code{TEXMF} to point to the lilypond data
121 For processing PostScript output (obtained with
122 @code{-f ps}) with Ghostscript you have to set @code{GS_LIB} to
123 point to the directory containing LilyPond PS files.
126 For processing PostScript output (obtained with
127 @code{-f ps}) with Ghostscript you have to set @code{GS_FONTPATH} to
128 point to the directory containing LilyPond PFA files.
130 When you print direct PS output, remember to send the PFA files to the
140 @cindex printing postscript
142 The LilyPond binary itself recognizes the following environment variables
145 This specifies a directory where locale messages and
146 data files will be looked up by default. The directory should contain
147 subdirectories called @file{ly/}, @file{ps/}, @file{tex/}, etc.
150 This selects the language for the warning messages of LilyPond.
154 @cindex LILYPONDPREFIX