X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Documentation%2Fuser%2Flilypond-book.itely;h=f324d0e56729f0ee4d56e2941c7ff277e283724a;hb=f02e7db17cd0babaeb7978251ca5809e353ad29a;hp=d94fda2b8dfc4ad4df46c54d58abea14d14e4762;hpb=e84722c88277938476af9545e666a3728d9fa284;p=lilypond.git diff --git a/Documentation/user/lilypond-book.itely b/Documentation/user/lilypond-book.itely index d94fda2b8d..f324d0e567 100644 --- a/Documentation/user/lilypond-book.itely +++ b/Documentation/user/lilypond-book.itely @@ -6,9 +6,6 @@ @node lilypond-book @chapter lilypond-book -[ The tutorial part is at the moment commented out and moved to -the end of this document ] - [TODO: THIS MANUAL IS NOT FINISHED YET. FIXME.] @command{lilypond-book} is a script that helps integrating lilypond with @@ -226,11 +223,10 @@ careful, don't give the source file that ext, or the file will be overwritten. If you use @code{--outdir}, you should also @code{cd} to that directory -before running LaTeX or makeinfo. - -@strong{[UGH: IS THIS THE BEST WAY TO DO IT? MAYBE ADD A COMMENT LINE TO THE -GENERATED FILE, SO LILYPOND-BOOK CAN TEST IF THE FILE IT IS TO OVERWRITE -IS GENERATED.]} +before running LaTeX or makeinfo. This may seem a little kludgy, but +both Latex and makeinfo expect picture files (the music) to be in the +current working directory. Moreover, if you do this, LaTeX will not +clutter you normal working directory with output files. @strong{About the input} @@ -311,234 +307,3 @@ Ignores almost all La@TeX{} commands that changes margins and linewidths. @email{tca@@gnu.org, Tom Cato Amundsen} - - -@ignore - -So what does this look like? Well, here is an example: -@lilypond[veryverbatim, intertext="produces this music:"] -\score{ - \notes\relative c'{ - \time 5/8; - [e16( g b c a g][e a b d] | )e2 d,8 | - [e16( g b c a g][e a b d] | )b2 [a16( f] | - [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] | - [f( a b d b a][f a b d] | )e2 - } -} -@end lilypond -If you are lucky, the above example show a nice feature of LilyPond -and La@TeX{}. Since LilyPond can output the music as @TeX{} graphics, -La@TeX{} can insert pagebreaks between the lines of music. - -Notice that there is no @code{\paper} statement in the example -above. Lilypond-book will insert some code for you that defines the -linewidth and the font to use. If you don't want to change the default, -there is no need to put an empty @code{\paper@{@}} inside the @code{\score}. -In the example above, something like -this might be inserted before your code: -@example -\include "paper16.ly" -\paper@{ \paper_sixteen - linewidth = 390.\pt; - castingalgorithm = \Gourlay; -@} -@end example -The actual values for linewidth will differ depending on papersize and -number of columns. Also, if you use a different fontsize for the -music, another file than @code{paper16.ly} will be included. - -If you want to make the music not so wide, you can insert a -@code{\paper} statement that set the linewidth: - -@lilypond[veryverbatim, intertext="produces this music:"] -\score{ - \notes\relative c'{ - \time 5/8; - [e16( g b c a g][e a b d] | )e2 d,8 | - [e16( g b c a g][e a b d] | )b2 [a16( f] | - [e a b d] )e4 c8 | [es16( bes a as g es][d c b! )g] | - [f( a b d b a][f a b d] | )e2 - } - \paper{linewidth = 10.\cm;} -} -@end lilypond - -Very often, if you mix music and text, the music is often only a -few notes or at most a few bars. This music should be as short as -possible and not stretched to be aligned to the right margin. - -If you only write voice-contents in the lilypond block, @command{lilypond-book} -will set the @code{linewidth} variable to -1, so Lilypond -will make the music as short as possible but without breaking the -line. Here is a well know harmonic progression: -@lilypond[veryverbatim, intertext="produce a well known harmonic progression:"] - \context Voice { } -@end lilypond - -If you want to place music examples in the text, -@lilypond[eps] -\context Voice { } -@end lilypond -, you can use the @code{eps} option. This will create the music as -eps graphics and include it into the document with the -@code{\includegraphics} command. - -The code used look like this: -@example -@@lilypond[eps] - \context Voice { } -@@end lilypond -@end example - -You can also use the @code{eps} option if the block is a complete -lilypond source. This 5 cm long empty line, -@lilypond[eps] -\score{ - \notes{s} - \paper{ linewidth = 5.\cm;} -} -@end lilypond -was created with this code: -@example -@@lilypond[eps] -\score@{ - \notes@{s@} - \paper@{ linewidth = 5.\cm;@} -@} -@@end lilypond -@end example - -To avoid that La@TeX{} places the music on a line of its one, there should -be no empty lines between the normal text and the lilypond -environment. - -You can also use @code{lilypondfile} (on a separate line, FIXME), to -include another file. - -@section Fontsize options You can use all lilypond fontsizes in -@command{lilypond-book}. The default 16pt fontsize is probably to big to be -included in the middle of the text, 11pt or 13pt is probably better. - -The code can look like this: -@example -@@lilypond[13pt, eps] - -@@end lilypond -@end example - -The following options set the fontsize: -@itemize -@item @code{11pt} -@lilypond[11pt, eps] - \relative c'{ - r16 [c d e][f d e c] [g'8 c][b-\prall c] | - [d16 g, a b][c a b g][d'8 g f-\prall g] - } -@end lilypond -@item @code{13pt} -@lilypond[13pt, eps] - \relative c'{ - r16 [c d e][f d e c] [g'8 c][b-\prall c] | - [d16 g, a b][c a b g][d'8 g f-\prall g] - } -@end lilypond -@item @code{16pt} -@lilypond[16pt, eps] - \relative c'{ - r16 [c d e][f d e c] [g'8 c][b-\prall c] | - [d16 g, a b][c a b g][d'8 g f-\prall g] - } -@end lilypond -@item @code{20pt} -@lilypond[20pt, eps] - \relative c'{ - r16 [c d e][f d e c] [g'8 c][b-\prall c] | - [d16 g, a b][c a b g][d'8 g f-\prall g] - } -@end lilypond -@item @code{26pt} -@lilypond[26pt, eps] - \relative c'{ - r16 [c d e][f d e c] [g'8 c][b-\prall c] | - [d16 g, a b][c a b g][d'8 g f-\prall g] - } -@end lilypond -@end itemize - - -@section More options -@itemize -@item The @code{singleline} option set @code{linewidth} to -1.0. -@item The @code{multiline} option set @code{linewidth} to a value letting -the music be aligned to the right margin. The music can span several -lines. -@end itemize - -@section Just in case... -The options @code{fragment} and @code{nonfragment} will override -@command{lilypond-book} when it scans the lilypond code to see if it is voice -contents or complete code. This might be useful if @command{lilypond-book} choose -wrong. - -Since there is no finder's fee which doubles every year, there is no -need to wait for the price money to grow. So send a bug report today -if you need this one of these options. - -@section Examples - -This was all options to @code{\begin}. The rest of the lilypond -document will show some ways you can use lilypond in -La@TeX{} documents. It will also act as a simple test-suite for -lilypond-book. You can place @code{eps} lilypond in and marginspars just -as any other included eps graphics. - -@lilypond -\score{ - \notes\relative c'{ - \time 12/8; - r4-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--] - [f16-.( )f-. dis8-- gis16-.( )gis-.] cis4.-\fermata | - - r4.-\fermata [cis,16 cis g'8 f16 f b8][g16 g f8 b16 b] dis4.-\fermata - } - \paper{linewidth = 7.\cm;} -} -@end lilypond - - -To the right you can see some bars from the trumpet fanfara from the -beginning of the fantastic street opera ``Houdini the Great'', by the -Danish composer Andy Pape. The music is put inside a -@code{floatingfigure} environment, and the music will be aligned by -the right marging if you set floatingfigure width and lilypond linewidth -to the same value. The code looks like this: - -@lilypond[verbatim] -\score{ - \notes\relative c'{ - \time 12/8; - r4.-\fermata [b16-.( )b-.] [f'8-- dis16-.( )dis-. gis8--] - [f16-.( )f-. dis8-- gis16-.( )gis-.] cis8.-\fermata | - - r4.-\fermata [cis,16 cis g'8 f16 f b8] - [g16 g f8 b16 b] dis4.-\fermata - } - \paper{linewidth = 7.\cm;} -} -@end lilypond - -If you have a lot of small music examples like this in the middle of -your text, you might get a nicer look by using ``double'' line -spacing. Put the @code{\linespread@{1.6@}} command into the preamble of -your document. Then the line spacing will not be increased between the -lines where you have music printed with the smallest font size. - -Lilypond-book does know about @code{\onecolumn} and @code{\twocolumn}. -So the music will be adjusted to the new linewith: - -Verbatim environments will also ignore the page margins. That is -a feature of La@TeX{}. (But you usually put things inside a verbatim -environment when you don't want La@TeX{} to do any linebreaking) - -@end ignore