]> git.lyx.org Git - lyx.git/blobdiff - lib/examples/lilypond.lyx
template files: remove all relative paths to re-eanable to use "new from template"
[lyx.git] / lib / examples / lilypond.lyx
index 0a1c37f579376f09fefa54a5850dc0c7be0d6c07..aa2f62dba74c538125006eca1c62fc3a3640dff4 100644 (file)
@@ -1,5 +1,5 @@
-#LyX 2.0 created this file. For more info see http://www.lyx.org/
-\lyxformat 413
+#LyX 2.1 created this file. For more info see http://www.lyx.org/
+\lyxformat 474
 \begin_document
 \begin_header
 \textclass article
@@ -12,16 +12,16 @@ lilypond
 \language_package default
 \inputencoding auto
 \fontencoding global
-\font_roman default
-\font_sans default
-\font_typewriter default
+\font_roman lmodern
+\font_sans lmss
+\font_typewriter lmtt
+\font_math auto
 \font_default_family default
 \use_non_tex_fonts false
 \font_sc false
 \font_osf false
 \font_sf_scale 100
 \font_tt_scale 100
-
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -31,7 +31,7 @@ lilypond
 \spacing single
 \use_hyperref true
 \pdf_title "LilyPond-book and LyX"
-\pdf_author "Your Name"
+\pdf_author "The LyX Team"
 \pdf_bookmarks true
 \pdf_bookmarksnumbered true
 \pdf_bookmarksopen true
@@ -41,17 +41,27 @@ lilypond
 \pdf_colorlinks true
 \pdf_backref false
 \pdf_pdfusetitle false
+\pdf_quoted_options "linkcolor=blue,urlcolor=blue,pdfstartview=XYZ"
 \papersize default
 \use_geometry true
-\use_amsmath 1
-\use_esint 1
-\use_mhchem 1
-\use_mathdots 1
+\use_package amsmath 1
+\use_package amssymb 1
+\use_package cancel 0
+\use_package esint 1
+\use_package mathdots 1
+\use_package mathtools 0
+\use_package mhchem 1
+\use_package stackrel 0
+\use_package stmaryrd 0
+\use_package undertilde 0
 \cite_engine basic
+\cite_engine_type default
+\biblio_style plain
 \use_bibtopic false
 \use_indices false
 \paperorientation portrait
 \suppress_date true
+\justification true
 \use_refstyle 0
 \index Index
 \shortcut idx
@@ -83,17 +93,11 @@ 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
+The LyX Team
 \end_layout
 
-\end_inset
-
-
+\begin_layout Date
+Version 2.1.x
 \end_layout
 
 \begin_layout Abstract
@@ -117,13 +121,13 @@ LilyPond is an open-source project that renders possible the creation of
 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
+ LilyPond-book is a 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
+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
@@ -173,8 +177,8 @@ Settings
  You can use any LaTeX-based LyX layout and use the regular preview and
  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.
+ LilyPond-book can also handle DocBook and HTML documents, but the integration
of these document types with LilyPond-book and LyX is missing at the moment.
 \end_layout
 
 \begin_layout Subsection
@@ -231,6 +235,20 @@ status open
 
 \begin_layout Plain Layout
 
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+staffsize=28
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Plain Layout
+
 
 \backslash
 relative c'' {
@@ -259,7 +277,11 @@ The previous LyX inset produces the following LaTeX-lookalike code:
 \begin_layout LyX-Code
 
 \backslash
-begin{lilypond}
+begin{lilypond}[staffsize=28]
+\end_layout
+
+\begin_layout LyX-Code
+
 \end_layout
 
 \begin_layout LyX-Code
@@ -283,8 +305,32 @@ end{lilypond}
 \end_layout
 
 \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 includes them in the LaTeX document
+What appear first inside square brackets are options to pass to LilyPond-book.
+ This is inserted in LyX from the 
+\family sans
+Insert
+\family default
+ menu, in the same way that the LilyPond inset itself is inserted.
+ Here, we set the dimension of the staff to 28
+\begin_inset space \thinspace{}
+\end_inset
+
+pt.
+ Other options can be added by separating them by a comma, for example:
+\family typewriter
+[staffsize=28,verbatim]
+\family default
+.
+ A list of music fragment options is available in the LilyPond documentation.
+ This whole block can be omitted when the default settings are desired.
+\end_layout
+
+\begin_layout Standard
+What follows after the options block is the textual representation in LilyPond
+ syntax of a musical fragment.
+ This code is not, in fact, processed by LaTeX, but is preprocessed by LilyPond-
+book, which creates the graphics files and includes them in the LaTeX document
  by replacing the above with a 
 \family typewriter
 
@@ -296,23 +342,34 @@ includegraphics{\SpecialChar \ldots{}
 \end_layout
 
 \begin_layout Standard
-Thus, the conversion path is as follow: 
+Thus, the conversion process is as follow: 
 \family sans
 LyX\SpecialChar \menuseparator
 LilyPond-book\SpecialChar \menuseparator
 LaTeX
 \family default
 .
+ LyX creates a .lytex file, LilyPond-book creates a .tex files and the accompanyin
+g image files, and LaTeX creates the final document.
  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,
+ musical extract inline, or in its own paragraph, centered, left-aligned,
  etc., what you see in the LyX window should be respected in the final format.
- An example of in-line use may be to display a chord name, such as
+ An example of inline use may be to display a chord name, such as
 \begin_inset Flex LilyPond
 status open
 
 \begin_layout Plain Layout
 
+\begin_inset Argument 1
+status open
+
+\begin_layout Plain Layout
+staffsize=12
+\end_layout
+
+\end_inset
 
 \backslash
 markup { 
 \backslash
@@ -572,12 +629,19 @@ score given
 
 \end_layout
 
+\begin_layout Standard
+Writing the notes directly within braces without using any LilyPond command
+ is convenient when writing short snippets.
+ Advanced users will probably want to enter their musical content using
+ LilyPond variables and commands, which is of course supported.
+\end_layout
+
 \begin_layout Subsubsection
 Fret diagrams
 \end_layout
 
 \begin_layout Standard
-Another gotcha is with subsequent lilypond snippets with 
+Another gotcha is with subsequent LilyPond snippets with 
 \family typewriter
 
 \backslash
@@ -633,6 +697,44 @@ end{lilypond}
 \begin_layout Standard
 For some reason LilyPond-book version 2.13 barks on this when run in safe
  mode (which you always should use, unless you know what you are doing).
+ This has been corrected as of version 2.15 (was LilyPond issue #1900).
+\end_layout
+
+\begin_layout Subsubsection
+The 
+\family typewriter
+
+\backslash
+lilypondfile
+\family default
+ command
+\end_layout
+
+\begin_layout Standard
+LilyPond-book supports including LilyPond code that resides in external
+ files with the 
+\family typewriter
+
+\backslash
+lilypondfile
+\family default
+ command.
+ With this command, the LilyPond code is processed as if it was typed inside
+ the document and the output score follows the typesetting determined by
+ LaTeX with respect to line width, page breaks, and so on.
+ This is in contrast to the long-standing LyX feature to include LilyPond
+ scores as external material, which calls LilyPond on the external file
+ to produce a rigid figure, and includes this figure in the document, leaving
+ the typesetting decisions to LilyPond.
+ Unfortunately, support for the 
+\family typewriter
+
+\backslash
+lilypondfile
+\family default
+ command in LyX is not implemented yet, but it is possible to use it inside
+ a TeX-Code block, provided that one writes the complete, absolute path
+ to the desired file.
 \end_layout
 
 \begin_layout Section
@@ -654,7 +756,7 @@ reference "sub:Editorial-headword"
 
 \end_inset
 
- shows a complex example using many LilyPond constructs; some scheme code
+ shows a complex score using many LilyPond constructs; some scheme code
  has been removed from the original source of this snippet, to be able to
  run in safe mode.
  Example