]> git.donarmstrong.com Git - lilypond.git/blobdiff - Documentation/user/text.itely
Finish LM 3 'Fundamental concepts' proofreading
[lilypond.git] / Documentation / user / text.itely
index 453657348ef65a5bc88b834a210242465fbdf1c8..43f4e942278624dff03208331c3bac84febbc0e2 100644 (file)
 @c -*- coding: utf-8; mode: texinfo; -*-
+@ignore
+    Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
+
+    When revising a translation, copy the HEAD committish of the
+    version that you are working on.  See TRANSLATION for details.
+@end ignore
+
+@c \version "2.11.51"
 
 @node Text
 @section Text
 
-This section explains how to include text (with various formatting) in
-your scores.
+@lilypondfile[quote]{text-headword.ly}
 
-@cindex Text, other languages
-To write accented and special text (such as characters from other languages),
-simply
-insert the characters directly into the lilypond file.  The file must be
-saved as UTF-8.  For more information, see @ref{Text encoding}.
-
-@lilypond[fragment,ragged-right,staffsize=16,quote]
-c'4^\markup { bla \bold bla }
-@end lilypond
+This section explains how to include text (with various
+formatting) in music scores.
 
-@lilypond[fragment,ragged-right,staffsize=16,quote]
-c'4^\markup { bla \bold bla }
-@end lilypond
+@noindent
+Some text elements that are not dealt with here are discussed in other
+specific sections: @ref{Vocal music}, @ref{Titles and headers}.
 
-@lilypond[fragment,ragged-right,staffsize=16,quote]
-c'4^\markup { bla \bold bla }
-@end lilypond
 
-@lilypond[fragment,ragged-right,staffsize=16,quote]
-c'4^\markup { bla \bold bla }
-@end lilypond
+@cindex Text, other languages
+@warning{To write accented and special text (such as characters
+from other languages), simply insert the characters directly into
+the LilyPond file.  The file must be saved as UTF-8.  For more
+information, see @ref{Text encoding}.}
 
 @menu
 * Writing text::                
-* Text markup::                 
+* Formatting text::             
+* Fonts::                       
 @end menu
 
 
 @node Writing text
 @subsection Writing text
 
-@anchor{Text scripts}
-@unnumberedsubsubsec Text scripts
+This section introduces different ways of adding text to a score.
+
+@menu
+* Text scripts::                
+* Text spanners::               
+* Text marks::                  
+* Separate text::               
+@end menu
+
+
+@node Text scripts
+@subsubsection Text scripts
 
 @cindex Text scripts
 @cindex text items, non-empty
 @cindex non-empty texts
+@cindex quoted text
 
-It is possible to place arbitrary strings of text or @ref{Text markup},
-above or below notes by using a string @code{c^"text"}.  By default,
-these indications do not influence the note spacing, but by using the
-command @code{\fatText}, the widths will be taken into account
+Simple @q{quoted text} indications may be added
+to a score, as demonstrated in the following example.
+Such indications can be manually placed
+above or below the staff, using the
+syntax described in @ref{Direction and
+placement}.
 
 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
-c4^"longtext" \fatText c4_"longlongtext" c4
+d8^"pizz." e f g a4-"scherz." f
 @end lilypond
 
-@noindent
-To prevent text from influencing spacing, use @code{\emptyText}.
+This syntax is actually a shorthand; more complex text
+formatting may be added to a note by explicitly using a
+@code{\markup} block, as described in @ref{Formatting text}.
+
+@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
+d8^\markup { \italic pizz. } e f g 
+a4_\markup { \tiny scherz. \bold molto } f
+@end lilypond
 
-More complex formatting may also be added to a note by using the
-markup command,
+By default, text indications do not influence the note spacing.
+However, their widths can be taken into account:
+in the following example, the first text string does not affect 
+spacing, whereas the second one does.
 
-@lilypond[fragment,ragged-right,verbatim,quote]
-c'4^\markup { bla \bold bla }
+@lilypond[quote,fragment,ragged-right,verbatim,relative=1]
+d8^"pizz." e f g
+\textLengthOn
+a4_"scherzando" f
 @end lilypond
 
-The @code{\markup} is described in more detail in
-@ref{Text markup}.
+@predefined
+
+@funindex \textLengthOn
+@code{\textLengthOn},
+@funindex \textLengthOff
+@code{\textLengthOff}
 
 
-@refcommands
+@seealso
+
+Notation Reference: @ref{Formatting text},
+@ref{Direction and placement}.
 
-@funindex \fatText
-@code{\fatText},
-@funindex \emptyText
-@code{\emptyText}.
+Snippets:
+@rlsr{Text}.
 
+Internals Reference: @rinternals{TextScript}.
 
-@commonprop
+@knownissues
 
-Checking to make sure that text scripts and lyrics are within the margins is
-a relatively large computational task.  To speed up processing, lilypond does
-not perform such calculations by default; to enable it, use
+Checking to make sure that text scripts and lyrics are within the
+margins is a relatively large computational task.  To speed up
+processing, LilyPond does not perform such calculations by
+default; to enable it, use
 
 @example
 \override Score.PaperColumn #'keep-inside-line = ##t
 @end example
 
 
+@node Text spanners
+@subsubsection Text spanners
+
+@cindex Text spanners
+
+Some performance indications, e.g., @notation{rallentando} or
+@notation{accelerando}, are written as text and are extended over
+multiple notes with dotted lines.
+Such objects, called @q{spanners}, may be created
+from one note to another using the following syntax:
+
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
+\override TextSpanner #'bound-details #'left #'text = "rit." 
+b1\startTextSpan 
+e,\stopTextSpan
+@end lilypond
+
+@noindent
+The string to be printed is set through
+object properties.  By default it is printed in italic characters,
+but different formatting can be obtained using
+@code{\markup} blocks, as described in @ref{Formatting text}.
+
+@lilypond[quote,ragged-right,fragment,relative=2,verbatim]
+\override TextSpanner #'bound-details #'left #'text =
+  \markup { \upright "rit." } 
+b1\startTextSpan c
+e,\stopTextSpan
+@end lilypond
+
+The line style, as well as the text string, can be defined as an
+object property.  This syntax is described in @ref{Line styles}.
+
+@predefined
+
+@funindex textSpannerUp
+@code{\textSpannerUp},
+@funindex textSpannerDown
+@code{\textSpannerDown},
+@funindex textSpannerNeutral
+@code{\textSpannerNeutral}
+
 @seealso
 
-In this manual: @ref{Text markup}.
+Notation Reference: @ref{Line styles}.
 
-Program reference: @internalsref{TextScript}.
+Snippets:
+@rlsr{Text}.
 
+Internals Reference: @rinternals{TextSpanner}.
 
-@anchor{Text and line spanners}
-@unnumberedsubsubsec Text and line spanners
 
-Some performance indications, e.g., @i{rallentando} and
-@i{accelerando} and @i{trills} are written as text and are extended
-over many measures with lines, sometimes dotted or wavy.
+@node Text marks
+@subsubsection Text marks
+
+@cindex coda on bar line
+@cindex segno on bar line
+@cindex fermata on bar line
+@cindex bar lines, symbols on
+@funindex \mark
 
-These all use the same routines as the glissando for drawing the texts
-and the lines, and tuning their behavior is therefore also done in the
-same way. It is done with a spanner, and the routine responsible for
-drawing the spanners is @code{ly:line-interface::print}. This
-routine determines the exact location of the two @i{span
-points} and draws a line in between, in the style requested.
+Various text elements can be added to a score using
+the syntax described in @ref{Rehearsal marks}:
 
-Here is an example of the different line styles available, and how to
-tune them.
+@c \mark needs to be placed on a separate line (it's not
+@c attached to an object like \markup is). -vv
 
-@lilypond[relative=2,ragged-right,verbatim,fragment]
-d2 \glissando d'2
-\once \override Glissando #'dash-fraction = #0.5
-d,2 \glissando d'2
-\override Glissando #'style = #'dotted-line
-d,2 \glissando d'2
-\override Glissando #'style = #'zigzag
-d,2 \glissando d'2
-\override Glissando #'style = #'trill
-d,2 \glissando d'2
+@lilypond[verbatim,quote,ragged-right,fragment,relative=2]
+c4
+\mark "Allegro"
+c c c
 @end lilypond
 
-The information that determines the end-points is computed on-the-fly
-for every graphic object, but it is possible to override these. 
+This syntax makes it possible to put any text on a bar line;
+more complex text formatting may be added using a @code{\markup}
+block, as described in @ref{Formatting text}.  This can be used to print
+signs like coda, segno or fermata, by specifying the appropriate
+symbol name:
 
-@lilypond[relative=2,ragged-right,verbatim,fragment]
-e2 \glissando f
-\once \override Glissando #'bound-details #'right #'Y = #-2
-e2 \glissando f
+@lilypond[fragment,quote,ragged-right,verbatim,relative=2]
+c1
+\mark \markup { \musicglyph #"scripts.ufermata" }
+c1
 @end lilypond
 
-The @code{Glissando} object, like any other using the
-@code{ly:line-interface::print} routine, carries a nested
-association list. In the above statement, the value for @code{Y}
-is set to @code{-2} for the association list corresponding to the right
-end point. Of course, it is also possible to adjust the left side with
-@code{left} instead of @code{right}.
-
-If @code{Y} is not set, the value is computed from the vertical
-position of right attachment point of the spanner. 
-
-In case of a line break, the values for the span-points are extended
-with contents of the @code{left-broken} and @code{right-broken}
-sublists, for example
-
-@lilypond[relative=2,ragged-right,verbatim,fragment]
-\override Glissando #'breakable = ##T 
-\override Glissando #'bound-details #'right-broken #'Y = #-3
-c1 \glissando \break
-f1
+@noindent
+Such objects are only typeset above the top staff of the score; depending on
+whether they are specified at the end or the middle of a bar, they 
+can be placed above the bar line or between notes.  When specified at the
+beginning of a score or at a line break, marks will be printed at
+the beginning of the line (the next line, in case of a line break).
+
+@lilypond[fragment,quote,ragged-right,verbatim,relative=2]
+\mark "Allegro"
+c1 c
+\mark "assai" \break
+c  c
 @end lilypond
 
-The following properties can be used for the
 
-@table @code
-@item Y
-This sets the Y-coordinate of the end point, in staff space.  By
-default, it is the center of the bound object, so for a glissando it
-points to the vertical center of the note head.
+@snippets
 
-For horizontal spanners, such as text spanner and trill spanners, it
-is hardcoded to 0.
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{printing-marks-at-the-end-of-a-line-or-a-score.ly}
 
-@item attach-dir
-This determines where the line starts and ends in X-direction,
-relative to the bound object.  So, a value of @code{-1} (or
-@code{LEFT}) makes the line start/end at the left side of the note
-head it is attached to.
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{aligning-marks-with-various-notation-objects.ly}
 
-@item X
-This is the absolute coordinate of the end point. It is usually
-computed on the fly, and there is little use in overriding it. 
+@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
+{printing-marks-on-every-staff.ly}
 
-@item stencil
-Line spanners may have symbols at the beginning or end, which is
-contained in this sub-property.  This is for internal use, it is
-recommended to use @code{text}.
+@seealso
 
-@item text
-This is a markup that is evaluated to yield stencil. It is
-used to put @i{cresc.} and @i{tr} on horizontal spanners.
+Notation Reference: @ref{Rehearsal marks},
+@ref{Formatting text}, @ref{The Feta font}.
 
-@lilypond[quote,ragged-right,fragment,relative=2,verbatim]
-\override TextSpanner #'bound-details #'left #'text
-   = \markup { \small \bold Slower }
-c2\startTextSpan b c a\stopTextSpan
-@end lilypond
+Snippets:
+@rlsr{Text}.
+
+Internals Reference: @rinternals{RehearsalMark}.
 
-@item stencil-align-dir-y
-@item stencil-offset
-Without setting this, the stencil is simply put there at the
-end-point, as defined by the @code{X} and @code{Y} sub properties.
-Setting either @code{stencil-align-dir-y} or @code{stencil-offset}
-will move the symbol at the edge relative to the end point of the line
+@knownissues
+@c  To be removed when Issue 69 in the tracker gets fixed. -vv
 
-@lilypond[relative=1,fragment,verbatim]
-\override TextSpanner #'bound-details #'left #'stencil-align-dir-y = #DOWN
-\override TextSpanner #'bound-details #'right #'stencil-align-dir-y = #UP
+If a mark is entered at the end of the last bar of the score (where
+there is no next line), then the mark will not be printed at
+all.
 
-\override TextSpanner #'bound-details #'left #'text = #"gggg"
-\override TextSpanner #'bound-details #'right #'text = #"hhhh"
-c4^\startTextSpan c c c \stopTextSpan
+@node Separate text
+@subsubsection Separate text
+
+@cindex separate text
+@cindex standalone text
+@cindex top-level text
+@cindex text, standalone
+@funindex \markup
+
+A @code{\markup} block can exist by itself, outside of any
+any @code{\score} block, as a @qq{top-level
+expression}.  This syntax is described in @ref{File structure}.
+
+@lilypond[verbatim,quote]
+\markup {
+  Tomorrow, and tomorrow, and tomorrow...
+}
 @end lilypond
 
-@item arrow
-Setting this sub property to @code{#t} produce an arrowhead at the end
-of the line.
+@noindent
+This allows printing text separately
+from the music, which is particularly 
+useful when the input file contains
+several music pieces, as described in
+@ref{Multiple scores in a book}.
+
+@lilypond[quote,ragged-right,verbatim]
+\score {
+  c'1
+}
+\markup {
+  Tomorrow, and tomorrow, and tomorrow...
+}
+\score {
+  c'1
+}
+@end lilypond
 
-@item padding
-This sub property controls the space between the specified end-point
-of the line and the actual end.  Without padding, a glissando would
-start and end in the center of each note head.
+Using a specific syntax, text blocks can be spread
+over multiple pages, making possible to print
+text documents or books -- and therefore to
+use LilyPond as a word processor.  This syntax is described in
+@ref{Multi-page markup}.
 
-@end table
+@predefined
+
+@code{\markup},
+@funindex \markuplines
+@code{\markuplines}
+
+@ignore
+@snippets
+
+TODO: add convenient snippets in input/new -vv
+@end ignore
 
 @seealso
 
-Program reference: @internalsref{TextSpanner},
-@internalsref{Glissando}, @internalsref{VoiceFollower},
-@internalsref{TrillSpanner}, @internalsref{line-spanner-interface}.
+Notation Reference: @ref{Formatting text},
+@ref{File structure}, 
+@ref{Multiple scores in a book},
+@ref{Multi-page markup}.
 
-Examples: @lsr{expressive,line-styles.ly}, @lsr{expressive,line-arrows.ly}
+Snippets:
+@rlsr{Text}.
 
+Internals Reference: @rinternals{TextScript}.
 
-@anchor{Text spanners}
-@unnumberedsubsubsec Text spanners
 
-@cindex Text spanners
+@node Formatting text
+@subsection Formatting text
 
-Some performance indications, e.g., @i{rallentando} or @i{accelerando},
-are written as text and are extended over many measures with dotted
-lines.  Such texts are created using text spanners; attach
-@code{\startTextSpan} and @code{\stopTextSpan} to the first and last
-notes of the spanner.
+This section presents basic and advanced text formatting,
+using the @code{\markup} mode specific syntax.
 
-The string to be printed, as well as the style, is set through object
-properties
+@menu
+* Text markup introduction::    
+* Selecting font and font size::      
+* Text alignment::              
+* Graphic notation inside markup::  
+* Music notation inside markup::  
+* Multi-page markup::          
+@end menu
 
-@lilypond[quote,ragged-right,fragment,relative=1,verbatim]
-c1
-\textSpannerDown
-\override TextSpanner #'bound-details #'left #'text =
-  \markup { \upright "rall" } 
-c2\startTextSpan b c\stopTextSpan a
-\break
-\textSpannerUp
-\override TextSpanner #'bound-details #'left #'text =
-  \markup { \italic "rit" } 
-c2\startTextSpan b c\stopTextSpan a
-@end lilypond
+@node Text markup introduction
+@subsubsection Text markup introduction
 
-@refcommands
+@cindex markup
+@cindex text markup
+@cindex markup text
+@cindex typeset text
+@funindex \markup
 
-@funindex textSpannerUp
-@code{\textSpannerUp},
-@funindex textSpannerDown
-@code{\textSpannerDown},
-@funindex textSpannerNeutral
-@code{\textSpannerNeutral}.
+A @code{\markup} block is used to typeset text with an extensible
+specific syntax called @qq{markup mode}.
 
+@cindex markup expressions
+@cindex markup syntax
 
-@commonprop
+The markup syntax is similar to LilyPond's usual syntax: a
+@code{\markup} expression is enclosed in curly braces @code{@{
+@dots{} @}}.
 
-To print a solid line, use
+Unlike simple @q{quoted text} indications, @code{\markup} blocks
+may contain nested expressions or specific commands,
+entered using the backslash @code{\} character.
+Such commands only affect the first following expression.
 
-@example
-\override TextSpanner #'dash-fraction = #'()
-@end example
+@lilypond[quote,verbatim,fragment,relative=1]
+e1-\markup "intenso"
+a2^\markup { poco \italic più forte  }
+c e1
+d2_\markup { \italic "string. assai" }
+e 
+b1^\markup { \bold { molto \italic  agitato } }
+c
+@end lilypond
 
+@cindex special characters in markup mode
+@cindex markup mode, special characters
+@cindex reserved characters, printing
+@cindex printing special characters
+@cindex quoted text in markup mode
 
-@seealso
+A @code{\markup} block may also contain quoted text, which
+can be useful to print special characters such as @code{\} and @code{#},
+or even double quotation marks -- these have to be preceded
+with backslashes:
 
-Program reference: @internalsref{TextSpanner}.
+@lilypond[quote,verbatim,fragment,relative=1]
+\clef bass
+a^\markup "##\ LEPORELLO \##"
+a_\markup "Bravi! \"Cosa rara\"!"
+r a8 d
+cis a r4 r2
+@end lilypond
 
+The way markup expressions are defined affects 
+how these expressions will stacked, centered and aligned
+when using the commands explained in @ref{Text alignment}.
 
-@anchor{Text marks}
-@unnumberedsubsubsec Text marks
+@lilypond[quote,verbatim,fragment,relative=1]
+c1^\markup { \column { a bbbb \line { c d } } }
+c1^\markup { \center-align { a bbbb c } }
+c1^\markup { \line { a b c } }
+@end lilypond
 
-@cindex coda on bar line
-@cindex segno on bar line
-@cindex fermata on bar line
-@cindex bar lines, symbols on
-@funindex \mark
+Lists of words that are not enclosed with double quotes
+or preceded by a command are not treated as a distinct
+expression.  In the following example, the first two
+@code{\markup} expressions are equivalent:
 
-The @code{\mark} command is primarily used for
-@ref{Rehearsal marks},
-but it can also be used to put signs like coda,
-segno, and fermata on a bar line.  Use @code{\markup} to
-access the appropriate symbol (symbols are listed in
-@ref{The Feta font}).
+@lilypond[quote,verbatim,fragment,relative=1]
+c1^\markup { \center-align { a bbb c } }
+c1^\markup { \center-align { a { bbb c } } }
+c1^\markup { \center-align { a \line { bbb c } } }
+@end lilypond
 
-@lilypond[fragment,quote,ragged-right,verbatim,relative=2]
-c1 \mark \markup { \musicglyph #"scripts.ufermata" }
-c1
+
+Markups can be stored in variables.  These variables may be
+directly attached to notes:
+
+@lilypond[quote,verbatim]
+allegro = \markup { \bold \large Allegro }
+
+{
+  d''8.^\allegro
+  d'16 d'4 r2
+}
 @end lilypond
 
+
 @noindent
-@code{\mark} is only typeset above the top stave of the score.  If
-you specify the @code{\mark} command at a bar line, the resulting
-mark is placed above the bar line.  If you specify it in the middle
-of a bar, the resulting mark is positioned between notes.  If it is
-specified before the beginning of a score line, it is placed
-before the first note of the line.  Finally, if the mark occurs at
-a line break, the mark will be printed at the
-beginning of the next line.
-@c  IMO this is a bug; hopefully it'll be fixed soon, so I can
-@c  delete this sentence.   -gp
-If there is no next line, then the mark will not be printed at all.
+An exhaustive list of @code{\markup}-specific commands can be found in
+@ref{Text markup commands}.
 
 
-@commonprop
+@seealso
 
-To print the mark at the end of the current line, use
+This manual: @ref{Text markup commands}.
 
-@example
-\override Score.RehearsalMark
-  #'break-visibility = #begin-of-line-invisible
-@end example
+Snippets:
+@rlsr{Text}.
 
-@code{\mark} is often useful for adding text to the end of bar.  In
-such cases, changing the @code{#'self-alignment} is very useful
+Internals Reference: @rinternals{TextScript}.
 
-@lilypond[fragment,quote,ragged-right,verbatim,relative=2]
-\override Score.RehearsalMark
-  #'break-visibility = #begin-of-line-invisible
-c1 c c c4 c c c
-\once \override Score.RehearsalMark #'self-alignment-X = #right
-\mark "D.S. al Fine "
-@end lilypond
+Init files: @file{scm/@/new@/-markup@/.scm}.
 
-Text marks may be aligned with notation objects other than
-bar lines,
 
-@lilypond[fragment,quote,ragged-right,verbatim,relative=2]
-\relative {
-  c1
-  \key cis \major
-  \clef alto
-  \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
-  \mark "on key"
-  cis
-  \key ces \major
-  \override Score.RehearsalMark #'break-align-symbols = #'(clef)
-  \clef treble
-  \mark "on clef"
-  ces
-  \override Score.RehearsalMark #'break-align-symbols = #'(time-signature)
-  \key d \minor
-  \clef tenor
-  \time 3/4
-  \mark "on time"
-  c
+@knownissues
+
+Syntax errors for markup mode can be confusing.
+
+
+@node Selecting font and font size
+@subsubsection Selecting font and font size
+
+@cindex font switching
+@funindex \italic
+@funindex \bold
+@funindex \underline
+
+Basic font switching is supported in markup mode:
+
+@lilypond[quote,verbatim,relative=2]
+{
+  d1^\markup { 
+    \bold { Più mosso } 
+    \italic { non troppo \underline Vivo } 
+  }
+  r2 r4 r8
+  d,_\markup { \italic quasi \smallCaps Tromba }
+  f1 d2 r
 }
 @end lilypond
 
-Possible symbols for the @code{break-align-symbols} list are
-@code{ambitus}, @code{breathing-sign}, @code{clef}, @code{custos},
-@code{staff-bar}, @code{left-edge}, @code{key-cancellation},
-@code{key-signature}, and @code{time-signature}.
+@cindex font size
+@cindex text size
+@funindex \fontsize
+@funindex \smaller
+@funindex \larger
+@funindex \bigger
+@funindex \magnify
+
+The size of the characters can also be altered in different ways:
+@itemize
+@item
+the font size can be defined to an absolute value,
+
+@item
+predefined commands allow to easily select standard sizes,
+
+@item
+the font size can also be changed relatively to its previous value.
+@end itemize
 
-The text marks will, by default, be aligned with the middle of the notation
-object, but this can be changed by overriding the
-@code{break-align-anchor-alignment} and
-@code{break-align-anchor} properties for the appropriate grob.
+@noindent
+The following example demonstrates these three methods:
 
-@lilypond[fragment,quote,ragged-right,verbatim]
+@lilypond[quote,verbatim,relative=2]
 {
-  \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
-  c1
-  \key cis \major
-
-  % the RehearsalMark will be aligned with the left edge of the KeySignature
-  \once \override Staff.KeySignature #'break-align-anchor-alignment = #LEFT
-  \mark \default
-  cis1
-  \key ces \major
-
-  % the RehearsalMark will be aligned with the right edge of the KeySignature
-  \once \override Staff.KeySignature #'break-align-anchor-alignment = #RIGHT
-  \mark \default
-  ces1
-  \key cis \major
-
-  % the RehearsalMark will be aligned with the left edge of the KeySignature
-  % and then shifted right by 2 units.
-  \once \override Staff.KeySignature #'break-align-anchor = #2
-  \mark \default
-  ces1
+  f1^\markup { \fontsize #5 Sinfonia } 
+  a,_\markup { 
+    \tiny espressivo
+    \large e
+    \normalsize intenso 
+  }
+  bes^\markup { (con 
+    \larger grande 
+    \smaller emozione 
+    \magnify #0.6 { e sentimento } )
+  }
+  d c2 r8 c bes a g1
 }
 @end lilypond
 
-Although text marks are normally only printed above the topmost
-staff, you may alter this to print them on every staff,
+@cindex subscript
+@cindex superscript
+@funindex \super
+@funindex \sub
 
-@lilypond[quote,ragged-right,verbatim,relative=2]
-{
-  \new Score \with {
-    \remove "Mark_engraver"
+Text may be printed as subscript or superscript. By default
+these are printed in a smaller size, but a normal size can be used as well:
+
+@lilypond[quote,verbatim]
+\markup {
+  \column {
+    \line { 1 \super st movement }
+    \line { 1 \normal-size-super st movement 
+      \sub { (part two) }  }
+  }
+}
+@end lilypond
+
+@cindex font families
+
+The markup mode provides an easy way to select alternate
+font families.  The default serif font, of roman type, is
+automatically selected unless specified otherwise: on the
+last line of the following example, there is no difference
+between the first and the second word.
+
+@lilypond[quote,verbatim]
+\markup {
+  \column {
+    \line { Act \number 1 }
+    \line { \sans { Scene I. } }
+    \line { \typewriter { Verona. An open place. } }
+    \line { Enter \roman Valentine and Proteus. }
   }
-  <<
-    \new Staff \with {
-      \consists "Mark_engraver"
+}
+@end lilypond
+
+@noindent
+Some of these font families, used for specific items
+such as numbers or dynamics, do not provide all
+characters, as mentioned in @ref{New dynamic marks} and
+@ref{Manual repeat marks}.
+
+@c \concat is actually documented in Align (it is not
+@c a font-switching command). But we need it here. -vv
+
+When used inside a word, some font-switching or formatting
+commands may produce an unwanted blank space.  This can
+easily be solved by concatenating the text elements together:
+
+@lilypond[quote,verbatim]
+\markup {
+  \column {
+    \line {
+      \concat { 1 \super st }
+      movement
     }
-    { c''1 \mark "foo" c'' }
-    \new Staff \with {
-      \consists "Mark_engraver"
+    \line {
+      \concat { \dynamic p , }
+      \italic { con dolce espressione }
     }
-    { c'1 \mark "foo" c' }
-  >>
+  }
 }
 @end lilypond
 
+An exhaustive list of font-switching, font-size
+and font-families related commands can be found in @ref{Font}.
 
-@seealso
+Defining custom font sets is also possible, as explained in
+@ref{Fonts}.
 
-Program reference: @internalsref{RehearsalMark}.
+@predefined
 
+@funindex \teeny
+@funindex \tiny
+@funindex \small
+@funindex \normalsize
+@funindex \large
+@funindex \huge
+@code{\teeny},
+@code{\tiny},
+@code{\small},
+@code{\normalsize},
+@code{\large},
+@code{\huge}.
 
+@c TODO: add @seealso
 
-@anchor{New dynamic marks}
-@unnumberedsubsubsec New dynamic marks
 
-It is possible to print new dynamic marks or text that should be aligned
-with dynamics.  Use @code{make-dynamic-script} to create these
-marks.  Note that the dynamic font only contains the characters
-@code{f,m,p,r,s} and @code{z}.
+@node Text alignment
+@subsubsection Text alignment
 
-Some situations (such as dynamic marks) have preset font-related
-properties.  If you are creating text in such situations, it
-is advisable to cancel those properties with
-@code{normal-text}.  See @ref{Overview of text markup commands},
-for more details.
+@cindex text, aligning
+@cindex aligning text
 
-@cindex make-dynamic-script
+This subsection discusses how to place text in markup mode,
+inside a @code{\markup} block.  Markup objects can also
+be moved as a whole, using the syntax described in
+@rlearning{Moving objects}.
 
-@lilypond[quote,verbatim,ragged-right]
-sfzp = #(make-dynamic-script "sfzp")
-\relative c' {
-  c4 c c\sfzp c
-}
-@end lilypond
+@c The padding commands should be mentioned on this page, but
+@c most of these require \box to be more clearly illustrated. -vv
 
-@cindex Dynamics, editorial
-@cindex Dynamics, parenthesis
+@cindex text, horizontal alignment
+@cindex horizontal text alignment
+@funindex \left-align
+@funindex \hcenter
+@funindex \right-align
 
-It is also possible to print dynamics in round parenthesis or square
-brackets.  These are often used for adding editorial dynamics.
+Markup objects may be aligned in different ways.  By default,
+a text indication is aligned on its left edge: in the following
+example, there's no difference
+between the first and the second markup.
 
-@lilypond[quote,verbatim,ragged-right]
-rndf = \markup{ \center-align {\line { \bold{\italic (}
-  \dynamic f \bold{\italic )} }} }
-boxf = \markup{ \bracket { \dynamic f } }
-{ c'1_\rndf c'1_\boxf }
+@lilypond[quote,verbatim,fragment,relative=1]
+a1-\markup { poco }
+e'
+a,-\markup { \left-align poco }
+e'
+a,-\markup { \hcenter { poco } }
+e'
+a,-\markup { \right-align poco }
 @end lilypond
 
+@funindex \halign
 
+The horizontal alignment may be fine-tuned
+using a numeric value:
 
-@node Text markup
-@subsection Text markup
+@lilypond[quote,verbatim,fragment,relative=1]
+a1-\markup { \halign #-1 poco }
+e'
+a,-\markup { \halign #0 poco }
+e'
+a,-\markup { \halign #0.5 poco }
+e'
+a,-\markup { \halign #2 poco }
+@end lilypond
 
-@anchor{Text markup introduction}
-@unnumberedsubsubsec Text markup introduction
+@noindent
+Some objects may have alignment procedures of their own,
+and therefore are not affected by these commands.  It is
+possible to move such markup objects as a whole, as shown
+for instance in @ref{Text marks},
+
+@cindex text, vertical alignment
+@cindex vertical text alignment
+@funindex \raise
+@funindex \lower
+
+Vertical alignment is a bit more complex. As stated above,
+markup objects can be moved as a whole; however, it is also
+possible to move specific elements inside a markup block.
+In this case, the element to be moved needs to be preceded
+with an @emph{anchor point}, that can be another markup element
+or an invisible object.  The following example demonstrates these
+two possibilities; the last markup in this example has no anchor
+point, and therefore is not moved.
 
-@cindex markup
-@cindex text markup
-@cindex markup text
-@cindex typeset text
+@lilypond[quote,verbatim,fragment,relative=1]
+d2^\markup { 
+  Acte I
+  \raise #2 { Scène 1 } }
+a'
+g_\markup {
+  \null
+  \lower #4 \bold { Très modéré } }
+a
+d,^\markup {
+  \raise #4 \italic { Une forêt. } }
+a'4 a g2 a
+@end lilypond
 
-Use @code{\markup} to typeset text.  Commands are entered with the
-backslash @code{\}.  To enter @code{\} and @code{#}, use double
-quotation marks.
+@funindex \general-align
+@funindex \translate
+@funindex \translate-scaled
+
+Some commands can affect both the horizontal and vertical
+alignment of text objects in markup mode.  Any object
+affected by these commands must be preceded with an
+anchor point:
 
 @lilypond[quote,verbatim,fragment,relative=1]
-c1^\markup { hello }
-c1_\markup { hi there }
-c1^\markup { hi \bold there, is \italic {anyone home?} }
-c1_\markup { "\special {weird} #characters" }
+d2^\markup {
+  Acte I
+  \translate #'(-1 . 2) "Scène 1" }
+a'
+g_\markup {
+  \null
+  \general-align #Y #3.2 \bold "Très modéré" }
+a
+d,^\markup {
+  \null
+  \translate-scaled #'(-1 . 2) \teeny "Une forêt." }
+a'4 a g2 a
 @end lilypond
 
-@noindent
-See @ref{Overview of text markup commands}, for a list of all
-commands.
+@cindex multi-line markup
+@cindex multi-line text
+@cindex columns, text
 
-@code{\markup} is primarily used for @internalsref{TextScript}s,
-but it can also be used anywhere text is called in lilypond
+A markup object may include several lines of text.
+In the following example, each element or expression
+is placed on its own line, either left-aligned or centered:
 
 @lilypond[quote,verbatim]
-\header{ title = \markup{ \bold { foo \italic { bar! } } } }
-\score{
-  \relative c'' {
-    \override Score.RehearsalMark
-      #'break-visibility = #begin-of-line-invisible
-    \override Score.RehearsalMark #'self-alignment-X = #right
-
-    \set Staff.instrumentName = \markup{ \column{ Alto solo } }
-    c2^\markup{ don't be \flat }
-    \override TextSpanner #'bound-details #'left #'text = \markup{\italic rit }
-    b2\startTextSpan
-    a2\mark \markup{ \large \bold Fine }
-    r2\stopTextSpan
-    \bar "||"
+\markup {
+  \column {
+    a
+    "b c"
+    \line { d e f }
+  }
+  \hspace #10
+  \center-align {
+    a
+    "b c"
+    \line { d e f }
   }
-  \addlyrics { bar, foo \markup{ \italic bar! } }
 }
 @end lilypond
 
-A @code{\markup} command can also be placed on its own, away from any
-@code{\score} block, see @ref{Multiple scores in a book}.
+Similarly, a list of elements or expressions may be
+spread to fill the entire horizontal line width -- if there
+is only one element, it will be centered on the page.
+These expressions can, in turn, include multi-line text
+or any other markup expression:
 
-@lilypond[quote,ragged-right,verbatim]
-\markup{ Here is some text. }
+@lilypond[quote,verbatim]
+\markup {
+  \fill-line {
+    \line { William S. Gilbert }
+    \center-align {
+      \huge \smallCaps "The Mikado"
+      or
+      \smallCaps "The Town of Titipu"
+    }
+    \line { Sir Arthur Sullivan }
+  }
+}
+\markup {
+  \fill-line { 1885 } 
+}
 @end lilypond
 
-@cindex font switching
-
-The markup in the example demonstrates font switching commands.  The
-command @code{\bold} and @code{\italic} apply to the first following
-word only; to apply a command to more than one word, enclose the
-words with braces,
+Long text indications can also be automatically wrapped
+accordingly to the given line width.  These will be
+either left-aligned or justified, as shown in
+the following example.
 
-@example
-\markup @{ \bold @{ hi there @} @}
-@end example
+@lilypond[quote,verbatim]
+\markup {
+  \column {
+    \line  \smallCaps { La vida breve }
+    \line \bold { Acto I }
+    \wordwrap \italic {
+      (La escena representa el corral de una casa de
+      gitanos en el Albaicín de Granada. Al fondo una
+      puerta por la que se vé el negro interior de
+      una Fragua, iluminado por los rojos resplandores
+      del fuego.) 
+    }
+    \hspace #0
+
+    \line \bold { Acto II }
+    \override #'(line-width . 50)
+    \justify \italic {
+      (Calle de Granada. Fachada de la casa de Carmela
+      y su hermano Manuel con grandes ventanas abiertas
+      a través de las que se ve el patio
+      donde se celebra una alegre fiesta)
+    }
+  }
+}
+@end lilypond
 
-@noindent
-For clarity, you can also do this for single arguments, e.g.,
+An exhaustive list of text alignment commands
+can be found in @ref{Align}.
 
-@example
-\markup @{ is \italic @{ anyone @} home @}
-@end example
+@c TODO: add @seealso
 
-In markup mode you can compose expressions, similar to mathematical
-expressions, XML documents, and music expressions.  You can stack
-expressions grouped vertically with the command @code{\column}.
-Similarly, @code{\center-align} aligns texts by their center lines:
+@node Graphic notation inside markup
+@subsubsection Graphic notation inside markup
 
-@lilypond[quote,verbatim,fragment,relative=1]
-c1^\markup { \column { a bbbb \line { c d } } }
-c1^\markup { \center-align { a bbbb c } }
-c1^\markup { \line { a b c } }
-@end lilypond
+Graphics around text:
+\box
+\circle
 
-Lists with no previous command are not kept distinct.  The expression
+(TODO: document padding commands here)
 
-@example
-\center-align @{ @{ a b @} @{ c d @} @}
-@end example
+\bracket
+\hbracket
 
-@noindent
+"Standalone" graphics:
 
-is equivalent to
+\arrow-head
+\draw-line
+\draw-circle
+\filled-box
+\triangle
+\strut
 
-@example
-\center-align @{ a b c d @}
-@end example
+\with-color
 
-@noindent
 
-To keep lists of words distinct, please use quotes @code{"} or
-the @code{\line} command
+Advanced graphics:
+\stencil
 
-@lilypond[quote,verbatim,fragment,relative=1]
-\fatText
-c4^\markup{ \center-align { on three lines } }
-c4^\markup{ \center-align { "all one line" } }
-c4^\markup{ \center-align { { on three lines } } }
-c4^\markup{ \center-align { \line { on one line } } }
-@end lilypond
+\postscript
+\epsfile
 
-Markups can be stored in variables and these variables
-may be attached to notes, like
-@example
-allegro = \markup @{ \bold \large @{ Allegro @} @}
- @{ a^\allegro b c d @}
-@end example
+\with-dimensions
 
-Some objects have alignment procedures of their own, which cancel out
-any effects of alignments applied to their markup arguments as a
-whole.  For example, the @internalsref{RehearsalMark} is horizontally
-centered, so using @code{\mark \markup @{ \left-align .. @}} has no
-effect.
+@node Music notation inside markup
+@subsubsection Music notation inside markup
 
-In addition, vertical placement is performed after creating the
-text markup object.  If you wish to move an entire piece of markup,
-you need to use the #'padding property or create an @q{anchor} point
-inside the markup (generally with @code{\hspace #0}).
+Notes can be printed in markup mode blah blah:
 
-@lilypond[quote,verbatim,fragment,relative=1]
-\fatText
-c'4^\markup{ \raise #5 "not raised" }
-\once \override TextScript #'padding = #3
-c'4^\markup{ raised }
-c'4^\markup{ \hspace #0 \raise #1.5 raised }
-@end lilypond
+\note  
+\note-by-number
 
-Some situations (such as dynamic marks) have preset font-related
-properties.  If you are creating text in such situations, it
-is advisable to cancel those properties with
-@code{normal-text}.  See @ref{Overview of text markup commands},
-for more details.
+Accidental symbols can be obtained easily:
 
+\doubleflat
+\sesquiflat
+\flat
+\semiflat
+\natural
+\semisharp
+\sharp
+\sesquisharp
+\doublesharp
 
-@seealso
+Some other notation objects blah blah
 
-This manual: @ref{Overview of text markup commands}.
+\beam
+\finger
+\dynamic
+\tied-lyric
+\markalphabet
+\markletter
+@c TODO: add \text here? -vv
 
-Program reference: @internalsref{TextScript}.
+Any musical symbol can be printed
 
-Init files: @file{scm/@/new@/-markup@/.scm}.
+\musicglyph
+@c TODO: add \lookup here? -vv
 
 
-@refbugs
+The markup mode has support for fret diagrams:
 
-Kerning or generation of ligatures is only done when the @TeX{}
-backend is used.  In this case, LilyPond does not account for them so
-texts will be spaced slightly too wide.
+\fret-diagram 
+\fret-diagram-terse
+\fret-diagram-verbose
 
-Syntax errors for markup mode are confusing.
+An entire @code{\score} block can even be nested in a @code{\markup}
+block.  In such a case, the @code{\score} must contain a @code{\layout} block.
 
 
-@anchor{Nested scores}
-@unnumberedsubsubsec Nested scores
+\score
 
-It is possible to nest music inside markups, by adding a @code{\score}
-block to a markup expression.  Such a score must contain a @code{\layout}
-block.
 
 @lilypond[quote,verbatim,ragged-right]
 \relative {
@@ -639,11 +873,17 @@ block.
 }
 @end lilypond
 
-@anchor{Page wrapping text}
-@unnumberedsubsubsec Page wrapping text
-Whereas @code{\markup} is used to enter a non-breakable block of text,
-@code{\markuplines} can be used at top-level to enter lines of text that
-can spread over multiple pages:
+@seealso
+
+Snippets:
+@rlsr{Text}.
+
+@node Multi-page markup
+@subsubsection Multi-page markup
+
+Whereas @code{\markup} is used to enter a non-breakable block of
+text, @code{\markuplines} can be used at top-level to enter lines
+of text that can spread over multiple pages:
 
 @verbatim
 \markuplines {
@@ -659,23 +899,68 @@ can spread over multiple pages:
 }
 @end verbatim
 
-@code{\markuplines} accepts a list of markup, that is either the result
-of a markup list command, or a list of markups or of markup lists. The
-built-in markup list commands are described in
-@ref{Overview of text markup list commands}.
+@code{\markuplines} accepts a list of markup, that is either the
+result of a markup list command, or a list of markups or of markup
+lists.  The built-in markup list commands are described in
+@ref{Text markup list commands}.
 
 @seealso
 
-This manual: @ref{Overview of text markup list commands}, 
-@ref{New markup list command definition}.
+This manual: @ref{Text markup list commands}, @ref{New
+markup list command definition}.
+
+Snippets:
+@rlsr{Text}.
 
-@refcommands
+@predefined
 
 @funindex \markuplines
 @code{\markuplines}
 
-@anchor{Font selection}
-@unnumberedsubsubsec Font selection
+
+@node Fonts
+@subsection Fonts
+
+@menu
+* Entire document fonts::       
+* Single entry fonts::          
+@end menu
+
+@node Entire document fonts
+@subsubsection Entire document fonts
+
+It is also possible to change the default font family for the
+entire document.  This is done by calling the
+@code{make-pango-font-tree} from within the @code{\paper} block.
+The function takes names for the font families to use for roman,
+sans serif and monospaced text.  For example,
+
+@cindex font families, setting
+@cindex Pango
+
+
+@lilypond[verbatim]
+\paper  {
+  myStaffSize = #20
+
+  #(define fonts
+    (make-pango-font-tree "Times New Roman"
+                          "Nimbus Sans"
+                          "Luxi Mono"
+                           (/ myStaffSize 20)))
+}
+
+{
+  c'^\markup { roman: foo \sans bla \typewriter bar }
+}
+@end lilypond
+
+@c we don't do Helvetica / Courier, since GS incorrectly loads
+@c Apple TTF fonts
+
+
+@node Single entry fonts
+@subsubsection Single entry fonts
 
 @cindex font selection
 @cindex font magnification
@@ -683,24 +968,25 @@ This manual: @ref{Overview of text markup list commands},
 
 By setting the object properties described below, you can select a
 font from the preconfigured font families.  LilyPond has default
-support for the feta music fonts. Text fonts are selected through
-Pango/FontConfig. The serif font defaults to New Century Schoolbook,
-the sans and typewriter to whatever the Pango installation defaults
-to.
+support for the feta music fonts.  Text fonts are selected through
+Pango/FontConfig.  The serif font defaults to New Century
+Schoolbook, the sans and typewriter to whatever the Pango
+installation defaults to.
 
 
-@itemize @bullet
+@itemize
 @item @code{font-encoding}
-is a symbol that sets layout of the glyphs.  This should only be set to
-select different types of non-text fonts, e.g.
+is a symbol that sets layout of the glyphs.  This should only be
+set to select different types of non-text fonts, e.g.
 
 @code{fetaBraces} for piano staff braces, @code{fetaMusic} the
-standard music font, including ancient glyphs, @code{fetaDynamic} for
-dynamic signs and @code{fetaNumber} for the number font.
+standard music font, including ancient glyphs, @code{fetaDynamic}
+for dynamic signs and @code{fetaNumber} 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{sans}, and @code{typewriter}.
+is a symbol indicating the general class of the typeface.
+Supported are @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
@@ -708,16 +994,15 @@ 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}.
+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 itemize
 
-Fonts selected in the way sketched above come from a predefined style
-sheet. If you want to use a font from outside the style sheet,
-then set the
-@code{font-name} property,
+Fonts selected in the way sketched above come from a predefined
+style sheet.  If you want to use a font from outside the style
+sheet, then set the @code{font-name} property,
 
 @lilypond[fragment,verbatim]
 {
@@ -732,57 +1017,31 @@ then set the
 @end lilypond
 
 @noindent
-Any font can be used, as long as it is available to Pango/FontConfig.
-To get a full list of all available fonts, run the command
+Any font can be used, as long as it is available to
+Pango/FontConfig.  To get a full list of all available fonts, run
+the command
+
 @example
 lilypond -dshow-available-fonts blabla
 @end example
-(the last argument of the command can be anything, but has to be present).
+
+(the last argument of the command can be anything, but has to be
+present).
 
 
 The size of the font may be set with the @code{font-size}
-property. The resulting size is taken relative to the
+property.  The resulting size is taken relative to the
 @code{text-font-size} as defined in the @code{\paper} block.
 
 @cindex font size
 @cindex font magnification
 
 
-It is also possible to change the default font family for the entire
-document. This is done by calling the @code{make-pango-font-tree} from
-within the @code{\paper} block. The function takes names for the font
-families to use for roman, sans serif and monospaced text. For
-example,
-
-@cindex font families, setting
-@cindex Pango
-
-
-@lilypond[verbatim]
-\paper  {
-  myStaffSize = #20
-
-  #(define fonts
-    (make-pango-font-tree "Times New Roman"
-                          "Nimbus Sans"
-                          "Luxi Mono"
-                           (/ myStaffSize 20)))
-}
-
-{
-  c'^\markup { roman: foo \sans bla \typewriter bar }
-}
-@end lilypond
-
-@c we don't do Helvetica / Courier, since GS incorrectly loads
-@c Apple TTF fonts
-
 
 
 @seealso
 
-Examples: @lsr{text,font@/-family@/-override.ly}.
-
-
+Snippets:
+@rlsr{Text}.