X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fexamples%2Flilypond.lyx;h=0a1c37f579376f09fefa54a5850dc0c7be0d6c07;hb=1094128fe1ef92d1f59abd8d5a66fb07134756be;hp=4b91ab9d72a083e079e6e5c4512a2a7a4fa0e810;hpb=cd8ddbc9ff3f279569b649bbdf8f2079f22b18b3;p=lyx.git diff --git a/lib/examples/lilypond.lyx b/lib/examples/lilypond.lyx index 4b91ab9d72..0a1c37f579 100644 --- a/lib/examples/lilypond.lyx +++ b/lib/examples/lilypond.lyx @@ -31,16 +31,16 @@ lilypond \spacing single \use_hyperref true \pdf_title "LilyPond-book and LyX" -\pdf_author "Julien Rioux" +\pdf_author "Your Name" \pdf_bookmarks true -\pdf_bookmarksnumbered false -\pdf_bookmarksopen false +\pdf_bookmarksnumbered true +\pdf_bookmarksopen true \pdf_bookmarksopenlevel 1 \pdf_breaklinks false \pdf_pdfborder false -\pdf_colorlinks false +\pdf_colorlinks true \pdf_backref false -\pdf_pdfusetitle true +\pdf_pdfusetitle false \papersize default \use_geometry true \use_amsmath 1 @@ -63,8 +63,8 @@ lilypond \bottommargin 2cm \secnumdepth 3 \tocdepth 3 -\paragraph_separation skip -\defskip smallskip +\paragraph_separation indent +\paragraph_indentation default \quotes_language english \papercolumns 1 \papersides 1 @@ -82,25 +82,97 @@ lilypond LilyPond-book and LyX \end_layout +\begin_layout Author +Fake Author +\begin_inset Note Note +status open + +\begin_layout Plain Layout +author of this example file: Julien Rioux +\end_layout + +\end_inset + + +\end_layout + \begin_layout Abstract -This is an example file demonstrating the inclusion of musical snippets - in a LyX document, using the LilyPond music notation and the LilyPond-book - utility for processing. +This document explains and demonstrates the inclusion of musical snippets + in a LyX document, using the LilyPond syntax for music notation and the + LilyPond-book utility for processing. +\end_layout + +\begin_layout Section +Introduction +\end_layout + +\begin_layout Standard +LilyPond is an open-source project that renders possible the creation of + beautiful computer-generated musical scores. + The project consists of a text-based music notation language, and a program + to process this notation into musical scores. +\end_layout + +\begin_layout Standard +While LilyPond itself supports the display of title, author information, + footnotes, endnotes, etc., its primary focus is on music typesetting. + For text typesetting, other programs are generally better suited. + LilyPond-book is an utility provided by the LilyPond project that helps + incorporate musical scores using the LilyPond notation into LaTeX documents, + among other formats. +\end_layout + +\begin_layout Standard +This document describes the use of the Lilypond music notation within LyX + documents that use a LaTeX-based layout, thus combining the beauty and + quality of the typesetting achieved by both LaTeX and LilyPond. + While a basic understanding of the LilyPond syntax for music notation is + in order, knowledge of LaTeX is not necessary when using LyX. +\end_layout + +\begin_layout Standard +Section +\begin_inset CommandInset ref +LatexCommand ref +reference "sec:Using-LilyPond-code" + +\end_inset + + explains the requirements, usage instructions, and shortcomings of LilyPond + music notation within LyX. + Section +\begin_inset CommandInset ref +LatexCommand ref +reference "sec:LilyPond-examples" + +\end_inset + + demonstrates the beauty and quality of the typesetting with a few examples. \end_layout \begin_layout Section Using LilyPond code within LyX +\begin_inset CommandInset label +LatexCommand label +name "sec:Using-LilyPond-code" + +\end_inset + + \end_layout \begin_layout Standard -Support for LilyPond constructs (LilyPond code) within LyX is enabled by - adding the LilyPond module to your document. - This is done from the menu Document \SpecialChar \menuseparator - Settings..., then selecting LilyPond - in the list of modules. +Support for LilyPond music notation (LilyPond code) within LyX is enabled + by adding the LilyPond module to your document. + This is done from the menu +\family sans +Document\SpecialChar \menuseparator +Settings +\family default +, then selecting LilyPond in the list of modules. You can use any LaTeX-based LyX layout and use the regular preview and - export mechanism; LyX will take care of processing the LaTeX code through - LilyPond-book for you. + export mechanism; LyX will take care of processing the mixed LaTeX/LilyPond + code through LilyPond-book for you. LilyPond-book can also handle DocBook documents but LilyPond-DocBook support in LyX is missing at the moment. \end_layout @@ -109,15 +181,12 @@ Support for LilyPond constructs (LilyPond code) within LyX is enabled by Requirements \end_layout -\begin_layout Itemize -LilyPond-book version 2.13 -\end_layout - -\begin_layout Paragraph -Notes: -\end_layout - \begin_layout Standard +LilyPond-book version 2.13 or newer. +\begin_inset Foot +status collapsed + +\begin_layout Plain Layout LilyPond-book supports LaTeX output since version 2.1. However, some features used by LyX are available only in recent versions: PDFLaTeX support (version 2.9), the @@ -131,17 +200,29 @@ LilyPond-book supports LaTeX output since version 2.1. flag (version 2.13). \end_layout +\end_inset + + +\end_layout + \begin_layout Subsection Integration \end_layout \begin_layout Standard -The module provides a LilyPond inset which you insert from the menu Insert - \SpecialChar \menuseparator - Custom Insets. +The module provides a LilyPond inset which you insert from the menu +\family sans +Insert\SpecialChar \menuseparator +Custom +\begin_inset space ~ +\end_inset + +Insets +\family default +. This inset is for typing the LilyPond code which will be typeset into your musical notes. - First, let's try a simple scale: + First, let us try a simple scale: \end_layout \begin_layout Standard @@ -171,6 +252,7 @@ relative c'' { \end_layout \begin_layout Standard +\noindent The previous LyX inset produces the following LaTeX-lookalike code: \end_layout @@ -202,21 +284,25 @@ end{lilypond} \begin_layout Standard This code is not, in fact, processed by LaTeX, but is preprocessed by LilyPond-b -ook, which creates the graphics files and include them in the LaTeX document - by replacing the above with +ook, which creates the graphics files and includes them in the LaTeX document + by replacing the above with a \family typewriter \backslash includegraphics{\SpecialChar \ldots{} } \family default -. + command. \end_layout \begin_layout Standard -Thus, the conversion path is as follow: LyX\SpecialChar \menuseparator +Thus, the conversion path is as follow: +\family sans +LyX\SpecialChar \menuseparator LilyPond-book\SpecialChar \menuseparator -LaTeX. +LaTeX +\family default +. Every step of the tool chain obeys your spacing, so whether you put the musical extract in line, or in its own paragraph, centered, left-aligned, etc., what you see in the LyX window should be respected in the final format. @@ -250,8 +336,12 @@ Previews It is possible to have a direct feedback of what the music notation looks like from within LyX. To do this, wrap a LilyPond inset inside a Preview inset, which you find - from the menu Insert \SpecialChar \menuseparator - Preview. + from the menu +\family sans +Insert\SpecialChar \menuseparator +Preview +\family default +. This only affects the display within LyX, not the output: \end_layout @@ -260,7 +350,7 @@ It is possible to have a direct feedback of what the music notation looks \begin_layout Standard \begin_inset Flex LilyPond -status open +status collapsed \begin_layout Plain Layout @@ -293,12 +383,19 @@ relative c'' { Unfortunately, you might find that the preview isn't exactly instantaneous. You need to move the cursor out of the Preview inset to start compilation, and processing time can take a few seconds. + Nevertheless, the direct feedback is often worthwhile during editing, and + renders the navigation through the document much easier. \end_layout \begin_layout Subsection Gotchas \end_layout +\begin_layout Standard +A few gotchas that have been experienced with the integration of LilyPond-book + and LyX are reported here. +\end_layout + \begin_layout Subsubsection Child documents \end_layout @@ -330,9 +427,17 @@ Include Type \begin_inset Quotes erd \end_inset - under Insert\SpecialChar \menuseparator + under +\family sans +Insert\SpecialChar \menuseparator File\SpecialChar \menuseparator -Child Document, you will get an error when producing output. +Child +\begin_inset space ~ +\end_inset + +Document +\family default +, you will get an error when producing output. This is due to the way LilyPond-book automatically processes these input files recursively. Since there is currently no command-line option to turn off this behavior @@ -376,8 +481,12 @@ usepackage{graphicx} \end_layout \begin_layout Standard -to your master document's preamble under Document\SpecialChar \menuseparator -Settings. +to your master document's preamble under +\family sans +Document\SpecialChar \menuseparator +Settings +\family default +. \end_layout \begin_layout Subsubsection @@ -444,7 +553,7 @@ With surrounding braces, all is well: \begin_layout Standard \begin_inset Flex LilyPond -status open +status collapsed \begin_layout Plain Layout @@ -528,6 +637,13 @@ For some reason LilyPond-book version 2.13 barks on this when run in safe \begin_layout Section LilyPond examples +\begin_inset CommandInset label +LatexCommand label +name "sec:LilyPond-examples" + +\end_inset + + \end_layout \begin_layout Standard @@ -1068,6 +1184,7 @@ staccato \end_layout \begin_layout Standard +\noindent [from \begin_inset Flex URL status collapsed @@ -1246,6 +1363,7 @@ lower } \end_layout \begin_layout Standard +\noindent [from \begin_inset Flex URL status collapsed