1 @c -*- coding: utf-8; mode: texinfo; documentlanguage: ja -*-
2 @c This file is part of lilypond-program.tely
4 Translation of GIT committish: 499a511d4166feaada31114e097f86b5e0c56421
6 When revising a translation, copy the HEAD committish of the
7 version that you are working on. See TRANSLATION for details.
12 @c Translators: Yoshiki Sawada
13 @c Translation status: post-GDP
15 @c Note: keep this node named so that `info lilypond-book' brings you here.
17 @chapter @command{lilypond-book}: Integrating text and music
21 If you want to add pictures of music to a document, you can simply do it
22 the way you would do with other types of pictures. The pictures are
23 created separately, yielding PostScript output or PNG images, and those
24 are included into a @LaTeX{} or HTML document.
26 @command{lilypond-book} provides a way to automate this process: This
27 program extracts snippets of music from your document, runs
28 @command{lilypond} on them, and outputs the document with pictures
29 substituted for the music. The line width and font size definitions for
30 the music are adjusted to match the layout of your document.
32 This is a separate program from @command{lilypond} itself, and is run
33 on the command line; for more information, see @ref{Command-line
34 usage}. If you have MacOS 10.3 or 10.4 and you have trouble running
35 @code{lilypond-book}, see @ref{Setup for MacOS X}.
37 This procedure may be applied to @LaTeX{}, HTML, Texinfo or DocBook
46 @cindex documents, adding music to
47 @cindex HTML, music in
48 @cindex Texinfo, music in
49 @cindex DocBook, music in
50 @cindex @LaTeX{}, music in
53 * An example of a musicological document::
54 * Integrating music and text::
55 * Music fragment options::
56 * Invoking lilypond-book::
57 * Filename extensions::
58 * Alternate methods of mixing text and music::
62 @node An example of a musicological document
63 @section An example of a musicological document
68 Some texts contain music examples. These texts are musicological
69 treatises, songbooks, or manuals like this. Such texts can be made by
70 hand, simply by importing a PostScript figure into the word processor.
71 However, there is an automated procedure to reduce the amount of work
72 involved in HTML, @LaTeX{}, Texinfo and DocBook documents.
74 A script called @code{lilypond-book} will extract the music fragments,
75 format them, and put back the resulting notation. Here we show a small
76 example for use with @LaTeX{}. The example also contains explanatory
77 text, so we will not comment on it further.
83 \documentclass[a4paper]{article}
87 Documents for \verb+lilypond-book+ may freely mix music and text.
92 c2 g'2 \times 2/3 { f8 e d } c'2 g4
96 Options are put in brackets.
98 \begin[fragment,quote,staffsize=26,verbatim]{lilypond}
102 Larger examples can be put into a separate file, and introduced with
103 \verb+\lilypondfile+.
105 \lilypondfile[quote,noindent]{screech-boink.ly}
107 (If needed, replace screech-boink.ly by any .ly file you put in the same
108 directory as this file.)
114 @subheading Processing
116 Save the code above to a file called @file{lilybook.lytex}, then in a
119 @c keep space after @version{} so TeX doesn't choke
121 lilypond-book --output=out --pdf lilybook.lytex
122 @emph{lilypond-book (GNU LilyPond) @version{} }
123 @emph{Reading lilybook.lytex...}
124 @emph{..lots of stuff deleted..}
125 @emph{Compiling lilybook.tex...}
128 @emph{..lots of stuff deleted..}
130 @emph{(replace @command{xpdf} by your favorite PDF viewer)}
133 Running @command{lilypond-book} and @command{latex} creates a lot of
134 temporary files, which would clutter up the working directory. To
135 remedy this, use the @code{--output=@var{dir}} option. It will create
136 the files in a separate subdirectory @file{dir}.
138 Finally the result of the @LaTeX{} example shown above.@footnote{This
139 tutorial is processed with Texinfo, so the example gives slightly
140 different results in layout.} This finishes the tutorial section.
146 Documents for @command{lilypond-book} may freely mix music and text.
151 c2 g'2 \times 2/3 { f8 e d } c'2 g4
155 Options are put in brackets.
157 @lilypond[fragment,quote,staffsize=26,verbatim]
161 Larger examples can be put into a separate file, and introduced with
162 @code{\lilypondfile}.
164 @lilypondfile[quote,noindent]{screech-boink.ly}
169 @node Integrating music and text
170 @section Integrating music and text
174 Here we explain how to integrate LilyPond with various output formats.
188 @LaTeX{} is the de-facto standard for publishing layouts in the exact
189 sciences. It is built on top of the @TeX{} typesetting engine,
190 providing the best typography available anywhere.
193 @uref{http://@/www@/.ctan@/.org/@/tex@/-archive/@/info/@/lshort/@/english/,
194 @emph{The Not So Short Introduction to @LaTeX{}}} for an overview on how
197 Music is entered using
200 \begin[options,go,here]@{lilypond@}
209 \lilypondfile[options,go,here]@{@var{filename}@}
216 \lilypond@{ YOUR LILYPOND CODE @}
219 Additionally, @code{\lilypondversion} displays the current version
221 Running @command{lilypond-book} yields a file that can be further
222 processed with @LaTeX{}.
224 We show some examples here. The @code{lilypond} environment
227 \begin[quote,fragment,staffsize=26]@{lilypond@}
235 @lilypond[quote,fragment,staffsize=26]
242 \lilypond[quote,fragment,staffsize=11]@{<c' e' g'>@}
248 @lilypond[quote,fragment,staffsize=11]{<c' e' g'>}
251 Currently, you cannot include @code{@{} or @code{@}} within
252 @code{\lilypond@{@}}, so this command is only useful with the
253 @code{fragment} option.
255 The default line width of the music will be adjusted by examining the
256 commands in the document preamble, the part of the document before
257 @code{\begin@{document@}}. The @command{lilypond-book} command sends
258 these to @LaTeX{} to find out how wide the text is. The line width for
259 the music fragments is then adjusted to the text width. Note that this
260 heuristic algorithm can fail easily; in such cases it is necessary to
261 use the @code{line-width} music fragment option.
263 @cindex titling and lilypond-book
264 @cindex \header in @LaTeX{} documents
266 Each snippet will call the following macros if they have been defined by
270 @item @code{\preLilyPondExample} called before the music,
272 @item @code{\postLilyPondExample} called after the music,
274 @item @code{\betweenLilyPondSystem[1]} is called between systems if
275 @code{lilypond-book} has split the snippet into several PostScript
276 files. It must be defined as taking one parameter and will be
277 passed the number of files already included in this snippet.
278 The default is to simply insert a @code{\linebreak}.
284 @cindex Latex, feta symbols
287 To include feta symbols (such as flat, segno, etc) in a LaTeX
288 document, use @code{\input@{titledefs@}}
291 \documentclass[a4paper]@{article@}
302 The font symbol names are defined in the file feta20.tex; to find
303 the location of this file, use the command
313 Sometimes it is useful to display music elements (such as ties and slurs)
314 as if they continued after the end of the fragment. This can be done by
315 breaking the staff and suppressing inclusion of the rest of the LilyPond
318 In @LaTeX{}, define @code{\betweenLilyPondSystem} in such a way that
319 inclusion of other systems is terminated once the required number of
320 systems are included. Since @code{\betweenLilyPondSystem} is first
321 called @emph{after} the first system, including only the first system
325 \def\betweenLilyPondSystem#1@{\endinput@}
327 \begin[fragment]@{lilypond@}
328 c'1\( e'( c'~ \break c' d) e f\)
332 If a greater number of systems is requested, a @TeX{} conditional must
333 be used before the @code{\endinput}. In this example, replace @q{2} by
334 the number of systems you want in the output,
337 \def\betweenLilyPondSystem#1@{
338 \ifnum##1<2\else\endinput\fi
342 Remember that the definition of @code{\betweenLilyPondSystem} is
343 effective until @TeX{} quits the current group (such as the @LaTeX{}
344 environment) or is overridden by another definition (which is, in
345 most cases, for the rest of the document). To reset your
349 \let\betweenLilyPondSystem\undefined
353 in your @LaTeX{} source.
355 This may be simplified by defining a @TeX{} macro
358 \def\onlyFirstNSystems#1@{
359 \def\betweenLilyPondSystem##1@{\ifnum##1<#1\else\endinput\fi@}
364 and then saying only how many systems you want before each fragment,
367 \onlyFirstNSystems@{3@}
368 \begin@{lilypond@}...\end@{lilypond@}
369 \onlyFirstNSystems@{1@}
370 \begin@{lilypond@}...\end@{lilypond@}
375 There are specific @command{lilypond-book} command line options and
376 other details to know when processing @LaTeX{} documents, see
377 @ref{Invoking lilypond-book}.
385 Texinfo is the standard format for documentation of the GNU project. An
386 example of a Texinfo document is this manual. The HTML, PDF, and Info
387 versions of the manual are made from the Texinfo document.
389 In the input file, music is specified with
392 @@lilypond[options,go,here]
401 @@lilypond[options,go,here]@{ YOUR LILYPOND CODE @}
408 @@lilypondfile[options,go,here]@{@var{filename}@}
411 Additionally, @code{@@lilypondversion} displays the current version
414 When @command{lilypond-book} is run on it, this results in a Texinfo
415 file (with extension @file{.texi}) containing @code{@@image} tags for
416 HTML, Info and printed output. @command{lilypond-book} generates images
417 of the music in EPS and PDF formats for use in the printed output, and
418 in PNG format for use in HTML and Info output.
420 We show two simple examples here. A @code{lilypond} environment
438 @@lilypond[fragment,staffsize=11]@{<c' e' g'>@}
444 @lilypond[fragment,staffsize=11]{<c' e' g'>}
446 Contrary to @LaTeX{}, @code{@@lilypond@{...@}} does not generate an
447 in-line image. It always gets a paragraph of its own.
455 Music is entered using
458 <lilypond fragment relative=2>
459 \key c \minor c4 es g2
463 @command{lilypond-book} then produces an HTML file with appropriate image
464 tags for the music fragments:
466 @lilypond[fragment,relative=2]
467 \key c \minor c4 es g2
470 For inline pictures, use @code{<lilypond ... />}, where the options
471 are separated by a colon from the music, for example
474 Some music in <lilypond relative=2: a b c/> a line of text.
478 To include separate files, say
481 <lilypondfile @var{option1} @var{option2} ...>@var{filename}</lilypondfile>
484 Additionally, @code{<lilypondversion/>} displays the current version
488 @cindex titling in HTML
489 @cindex preview image
497 For inserting LilyPond snippets it is good to keep the conformity of our
498 DocBook document, thus allowing us to use DocBook editors, validation
499 etc. So we don't use custom tags, only specify a convention based on the
500 standard DocBook elements.
502 @subheading Common conventions
504 For inserting all type of snippets we use the @code{mediaobject} and
505 @code{inlinemediaobject} element, so our snippets can be formatted
506 inline or not inline. The snippet formatting options are always
507 provided in the @code{role} property of the innermost element (see in
508 next sections). Tags are chosen to allow DocBook editors format the
509 content gracefully. The DocBook files to be processed with
510 @command{lilypond-book} should have the extension @file{.lyxml}.
512 @subheading Including a LilyPond file
514 This is the most simple case. We must use the @file{.ly} extension for
515 the included file, and insert it as a standard @code{imageobject}, with
516 the following structure:
521 <imagedata fileref="music1.ly" role="printfilename" />
526 Note that you can use @code{mediaobject} or @code{inlinemediaobject}
527 as the outermost element as you wish.
529 @subheading Including LilyPond code
531 Including LilyPond code is possible by using a @code{programlisting},
532 where the language is set to @code{lilypond} with the following
538 <programlisting language="lilypond" role="fragment verbatim staffsize=16 ragged-right relative=2">
539 \context Staff \with @{
540 \remove Time_signature_engraver
541 \remove Clef_engraver@}
548 As you can see, the outermost element is a @code{mediaobject} or
549 @code{inlinemediaobject}, and there is a @code{textobject} containing
550 the @code{programlisting} inside.
552 @subheading Processing the DocBook document
554 Running @command{lilypond-book} on our @file{.lyxml} file will create a
555 valid DocBook document to be further processed with @file{.xml}
556 extension. If you use
557 @uref{http://@/dblatex@/.sourceforge@/.net@/,dblatex}, it will create a
558 PDF file from this document automatically. For HTML (HTML Help,
559 JavaHelp etc.) generation you can use the official DocBook XSL
560 stylesheets, however, it is possible that you have to make some
561 customization for it.
564 @node Music fragment options
565 @section Music fragment options
569 In the following, a @q{LilyPond command} refers to any command described
570 in the previous sections which is handled by @command{lilypond-book} to
571 produce a music snippet. For simplicity, LilyPond commands are only
572 shown in @LaTeX{} syntax.
574 Note that the option string is parsed from left to right; if an option
575 occurs multiple times, the last one is taken.
577 The following options are available for LilyPond commands:
580 @item staffsize=@var{ht}
581 Set staff size to @var{ht}, which is measured in points.
584 Produce ragged-right lines with natural spacing, i.e.,
585 @code{ragged-right = ##t} is added to the LilyPond snippet. This is the
586 default for the @code{\lilypond@{@}} command if no @code{line-width}
587 option is present. It is also the default for the @code{lilypond}
588 environment if the @code{fragment} option is set, and no line width is
589 explicitly specified.
592 For single-line snippets, allow the staff length to be stretched to
593 equal that of the line width, i.e., @code{ragged-right = ##f} is
594 added to the LilyPond snippet.
597 @itemx line-width=@var{size}\@var{unit}
598 Set line width to @var{size}, using @var{unit} as units. @var{unit} is
599 one of the following strings: @code{cm}, @code{mm}, @code{in}, or
600 @code{pt}. This option affects LilyPond output (this is, the staff
601 length of the music snippet), not the text layout.
603 If used without an argument, set line width to a default value (as
604 computed with a heuristic algorithm).
606 If no @code{line-width} option is given, @command{lilypond-book} tries to
607 guess a default for @code{lilypond} environments which don't use the
608 @code{ragged-right} option.
611 Do not print the time signature, and turns off the timing (time signature,
612 bar lines) in the score.
615 Make @command{lilypond-book} add some boilerplate code so that you can
623 without @code{\layout}, @code{\score}, etc.
626 Do not add additional code to complete LilyPond code in music snippets.
627 Since this is the default, @code{nofragment} is redundant normally.
629 @item indent=@var{size}\@var{unit}
630 Set indentation of the first music system to @var{size}, using
631 @var{unit} as units. @var{unit} is one of the following strings:
632 @code{cm}, @code{mm}, @code{in}, or @code{pt}. This option affects
633 LilyPond, not the text layout.
636 Set indentation of the first music system to zero. This option affects
637 LilyPond, not the text layout. Since no indentation is the default,
638 @code{noindent} is redundant normally.
641 Reduce line length of a music snippet by @math{2*0.4}@dmn{in} and put
642 the output into a quotation block. The value @q{0.4@dmn{in}} can be
643 controlled with the @code{exampleindent} option.
646 Set the amount by which the @code{quote} option indents a music snippet.
649 @itemx relative=@var{n}
650 Use relative octave mode. By default, notes are specified relative to
651 middle@tie{}C. The optional integer argument specifies the octave of
652 the starting note, where the default @code{1} is middle C.
653 @code{relative} option only works when @code{fragment} option is set,
654 so @code{fragment} is automatically implied by @code{relative},
655 regardless of the presence of any @code{(no)fragment} option in the
659 LilyPond also uses @command{lilypond-book} to produce its own
660 documentation. To do that, some more obscure music fragment options are
665 The argument of a LilyPond command is copied to the output file and
666 enclosed in a verbatim block, followed by any text given with the
667 @code{intertext} option (not implemented yet); then the actual music is
668 displayed. This option does not work well with @code{\lilypond@{@}} if
669 it is part of a paragraph.
671 If @code{verbatim} is used in a @code{lilypondfile} command, it is
672 possible to enclose verbatim only a part of the source file. If the
673 source file contain a comment containing @samp{begin verbatim} (without
674 quotes), quoting the source in the verbatim block will start after the
675 last occurrence of such a comment; similarly, quoting the source verbatim
676 will stop just before the first occurrence of a comment containing
677 @samp{end verbatim}, if there is any. In the following source file
678 example, the music will be interpreted in relative mode, but the
679 verbatim quote will not show the @code{relative} block, i.e.
682 \relative c' @{ % begin verbatim
689 will be printed with a verbatim block like
697 If you would like to translate comments and variable names in verbatim
698 output but not in the sources, you may set the environment variable
699 @code{LYDOC_LOCALEDIR} to a directory path; the directory should
700 contain a tree of @file{.mo} message catalogs with @code{lilypond-doc}
704 (Only for Texinfo output.) Prepend line @code{\version
705 @@w@{"@@version@{@}"@}} to @code{verbatim} output.
708 (Only for Texinfo output.) If @command{lilypond} is called with the
709 @option{--header=@/texidoc} option, and the file to be processed is
710 called @file{foo@/.ly}, it creates a file @file{foo@/.texidoc} if there
711 is a @code{texidoc} field in the @code{\header}. The @code{texidoc}
712 option makes @command{lilypond-book} include such files, adding its
713 contents as a documentation block right before the music snippet.
715 Assuming the file @file{foo@/.ly} contains
719 texidoc = "This file demonstrates a single note."
725 and we have this in our Texinfo document @file{test.texinfo}
728 @@lilypondfile[texidoc]@{foo.ly@}
732 the following command line gives the expected result
735 lilypond-book --pdf --process="lilypond \
736 -dbackend=eps --header=texidoc" test.texinfo
739 Most LilyPond test documents (in the @file{input} directory of the
740 distribution) are small @file{.ly} files which look exactly like this.
742 For localization purpose, if the Texinfo document contains
743 @code{@@documentlanguage @var{LANG}} and @file{foo@/.ly} header
744 contains a @code{texidoc@var{LANG}} field, and if @command{lilypond}
745 is called with @option{--header=@/texidoc@var{LANG}}, then
746 @file{foo@/.texidoc@var{LANG}} will be included instead of
747 @file{foo@/.texidoc}.
750 (Only for Texinfo output.) This option is similar to quote, but only
751 the music snippet (and the optional verbatim block implied by
752 @code{verbatim} option) is put into a quotation block. This option is
753 useful if you want to @code{quote} the music snippet but not the
754 @code{texidoc} documentation block.
757 (Only for Texinfo output.) This option works similarly to
758 @code{texidoc} option: if @command{lilypond} is called with the
759 @option{--header=@/doctitle} option, and the file to be processed is
760 called @file{foo@/.ly} and contains a @code{doctitle} field in the
761 @code{\header}, it creates a file @file{foo@/.doctitle}. When
762 @code{doctitle} option is used, the contents of @file{foo@/.doctitle},
763 which should be a single line of @var{text}, is inserted in the
764 Texinfo document as @code{@@lydoctitle @var{text}}.
765 @code{@@lydoctitle} should be a macro defined in the Texinfo document.
766 The same remark about @code{texidoc} processing with localized
767 languages also applies to @code{doctitle}.
770 (Only for Texinfo output.) Do not translate comments and variable
771 names in the snippet quoted verbatim.
774 If a LilyPond input file is included with @code{\lilypondfile}, print
775 the file name right before the music snippet. For HTML output, this
776 is a link. Only the base name of the file is printed, i.e. the
777 directory part of the file path is stripped.
780 This option includes fonts in all of the generated EPS-files for this
781 snippet. This should be used if the snippet uses any font that @LaTeX{}
782 cannot find on its own.
787 @node Invoking lilypond-book
788 @section Invoking @command{lilypond-book}
792 @command{lilypond-book} produces a file with one of the following
793 extensions: @file{.tex}, @file{.texi}, @file{.html} or @file{.xml},
794 depending on the output format. All of @file{.tex}, @file{.texi} and
795 @file{.xml} files need further processing.
797 @subheading Format-specific instructions
799 @subsubheading @LaTeX{}
801 There are two ways of processing your @LaTeX{} document for printing or
802 publishing: getting a PDF file directly with PDF@LaTeX{}, or getting a
803 PostScript file with @LaTeX{} via a DVI to PostScript translator like
804 @command{dvips}. The first way is simpler and recommended@footnote{Note
805 that PDF@LaTeX{} and @LaTeX{} may not be both usable to compile any
806 @LaTeX{} document, that is why we explain the two ways.}, and whichever
807 way you use, you can easily convert between PostScript and PDF with
808 tools, like @command{ps2pdf} and @command{pdf2ps} included in
811 To produce a PDF file through PDF@LaTeX{}, use
814 lilypond-book --pdf yourfile.pdftex
815 pdflatex yourfile.tex
818 @cindex outline fonts
821 @cindex invoking dvips
822 To produce PDF output via @LaTeX{}/@command{dvips}/@command{ps2pdf}, you
826 lilypond-book yourfile.lytex
828 dvips -Ppdf yourfile.dvi
833 The @file{.dvi} file created by this process will not contain
834 note heads. This is normal; if you follow the instructions, they
835 will be included in the @file{.ps} and @file{.pdf} files.
837 Running @command{dvips} may produce some warnings about fonts; these
838 are harmless and may be ignored. If you are running @command{latex} in
839 twocolumn mode, remember to add @code{-t landscape} to the
840 @command{dvips} options.
842 @subsubheading Texinfo
844 To produce a Texinfo document (in any output format), follow the normal
845 procedures for Texinfo; this is, either call @command{texi2pdf} or
846 @command{texi2dvi} or @command{makeinfo}, depending on the output format
849 @xref{Format with texi2dvi, , , texinfo, GNU Texinfo}, and @ref{Creating
850 an Info File, , , texinfo, GNU Texinfo}.
853 See the documentation of Texinfo for further details.
857 @subheading Command line options
859 @command{lilypond-book} accepts the following command line options:
862 @item -f @var{format}
863 @itemx --format=@var{format}
864 Specify the document type to process: @code{html}, @code{latex},
865 @code{texi} (the default) or @code{docbook}. If this option is missing,
866 @command{lilypond-book} tries to detect the format automatically, see
867 @ref{Filename extensions}. Currently, @code{texi} is the same as
870 @c This complicated detail is not implemented, comment it out -jm
872 The @code{texi} document type produces a Texinfo file with music
873 fragments in the printed output only. For getting images in the HTML
874 version, the format @code{texi-html} must be used instead.
877 @item -F @var{filter}
878 @itemx --filter=@var{filter}
879 Pipe snippets through @var{filter}. @code{lilypond-book} will
880 not --filter and --process at the same time. For example,
883 lilypond-book --filter='convert-ly --from=2.0.0 -' my-book.tely
888 Print a short help message.
891 @itemx --include=@var{dir}
892 Add @var{dir} to the include path. @command{lilypond-book} also looks
893 for already compiled snippets in the include path, and does not write
894 them back to the output directory, so in some cases it is necessary to
895 invoke further processing commands such as @command{makeinfo} or
896 @command{latex} with the same @code{-I @var{dir}} options.
899 @itemx --output=@var{dir}
900 Place generated files in directory @var{dir}. Running
901 @command{lilypond-book} generates lots of small files that LilyPond will
902 process. To avoid all that garbage in the source directory, use the
903 @option{--output} command line option, and change to that directory
904 before running @command{latex} or @command{makeinfo}.
907 lilypond-book --output=out yourfile.lytex
912 @itemx --skip-lily-check
913 Do not fail if no lilypond output is found. It is used for LilyPond
914 Info documentation without images.
916 @itemx --skip-png-check
917 Do not fail if no PNG images are found for EPS files. It is used for
918 LilyPond Info documentation without images.
920 @itemx --lily-output-dir=@var{dir}
921 Write lily-XXX files to directory @var{dir}, link into @code{--output}
922 directory. Use this option to save building time for documents in
923 different directories which share a lot of identical snippets.
925 @itemx --info-images-dir=@var{dir}
926 Format Texinfo output so that Info will look for images of music in
929 @itemx --latex-program=@var{prog}
930 Run executable @command{prog} instead of @command{latex}. This is
931 useful if your document is processed with @command{xelatex}, for
934 @itemx --left-padding=@var{amount}
935 Pad EPS boxes by this much. @var{amount} is measured in millimeters,
936 and is 3.0 by default. This option should be used if the lines of
937 music stick out of the right margin.
939 The width of a tightly clipped system can vary, due to notation
940 elements that stick into the left margin, such as bar numbers and
941 instrument names. This option will shorten each line and move each
942 line to the right by the same amount.
945 @item -P @var{command}
946 @itemx --process=@var{command}
947 Process LilyPond snippets using @var{command}. The default command is
948 @code{lilypond}. @code{lilypond-book} will not @code{--filter} and
949 @code{--process} at the same time.
952 Create PDF files for use with PDF@LaTeX{}.
960 Print version information.
965 The Texinfo command @code{@@pagesizes} is not interpreted. Similarly,
966 @LaTeX{} commands that change margins and line widths after the preamble
969 Only the first @code{\score} of a LilyPond block is processed.
972 @node Filename extensions
973 @section Filename extensions
977 You can use any filename extension for the input file, but if you do not
978 use the recommended extension for a particular format you may need to
979 manually specify the output format; for details, see @ref{Invoking
980 lilypond-book}. Otherwise, @command{lilypond-book} automatically
981 selects the output format based on the input filename's extension.
984 @multitable @columnfractions .2 .5
985 @item @strong{extension} @tab @strong{output format}
987 @item @file{.html} @tab HTML
988 @item @file{.itely} @tab Texinfo
989 @item @file{.latex} @tab @LaTeX{}
990 @item @file{.lytex} @tab @LaTeX{}
991 @item @file{.lyxml} @tab DocBook
992 @item @file{.tely} @tab Texinfo
993 @item @file{.tex} @tab @LaTeX{}
994 @item @file{.texi} @tab Texinfo
995 @item @file{.texinfo} @tab Texinfo
996 @item @file{.xml} @tab HTML
1000 If you use the same filename extension for the input file than the
1001 extension @command{lilypond-book} uses for the output file, and if the
1002 input file is in the same directory as @command{lilypond-book} working
1003 directory, you must use @code{--output} option to make
1004 @command{lilypond-book} running, otherwise it will exit with an error
1005 message like @qq{Output would overwrite input file}.
1008 @node Alternate methods of mixing text and music
1009 @section Alternative methods of mixing text and music
1013 This section shows methods to integrate text and music, different than
1014 the automated method with @command{lilypond-book}.
1017 * Many quotes from a large score::
1018 * Inserting LilyPond output into OpenOffice.org::
1019 * Inserting LilyPond output into other programs::
1022 @node Many quotes from a large score
1023 @unnumberedsubsec Many quotes from a large score
1027 If you need to quote many fragments from a large score, you can also use
1028 the clip systems feature, see @ruser{Extracting fragments of music}.
1031 @node Inserting LilyPond output into OpenOffice.org
1032 @unnumberedsubsec Inserting LilyPond output into OpenOffice.org
1036 @cindex OpenOffice.org
1038 LilyPond notation can be added to OpenOffice.org with
1039 @uref{http://@/ooolilypond@/.sourceforge@/.net@/,OOoLilyPond}.
1042 @node Inserting LilyPond output into other programs
1043 @unnumberedsubsec Inserting LilyPond output into other programs
1047 To insert LilyPond output in other programs, use @code{lilypond}
1048 instead of @code{lilypond-book}. Each example must be created
1049 individually and added to the document; consult the documentation for
1050 that program. Most programs will be able to insert LilyPond output in
1051 @file{PNG}, @file{EPS}, or @file{PDF} formats.
1053 To reduce the white space around your LilyPond score, use
1054 the following options
1062 bookTitleMarkup = ##f
1063 scoreTitleMarkup = ##f
1069 To produce a useful @file{EPS} file, use
1072 lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts myfile.ly
1075 lilypond -dbackend=eps -dno-gs-load-fonts -dinclude-eps-fonts --png myfile.ly