1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @c This file is part of lilypond-program.tely
4 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
6 When revising a translation, copy the HEAD committish of the
7 version that you are working on. See TRANSLATION for details.
12 @c Note: keep this node named so that `info lilypond-book' brings you here.
14 @chapter @command{lilypond-book}: Integrating text and music
16 If you want to add pictures of music to a document, you can simply do it
17 the way you would do with other types of pictures. The pictures are
18 created separately, yielding PostScript output or PNG images, and those
19 are included into a @LaTeX{} or HTML document.
21 @command{lilypond-book} provides a way to automate this process: This
22 program extracts snippets of music from your document, runs
23 @command{lilypond} on them, and outputs the document with pictures
24 substituted for the music. The line width and font size definitions for
25 the music are adjusted to match the layout of your document.
27 This is a separate program from @command{lilypond} itself, and is run
28 on the command line; for more information, see @ref{Command-line
29 usage}. If you have MacOS 10.3 or 10.4 and you have trouble running
30 @code{lilypond-book}, see @ref{Setup for MacOS X}.
32 This procedure may be applied to @LaTeX{}, HTML, Texinfo or DocBook
41 @cindex documents, adding music to
42 @cindex HTML, music in
43 @cindex Texinfo, music in
44 @cindex DocBook, music in
45 @cindex @LaTeX{}, music in
48 * An example of a musicological document::
49 * Integrating music and text::
50 * Music fragment options::
51 * Invoking lilypond-book::
52 * Filename extensions::
53 * Alternate methods of mixing text and music::
57 @node An example of a musicological document
58 @section An example of a musicological document
61 Some texts contain music examples. These texts are musicological
62 treatises, songbooks, or manuals like this. Such texts can be made by
63 hand, simply by importing a PostScript figure into the word processor.
64 However, there is an automated procedure to reduce the amount of work
65 involved in HTML, @LaTeX{}, Texinfo and DocBook documents.
67 A script called @code{lilypond-book} will extract the music fragments,
68 format them, and put back the resulting notation. Here we show a small
69 example for use with @LaTeX{}. The example also contains explanatory
70 text, so we will not comment on it further.
76 \documentclass[a4paper]{article}
80 Documents for \verb+lilypond-book+ may freely mix music and text.
85 c2 g'2 \times 2/3 { f8 e d } c'2 g4
89 Options are put in brackets.
91 \begin[fragment,quote,staffsize=26,verbatim]{lilypond}
95 Larger examples can be put into a separate file, and introduced with
98 \lilypondfile[quote,noindent]{screech-boink.ly}
100 (If needed, replace screech-boink.ly by any .ly file you put in the same
101 directory as this file.)
107 @subheading Processing
109 Save the code above to a file called @file{lilybook.lytex}, then in a
112 @c keep space after @version{} so TeX doesn't choke
114 lilypond-book --output=out --pdf lilybook.lytex
115 @emph{lilypond-book (GNU LilyPond) @version{} }
116 @emph{Reading lilybook.lytex...}
117 @emph{..lots of stuff deleted..}
118 @emph{Compiling lilybook.tex...}
121 @emph{..lots of stuff deleted..}
123 @emph{(replace @command{xpdf} by your favorite PDF viewer)}
126 Running @command{lilypond-book} and @command{latex} creates a lot of
127 temporary files, which would clutter up the working directory. To
128 remedy this, use the @code{--output=@var{dir}} option. It will create
129 the files in a separate subdirectory @file{dir}.
131 Finally the result of the @LaTeX{} example shown above.@footnote{This
132 tutorial is processed with Texinfo, so the example gives slightly
133 different results in layout.} This finishes the tutorial section.
139 Documents for @command{lilypond-book} may freely mix music and text.
144 c2 g'2 \times 2/3 { f8 e d } c'2 g4
148 Options are put in brackets.
150 @lilypond[fragment,quote,staffsize=26,verbatim]
154 Larger examples can be put into a separate file, and introduced with
155 @code{\lilypondfile}.
157 @lilypondfile[quote,noindent]{screech-boink.ly}
162 @node Integrating music and text
163 @section Integrating music and text
165 Here we explain how to integrate LilyPond with various output formats.
177 @LaTeX{} is the de-facto standard for publishing layouts in the exact
178 sciences. It is built on top of the @TeX{} typesetting engine,
179 providing the best typography available anywhere.
182 @uref{http://@/www@/.ctan@/.org/@/tex@/-archive/@/info/@/lshort/@/english/,
183 @emph{The Not So Short Introduction to @LaTeX{}}} for an overview on how
186 Music is entered using
189 \begin[options,go,here]@{lilypond@}
198 \lilypondfile[options,go,here]@{@var{filename}@}
205 \lilypond@{ YOUR LILYPOND CODE @}
208 Additionally, @code{\lilypondversion} displays the current version
210 Running @command{lilypond-book} yields a file that can be further
211 processed with @LaTeX{}.
213 We show some examples here. The @code{lilypond} environment
216 \begin[quote,fragment,staffsize=26]@{lilypond@}
224 @lilypond[quote,fragment,staffsize=26]
231 \lilypond[quote,fragment,staffsize=11]@{<c' e' g'>@}
237 @lilypond[quote,fragment,staffsize=11]{<c' e' g'>}
240 Currently, you cannot include @code{@{} or @code{@}} within
241 @code{\lilypond@{@}}, so this command is only useful with the
242 @code{fragment} option.
244 The default line width of the music will be adjusted by examining the
245 commands in the document preamble, the part of the document before
246 @code{\begin@{document@}}. The @command{lilypond-book} command sends
247 these to @LaTeX{} to find out how wide the text is. The line width for
248 the music fragments is then adjusted to the text width. Note that this
249 heuristic algorithm can fail easily; in such cases it is necessary to
250 use the @code{line-width} music fragment option.
252 @cindex titling and lilypond-book
253 @cindex \header in @LaTeX{} documents
255 Each snippet will call the following macros if they have been defined by
259 @item @code{\preLilyPondExample} called before the music,
261 @item @code{\postLilyPondExample} called after the music,
263 @item @code{\betweenLilyPondSystem[1]} is called between systems if
264 @code{lilypond-book} has split the snippet into several PostScript
265 files. It must be defined as taking one parameter and will be
266 passed the number of files already included in this snippet.
267 The default is to simply insert a @code{\linebreak}.
273 @cindex Latex, feta symbols
276 To include feta symbols (such as flat, segno, etc) in a LaTeX
277 document, use @code{\input@{titledefs@}}
280 \documentclass[a4paper]@{article@}
291 The font symbol names are defined in the file feta20.tex; to find
292 the location of this file, use the command
302 Sometimes it is useful to display music elements (such as ties and slurs)
303 as if they continued after the end of the fragment. This can be done by
304 breaking the staff and suppressing inclusion of the rest of the LilyPond
307 In @LaTeX{}, define @code{\betweenLilyPondSystem} in such a way that
308 inclusion of other systems is terminated once the required number of
309 systems are included. Since @code{\betweenLilypondSystem} is first
310 called @emph{after} the first system, including only the first system
314 \def\betweenLilyPondSystem#1@{\endinput@}
316 \begin[fragment]@{lilypond@}
317 c'1\( e'( c'~ \break c' d) e f\)
321 If a greater number of systems is requested, a @TeX{} conditional must
322 be used before the @code{\endinput}. In this example, replace @q{2} by
323 the number of systems you want in the output,
326 \def\betweenLilyPondSystem#1@{
327 \ifnum##1<2\else\endinput\fi
331 Remember that the definition of @code{\betweenLilyPondSystem} is
332 effective until @TeX{} quits the current group (such as the @LaTeX{}
333 environment) or is overridden by another definition (which is, in
334 most cases, for the rest of the document). To reset your
338 \let\betweenLilyPondSystem\undefined
342 in your @LaTeX{} source.
344 This may be simplified by defining a @TeX{} macro
347 \def\onlyFirstNSystems#1@{
348 \def\betweenLilyPondSystem##1@{\ifnum##1<#1\else\endinput\fi@}
353 and then saying only how many systems you want before each fragment,
356 \onlyFirstNSystems@{3@}
357 \begin@{lilypond@}...\end@{lilypond@}
358 \onlyFirstNSystems@{1@}
359 \begin@{lilypond@}...\end@{lilypond@}
364 There are specific @command{lilypond-book} command line options and
365 other details to know when processing @LaTeX{} documents, see
366 @ref{Invoking lilypond-book}.
372 Texinfo is the standard format for documentation of the GNU project. An
373 example of a Texinfo document is this manual. The HTML, PDF, and Info
374 versions of the manual are made from the Texinfo document.
376 In the input file, music is specified with
379 @@lilypond[options,go,here]
388 @@lilypond[options,go,here]@{ YOUR LILYPOND CODE @}
395 @@lilypondfile[options,go,here]@{@var{filename}@}
398 Additionally, @code{@@lilypondversion} displays the current version
401 When @command{lilypond-book} is run on it, this results in a Texinfo
402 file (with extension @file{.texi}) containing @code{@@image} tags for
403 HTML, Info and printed output. @command{lilypond-book} generates images
404 of the music in EPS and PDF formats for use in the printed output, and
405 in PNG format for use in HTML and Info output.
407 We show two simple examples here. A @code{lilypond} environment
425 @@lilypond[fragment,staffsize=11]@{<c' e' g'>@}
431 @lilypond[fragment,staffsize=11]{<c' e' g'>}
433 Contrary to @LaTeX{}, @code{@@lilypond@{...@}} does not generate an
434 in-line image. It always gets a paragraph of its own.
440 Music is entered using
443 <lilypond fragment relative=2>
444 \key c \minor c4 es g2
448 @command{lilypond-book} then produces an HTML file with appropriate image
449 tags for the music fragments:
451 @lilypond[fragment,relative=2]
452 \key c \minor c4 es g2
455 For inline pictures, use @code{<lilypond ... />}, where the options
456 are separated by a colon from the music, for example
459 Some music in <lilypond relative=2: a b c/> a line of text.
463 To include separate files, say
466 <lilypondfile @var{option1} @var{option2} ...>@var{filename}</lilypondfile>
469 Additionally, @code{<lilypondversion/>} displays the current version
473 @cindex titling in HTML
474 @cindex preview image
480 For inserting LilyPond snippets it is good to keep the conformity of our
481 DocBook document, thus allowing us to use DocBook editors, validation
482 etc. So we don't use custom tags, only specify a convention based on the
483 standard DocBook elements.
485 @subheading Common conventions
487 For inserting all type of snippets we use the @code{mediaobject} and
488 @code{inlinemediaobject} element, so our snippets can be formatted
489 inline or not inline. The snippet formatting options are always
490 provided in the @code{role} property of the innermost element (see in
491 next sections). Tags are chosen to allow DocBook editors format the
492 content gracefully. The DocBook files to be processed with
493 @command{lilypond-book} should have the extension @file{.lyxml}.
495 @subheading Including a LilyPond file
497 This is the most simple case. We must use the @file{.ly} extension for
498 the included file, and insert it as a standard @code{imageobject}, with
499 the following structure:
504 <imagedata fileref="music1.ly" role="printfilename" />
509 Note that you can use @code{mediaobject} or @code{inlinemediaobject}
510 as the outermost element as you wish.
512 @subheading Including LilyPond code
514 Including LilyPond code is possible by using a @code{programlisting},
515 where the language is set to @code{lilypond} with the following
521 <programlisting language="lilypond" role="fragment verbatim staffsize=16 ragged-right relative=2">
522 \context Staff \with @{
523 \remove Time_signature_engraver
524 \remove Clef_engraver@}
531 As you can see, the outermost element is a @code{mediaobject} or
532 @code{inlinemediaobject}, and there is a @code{textobject} containing
533 the @code{programlisting} inside.
535 @subheading Processing the DocBook document
537 Running @command{lilypond-book} on our @file{.lyxml} file will create a
538 valid DocBook document to be further processed with @file{.xml}
539 extension. If you use
540 @uref{http://@/dblatex@/.sourceforge@/.net@/,dblatex}, it will create a
541 PDF file from this document automatically. For HTML (HTML Help,
542 JavaHelp etc.) generation you can use the official DocBook XSL
543 stylesheets, however, it is possible that you have to make some
544 customization for it.
547 @node Music fragment options
548 @section Music fragment options
550 In the following, a @q{LilyPond command} refers to any command described
551 in the previous sections which is handled by @command{lilypond-book} to
552 produce a music snippet. For simplicity, LilyPond commands are only
553 shown in @LaTeX{} syntax.
555 Note that the option string is parsed from left to right; if an option
556 occurs multiple times, the last one is taken.
558 The following options are available for LilyPond commands:
561 @item staffsize=@var{ht}
562 Set staff size to @var{ht}, which is measured in points.
565 Produce ragged-right lines with natural spacing, i.e.,
566 @code{ragged-right = ##t} is added to the LilyPond snippet. This is the
567 default for the @code{\lilypond@{@}} command if no @code{line-width}
568 option is present. It is also the default for the @code{lilypond}
569 environment if the @code{fragment} option is set, and no line width is
570 explicitly specified.
573 For single-line snippets, allow the staff length to be stretched to
574 equal that of the line width, i.e., @code{ragged-right = ##f} is
575 added to the LilyPond snippet.
578 @itemx line-width=@var{size}\@var{unit}
579 Set line width to @var{size}, using @var{unit} as units. @var{unit} is
580 one of the following strings: @code{cm}, @code{mm}, @code{in}, or
581 @code{pt}. This option affects LilyPond output (this is, the staff
582 length of the music snippet), not the text layout.
584 If used without an argument, set line width to a default value (as
585 computed with a heuristic algorithm).
587 If no @code{line-width} option is given, @command{lilypond-book} tries to
588 guess a default for @code{lilypond} environments which don't use the
589 @code{ragged-right} option.
592 Do not print the time signature, and turns off the timing (time signature,
593 bar lines) in the score.
596 Make @command{lilypond-book} add some boilerplate code so that you can
604 without @code{\layout}, @code{\score}, etc.
607 Do not add additional code to complete LilyPond code in music snippets.
608 Since this is the default, @code{nofragment} is redundant normally.
610 @item indent=@var{size}\@var{unit}
611 Set indentation of the first music system to @var{size}, using
612 @var{unit} as units. @var{unit} is one of the following strings:
613 @code{cm}, @code{mm}, @code{in}, or @code{pt}. This option affects
614 LilyPond, not the text layout.
617 Set indentation of the first music system to zero. This option affects
618 LilyPond, not the text layout. Since no indentation is the default,
619 @code{noindent} is redundant normally.
622 Reduce line length of a music snippet by @math{2*0.4}@dmn{in} and put
623 the output into a quotation block. The value @q{0.4@dmn{in}} can be
624 controlled with the @code{exampleindent} option.
627 Set the amount by which the @code{quote} option indents a music snippet.
630 @itemx relative=@var{n}
631 Use relative octave mode. By default, notes are specified relative to
632 middle@tie{}C. The optional integer argument specifies the octave of
633 the starting note, where the default @code{1} is middle C.
634 @code{relative} option only works when @code{fragment} option is set,
635 so @code{fragment} is automatically implied by @code{relative},
636 regardless of the presence of any @code{(no)fragment} option in the
640 LilyPond also uses @command{lilypond-book} to produce its own
641 documentation. To do that, some more obscure music fragment options are
646 The argument of a LilyPond command is copied to the output file and
647 enclosed in a verbatim block, followed by any text given with the
648 @code{intertext} option (not implemented yet); then the actual music is
649 displayed. This option does not work well with @code{\lilypond@{@}} if
650 it is part of a paragraph.
652 If @code{verbatim} is used in a @code{lilypondfile} command, it is
653 possible to enclose verbatim only a part of the source file. If the
654 source file contain a comment containing @samp{begin verbatim} (without
655 quotes), quoting the source in the verbatim block will start after the
656 last occurrence of such a comment; similarly, quoting the source verbatim
657 will stop just before the first occurrence of a comment containing
658 @samp{end verbatim}, if there is any. In the following source file
659 example, the music will be interpreted in relative mode, but the
660 verbatim quote will not show the @code{relative} block, i.e.
663 \relative c' @{ % begin verbatim
670 will be printed with a verbatim block like
678 If you would like to translate comments and variable names in verbatim
679 output but not in the sources, you may set the environment variable
680 @code{LYDOC_LOCALEDIR} to a directory path; the directory should
681 contain a tree of @file{.mo} message catalogs with @code{lilypond-doc}
685 (Only for Texinfo output.) Prepend line @code{\version
686 @@w@{"@@version@{@}"@}} to @code{verbatim} output.
689 (Only for Texinfo output.) If @command{lilypond} is called with the
690 @option{--header=@/texidoc} option, and the file to be processed is
691 called @file{foo@/.ly}, it creates a file @file{foo@/.texidoc} if there
692 is a @code{texidoc} field in the @code{\header}. The @code{texidoc}
693 option makes @command{lilypond-book} include such files, adding its
694 contents as a documentation block right before the music snippet.
696 Assuming the file @file{foo@/.ly} contains
700 texidoc = "This file demonstrates a single note."
706 and we have this in our Texinfo document @file{test.texinfo}
709 @@lilypondfile[texidoc]@{foo.ly@}
713 the following command line gives the expected result
716 lilypond-book --pdf --process="lilypond \
717 -dbackend=eps --header=texidoc" test.texinfo
720 Most LilyPond test documents (in the @file{input} directory of the
721 distribution) are small @file{.ly} files which look exactly like this.
723 For localization purpose, if the Texinfo document contains
724 @code{@@documentlanguage @var{LANG}} and @file{foo@/.ly} header
725 contains a @code{texidoc@var{LANG}} field, and if @command{lilypond}
726 is called with @option{--header=@/texidoc@var{LANG}}, then
727 @file{foo@/.texidoc@var{LANG}} will be included instead of
728 @file{foo@/.texidoc}.
731 (Only for Texinfo output.) This option is similar to quote, but only
732 the music snippet (and the optional verbatim block implied by
733 @code{verbatim} option) is put into a quotation block. This option is
734 useful if you want to @code{quote} the music snippet but not the
735 @code{texidoc} documentation block.
738 (Only for Texinfo output.) This option works similarly to
739 @code{texidoc} option: if @command{lilypond} is called with the
740 @option{--header=@/doctitle} option, and the file to be processed is
741 called @file{foo@/.ly} and contains a @code{doctitle} field in the
742 @code{\header}, it creates a file @file{foo@/.doctitle}. When
743 @code{doctitle} option is used, the contents of @file{foo@/.doctitle},
744 which should be a single line of @var{text}, is inserted in the
745 Texinfo document as @code{@@lydoctitle @var{text}}.
746 @code{@@lydoctitle} should be a macro defined in the Texinfo document.
747 The same remark about @code{texidoc} processing with localized
748 languages also applies to @code{doctitle}.
751 (Only for Texinfo output.) Do not translate comments and variable
752 names in the snippet quoted verbatim.
755 If a LilyPond input file is included with @code{\lilypondfile}, print
756 the file name right before the music snippet. For HTML output, this
757 is a link. Only the base name of the file is printed, i.e. the
758 directory part of the file path is stripped.
761 This option includes fonts in all of the generated EPS-files for this
762 snippet. This should be used if the snippet uses any font that @LaTeX{}
763 cannot find on its own.
768 @node Invoking lilypond-book
769 @section Invoking @command{lilypond-book}
771 @command{lilypond-book} produces a file with one of the following
772 extensions: @file{.tex}, @file{.texi}, @file{.html} or @file{.xml},
773 depending on the output format. All of @file{.tex}, @file{.texi} and
774 @file{.xml} files need further processing.
776 @subheading Format-specific instructions
778 @subsubheading @LaTeX{}
780 There are two ways of processing your @LaTeX{} document for printing or
781 publishing: getting a PDF file directly with PDF@LaTeX{}, or getting a
782 PostScript file with @LaTeX{} via a DVI to PostScript translator like
783 @command{dvips}. The first way is simpler and recommended@footnote{Note
784 that PDF@LaTeX{} and @LaTeX{} may not be both usable to compile any
785 @LaTeX{} document, that is why we explain the two ways.}, and whichever
786 way you use, you can easily convert between PostScript and PDF with
787 tools, like @command{ps2pdf} and @command{pdf2ps} included in
790 To produce a PDF file through PDF@LaTeX{}, use
793 lilypond-book --pdf yourfile.pdftex
794 pdflatex yourfile.tex
797 @cindex outline fonts
800 @cindex invoking dvips
801 To produce PDF output via @LaTeX{}/@command{dvips}/@command{ps2pdf}, you
805 lilypond-book yourfile.lytex
807 dvips -Ppdf yourfile.dvi
812 The @file{.dvi} file created by this process will not contain
813 note heads. This is normal; if you follow the instructions, they
814 will be included in the @file{.ps} and @file{.pdf} files.
816 Running @command{dvips} may produce some warnings about fonts; these
817 are harmless and may be ignored. If you are running @command{latex} in
818 twocolumn mode, remember to add @code{-t landscape} to the
819 @command{dvips} options.
821 @subsubheading Texinfo
823 To produce a Texinfo document (in any output format), follow the normal
824 procedures for Texinfo; this is, either call @command{texi2pdf} or
825 @command{texi2dvi} or @command{makeinfo}, depending on the output format
828 @xref{Format with texi2dvi, , , texinfo, GNU Texinfo}, and @ref{Creating
829 an Info File, , , texinfo, GNU Texinfo}.
832 See the documentation of Texinfo for further details.
836 @subheading Command line options
838 @command{lilypond-book} accepts the following command line options:
841 @item -f @var{format}
842 @itemx --format=@var{format}
843 Specify the document type to process: @code{html}, @code{latex},
844 @code{texi} (the default) or @code{docbook}. If this option is missing,
845 @command{lilypond-book} tries to detect the format automatically, see
846 @ref{Filename extensions}. Currently, @code{texi} is the same as
849 @c This complicated detail is not implemented, comment it out -jm
851 The @code{texi} document type produces a Texinfo file with music
852 fragments in the printed output only. For getting images in the HTML
853 version, the format @code{texi-html} must be used instead.
856 @item -F @var{filter}
857 @itemx --filter=@var{filter}
858 Pipe snippets through @var{filter}. @code{lilypond-book} will
859 not --filter and --process at the same time. For example,
862 lilypond-book --filter='convert-ly --from=2.0.0 -' my-book.tely
867 Print a short help message.
870 @itemx --include=@var{dir}
871 Add @var{dir} to the include path. @command{lilypond-book} also looks
872 for already compiled snippets in the include path, and does not write
873 them back to the output directory, so in some cases it is necessary to
874 invoke further processing commands such as @command{makeinfo} or
875 @command{latex} with the same @code{-I @var{dir}} options.
878 @itemx --output=@var{dir}
879 Place generated files in directory @var{dir}. Running
880 @command{lilypond-book} generates lots of small files that LilyPond will
881 process. To avoid all that garbage in the source directory, use the
882 @option{--output} command line option, and change to that directory
883 before running @command{latex} or @command{makeinfo}.
886 lilypond-book --output=out yourfile.lytex
891 @itemx --skip-lily-check
892 Do not fail if no lilypond output is found. It is used for LilyPond
893 Info documentation without images.
895 @itemx --skip-png-check
896 Do not fail if no PNG images are found for EPS files. It is used for
897 LilyPond Info documentation without images.
899 @itemx --lily-output-dir=@var{dir}
900 Write lily-XXX files to directory @var{dir}, link into @code{--output}
901 directory. Use this option to save building time for documents in
902 different directories which share a lot of identical snippets.
904 @itemx --info-images-dir=@var{dir}
905 Format Texinfo output so that Info will look for images of music in
908 @itemx --latex-program=@var{prog}
909 Run executable @command{prog} instead of @command{latex}. This is
910 useful if your document is processed with @command{xelatex}, for
913 @itemx --left-padding=@var{amount}
914 Pad EPS boxes by this much. @var{amount} is measured in millimeters,
915 and is 3.0 by default. This option should be used if the lines of
916 music stick out of the right margin.
918 The width of a tightly clipped system can vary, due to notation
919 elements that stick into the left margin, such as bar numbers and
920 instrument names. This option will shorten each line and move each
921 line to the right by the same amount.
924 @item -P @var{command}
925 @itemx --process=@var{command}
926 Process LilyPond snippets using @var{command}. The default command is
927 @code{lilypond}. @code{lilypond-book} will not @code{--filter} and
928 @code{--process} at the same time.
931 Create PDF files for use with PDF@LaTeX{}.
939 Print version information.
944 The Texinfo command @code{@@pagesizes} is not interpreted. Similarly,
945 @LaTeX{} commands that change margins and line widths after the preamble
948 Only the first @code{\score} of a LilyPond block is processed.
951 @node Filename extensions
952 @section Filename extensions
954 You can use any filename extension for the input file, but if you do not
955 use the recommended extension for a particular format you may need to
956 manually specify the output format; for details, see @ref{Invoking
957 lilypond-book}. Otherwise, @command{lilypond-book} automatically
958 selects the output format based on the input filename's extension.
961 @multitable @columnfractions .2 .5
962 @item @strong{extension} @tab @strong{output format}
964 @item @file{.html} @tab HTML
965 @item @file{.itely} @tab Texinfo
966 @item @file{.latex} @tab @LaTeX{}
967 @item @file{.lytex} @tab @LaTeX{}
968 @item @file{.lyxml} @tab DocBook
969 @item @file{.tely} @tab Texinfo
970 @item @file{.tex} @tab @LaTeX{}
971 @item @file{.texi} @tab Texinfo
972 @item @file{.texinfo} @tab Texinfo
973 @item @file{.xml} @tab HTML
977 If you use the same filename extension for the input file than the
978 extension @command{lilypond-book} uses for the output file, and if the
979 input file is in the same directory as @command{lilypond-book} working
980 directory, you must use @code{--output} option to make
981 @command{lilypond-book} running, otherwise it will exit with an error
982 message like @qq{Output would overwrite input file}.
985 @node Alternate methods of mixing text and music
986 @section Alternative methods of mixing text and music
988 This section shows methods to integrate text and music, different than
989 the automated method with @command{lilypond-book}.
992 * Many quotes from a large score::
993 * Inserting LilyPond output into OpenOffice.org::
994 * Inserting LilyPond output into other programs::
997 @node Many quotes from a large score
998 @unnumberedsubsec Many quotes from a large score
1000 If you need to quote many fragments from a large score, you can also use
1001 the clip systems feature, see @ruser{Extracting fragments of music}.
1004 @node Inserting LilyPond output into OpenOffice.org
1005 @unnumberedsubsec Inserting LilyPond output into OpenOffice.org
1007 @cindex OpenOffice.org
1009 LilyPond notation can be added to OpenOffice.org with
1010 @uref{http://@/ooolilypond@/.sourceforge@/.net@/,OOoLilyPond}.
1013 @node Inserting LilyPond output into other programs
1014 @unnumberedsubsec Inserting LilyPond output into other programs
1016 To insert LilyPond output in other programs, use @code{lilypond}
1017 instead of @code{lilypond-book}. Each example must be created
1018 individually and added to the document; consult the documentation for
1019 that program. Most programs will be able to insert LilyPond output in
1020 @file{PNG}, @file{EPS}, or @file{PDF} formats.
1022 To reduce the white space around your LilyPond score, use
1023 the following options
1031 bookTitleMarkup = ##f
1032 scoreTitleMarkup = ##f
1038 To produce a useful @file{EPS} file, use
1041 lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts myfile.ly
1044 lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts --png myfile.ly