]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/changing-defaults.itely
* scripts/lilypond-book.py (compose_ly): bugfix for relative < 0.
[lilypond.git] / Documentation / user / changing-defaults.itely
index 3768abe1d612ddfe048607c8b050cd25b3c62932..336b4c9d23c290adbcc1e470932124012644df26 100644 (file)
@@ -2,11 +2,49 @@
 @node Changing defaults
 @chapter Changing defaults
 
-TODO: reorganise.
+
+The purpose of LilyPond's design is to provide the finest output
+quality as a default. Nevertheless, it may happen that you need to
+change that default layout.  The layout is controlled through a large
+number of proverbial ``knobs and switches.''  This chapter does not
+list each and every knob. Rather, it outlines what groups of controls
+are available, and how to tune them.
+
+Which controls are available for tuning is described in a separate
+document, the @internalsref{Program reference} manual. This manual
+lists all different variables, functions and options available in
+LilyPond. It is available as a HTML document, which is available
+@uref{http://lilypond.org/doc/Documentation/user/out-www/lilypond-internals/,on-line},
+but is also included with the LilyPond documentation package.
+
+There are X areas where the default settings may be changed:
+
+@itemize @bullet
+@item Output: changing the appearance of individual
+  objects. For example, changing stem directions, or the location of
+  subscripts.
+  
+@item Context: changing aspects of the translation from music events to
+  notation. For example, giving each staff a separate time signature. 
+  
+@item Global layout: changing the appearance of the spacing, line
+  breaks and page dimensions.
+@end itemize
+
+Then, there are separate systems for typesetting text (like
+@emph{ritardando}) and selecting different fonts. This chapter also
+discusses these.
+
+Internally, LilyPond uses Scheme (a LISP dialect) to provide
+infrastructure.  Overriding layout decisions in effect accesses the
+program internals, so it is necessary to learn a (very small) subset
+of Scheme. That is why this chapter starts with a short tutorial on
+entering numbers, lists, strings and symbols in Scheme.
+
 
 @menu
-* Scheme integration::          
-* Setting variables::           
+* Scheme tutorial::             
+* Context ::                    
 * Fine tuning layout::          
 * Tuning output::               
 * Text markup::                 
@@ -15,10 +53,8 @@ TODO: reorganise.
 * Output details::              
 @end menu
 
-
-
-@node Scheme integration
-@section Scheme integration
+@node Scheme tutorial
+@section Scheme tutorial
 
 @cindex Scheme
 @cindex GUILE
@@ -27,112 +63,606 @@ TODO: reorganise.
 @cindex evaluating Scheme
 @cindex LISP
 
-LilyPond internally uses GUILE, a Scheme-interpreter, to represent
-data throughout the whole program, and glue together different program
-modules. For advanced usage, it is sometimes necessary to access and
-program the Scheme interpreter.
+LilyPond uses the Scheme programming language, both as part of the
+input syntax, and as internal mechanism to glue together modules of
+the program. This section is a very brief overview of entering data in
+Scheme.@footnote{If you want to know more about Scheme, see
+@uref{http://www.schemers.org}.}
+
+The most basic thing of a language is data: numbers, character
+strings, lists, etc. Here is a list of data types that are relevant to
+LilyPond input.
+
+@table @asis
+@item Booleans
+  Boolean values are True or False. The Scheme for True is @code{#t}
+  and False is @code{#f}.
+@item Numbers
+  Numbers are entered in the standard fashion,
+  @code{1} is the (integer) number one, while @code{-1.5} is a
+  floating point number (a non-integer number). 
+@item Strings
+  Strings are enclosed in double quotes,
+  @example
+    "this is a string"
+  @end example
+
+  Strings may span several lines
+  @example
+    "this
+    is
+    a string"
+  @end example
+
+  Quotation marks and newlines can also be added with so-called escape
+  sequences. The string @code{a said "b"} is entered as
+  @example
+    "a said \"b\""
+  @end example
+
+  Newlines and backslashes are escaped with @code{\n} and @code{\\}
+respectively.
+@end table
 
-Scheme is a full-blown programming language, from the LISP
-family. and a full discussion is outside the scope of this document.
-Interested readers are referred to the website
-@uref{http://www.schemers.org/} for more information on Scheme.
 
-The GUILE library for extension is documented at
-@uref{http://www.gnu.org/software/guile}.
-@ifinfo
-When it is installed, the following link should take you to its manual
-@ref{(guile.info)guile}
-@end ifinfo
+In a music file, snippets of Scheme code are introduced with the hash
+mark @code{#}. So, the previous examples translated in LilyPondese are
 
-@menu
-* Inline Scheme::               
-@end menu
+@example
+  ##t ##f 
+  #1 #1.5
+  #"this is a string"
+  #"this
+  is
+  a string"
+@end example
+
+For the rest of this section, we will assume that the data is entered
+in a music file, so we add @code{#}s everywhere.
+
+Scheme can be used to do calculations. It uses @emph{prefix}
+syntax. Adding 1 and 2 is written as @code{(+ 1 2)} rather than the
+traditional 1+2.
+
+@lisp
+  #(+ 1 2)
+   @result{} #3 
+@end lisp
+
+The arrow @result{} shows that the result of evaluating @code{(+ 1 2)}
+is @code{3}.  Calculations may be nested: the result of a function may
+be used for another calculation.
 
-@node Inline Scheme
-@subsection Inline Scheme
+@lisp
+  #(+ 1 (* 3 4))
+   @result{} #(+ 1 12) 
+   @result{} #13
+@end lisp
+
+These calculations are examples of evaluations: an expression (like
+@code{(* 3 4)} is replaced by its value @code{12}. A similar thing
+happens with variables. After defining a variable  
 
-Scheme expressions can be entered in the input file by entering a
-hash-sign (@code{#}).  The expression following the hash-sign is
-evaluated as Scheme. For example, the boolean value @var{true} is
-@code{#t} in Scheme, so for LilyPond @var{true} looks like @code{##t},
-and can be used in property assignments:
 @example
-  \set Staff.autoBeaming = ##f
+  twelve = #12 
+@end example
+
+variables can also be used in expressions, here
+
+@example
+  twentyFour = #(* 2 twelve) 
+@end example 
+
+the number 24 is stored in the variable @code{twentyFour}.
+
+The @emph{name} of a variable is also an expression, similar to a
+number or a string. It is entered as
+
+@example
+  #'twentyFour
+@end example
+
+The quote mark @code{'} prevents Scheme interpreter from substituting
+@code{24} for the @code{twentyFour}. Instead, we get the name
+@code{twentyFour}.
+
+This syntax will be used very frequently, since many of the layout
+tweaks involve assigning (Scheme) values to internal variables, for
+example
+
+@example
+  \override Stem #'thickness = #2.6
 @end example
 
+This instruction adjusts the appearance of stems. The value @code{2.6}
+is put into a the @code{thickness} variable of a @code{Stem}
+object. This makes stems almost twice as thick as their normal size.
+To distinguish between variables defined in input files (like
+@code{twentyFour} in the example above), and internal variables, we
+will call the latter ``properties.'' So, the stem object has a
+@code{thickness} property.
 
-@node Setting variables
-@section Setting variables
+Two-dimensional offsets (X and Y coordinates) as well as object sizes
+(intervals with a left and right point) are entered as @code{pairs}. A
+pair@footnote{In Scheme terminology, the pair is called @code{cons},
+and its two elements are called car and cdr respectively.}  is entered
+as @code{(first . second)}, and like symbols, they must be quoted,
 
-When the music is converted from notes to print it is interpreted
-in left-to-right order. This is similar to what happens when we read
-music. During this step context-sensitive information such as the
-accidentals to print, and where bar lines must be placed, are stored in
-variables. These variables are called @emph{context properties}.
-The properties can also be manipulated from input files. Consider this input:
 @example
-\set Staff.autoBeaming = ##f
+  \override TextScript #'extra-offset = #'(1 . 2)  
 @end example 
 
+This assigns the pair (1, 2) to @code{extra-offset} variable of the
+TextScript object. This moves the object 1 staff space to the right,
+and 2 spaces up.
+
+The two elements of a pair may be arbitrary values, for example
+
+@example
+  #'(1 . 2)
+  #'(#t . #f)
+  #'("blah-blah" . 3.14159265)
+@end example
+
+A list is entered by enclosing its elements in parentheses, and adding
+a quote. For example,
+@example
+  #'(1 2 3)
+  #'(1 2 "string" #f)
+@end example
+
+We have been using lists all along.  A calculation, like @code{(+ 1
+2)} is also a list (containing the symbol @code{+} and the numbers 1
+and 2). For entering lists, use a quote @code{'} and for
+calculations, do not use a quote. 
+
+Inside a quoted list or pair, there is no need to quote anymore.  The
+following is a pair of symbols, a list of symbols and a list of lists
+respectively,
+
+@example
+  #'(stem . head)
+  #'(staff clef key-signature)
+  #'((1) (2))
+@end example
+
+
+@node Context 
+@section Context
+
+When music is printed, a lot of things notation elements must be added
+to the input, which is often bare bones.  For example, compare the
+input and output of the following example
+
+@lilypond[verbatim,relative=2]
+  cis4 cis2. g4
+@end lilypond
+
+The input is rather sparse, but in the output, bar lines, accidentals,
+clef and time signature are added. LilyPond @emph{interprets} the
+input. During this step, the musical information is inspected in time
+order, similar to reading a score from left to right. While reading,
+the program remembers where measure boundaries are, and what pitches
+need explicit accidentals.
+
+This is contextual information. and it can be present on several
+levels.  For example, the effect of an accidental is limited to a
+single stave, while a bar line must be synchronized across the entire
+score.  To match this hierarchy, LilyPond's interpretation step is
+hierarchical.  There are interpretation contexts, like
+@context{Voice}, Staff and Score, and each level can maintain its own
+properties.
+
+Full description of all available contexts is in the program
+reference, see
+@ifhtml
+@internalsref{Contexts}
+@end ifhtml
+@ifnothtml 
+Translation @arrow{} Context.
+@end ifnothtml
+
+@menu
+* Creating contexts::           
+* Changing context properties on the fly ::  
+* Modifying context plug-ins::  
+* Layout tunings within contexts::  
+* Defining context defaults ::  
+* Which properties to change::  
+@end menu
+
+@node Creating contexts
+@subsection Creating contexts
+
+For simple scores, the correct contexts are created automatically. For
+more complex scores, it is necessary to instantiate them by hand.
+There are three commands to do this.
+
+The easiest command is @code{\new}, and it also the quickest to type.
+It is prepended to a  music expression, for example
+
+@example
+  \new @var{type} @var{music expression}
+@end example
+
 @noindent
-It sets the property named @code{autoBeaming} in the current staff at
-this point in the music to @code{##f}, which means `false'. This
-property controls whether beams are printed automatically:
-@c
-@lilypond[relative=1,fragment,verbatim]
-  c8 c c c
-  \set Staff.autoBeaming = ##f
-  c8 c c c  
+where @var{type} is a context name (like @code{Staff} or
+@code{Voice}).  This command creates a new context, and starts
+interpreting @var{music expression} with that.
+
+A practical application of @code{\new} is a score with many
+staves. Each part that should be on its own staff, gets a @code{\new
+Staff}.
+
+@lilypond[verbatim,relative=2,raggedright]
+  << \new Staff { c4 c }
+     \new Staff { d4 d }
+  >>
 @end lilypond
 
+
+The @code{\context} command also directs a music expression to a
+context object, but gives the context an extra name. The syntax is
+
+@example
+  \context @var{type} = @var{id} @var{music}
+@end example
+
+This form will search for an existing context of type @var{type}
+called @var{id}. If that context does not exist yet, it is created.
+This is useful if the context referred to later on. For example, when
+setting lyrics the melody is in a named context
+
+@example
+ \context Voice = "@b{tenor}" @var{music}
+@end example
+
 @noindent
-LilyPond includes a built-in programming language, namely, a dialect
-of Scheme.  The argument to @code{\set}, @code{##f}, is an
-expression in that language.  The first hash-mark signals that a piece
-of Scheme code follows. The second hash character is part of the
-boolean value true (@code{#t}).  Values of other types may be
-entered as follows:
-@itemize @bullet
-@item a string, enclosed in double quotes, for example,
+so the texts can be properly aligned to its notes,
+
 @example
-  \set Staff.instrument = #"French Horn"
+\new Lyrics \lyricsto "@b{tenor}" @var{lyrics} 
 @end example
-@item a boolean: either @code{#t} or @code{#f}, for true and false
-respectively, e.g.
+
+@noindent
+
+Another possibility is funneling two different music expressions into
+one context. In the following example, articulations and notes are
+entered separately,
+
+@verbatim
+music = \notes { c4 c4 }
+arts = \notes  { s4-. s4-> }
+@end verbatim
+
+They are combined by sending both to the same @context{Voice} context,
+
+@verbatim
+  << \new Staff \context Voice = "A" \music
+     \context Voice = "A" \arts
+  >>
+@end verbatim
+@lilypond[raggedright]
+music = \notes { c4 c4 }
+arts = \notes  { s4-. s4-> }
+\score {
+       \notes \relative c''  << \new Staff \context Voice = "A" \music
+     \context Voice = "A" \arts
+  >>
+} 
+@end lilypond
+
+
+
+The third command for creating contexts is
 @example
-  \set autoBeaming = ##f
-  \set Score.skipBars = ##t
+  \context @var{type} @var{music}
 @end example
 
-@item a number, such as
+
+@noindent
+This is similar to @code{\context} with @code{= @var{id}}, but matches
+any context of type @var{type}, regardless of its given name.
+
+This variant is used with music expressions that can be interpreted at
+several levels. For example, the @code{\applyoutput} command (see
+@ref{Running a function on all layout objects}). Without an explicit
+@code{\context}, it is usually is applied to @context{Voice}
+
 @example
-  \set Score.currentBarNumber = #20
+  \applyoutput #@var{function}   % apply to Voice
 @end example
 
-@item a symbol, which is introduced by a quote character, as in 
+To have it interpreted at @context{Score} or @context{Staff} level use
+these forms
+
 @example
-  \set Staff.crescendoSpanner = #'dashed-line
+  \context Score \applyoutput #@var{function}
+  \context Staff \applyoutput #@var{function}
 @end example
 
-@item a pair, which is also introduced by a quote character, like in
-the following statements, which set properties to the pairs (-7.5, 6) 
-and (3, 4) respectively:
+
+@node Changing context properties on the fly 
+@subsection Changing context properties  on the fly
+
+Each context can have different @emph{properties}, variables contained
+in that context. They can be changed during the interpretation step.
+This is achieved by inserting the @code{\set} command in the music,
+
+@quotation
+  @code{\set }[@var{context}]@code{.}@var{prop}@code{ = #}@var{value} 
+@end quotation
+
+For example,
+@lilypond[verbatim,relative=2]
+  R1*2 
+  \set Score.skipBars = ##t
+  R1*2
+@end lilypond
+
+This command skips measures that have no notes. The result is that
+multi rests are condensed.  The value assigned is a Scheme object. In
+this case, it is @code{#t}, the boolean True value.
+
+If the @var{context} argument is left out, then the current
+bottom-most context (typically ChordNames, @context{Voice} or Lyrics)
+is used.  In this example,
+
+@lilypond[verbatim,relative=2]
+  c8 c c c
+  \set autoBeaming = ##f
+  c8 c c c
+@end lilypond
+
+@noindent
+the @var{context} argument to @code{\set} is left out, and the current
+@internalsref{Voice} is used.
+
+Contexts are hierarchical, so if a bigger context was specified, for
+example @code{Staff}, then the change would also apply to all
+@context{Voice}s in the current stave. The change is applied
+`on-the-fly', during the music, so that the setting only affects the
+second group of eighth notes.
+
+There is also an @code{\unset} command,
+@quotation
+  @code{\set }[@var{context}]@code{.}@var{prop}
+@end quotation
+
+@noindent
+which removes the definition of @var{prop}. This command only removes
+the definition if it is set in @var{context}. In
 
 @example
-  \set Staff.minimumVerticalExtent = #'(-7.5 . 6)
-  \set Staff.timeSignatureFraction = #'(3 . 4)
+  \set Staff.autoBeaming = ##f
+  \unset Voice.autoBeaming
 @end example
 
-@item a list, which is also introduced by a quote character. In the
-following example, the @code{breakAlignOrder} property is set to a
-list of symbols:
+@noindent
+the current @context{Voice} does not have the property, and the
+definition at @context{Staff} level remains intact.
+
+Settings that should only apply to a single time-step can be entered
+easily with @code{\once}, for example in
+
+@lilypond[verbatim,relative=2]
+  c4
+  \once \set fontSize = #4.7
+  c4
+  c4
+@end lilypond
+
+the property @code{fontSize} is unset automatically after the second
+note.
+
+A full description of all available context properties is in the
+program reference, see
+@ifhtml
+@internalsref{Tunable-context-properties}.
+@end ifhtml
+@ifnothtml
+Translation @arrow{} Tunable context properties.
+@end ifnothtml
+
+
+@node Modifying context plug-ins
+@subsection Modifying context plug-ins
+
+Notation contexts (like Score and Staff) not only store properties,
+they also contain plug-ins, called ``engravers'' that create notation
+elements. For example, the Voice context contains a
+@code{Note_head_engraver} and the Staff context contains a
+@code{Key_signature_engraver}.
+
+For a full a description of each plug-in, see 
+@ifhtml
+@internalsref{Engravers}
+@end ifhtml
+@ifnothtml
+Program reference @arrow Translation @arrow{} Engravers.
+@end ifnothtml
+Every context described in
+@ifhtml
+@internalsref{Contexts}
+@end ifhtml
+@ifnothtml 
+Program reference @arrow Translation @arrow{} Context.
+@end ifnothtml
+lists the engravers used for that context.
+
+
+It can be useful to shuffle around these plug-ins. This is done by
+starting a new context, with @code{\new} or @code{\context}, and
+modifying them like this, 
+
 @example
-  \set Score.breakAlignOrder = 
- #'(left-edge time-signature key-signatures)
+ \new @var{context} \with @{
+   \consists @dots{}
+   \consists @dots{}
+   \remove  @dots{}
+   \remove @dots{}
+   @emph{etc.}
+ @}
+ @var{..music..}
 @end example
 
+where the @dots{} should be the name of an engraver. Here is a simple
+example which removes @code{Time_signature_engraver} and
+@code{Clef_engraver} from a @code{Staff} context,
+
+@lilypond[relative=1, verbatim]
+<< \new Staff {
+    f2 g
+  }
+  \new Staff \with {
+     \remove "Time_signature_engraver"
+     \remove "Clef_engraver"
+  } {
+    f2 g2
+  }
+>>
+@end lilypond
+
+In the second stave there are no time signature or clef symbols.  This
+is a rather crude method of making objects disappear, it will affect
+the entire staff. More sophisticated methods are shown in (TODO).
+
+The next example shows a practical application.  Bar lines and time
+signatures are normally synchronized across the score.  This is done
+by the @code{Timing_engraver}. This plug-in keeps an administration of
+time signature, location within the measure, etc. By moving the
+@code{Timing_engraver} engraver from Score to Staff context, we can
+have score where each staff has its own time signature.
+
+@cindex polymetric scores
+
+
+@lilypond[relative=1,raggedright,verbatim]
+\new Score \with {
+  \remove "Timing_engraver"
+} <<
+  \new Staff \with {
+    \consists "Timing_engraver"
+  } {
+      \time 3/4
+      c4 c c c c c
+  }
+  \new Staff \with {
+    \consists "Timing_engraver"
+  } {
+       \time 2/4
+       c4 c c c c c
+  }
+>>
+@end lilypond
+
+
+@node Layout tunings within contexts
+@subsection Layout tunings within contexts
+
+Each context is responsible for creating certain types of graphical
+objects. The settings used for printing these objects are also stored by
+context. By changing these settings, the appearance of objects can be
+altered.
+The syntax for this is
+
+@example
+  \override @var{context}.@var{name}@code{ #'}@var{property} = #@var{value}
+@end example
+
+Here @var{name} is the name of a graphical object, like @code{Stem} or
+@code{NoteHead}.  @var{property} is an internal variable of the
+formatting system (`grob property' or `layout property'). It is a
+symbol, so it must be quoted. The subsection refTODO explains what to
+fill in for @var{name}, @var{property} and @var{value}. Here we only
+discuss functionality of this command.
+
+The command
+
+@verbatim
+  \override Staff.Stem #'thickness = #4.0 
+@end verbatim
+
+@noindent
+makes stems thicker (the default is 1.3, with staff line thickness as a
+unit). Since the command specifies @context{Staff} as context, it only
+applies to the current staff. Other staves will keep their normal
+appearance.  Here we see the command in action:
+
+@lilypond[verbatim,relative=2]
+  c4
+  \override Staff.Stem #'thickness = #4.0 
+  c4
+  c4
+  c4
+@end lilypond
+
+The @code{\override} command is executed during the interpreting phase,
+and changes the definition of the @code{Stem} within
+@context{Staff}. After the command all stems are thickened.
+
+Analogous to @code{\set}, the @var{context} argument may be left out,
+causing it to default to @context{Voice} and adding @code{\once} applies
+the change during only one timestep
+
+@lilypond[verbatim,relative=2]
+  c4
+  \once \override Stem #'thickness = #4.0 
+  c4
+  c4 
+@end lilypond
+
+The @code{\override} must be done before the object is
+started. Therefore, when altering @emph{Spanner} objects, like slurs or
+beams, the @code{\override} command must be executed at the moment that
+the object is created. In this example,
+
+
+
+@lilypond[verbatim,relative=2]
+  \override Slur #'thickness = #2.0
+  c8[( c
+  \override Beam #'thickness = #0.6
+  c8 c]) 
+@end lilypond
+
+@noindent
+the slur is fatter and the beam is not. This is because the command for
+@code{Beam} comes after the Beam is started. Therefore it has no effect.
+
+Analogous to @code{\unset}, the @code{\revert} command for a context
+undoes a @code{\override} command; like with @code{\unset}, it only
+affects settings that were made in the same context. In other words, the
+@code{\revert} in the next example does not do anything.
+
+@verbatim
+  \override Voice.Stem #'thickness = #4.0
+  \revert Staff.Stem #'thickness
+@end verbatim
+
+
+@node Defining context defaults 
+@subsection Defining context defaults
+
+Context properties can be set as defaults, within the
+@code{\paper} block. For example, 
+
+@verbatim
+\paper {
+  \context {
+    \ScoreContext
+    skipBars = ##t
+  }
+}
+@end verbatim
+
+@noindent
+will set skipBars default 
+
+@node Which properties to change
+@subsection Which properties to change
 
-@end itemize
 
 There are many different properties.  Not all of them are listed in
 this manual. However, the program reference lists them all in the
@@ -336,7 +866,6 @@ Adding variables on top of this existing definition overrides the
 system default, and alters the resulting appearance of the layout
 object.
 
-@syntax
 
 
 Changing a variable for only one object is commonly achieved with
@@ -404,12 +933,6 @@ The back-end is not very strict in type-checking object properties.
 Cyclic references in Scheme values for properties can cause hangs
 and/or crashes.
 
-@menu
-* Constructing a tweak::        
-* Applyoutput::                 
-* Font selection::              
-* Text markup::                 
-@end menu
 
 @node Constructing a tweak
 @subsection Constructing a tweak
@@ -631,24 +1154,29 @@ all three mechanisms work for every object that supports
 
 
 @itemize @bullet
+@item @code{font-encoding}
+is a symbol that sets layout of the glyphs. Choices include
+@code{text} for normal text, @code{braces} (for piano staff braces),
+@code{music} (the standard music font, including ancient glyphs),
+@code{dynamic} (for dynamic signs) and @code{number} for the number
+font.
+
+
 @item @code{font-family}
  is a symbol indicating the general class of the typeface.  Supported are
-@code{roman} (Computer Modern), @code{braces} (for piano staff
-braces), @code{music} (the standard music font, including ancient
-glyphs), @code{dynamic} (for dynamic signs) and @code{typewriter}.
+@code{roman} (Computer Modern), @code{sans} and @code{typewriter}
   
 @item @code{font-shape}
-  is a symbol indicating the shape of the font, there are typically several
-  font shapes available for each font family. Choices are @code{italic},
-  @code{caps} and @code{upright}.
+  is a symbol indicating the shape of the font, there are typically
+several font shapes available for each font family. Choices are
+@code{italic}, @code{caps} and @code{upright}.
 
 @item @code{font-series}
 is a  symbol indicating the series of the font. There are typically several
 font series for each font family and shape. Choices are @code{medium}
 and @code{bold}. 
 
-@end table
-
+@end itemize
 
 Fonts selected in the way sketched above come from a predefined style
 sheet.
@@ -1210,8 +1738,6 @@ reliably choose page breaks in longer pieces.
 @section Interpretation context
 
 @menu
-* Creating contexts::           
-* Default contexts::            
 * Context properties::          
 * Defining contexts::           
 * Changing contexts locally::   
@@ -1249,89 +1775,6 @@ performance contexts can be found in @file{ly/engraver-init.ly} and
 @file{ly/performer-init.ly}, respectively.
 
 
-@node Creating contexts
-@subsection Creating contexts
-@cindex @code{\context}
-@cindex context selection
-
-Contexts for a music expression can be selected manually, using one of
-the following music expressions:
-
-@example
-\new @var{contexttype} @var{musicexpr}
-\context @var{contexttype} [= @var{contextname}] @var{musicexpr}
-@end example
-
-@noindent
-This means that @var{musicexpr} should be interpreted within a context
-of type @var{contexttype} (with name @var{contextname} if specified).
-If no such context exists, it will be created:
-
-@lilypond[verbatim,raggedright]
-\score {
-  \notes \relative c'' {
-    c4 <<d4 \context Staff = "another" e4>> f
-  }
-}
-@end lilypond
-
-@noindent
-In this example, the @code{c} and @code{d} are printed on the default
-staff.  For the @code{e}, a context @code{Staff} called @code{another}
-is specified; since that does not exist, a new context is created.
-Within @code{another}, a (default) Voice context is created for the
-@code{e4}.  A context is ended when when all music referring it has
-finished, so after the third quarter, @code{another} is removed.
-
-The @code{\new} construction creates a context with a
-generated, unique @var{contextname}. An expression with
-@code{\new} always leads to a new context. This is convenient
-for creating multiple staves, multiple lyric lines, etc.
-
-When using automatic staff changes, automatic phrasing, etc., the
-context names have special meanings, so @code{\new} cannot be
-used.
-
-
-@node Default contexts
-@subsection Default contexts
-
-Every top level music is interpreted by the @code{Score} context; in
-other words, you may think of @code{\score} working like
-
-@example
-\score @{
-  \context Score @var{music}
-@}
-@end example
-
-Music expressions  inherit their context from the enclosing music
-expression. Hence, it is not necessary to explicitly specify
-@code{\context} for most expressions.  In
-the following example, only the sequential expression has an explicit
-context. The notes contained therein inherit the @code{goUp} context
-from the enclosing music expression.
-
-@lilypond[verbatim,raggedright]
-  \notes \context Voice = goUp { c'4 d' e' }
-@end lilypond
-
-
-Second, contexts are created automatically to be able to interpret the
-music expressions.  Consider the following example:
-
-@lilypond[verbatim,raggedright]
-  \score { \notes { c'4-( d' e'-) } }
-@end lilypond
-
-@noindent
-The sequential music is interpreted by the Score context initially,
-but when a note is encountered, contexts are setup to accept that
-note.  In this case, a @code{Voice}, and @code{Staff}
-context are created.  The rest of the sequential music is also
-interpreted with the same @code{Voice}, and
-@code{Staff} context, putting the notes on the same staff, in the same
-voice.
 
 @node Context properties
 @subsection Context properties
@@ -1574,12 +2017,6 @@ through La@TeX{}.  Using the option @option{-f}
 (or @option{--format}) other output formats can be selected also, but
  none of them work reliably.
 
-At the beginning of the output file, various global parameters are
-defined.  Then the file @file{lilyponddefs.tex} is loaded to define
-the macros used in the code which follows.  @file{lilyponddefs.tex}
-includes various other files, partially depending on the global
-parameters.
-
 Now the music is output system by system (a `system' consists of all
 staves belonging together).  From @TeX{}'s point of view, a system is an
 @code{\hbox} which contains a lowered @code{\vbox} so that it is centered