From a46161781c8da914e9f63bd91178615782f030e0 Mon Sep 17 00:00:00 2001 From: janneke Date: Fri, 26 Jul 2002 10:38:06 +0000 Subject: [PATCH] * Documentation/user/lilypond-book.itely (Insert music snippets into your texts using lilypond-book): Briefly mention HTML documents. Started rewrite, but lost inspiration. --- ChangeLog | 4 + Documentation/user/lilypond-book.itely | 156 ++++++++++++++++++------- Documentation/user/lilypond.tely | 13 +-- Documentation/user/refman.itely | 2 +- Documentation/user/tutorial.itely | 8 +- 5 files changed, 129 insertions(+), 54 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8374f5c131..aa458bc0fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2002-07-26 Jan Nieuwenhuizen + * Documentation/user/lilypond-book.itely (Insert music snippets + into your texts using lilypond-book): Briefly mention HTML + documents. Started rewrite, but lost inspiration. + * lily/grob-scheme.cc (get_original, get_system, get_broken_into): Move scheme funcs from grob.cc and spanner.cc. diff --git a/Documentation/user/lilypond-book.itely b/Documentation/user/lilypond-book.itely index 4b01fb20ad..0e39d98b46 100644 --- a/Documentation/user/lilypond-book.itely +++ b/Documentation/user/lilypond-book.itely @@ -1,9 +1,41 @@ @c -*-texinfo-*- -@node Merging text and music with lilypond-book -@chapter Merging text and music with lilypond-book +@ignore -@command{lilypond-book} runs Lilypond on fragments of lilypond in a +TODO: cleanup + +** AARGH.e We also have tutorial.itely: Integrating text and music. + + Could also do with a cleanup. Lost inspiration to fix this manual + where to describe what? + + + +@end ignore + +@c @node Merging text and music with lilypond-book +@c @chapter Merging text and music with lilypond-book + +@node Insert music snippets into your texts using lilypond-book +@chapter Insert music snippets into your texts using lilypond-book + +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. You write +LilyPond code, process it separately to embedded PostScript or +@code{png}, and include it as a picture into your La@TeX{} or +@code{html} source. + +@command{lilypond-book} provides you with an alternative and easier +way; it allows you to insert snippets of LilyPond code into your +La@TeX{}, @code{html} or @code{texi} document. @code{lilypond-book} +introduces some extra LilyPond specific constructs, that integrate +seamlessly with the rest of your source document. + + + + + +@command{lilypond-book} runs LilyPond on fragments of LilyPond in a La@TeX{} or Texinfo file, and includes the results into a document that can be processed with La@TeX{}, @command{makeinfo} or @command{texi2dvi}. The result is a text document containing formatted @@ -53,26 +85,15 @@ can make a HTML document with embedded music. @section Texinfo reference -You specify the lilypond code like this: +You specify the LilyPond code like this: @example @@lilypond[options, go, here] - YOUR LILYPOND CODE + YOUR LILYPOND CODE @@end lilypond @@lilypond[option, go, here]@{ YOUR LILYPOND CODE @} @@lilypondfile[options, go,here]@{@var{filename}@} @end example - -@command{lilypond-book} knows the default margins, and a few paper -sizes. One of these commands should be in the beginning of the document: -@itemize @bullet -@item @code{@@afourpaper} -@item @code{@@afourlatex} -@item @code{@@afourwide} -@item @code{@@smallbook} -@end itemize -@code{@@pagesizes} are not yet supported. - We show two simple examples here. First a complete block: @example @@lilypond[26pt] @@ -94,9 +115,19 @@ and its music: @lilypond[11pt]{} +@command{lilypond-book} knows the default margins, and a few paper +sizes. One of these commands should be in the beginning of the document: +@itemize @bullet +@item @code{@@afourpaper} +@item @code{@@afourlatex} +@item @code{@@afourwide} +@item @code{@@smallbook} +@end itemize +@code{@@pagesizes} are not yet supported. + @section La@TeX{} reference -You specify the lilypond code like this: +You specify the LilyPond code like this: @example \begin[option, go, here]@{lilypond@} YOUR LILYPOND CODE @@ -111,6 +142,30 @@ or \lilypond@{ YOUR LILYPOND CODE @} @end example +We show some examples here. + +@example +\begin[26pt]@{lilypond@} +c' d' e' f' g'2 g'2 +\end@{lilypond@} +@end example + +produces this music: + +@lilypond[26pt] +c' d' e' f' g'2 g'2 +@end lilypond + +Then the short version: +@example +\lilypond[11pt]@{@} +@end example + +and its music: + +@lilypond[11pt]{} + + You can use whatever commands you like in the document preamble, that is the part of the document before @code{\begin@{document@}}. @command{lilypond-book} will send it to La@TeX{} to find out how wide @@ -128,28 +183,44 @@ The music will be surrounded by @code{\preLilypondExample} and defined to nothing by default, and the user can redefine them to whatever he wants. -We show some examples here. -@example -\begin[26pt]@{lilypond@} -c' d' e' f' g'2 g'2 -\end@{lilypond@} -@end example +@section HTML reference -produces this music: +You specify the LilyPond code like this: -@lilypond[26pt] -c' d' e' f' g'2 g'2 +@quotation +@example + + \key c \minor r8 c16 b c8 g as c16 b c8 d | g,4 + +@end example +@end quotation + +produces + +@quotation +@verbatim + + \key c \minor r8 c16 b c8 g as c16 b c8 d | g,4 + +@end verbatim +@lilypond[relative1] + \key c \minor r8 c16 b c8 g as c16 b c8 d | g,4 @end lilypond +@end quotation -Then the short version: +Inline picture: + +@quotation @example -\lilypond[11pt]@{@} +Some music in a line of text. @end example +@end quotation -and its music: +@c Huh? ugh, can't show inline pictures in texinfo? + +@c Some music in @lilypond{a b c} a line of text. -@lilypond[11pt]{} @section Options @@ -163,7 +234,7 @@ La@TeX{} only. This enables you to place music examples in the running text (and not in a separate paragraph). To avoid that La@TeX{} places the music on a line of its own, there should be no empty lines between the normal text and -the lilypond environment. For inline music, you probably also need a +the LilyPond environment. For inline music, you probably also need a smaller music font size (eg. 11 pt or 13 pt) @@ -171,7 +242,7 @@ smaller music font size (eg. 11 pt or 13 pt) CONTENTS is copied into the source enclosed in a verbatim block, followed by any text given with the @code{intertext} option, then the actual music is displayed. This option does not work with - the short version of the lilypond blocks: + the short version of the LilyPond blocks: @code{ @@lilypond@{ CONTENTS @} } and @code{ \lilypond@{ CONTENTS @} } @@ -182,7 +253,7 @@ smaller music font size (eg. 11 pt or 13 pt) Used in conjunction with @code{verbatim} option: this puts @var{text} between the code and the music. @item filename="@var{filename}" - Save the lilypond code to @var{filename}. By default, a hash value + Save the LilyPond code to @var{filename}. By default, a hash value of the code is used. @item @code{11pt} @@ -229,7 +300,7 @@ of the code is used. @item fragment @item nofragment Override @command{lilypond-book} auto detection of what type of code is in the - lilypond block, voice contents or complete code. + LilyPond block, voice contents or complete code. @item indent=@var{size}@var{unit} Set first line indent to @var{size}, where @var{unit} = cm, mm, in or pt. @item noindent @@ -247,7 +318,7 @@ with @code{\lilypondfile}. @section Invocation When you run @command{lilypond-book} it will generate lots of small -files that Lilypond will process. So to avoid all the garbage in +files that LilyPond will process. So to avoid all the garbage in your source directory, you should either change to a temporary directory, or use the @code{--outdir} command line options: @@ -279,13 +350,14 @@ files, you should add the following to the top of your LaTeX lilypond-book accepts the following command-line options: @table @code @item @option{-f}, @option{--format=} - Specify the document type to process, @code{latex} or @code{texi}. - @command{lilypond-book} usually figure this out automatically. + Specify the document type to process: @code{html}, @code{latex} or +@code{texi} (default). @command{lilypond-book} usually figures this +out automatically. @item --default-music-fontsize=@var{sz}pt - Set the fontsize to use for lilypond if no fontsize is given + Set the fontsize to use for LilyPond if no fontsize is given as option. @item --force-music-fontsize=@var{sz}pt - Force all lilypond to use this fontsize, overriding options + Force all LilyPond to use this fontsize, overriding options given to @code{\begin@{lilypond@}} @item -I @var{DIR}, --include=@var{DIR} Add @var{DIR} to the include path. @@ -294,9 +366,9 @@ lilypond-book accepts the following command-line options: @item --dep-prefix=@code{PREF} prepend @code{PREF} before each @code{-M} dependency @item -n, --no-lily - don't run lilypond, but do generate the @code{.ly} files + don't run LilyPond, but do generate the @code{.ly} files @item --no-music - strip all lilypond blocks from the file. + strip all LilyPond blocks from the file. @item --no-pictures don't generate pictures when processing Texinfo. @item --read-lys @@ -325,7 +397,7 @@ lilypond-book accepts the following command-line options: The La@TeX{} \includeonly@{...@} command is ignored. -The Texinfo command @code{pagesize} is on the TODO list for Lilypond +The Texinfo command @code{pagesize} is on the TODO list for LilyPond 1.6, but changing the linewidth in other ways will not give you a straight right margin. diff --git a/Documentation/user/lilypond.tely b/Documentation/user/lilypond.tely index e14e543fbe..44fc09c7f3 100644 --- a/Documentation/user/lilypond.tely +++ b/Documentation/user/lilypond.tely @@ -74,18 +74,17 @@ this and other documentation. @menu * Preface:: Preface. * Introduction:: What, Why, How. -* Tutorial:: A tutorial introduction to -LilyPond. +* Tutorial:: A tutorial introduction to LilyPond. * Reference Manual:: Reference Manual. -* Advanced Topics:: How it all works. +* Advanced Topics:: How it all works. * Invoking LilyPond:: Operation. -* Converting from other formats:: Converting to lilypond source format. -* Merging text and music with lilypond-book:: +* Converting from other formats:: Converting to lilypond source format. +* Insert music snippets into your texts using lilypond-book:: The lilypond-book manual. * Literature:: Additional reading material. * Index:: Unified index. -* Refman appendix:: -* GNU Free Documentation License:: FDL. +* Refman appendix:: +* GNU Free Documentation License:: FDL. @end menu @end ifnottex diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 6d229f2cf5..c83c680dbc 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -451,7 +451,7 @@ readable. @cindex ghostscript If you view the result with Xdvi, then staff lines will show through -the letters. Printing the postscript file obtained with ly2dvi does +the letters. Printing the PostScript file obtained with ly2dvi does produce the correct result. diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index 52f5cdf3e1..2865536d39 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -2659,10 +2659,10 @@ However, there is a also an automated procedure: If you use HTML, La@TeX{} or texinfo, you can mix text and LilyPond code. A script called @code{lilypond-book} will extract the music fragments, run LilyPond on them, and put back the resulting notation. -This utility program is described fully in the chapter @ref{Merging text -and music with lilypond-book}. Here we show a small example. Since the -example also contains explanatory text, we won't comment on the -contents. +This utility program is described fully in the chapter @ref{Insert +music snippets into your texts using lilypond-book}. Here we show a +small example. Since the example also contains explanatory text, we +won't comment on the contents. @example \documentclass[a4paper]@{article@} -- 2.39.5