]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/lilypond-book.itely
(lilypond_version_re_str): handle
[lilypond.git] / Documentation / user / lilypond-book.itely
index a7e2148362a8ca0e277366f6fa52d4ceffbe85de..a10a8ebe7d4972125dae403d24660da233c15784 100644 (file)
@@ -12,8 +12,8 @@ TODO: cleanup
 @end ignore
 
 
-@node lilypond-book manual
-@chapter lilypond-book manual
+@node  Integrating text and music
+@chapter Integrating text and music
 
 If you want to add pictures of music to a document, you can simply do
 it the way you would do with other types of pictures.  The pictures
@@ -36,6 +36,7 @@ Short Introduction to LaTeX} provides a introduction to using La@TeX{}.
 
 
 @menu
+* An example of a musicological document::  
 * Integrating Texinfo and music::  
 * Integrating LaTeX and music::  
 * Integrating HTML and music::  
@@ -45,6 +46,109 @@ Short Introduction to LaTeX} provides a introduction to using La@TeX{}.
 
 
 
+
+@node An example of a musicological document
+@section  An example of a musicological document
+
+@cindex musicology
+@cindex La@TeX{}, music in
+@cindex HTML, music in
+@cindex Texinfo, music in
+Some texts contain music examples.  These texts are musicological
+treatises, songbooks or manuals like this.  Such texts can be made by
+hand, simply by importing a PostScript figure into the word processor.
+However, there is an automated procedure to reduce the amount of work
+involved HTML, La@TeX{}, and Texinfo documents.
+
+A script called @code{lilypond-book} will extract the music fragments,
+format them, and put back the resulting notation.  Here we show a
+small example for use with @LaTeX{}.  The example also contains explanatory text, so we will
+not comment on it further
+
+@verbatim
+\documentclass[a4paper]{article}
+\begin{document}
+
+Documents for lilypond-book may freely mix music and text.  For
+example,
+
+\begin{lilypond}
+\relative {
+  c2 g'2 \times 2/3 { f8 e d } c'2 g4
+}
+\end{lilypond}
+
+Options are put in brackets.
+
+\begin[fragment,quote,staffsize=26,verbatim]{lilypond}
+  c'4 f16
+\end{lilypond}
+
+Larger examples can be put in a separate file, and introduced with
+\verb+\lilypondfile+.
+
+\lilypondfile[quote,noindent]{screech-boink.ly}
+
+\end{document}
+@end verbatim
+
+Under Unix, you can view the results as follows
+
+@example
+cd input/tutorial
+mkdir -p out/
+lilypond-book --output=out/ lilybook.tex
+@emph{lilypond-book (GNU LilyPond) 2.3.11}
+@emph{Reading `input/tutorial/lilybook.tex'}
+@emph{..lots of stuff deleted..}
+@emph{Compiling `out//lilybook.tex'}
+cd out
+latex lilybook
+@emph{lots of stuff deleted}
+xdvi lilybook 
+@end example
+
+To convert the file into a nice PDF document, run the following
+commands
+
+@example
+dvips -Ppdf -u+lilypond -u+ec-mftrace lilybook
+ps2pdf lilybook.ps
+@end example
+
+Running lilypond-book and running latex creates a lot of temporary
+files, which would clutter up the working directory.  To remedy this,
+use the @code{--output=@var{dir}} option.  It will create the files in
+a separate subdirectory @file{dir}.
+
+Finally the result of the La@TeX{} example shown above.@footnote{ This
+tutorial is processed with Texinfo, so the example is as well.  This
+gives slightly different results in layout.}  This finishes the
+tutorial section.
+
+@page
+
+Documents for lilypond-book may freely mix music and text.  For
+example,
+
+@lilypond
+\relative c' {
+  c2 g'2 \times 2/3 { f8 e d } c'2 g4
+}
+@end lilypond
+
+Options are put in brackets.
+
+@lilypond[fragment,quote,staffsize=26,verbatim]
+c'4 f16
+@end lilypond
+
+Larger examples can be put in a separate file, and introduced with
+@code{\lilypondfile}.
+
+@lilypondfile[quote,noindent]{screech-boink.ly}
+
+
 @cindex texinfo
 @cindex latex
 @cindex texinfo
@@ -78,7 +182,7 @@ show two simple examples here.  First a complete block:
 @noindent
 produces
 
-@lilypond
+@lilypond[fragment]
   c' d' e' f' g'2 g'
 @end lilypond
 
@@ -91,7 +195,7 @@ Then the short version:
 @noindent
 produces
 
-@lilypond[staffsize=11]{ <c' e' g'> }
+@lilypond[fragment,staffsize=11]{ <c' e' g'> }
 
 When producing texinfo, lilypond-book also generates bitmaps of the
 music, so you can make a HTML document with embedded music.
@@ -135,7 +239,7 @@ We show some examples here:
 @noindent
 produces
 
-@lilypond[staffsize=26]
+@lilypond[fragment,staffsize=26]
   c' d' e' f' g'2 g'2
 @end lilypond
 
@@ -148,7 +252,7 @@ Then the short version:
 @noindent
 produces
 
-@lilypond[staffsize=11]{<c' e' g'>}
+@lilypond[fragment,staffsize=11]{<c' e' g'>}
 
 The linewidth of the music will be adjust by examining the commands in
 the document preamble, the part of the document before
@@ -165,16 +269,8 @@ and the
 are also interpreted.
 
 @cindex titling and lilypond-book
-@cindex lilypond-book and titling
 @cindex @code{\header} in La@TeX{} documents
 
-The titling from the @code{\header} section of the fragments can be
-imported by adding the following to the top of the La@TeX{} file:
-
-@example
-\input titledefs.tex
-\def\preLilyPondExample@{\def\mustmakelilypondtitle@{@}@}
-@end example
 
 The music will be surrounded by @code{\preLilyPondExample} and
 @code{\postLilyPondExample}, which are defined to be empty by default.
@@ -188,7 +284,7 @@ For printing the LaTeX document, you will need to use dvips. For
 producing PostScript with scalable fonts, add the following options to
 the dvips command line:
 @example
- -Ppdf -u +lilypond.map
+ -Ppdf -u+lilypond.map -u+ec-mftrace.map
 @end example 
 
 @noindent
@@ -227,12 +323,12 @@ of which lilypond-book will produce a HTML with appropriate image tags for the
 music fragments:
  
 @example
-<lilypond relative=1 verbatim>
+<lilypond relative=2 verbatim>
   \key c \minor r8 c16 b c8 g as c16 b c8 d | g,4
 </lilypond>
 @end example
 
-@lilypond[relative=1]
+@lilypond[fragment,relative=2]
   \key c \minor r8 c16 b c8 g as c16 b c8 d | g,4
 @end lilypond
 
@@ -327,7 +423,7 @@ documents are composed from small @file{.ly} files in this way:
   \header @{
     texidoc = "this file demonstrates a single note"
   @}
-  \score @{ \notes @{ c'4 @} @} 
+  @{ c'4 @}
 @end example
 
 @item relative, relative=@var{N}
@@ -387,7 +483,7 @@ Place generated files in @var{dir}.
 
 @item @option{-P @var{process}}, @option{--process=@var{COMMAND}}
 Process lilypond snippets using @var{command}.  The default command is
-@var{lilypond-bin}.
+@code{lilypond}.
 
 @item @option{--verbose}
 Be verbose.