]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/running.itely
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / Documentation / user / running.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond.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
11 @node Running LilyPond
12 @chapter Running LilyPond
13
14 This chapter details the technicalities of running LilyPond.
15
16 Some of these commands are run from the command-line.  By
17 @q{command-line}, we mean the command
18 line in the operating system.  Windows users
19 might be more familiar with the terms @q{DOS shell} or
20 @q{command shell}; OSX users might be more familiar with the
21 terms @q{terminal} or @q{console}.  OSX users should also
22 consult @ref{Notes for the MacOS X app}.
23
24 Describing how to use
25 this part of an operating system is outside the scope of this
26 manual; please consult other documentation on this topic if
27 you are unfamiliar with the command-line.
28
29 @menu
30 * Invoking lilypond::           
31 * Notes for the MacOS X app::   
32 * Updating files with convert-ly::  
33 * Reporting bugs::              
34 * Error messages::              
35 * Editor support::              
36 * Point and click::             
37 @end menu
38
39 @node Invoking lilypond
40 @section Invoking lilypond
41 @cindex Invoking LilyPond
42 @cindex command line options
43 @cindex options, command line
44 @cindex switches
45
46
47 The @code{lilypond} executable may be called as follows from the command line.
48
49 @example
50 lilypond [@var{option}]@dots{} @var{file}@dots{}
51 @end example
52
53
54 When invoked with a filename that has no extension, the @file{.ly}
55 extension is tried first.  To read input from stdin, use a
56 dash (@code{-}) for @var{file}.
57
58 When @file{filename.ly} is processed it will produce
59 @file{filename.tex} as output (or @file{filename.ps} for PostScript
60 output).  If @file{filename.ly} contains more than one @code{\score}
61 block, then the rest of the scores will be output in numbered files,
62 starting with @file{filename-1.tex}.  Several files can be specified;
63 they will each be processed independently.  @footnote{The status of
64 GUILE is not reset after processing a @code{.ly} file, so be careful
65 not to change any system defaults from within Scheme.}
66
67
68 @subsection Command line options
69
70 The following options are supported:
71
72 @table @code
73
74 @item -e,--evaluate=@var{expr}
75 Evaluate the Scheme @var{expr} before parsing any @file{.ly} files.
76 Multiple @code{-e} options may be given, they will be evaluated
77 sequentially.
78
79 The expression will be evaluated in the @code{guile-user} module, so
80 if you want to use definitions in @var{expr}, use
81
82 @example
83 lilypond -e '(define-public a 42)'
84 @end example
85
86 @noindent
87 on the command-line, and include
88
89 @example
90 #(use-modules (guile-user))
91 @end example
92
93 @noindent
94 at the top of the @code{.ly} file.
95
96 @item -f,--format=@var{format}
97 which formats should be written.  Choices for @code{format} are
98 @code{svg}, @code{ps}, @code{pdf}, @code{png}, @code{tex}, @code{dvi}.
99
100 Example: @code{lilypond -fpng filename.ly}
101
102
103
104 @item -d,--define-default=@var{var}=@var{val}
105 This sets the internal program option @var{var} to the Scheme value
106 @var{val}. If @var{val} is not supplied, then @var{#t} is used. To
107 switch off an option, @code{no-} may be prefixed to @var{var}, e.g.
108
109 @cindex point and click, command line
110
111 @example
112 -dno-point-and-click
113 @end example
114
115 @noindent
116 is the same as
117 @example
118 -dpoint-and-click='#f'
119 @end example
120
121 Here are a few interesting options.
122
123 @table @samp
124 @item help
125 Running @code{lilypond -dhelp} will print all of the @code{-d} options
126 available.
127
128 @item paper-size
129 This option sets the default paper-size, 
130 @example
131 -dpaper-size=\"letter\"
132 @end example
133
134 @noindent
135 Note that the string must be enclosed in escaped quotes ( @code{\"} ).
136
137
138 @item safe
139 Do not trust the @code{.ly} input.
140
141 When LilyPond formatting is available through a web server, either the
142 @code{--safe} or the @code{--jail} option @b{MUST} be passed.  The
143 @code{--safe} option will prevent inline Scheme code from wreaking
144 havoc, for example
145
146 @quotation
147 @verbatim
148 #(system "rm -rf /")
149 {
150   c4^#(ly:export (ly:gulp-file "/etc/passwd"))
151 }
152 @end verbatim
153 @end quotation
154
155 The @code{-dsafe} option works by evaluating in-line Scheme
156 expressions in a special safe module.  This safe module is derived from
157 GUILE @file{safe-r5rs} module, but adds a number of functions of the
158 LilyPond API.  These functions are listed in @file{scm/@/safe@/-lily@/.scm}.
159
160 In addition, safe mode disallows @code{\include} directives and
161 disables the use of backslashes in @TeX{} strings.
162
163 In safe mode, it is not possible to import LilyPond variables
164 into Scheme.
165
166 safe does @emph{not} detect resource overuse.  It is still possible to
167 make the program hang indefinitely, for example by feeding cyclic data
168 structures into the backend.  Therefore, if using LilyPond on a
169 publicly accessible webserver, the process should be limited in both
170 CPU and memory usage.
171
172 The safe mode will prevent many useful LilyPond snippets from being
173 compiled.  The @code{--jail} is a more secure alternative, but
174 requires more work to set up.
175
176 @item backend
177 the output format to use for the back-end.  Choices for @code{format} are
178 @table @code
179 @item tex
180 for @TeX{} output, to be processed with La@TeX{}.  If present, the file
181 @file{file.textmetrics} is read to determine text extents.
182 @item texstr
183 dump text strings to @file{.texstr} file, which can be run through
184 (La)@TeX{}, resulting in a @code{.textmetrics} file, which contains the
185 extents of strings of text.  @strong{Warning:} this functionality is
186 currently missing due to heavy restructuring of the source code.
187 @item ps
188  for PostScript.
189 @cindex PostScript output
190
191   Postscript files include TTF, Type1 and OTF fonts.  No subsetting of
192   these fonts is done.  When using oriental character sets, this can
193   lead to huge files.
194
195 @item eps
196  for encapsulated PostScript.  This dumps every page (system) as a separate
197 @file{EPS} file, without fonts, and as one collated @file{EPS} file with
198 all pages (systems) including fonts.
199
200 This mode is used by default by lilypond-book.
201
202 @item svg
203  for SVG (Scalable Vector Graphics).  This dumps every page as a separate
204 @file{SVG} file, with embedded fonts.
205 @cindex SVG (Scalable Vector Graphics)
206   You need a SVG viewer which supports embedded fonts, or a SVG
207   viewer which is able to replace the embedded fonts with OTF fonts.
208   Under Unix, you may use @uref{http://www.inkscape.org,Inkscape}
209   (version 0.42 or later), after copying the OTF fonts in directory
210   @file{PATH/TO/share/lilypond/VERSION/fonts/otf/} to @file{~/.fonts/}.
211 @item scm
212  for a dump of the raw, internal Scheme-based drawing commands.
213 @cindex Scheme dump
214 @end table
215
216 Example: @code{lilypond -dbackend=svg filename.ly}
217
218 @cindex output format, setting
219
220 @item preview
221 Generate an output file containing the titles and the first system
222
223 @item print-pages
224 Generate the full pages, the default.  @code{-dno-print-pages} is
225 useful in combination with @code{-dpreview}.
226
227 @end table
228
229
230
231 @item -h,--help
232 Show a summary of usage.
233
234 @item -H,--header=FIELD
235 Dump a header field to file BASENAME.FIELD
236
237 @item --include, -I=@var{directory}
238 Add @var{directory} to the search path for input files.
239 @cindex file searching
240 @cindex search path
241
242 @item -i,--init=@var{file}
243 Set init file to @var{file} (default: @file{init.ly}).
244
245 @item -o,--output=@var{FILE}
246 Set the default output file to @var{FILE}.  The appropriate
247 suffix will be added (ie @code{.pdf} for pdf, @code{.tex}
248 for tex, etc).
249
250 @item --ps
251 Generate PostScript.
252
253 @item --dvi
254 Generate DVI files.  In this case, the @TeX{} backend should be
255 specified, i.e., @code{-dbackend=tex}.
256
257 @item --png
258 Generate pictures of each page, in PNG format.  This implies
259 @code{--ps}.  The resolution in DPI of the image may be set with
260 @example
261 -dresolution=110
262 @end example
263
264 @item --pdf
265 Generate PDF.  This implies @code{--ps}.
266
267
268
269 @item -j,--jail=@var{user},@var{group},@var{jail},@var{dir}
270 Run LilyPond in a chroot jail.
271
272 The @code{--jail} option provides a more flexible alternative to
273 @code{--safe} when LilyPond formatting is available through a web
274 server or whenever LilyPond executes externally provided
275 sources.
276
277 The @code{--jail} option works by changing the root of LilyPond to
278 @var{jail} just before starting the actual compilation process.  The user
279 and group are then changed to match those provided, and the current
280 directory is changed to @var{dir}.  This setup guarantees that it is not
281 possible (at least in theory) to escape from the jail.  Note that for
282 @code{--jail} to work LilyPond must be run as root, which is usually
283 accomplished in a safe way using @command{sudo}.
284
285 Setting up a jail is a slightly delicate matter, as we must be sure that
286 LilyPond is able to find whatever it needs to compile the source
287 @emph{inside the jail}. A typical setup comprises the following items:
288
289 @table @asis
290 @item Setting up a separate filesystem
291 A separate filesystem should be created for LilyPond, so that it can be
292 mounted with safe options such as @code{noexec}, @code{nodev}, and
293 @code{nosuid}.  In this way, it is impossible to run executables or to
294 write directly to a device from LilyPond.  If you do not want to create a
295 separate partition, just create a file of reasonable size and use it to
296 mount a loop device.  A separate filesystem also guarantees that LilyPond
297 cannot write more space than it is allowed.
298
299 @item Setting up a separate user
300 A separate user and group (say, @samp{lily}/@samp{lily}) with low
301 privileges should be used to run LilyPond inside the jail.  There should
302 be a single directory writable by this user, which should be passed in
303 @var{dir}.
304
305 @item Preparing the jail
306 LilyPond needs to read a number of files while running.  All these files
307 are to be copied into the jail, under the same path they appear in the
308 real root filesystem.  The entire content of the LilyPond installation
309 (e.g., @file{/usr/share/lilypond})
310 should be copied.
311
312 If problems arise, the simplest way to trace them down is to run
313 LilyPond using @command{strace}, which will allow you to determine which
314 files are missing.
315
316 @item Running LilyPond
317 In a jail mounted with @code{noexec} it is impossible to execute any external
318 program.  Therefore LilyPond must be run with a backend that does not
319 require any such program.  As we already mentioned, it must be also run
320 with superuser privileges (which, of course, it will lose immediately),
321 possibly using @command{sudo}.  It is a good idea to limit the number of
322 seconds of CPU time LilyPond can use (e.g., using @command{ulimit
323 -t}), and, if your operating system supports it, the amount of memory
324 that can be allocated.
325 @end table
326
327
328 @item -v,--version
329 Show version information.
330
331 @item -V,--verbose
332 Be verbose: show full paths of all files read, and give timing
333 information.
334
335 @item -w,--warranty
336 Show the warranty with which GNU LilyPond comes. (It comes with
337 @strong{NO WARRANTY}!)
338 @end table
339
340
341 @subsection Environment variables
342
343
344 @cindex LANG
345 @cindex LILYPOND_DATADIR
346
347 @code{Lilypond} recognizes the following environment variables:
348 @table @code
349 @item LILYPOND_DATADIR
350 This specifies a directory where locale messages and
351 data files will be looked up by default.  The directory should contain
352 subdirectories called @file{ly/}, @file{ps/}, @file{tex/}, etc.
353
354 @item LANG
355 This selects the language for the warning messages.
356
357 @item LILYPOND_GC_YIELD
358 With this variable the memory footprint and performance can be
359 adjusted. It is a percentage tunes memory management behavior. With
360 higher values, the program uses more memory, with smaller values, it
361 uses more CPU time. The default value is @code{70}.
362
363 @end table
364
365
366 @node Notes for the MacOS X app
367 @section Notes for the MacOS X app
368
369 The scripts (such as lilypond-book, convert-ly, abc2ly, and even
370 lilypond itself) are also
371 included inside MacOS X .app. They can be run from the command line by
372 invoking them directly, e.g.
373
374 @example
375 @var{path/to}/LilyPond.app/Contents/Resources/bin/lilypond
376 @end example
377
378 @noindent
379 The same is true of the other scripts in that directory, including
380 lilypond-book, convert-ly, abc2ly, etc.
381
382 Alternatively, you may create scripts which add the path
383 automatically.  Create a directory to store these scripts,
384
385 @example
386 mkdir -p ~/bin
387 cd ~/bin
388 @end example
389
390 Create a file called @code{lilypond} which contains
391
392 @example
393 exec @var{path/to}/LilyPond.app/Contents/Resources/bin/lilypond "$@@"
394 @end example
395
396 Create similar files @code{lilypond-book}, @code{convert-ly}, and
397 any other helper programs you use (@code{abc2ly}, @code{midi2ly},
398 etc).  Simply replace the @code{bin/lilypond} with
399 @code{bin/convert-ly} (or other program name) in the above file.
400
401 Make the file executable,
402
403 @example
404 chmod u+x lilypond
405 @end example
406
407 Now, add this directory to your path.  Modify (or create)
408 a file called @code{.profile} in your home directory such that it contains
409
410 @example
411 export PATH=$PATH:~/bin
412 @end example
413
414 @noindent
415 This file should end with a blank line.
416
417 Note that @var{path/to} will generally be @code{/Applications/}.
418
419
420 @node Updating files with convert-ly
421 @section Updating with @command{convert-ly}
422
423 @cindex Updating a LilyPond file
424 @funindex convert-ly
425
426 The LilyPond input syntax is routinely changed to simplify it or improve
427 it in different ways.  As a side effect of this, the LilyPond interpreter
428 often is no longer compatible with older input files.  To remedy this,
429 the program @command{convert-ly} can be used to deal with most of the
430 syntax changes between LilyPond versions.
431
432 It uses @code{\version} statements in the input files to detect the
433 old version number.  In most cases, to upgrade your input file it is
434 sufficient to run@footnote{MacOS X users may execute this command
435 under the menu entry @samp{Compile > Update syntax}.}
436
437 @example
438 convert-ly -e myfile.ly
439 @end example
440
441 If there are no changes to myfile.ly and file called myfile.ly.NEW
442 is created, then myfile.ly is already updated.
443
444 @command{convert-ly} always converts up to the last syntax change handled by
445 it.  This means that the @code{\version} number left in the file is
446 usually lower than the version of @command{convert-ly} itself.
447
448 To upgrade LilyPond fragments in texinfo files, use
449
450 @example
451 convert-ly --from=... --to=... --no-version *.itely
452 @end example
453
454 To see the changes in the LilyPond syntax between two versions, use
455
456 @example
457 convert-ly --from=... --to=... -s
458 @end example
459
460 To upgrade many files at once, combine @code{convert-ly} with
461 standard unix commands.  This example will upgrade all @code{.ly}
462 files in the current directory
463
464 @example
465 for f in *.ly; do convert-ly -e $f; done;
466 @end example
467
468 In general, the program is invoked as follows:
469
470 @example
471 convert-ly [@var{option}]@dots{} @var{file}@dots{}
472 @end example
473
474
475 The following options can be given:
476
477 @table @code
478 @item -e,--edit
479 Do an inline edit of the input file.  Overrides @code{--output}.
480
481 @item -f,--from=@var{from-patchlevel}
482 Set the version to convert from.  If this is not set, @command{convert-ly}
483 will guess this, on the basis of @code{\version} strings in the file.
484
485 @item -n,--no-version
486 Normally, @command{convert-ly} adds a @code{\version} indicator
487 to the output.  Specifying this option suppresses this.
488
489 @item -s, --show-rules
490 Show all known conversions and exit.
491
492 @item --to=@var{to-patchlevel}
493 Set the goal version of the conversion.  It defaults to the latest
494 available version.
495
496 @item -h, --help
497 Print usage help.
498 @end table
499
500
501 @refbugs
502
503 Not all language changes are handled.  Only one output option can be
504 specified.  Automatically updating scheme and lilypond scheme
505 interfaces is quite unlikely; be prepared to tweak scheme code
506 manually.
507
508
509 @c  We might want to make this a completely new section, along with more
510 @c  info about how to upgrade old input files.  -gp
511
512 @ignore
513 Copy and paste from CVS, last updated
514 Aug 18, 2005
515
516 http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/lilypond/lily-bugs/bugs/
517 convert-ly.txt?rev=HEAD&content-type=text/plain
518
519 NEW: not exactly copied; this list has been modified.  Since we're
520 changing the bug system, it doesn't make sense to copy from
521 the bug CVS any more.  I'll figure out something else.  -gp
522 @end ignore
523 @verbatim
524
525 There are a few things that the convert-ly cannot handle. Here's a list of
526 limitations
527 that the community has complained about.
528
529 This bug report structure has been chosen because convert-ly has a structure
530 that doesn't
531 allow to smoothly implement all needed changes. Thus this is just a wishlist,
532 placed
533 here for reference.
534
535 1.6->2.0:
536  Doesn't always convert figured bass correctly, specifically things like {<
537 >}. Mats' comment on working around this:
538    To be able to run convert-ly
539    on it, I first replaced all occurencies of '{<' to some dummy like '{#'
540    and similarly I replaced '>}' with '&}'. After the conversion, I could
541    then change back from '{ #' to '{ <' and from '& }' to '> }'.
542  Doesn't convert all text markup correctly. In the old markup syntax,
543  it was possible to group a number of markup commands together within
544 parentheses, e.g.
545    -#'((bold italic) "string")
546    This will incorrectly be converted into
547    -\markup{{\bold italic} "string"}
548    instead of the correct
549    -\markup{\bold \italic "string"}
550 2.0->2.2:
551  Doesn't handle \partcombine
552  Doesn't do \addlyrics => \lyricsto, this breaks some scores with multiple
553 stanzas.
554 2.0->2.4:
555  \magnify isn't changed to \fontsize.
556     - \magnify #m => \fontsize #f, where f = 6ln(m)/ln(2)
557  remove-tag isn't changed.
558     - \applyMusic #(remove-tag '. . .) => \keepWithTag #'. . .
559  first-page-number isn't changed.
560     - first-page-number no => print-first-page-number = ##f
561  Line breaks in header strings aren't converted.
562     - \\\\  as line break in \header strings => \markup \center-align <
563       "First Line" "Second Line" >
564  Crescendo and decrescendo terminators aren't converted.
565     - \rced => \!
566     - \rc => \!
567 2.2->2.4:
568  \turnOff (used in \set Staff.VoltaBracket = \turnOff) is not properly
569 converted.
570 2.4.2->2.5.9
571  \markup{ \center-align <{ ... }> } should be converted to:
572  \markup{ \center-align {\line { ... }} }
573  but now, \line is missing.
574 2.4->2.6
575  Special LaTeX characters such as $~$ in text are not converted to UTF8.
576 2.8
577  \score{} must now begin with a music expression.  Anything else
578  (particularly \header{}) must come after the music.
579 @end verbatim
580
581
582 @node Reporting bugs
583 @section Reporting bugs
584
585 @cindex bugs
586 @cindex reporting bugs
587
588 If you have input that results in a crash or an erroneous output, then
589 that is a bug. There is a list of current bugs on our google bug tracker,
590
591 @uref{http://code.google.com/p/lilypond/issues/list}
592
593 If you have discovered a bug which is not listed, please report the
594 bug by following the directions on
595
596 @uref{http://lilypond.org/web/devel/participating/bugs}
597
598 Please construct submit @ref{Minimal examples} of bug reports.  We do not
599 have the resources to investigate reports which are not as small as possible.
600
601
602 @node Error messages
603 @section Error messages
604
605 @cindex error messages
606 Different error messages can appear while compiling a file:
607
608 @table @emph
609 @cindex warning
610
611 @item Warning
612 Something looks suspect.  If you are requesting something out of the
613 ordinary then you will understand the message, and can ignore it.
614 However, warnings usually indicate that something is wrong with the
615 input file.
616
617 @item Error
618 Something is definitely wrong.  The current processing step (parsing,
619 interpreting, or formatting) will be finished, but the next step will
620 be skipped.
621
622 @cindex error
623 @cindex fatal error
624 @item Fatal error
625 Something is definitely wrong, and LilyPond cannot continue.  This
626 happens rarely.  The most usual cause is misinstalled fonts.
627
628 @cindex trace, Scheme
629 @cindex call trace
630 @cindex Scheme error
631 @item Scheme error
632 Errors that occur while executing Scheme code are caught by the Scheme
633 interpreter.  If running with the verbose option (@code{-V} or
634 @code{--verbose}) then a call trace of the offending
635 function call is printed.
636
637 @cindex Programming error
638 @item Programming error
639 There was some internal inconsistency.  These error messages are
640 intended to help the programmers and debuggers.  Usually, they can be
641 ignored.  Sometimes, they come in such big quantities that they obscure
642 other output.  In this case, file a bug-report.
643
644 @item Aborted (core dumped)
645 This signals a serious programming error that caused the program to
646 crash.  Such errors are considered critical.  If you stumble on one,
647 send a bug-report.
648
649
650 @end table
651
652 @cindex errors, message format
653 If warnings and errors can
654 be linked to some part of the input file, then error messages have the
655 following form
656
657 @example
658 @var{filename}:@var{lineno}:@var{columnno}: @var{message}
659 @var{offending input line}
660 @end example
661
662 A line-break is inserted in the offending line to indicate the column
663 where the error was found.  For example,
664
665 @example
666 test.ly:2:19: error: not a duration: 5:
667   @{ c'4 e'5
668              g' @}
669 @end example
670
671 These locations are LilyPond's best guess about where the warning or
672 error occurred, but (by their very nature) warnings and errors occur
673 when something unexpected happens.  If you can't see an error in the
674 indicated line of your input file, try checking one or two lines
675 above the indicated position.
676
677
678 @node Editor support
679 @section Editor support
680
681 @cindex editors
682 @cindex vim
683 @cindex emacs
684 @cindex modes, editor
685 @cindex syntax coloring
686 @cindex coloring, syntax
687
688 There is support from different editors for LilyPond.
689
690 @table @asis
691 @item Emacs
692 Emacs has a @file{lilypond-mode}, which provides keyword
693 autocompletion, indentation, LilyPond specific parenthesis matching
694 and syntax coloring, handy compile short-cuts and reading LilyPond
695 manuals using Info.  If @file{lilypond-mode} is not installed on your
696 platform, then read the
697 @ifhtml
698 @uref{source/Documentation/topdocs/INSTALL.html,installation instructions}.
699 @end ifhtml
700 @ifnothtml
701 installation instructions.
702 @end ifnothtml
703
704 @item VIM
705
706 For @uref{http://@/www@/.vim@/.org,VIM}, a @file{vimrc} is supplied, along
707 with syntax coloring tools.  For more information, refer to the
708 @ifhtml
709 @uref{source/Documentation/topdocs/INSTALL.html,installation instructions}.
710 @end ifhtml
711 @ifnothtml
712 installation instructions.
713 @end ifnothtml
714
715
716 @item LilyPondTool
717
718 Created as a plugin for the @uref{http://@/www@/.jedit@/.org@/,jEdit} text
719 editor, LilyPondTool is the most feature-rich text-based tool for editing
720 LilyPond scores.  Its features include a Document Wizard with lyrics
721 support to set up documents easier, and embedded PDF viewer with advanced
722 point-and-click support.  For screenshots, demos and installation
723 instructions, visit @uref{http://lilypondtool@/.organum@/.hu}
724
725 @end table
726
727 All these editors can be made to jump into the input file to the source
728 of a symbol in the graphical output.  See @ref{Point and click}.
729
730
731 @node Point and click
732 @section Point and click
733 @cindex point and click
734
735
736 Point and click lets you find notes in the input by clicking on them
737 in the PDF viewer.  This makes it easier to find input that causes
738 some error in the sheet music.
739
740 When this functionality is active, LilyPond adds hyperlinks to the PDF
741 file. These hyperlinks are sent to the web-browser, which opens a
742 text-editor with the cursor in the right place.
743
744 To make this chain work, you should configure your PDF viewer to
745 follow hyperlinks using the @file{lilypond-invoke-editor} script
746 supplied with LilyPond.
747
748 For Xpdf on Unix, the following should be present in
749 @file{xpdfrc}@footnote{On unix, this file is found either in
750 @file{/etc/xpdfrc} or as @file{.xpdfrc} in your home directory.}
751
752 @example
753 urlCommand     "lilypond-invoke-editor %s"
754 @end example
755
756 The program @file{lilypond-invoke-editor} is a small helper
757 program. It will invoke an editor for the special @code{textedit}
758 URIs, and run a web browser for others.  It tests the environment
759 variable @code{EDITOR} for the following patterns,
760
761 @table @code
762 @item emacs
763   this will invoke
764 @example
765 emacsclient --no-wait +@var{line}:@var{column} @var{file}
766 @end example
767 @item vim
768   this will invoke
769 @example
770 gvim --remote +:@var{line}:norm@var{char} @var{file}
771 @end example
772
773 @item nedit
774 this will invoke
775 @example
776   nc -noask +@var{line} @var{file}'
777 @end example
778 @end table
779
780 The environment variable @code{LYEDITOR} is used to override this. It
781 contains the command line to start the editor, where @code{%(file)s},
782 @code{%(column)s}, @code{%(line)s} is replaced with the file, column
783 and line respectively. The  setting
784
785 @example
786 emacsclient --no-wait +%(line)s:%(column)s %(file)s
787 @end example
788
789 @noindent
790 for @code{LYEDITOR} is equivalent to the standard emacsclient
791 invocation.
792
793
794 @cindex file size, output
795
796 The point and click links enlarge the output files significantly. For
797 reducing the size of PDF and PS files, point and click may be switched
798 off by issuing
799
800 @example
801 #(ly:set-option 'point-and-click #f)
802 @end example
803
804 @noindent
805 in a @file{.ly} file.  Alternately, you may pass this as an command-line
806 option
807
808 @example
809 lilypond -dno-point-and-click file.ly
810 @end example
811