Next: , Previous: Extracting fragments of notation, Up: Input files


10.1.6 Including LilyPond files

A large project may be split up into separate files. To refer to another file, use

\include "otherfile.ly"

The line \include "file.ly" is equivalent to pasting the contents of file.ly into the current file at the place where you have the \include. For example, for a large project you might write separate files for each instrument part and create a “full score” file which brings together the individual instrument files.

The initialization of LilyPond is done in a number of files that are included by default when you start the program, normally transparent to the user. Run lilypond –verbose to see a list of paths and files that Lily finds.

Files placed in directory PATH/TO/share/lilypond/VERSION/ly/ (where VERSION is in the form “2.6.1”) are on the path and available to \include. Files in the current working directory are available to \include, but a file of the same name in LilyPond's installation takes precedence. Files are available to \include from directories in the search path specified as an option when invoking lilypond --include=DIR which adds DIR to the search path.

The \include statement can use full path information, but with the Unix convention "/" rather than the DOS/Windows "\". For example, if stuff.ly is located one directory higher than the current working directory, use

\include "../stuff.ly"


Next: , Previous: Extracting fragments of notation, Up: Input files

This page is for LilyPond-2.10.33 (stable-branch).

Report errors to http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs.